react-native-navigation 7.23.0 → 7.23.1-snapshot.277

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.
@@ -1,19 +1,48 @@
1
- env:
2
- CI: true
3
- ANDROID_HOME: /usr/local/share/android-sdk/
4
- PATH: "$PATH:/usr/local/share/android-sdk/platform-tools/"
5
1
  steps:
6
- - label: "Android :android:"
2
+ - block: ":rocket: Release!"
3
+ prompt: "Fill out the details for release"
4
+ if: 'build.message =~ /^release\$/i'
5
+ fields:
6
+ - text: "VERSION"
7
+ key: "version"
8
+ - text: "NPM_TAG"
9
+ key: "npm-tag"
10
+ default: 'null'
11
+ required: false
12
+ - text: "BUILD_DOCUMENTATION_VERSION"
13
+ key: "build-documentation-version"
14
+ default: 'null'
15
+ hint: 'Leave NULL if no version is specified'
16
+ - text: "REMOVE_DOCUMENTATION_VERSION"
17
+ key: "remove-documentation-version"
18
+ default: 'null'
19
+ hint: 'Leave NULL if no version is specified'
20
+
21
+ - label: ":android: Android"
7
22
  command:
8
- - "env"
23
+ - "nvm install"
9
24
  - "npm install"
10
- - "npm run clean"
25
+ - "npm run test-js"
11
26
  - "npm run test-unit-android -- --release"
12
27
  - "npm run test-e2e-android-multi -- --release --headless --verbose --ci"
13
-
14
- - label: "IOS :ios:"
28
+ key: "android_build"
29
+
30
+ - label: ":ios: iOS"
15
31
  command:
16
- - "env"
32
+ - "nvm install"
17
33
  - "npm install"
18
- - "npm run clean"
34
+ - "npm run test-unit-ios -- --release"
35
+ - "npm run test-snapshot-ios -- --release"
19
36
  - "npm run test-e2e-ios -- --release --multi --ci"
37
+ key: "ios_build"
38
+
39
+ - label: ":package: Publish"
40
+ env:
41
+ if: "build.pull_request.id == null"
42
+ command:
43
+ - "nvm install"
44
+ - "npm install"
45
+ - "npm run release"
46
+ depends_on:
47
+ - "android_build"
48
+ - "ios_build"
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 14
@@ -2,9 +2,30 @@ package com.reactnativenavigation.views.stack.topbar.titlebar
2
2
 
3
3
  import android.annotation.SuppressLint
4
4
  import android.content.Context
5
+ import androidx.core.view.children
5
6
  import com.facebook.react.ReactInstanceManager
6
7
  import com.reactnativenavigation.react.ReactView
7
8
 
8
9
  @SuppressLint("ViewConstructor")
9
10
  class TitleBarReactView(context: Context?, reactInstanceManager: ReactInstanceManager?, componentId: String?,
10
- componentName: String?) : ReactView(context, reactInstanceManager, componentId, componentName)
11
+ componentName: String?) : ReactView(context, reactInstanceManager, componentId, componentName) {
12
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
13
+ super.onMeasure(interceptReactRootViewMeasureSpec(widthMeasureSpec), heightMeasureSpec)
14
+ }
15
+
16
+ private fun interceptReactRootViewMeasureSpec(widthMeasureSpec: Int): Int {
17
+ // This is a HACK.
18
+ // ReactRootView has problematic behavior when setting width to WRAP_CONTENT,
19
+ // It's causing infinite measurements, that hung up the UI.
20
+ // Intercepting largest child by width, and use its width as (parent) ReactRootView width fixed that.
21
+ // See for more details https://github.com/wix/react-native-navigation/pull/7096
22
+ var measuredWidth = 0;
23
+ this.children.forEach {
24
+ if (it.measuredWidth > measuredWidth) {
25
+ measuredWidth = it.measuredWidth
26
+ }
27
+ }
28
+ return if (measuredWidth > 0) MeasureSpec.makeMeasureSpec(measuredWidth, MeasureSpec.EXACTLY) else
29
+ widthMeasureSpec
30
+ }
31
+ }
@@ -430,6 +430,11 @@ export interface OptionsTopBarButton {
430
430
  * Set the button icon
431
431
  */
432
432
  icon?: ImageResource;
433
+ /**
434
+ * Set the SF symbol as icon (will be used primarily)
435
+ * #### (iOS 13+ specific)
436
+ */
437
+ sfSymbol?: string;
433
438
  /**
434
439
  * Set the button icon insets
435
440
  */
@@ -31,7 +31,9 @@
31
31
  return [[RNNUIBarButtonItem alloc] initCustomIcon:button
32
32
  iconCreator:_iconCreator
33
33
  onPress:onPress];
34
- } else if (button.icon.hasValue) {
34
+ } else if (button.sfSymbol.hasValue) {
35
+ return [[RNNUIBarButtonItem alloc] initWithSFSymbol:button onPress:onPress];
36
+ } else if (button.icon.hasValue) {
35
37
  return [[RNNUIBarButtonItem alloc] initWithIcon:button onPress:onPress];
36
38
  } else if (button.text.hasValue) {
37
39
  return [[RNNUIBarButtonItem alloc] initWithTitle:button onPress:onPress];
@@ -16,6 +16,7 @@
16
16
  @property(nonatomic, strong) Color *color;
17
17
  @property(nonatomic, strong) Color *disabledColor;
18
18
  @property(nonatomic, strong) Image *icon;
19
+ @property(nonatomic, strong) Text *sfSymbol;
19
20
  @property(nonatomic, strong) Bool *enabled;
20
21
  @property(nonatomic, strong) RNNInsetsOptions *iconInsets;
21
22
  @property(nonatomic, strong) Bool *selectTabOnPress;
@@ -11,6 +11,7 @@
11
11
  self.fontWeight = [TextParser parse:dict key:@"fontWeight"];
12
12
  self.fontSize = [NumberParser parse:dict key:@"fontSize"];
13
13
  self.text = [TextParser parse:dict key:@"text"];
14
+ self.sfSymbol = [TextParser parse:dict key:@"sfSymbol"];
14
15
  self.testID = [TextParser parse:dict key:@"testID"];
15
16
  self.accessibilityLabel = [TextParser parse:dict key:@"accessibilityLabel"];
16
17
  self.color = [ColorParser parse:dict key:@"color"];
@@ -39,6 +40,7 @@
39
40
  newOptions.color = self.color.copy;
40
41
  newOptions.disabledColor = self.disabledColor.copy;
41
42
  newOptions.icon = self.icon.copy;
43
+ newOptions.sfSymbol = self.sfSymbol.copy;
42
44
  newOptions.iconInsets = self.iconInsets.copy;
43
45
  newOptions.enabled = self.enabled.copy;
44
46
  newOptions.selectTabOnPress = self.selectTabOnPress.copy;
@@ -71,6 +73,8 @@
71
73
  self.disabledColor = options.disabledColor;
72
74
  if (options.icon.hasValue)
73
75
  self.icon = options.icon;
76
+ if (options.sfSymbol.hasValue)
77
+ self.sfSymbol = options.sfSymbol;
74
78
  if (options.enabled.hasValue) {
75
79
  self.enabled = options.enabled;
76
80
  [self.iconBackground setEnabled:self.enabled];
@@ -82,6 +82,9 @@
82
82
  setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds withDefault:NO]];
83
83
 
84
84
  [stack.view setBackgroundColor:[withDefault.layout.backgroundColor withDefault:nil]];
85
+ if (options.topBar.background.component.name.hasValue) {
86
+ [self setCustomNavigationComponentBackground:options perform:nil];
87
+ }
85
88
  }
86
89
 
87
90
  - (void)applyOptionsOnViewDidLayoutSubviews:(RNNNavigationOptions *)options {
@@ -14,6 +14,8 @@ typedef void (^RNNButtonPressCallback)(NSString *buttonId);
14
14
  - (instancetype)initCustomIcon:(RNNButtonOptions *)buttonOptions
15
15
  iconCreator:(RNNIconCreator *)iconCreator
16
16
  onPress:(RNNButtonPressCallback)onPress;
17
+ - (instancetype)initWithSFSymbol:(RNNButtonOptions *)buttonOptions
18
+ onPress:(RNNButtonPressCallback)onPress;
17
19
  - (instancetype)initWithIcon:(RNNButtonOptions *)buttonOptions
18
20
  onPress:(RNNButtonPressCallback)onPress;
19
21
  - (instancetype)initWithTitle:(RNNButtonOptions *)buttonOptions
@@ -20,6 +20,23 @@
20
20
  return self;
21
21
  }
22
22
 
23
+ - (instancetype)initWithSFSymbol:(RNNButtonOptions *)buttonOptions
24
+ onPress:(RNNButtonPressCallback)onPress {
25
+ UIImage *iconImage = [UIImage alloc];
26
+
27
+ if (@available(iOS 13.0, *)) {
28
+ iconImage = [UIImage systemImageNamed:[buttonOptions.sfSymbol withDefault:nil]];
29
+ }
30
+
31
+ self = [super initWithImage:iconImage
32
+ style:UIBarButtonItemStylePlain
33
+ target:self
34
+ action:@selector(onButtonPressed:)];
35
+ [self applyOptions:buttonOptions];
36
+ self.onPress = onPress;
37
+ return self;
38
+ }
39
+
23
40
  - (instancetype)initWithIcon:(RNNButtonOptions *)buttonOptions
24
41
  onPress:(RNNButtonPressCallback)onPress {
25
42
  UIImage *iconImage = buttonOptions.icon.get;
@@ -488,6 +488,11 @@ export interface OptionsTopBarButton {
488
488
  * Set the button icon
489
489
  */
490
490
  icon?: ImageResource;
491
+ /**
492
+ * Set the SF symbol as icon (will be used primarily)
493
+ * #### (iOS 13+ specific)
494
+ */
495
+ sfSymbol?: string;
491
496
  /**
492
497
  * Set the button icon insets
493
498
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.23.0",
3
+ "version": "7.23.1-snapshot.277",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,