@complexify/expo-mapbox-navigation 1.1.4 → 1.1.6

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.
@@ -57,6 +57,10 @@ export type ExpoMapboxNavigationViewProps = {
57
57
  floatingButtonsTextColor?: string;
58
58
  floatingButtonsBorderColor?: string;
59
59
  wayNameViewBackgroundColor?: string;
60
+ maneuverViewPrimaryColor?: string;
61
+ maneuverViewSecondaryColor?: string;
62
+ maneuverViewTextColor?: string;
63
+ maneuverViewBackgroundColor?: string;
60
64
  };
61
65
  export {};
62
66
  //# sourceMappingURL=ExpoMapboxNavigation.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoMapboxNavigation.types.d.ts","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,KAAK,aAAa,GAAG;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,WAAW,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,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,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAGpC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAGpC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoMapboxNavigation.types.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewStyle, StyleProp } from \"react-native\";\n\ntype ProgressEvent = {\n distanceRemaining: number;\n distanceTraveled: number;\n durationRemaining: number;\n fractionTraveled: number;\n};\n\nexport type ExpoMapboxNavigationViewProps = {\n coordinates: Array<{ latitude: number; longitude: number }>;\n waypointIndices?: number[];\n useRouteMatchingApi?: boolean;\n locale?: string;\n routeProfile?: string;\n routeExcludeList?: string[];\n mapStyle?: string;\n mute?: boolean;\n routeColor?: string;\n routeAlternateColor?: string;\n routeCasingColor?: string;\n routeAlternateCasingColor?: string;\n traversedRouteColor?: string;\n maneuverArrowColor?: string;\n onRouteProgressChanged?: (event: { nativeEvent: ProgressEvent }) => void;\n onCancelNavigation?: () => void;\n onWaypointArrival?: (event: {\n nativeEvent: ProgressEvent | undefined;\n }) => void;\n onFinalDestinationArrival?: () => void;\n onRouteChanged?: () => void;\n onUserOffRoute?: () => void;\n onRoutesLoaded?: () => void;\n style?: StyleProp<ViewStyle>;\n\n // Top Banner (1)\n topBannerBackgroundColor?: string;\n topBannerPrimaryTextColor?: string;\n topBannerSecondaryTextColor?: string;\n topBannerDistanceTextColor?: string;\n topBannerSeparatorColor?: string;\n\n // Information Stack (2)\n informationStackBackgroundColor?: string;\n informationStackTextColor?: string;\n\n // Bottom Banner (3)\n bottomBannerBackgroundColor?: string;\n bottomBannerTimeRemainingTextColor?: string;\n bottomBannerDistanceRemainingTextColor?: string;\n bottomBannerArrivalTimeTextColor?: string;\n\n // Resume Button (4)\n resumeButtonBackgroundColor?: string;\n resumeButtonTextColor?: string;\n resumeButtonBorderColor?: string;\n\n // Speed Limit View (5)\n speedLimitBackgroundColor?: string;\n speedLimitTextColor?: string;\n speedLimitBorderColor?: string;\n\n // Floating Stack (6)\n floatingStackBackgroundColor?: string;\n floatingButtonsBackgroundColor?: string;\n floatingButtonsTextColor?: string;\n floatingButtonsBorderColor?: string;\n\n // Way Name Label (8)\n wayNameViewBackgroundColor?: string;\n};\n"]}
1
+ {"version":3,"file":"ExpoMapboxNavigation.types.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewStyle, StyleProp } from \"react-native\";\n\ntype ProgressEvent = {\n distanceRemaining: number;\n distanceTraveled: number;\n durationRemaining: number;\n fractionTraveled: number;\n};\n\nexport type ExpoMapboxNavigationViewProps = {\n coordinates: Array<{ latitude: number; longitude: number }>;\n waypointIndices?: number[];\n useRouteMatchingApi?: boolean;\n locale?: string;\n routeProfile?: string;\n routeExcludeList?: string[];\n mapStyle?: string;\n mute?: boolean;\n routeColor?: string;\n routeAlternateColor?: string;\n routeCasingColor?: string;\n routeAlternateCasingColor?: string;\n traversedRouteColor?: string;\n maneuverArrowColor?: string;\n onRouteProgressChanged?: (event: { nativeEvent: ProgressEvent }) => void;\n onCancelNavigation?: () => void;\n onWaypointArrival?: (event: {\n nativeEvent: ProgressEvent | undefined;\n }) => void;\n onFinalDestinationArrival?: () => void;\n onRouteChanged?: () => void;\n onUserOffRoute?: () => void;\n onRoutesLoaded?: () => void;\n style?: StyleProp<ViewStyle>;\n\n // Top Banner (1)\n topBannerBackgroundColor?: string;\n topBannerPrimaryTextColor?: string;\n topBannerSecondaryTextColor?: string;\n topBannerDistanceTextColor?: string;\n topBannerSeparatorColor?: string;\n\n // Information Stack (2)\n informationStackBackgroundColor?: string;\n informationStackTextColor?: string;\n\n // Bottom Banner (3)\n bottomBannerBackgroundColor?: string;\n bottomBannerTimeRemainingTextColor?: string;\n bottomBannerDistanceRemainingTextColor?: string;\n bottomBannerArrivalTimeTextColor?: string;\n\n // Resume Button (4)\n resumeButtonBackgroundColor?: string;\n resumeButtonTextColor?: string;\n resumeButtonBorderColor?: string;\n\n // Speed Limit View (5)\n speedLimitBackgroundColor?: string;\n speedLimitTextColor?: string;\n speedLimitBorderColor?: string;\n\n // Floating Stack (6)\n floatingStackBackgroundColor?: string;\n floatingButtonsBackgroundColor?: string;\n floatingButtonsTextColor?: string;\n floatingButtonsBorderColor?: string;\n\n // Way Name Label (8)\n wayNameViewBackgroundColor?: string;\n\n // Maneuver View (Direction Arrow and Text)\n maneuverViewPrimaryColor?: string; // Main arrow color\n maneuverViewSecondaryColor?: string; // Secondary arrow color\n maneuverViewTextColor?: string; // Direction text color\n maneuverViewBackgroundColor?: string; // Background of the direction bar\n};\n"]}
@@ -23,6 +23,12 @@ class CustomDayStyle: StandardDayStyle {
23
23
  var customFloatingButtonsBorderColor: UIColor?
24
24
  var customFloatingButtonsTextColor: UIColor?
25
25
 
26
+ // New properties for maneuver view
27
+ var customManeuverViewPrimaryColor: UIColor?
28
+ var customManeuverViewSecondaryColor: UIColor?
29
+ var customManeuverViewTextColor: UIColor?
30
+ var customManeuverViewBackgroundColor: UIColor?
31
+
26
32
  required init() {
27
33
  super.init()
28
34
  styleType = .day
@@ -52,6 +58,8 @@ class CustomDayStyle: StandardDayStyle {
52
58
  // Bottom banner text colors
53
59
  if let timeRemainingColor = customBottomBannerTimeRemainingTextColor {
54
60
  TimeRemainingLabel.appearance(for: traitCollection).textColor = timeRemainingColor
61
+ TimeRemainingLabel.appearance(for: traitCollection).valueTextColor = timeRemainingColor
62
+ TimeRemainingLabel.appearance(for: traitCollection).unitTextColor = timeRemainingColor
55
63
  }
56
64
  if let distanceRemainingColor = customBottomBannerDistanceRemainingTextColor {
57
65
  DistanceRemainingLabel.appearance(for: traitCollection).textColor = distanceRemainingColor
@@ -97,31 +105,33 @@ class CustomDayStyle: StandardDayStyle {
97
105
  // Floating buttons customization
98
106
  if let floatingBgColor = customFloatingButtonsBackgroundColor {
99
107
  FloatingButton.appearance(for: traitCollection).backgroundColor = floatingBgColor
100
- OverviewButton.appearance(for: traitCollection).backgroundColor = floatingBgColor
101
- MuteButton.appearance(for: traitCollection).backgroundColor = floatingBgColor
102
- FeedbackButton.appearance(for: traitCollection).backgroundColor = floatingBgColor
103
108
  }
104
109
  if let floatingTextColor = customFloatingButtonsTextColor {
105
110
  FloatingButton.appearance(for: traitCollection).tintColor = floatingTextColor
106
- OverviewButton.appearance(for: traitCollection).tintColor = floatingTextColor
107
- MuteButton.appearance(for: traitCollection).tintColor = floatingTextColor
108
- FeedbackButton.appearance(for: traitCollection).tintColor = floatingTextColor
109
111
  }
110
112
  if let floatingBorderColor = customFloatingButtonsBorderColor {
111
113
  FloatingButton.appearance(for: traitCollection).borderColor = floatingBorderColor
112
- OverviewButton.appearance(for: traitCollection).borderColor = floatingBorderColor
113
- MuteButton.appearance(for: traitCollection).borderColor = floatingBorderColor
114
- FeedbackButton.appearance(for: traitCollection).borderColor = floatingBorderColor
115
114
  }
116
115
 
117
116
  // Set default values for floating buttons
118
117
  FloatingButton.appearance(for: traitCollection).borderWidth = 1.0
119
118
  FloatingButton.appearance(for: traitCollection).cornerRadius = 4.0
120
- OverviewButton.appearance(for: traitCollection).borderWidth = 1.0
121
- OverviewButton.appearance(for: traitCollection).cornerRadius = 4.0
122
- MuteButton.appearance(for: traitCollection).borderWidth = 1.0
123
- MuteButton.appearance(for: traitCollection).cornerRadius = 4.0
124
- FeedbackButton.appearance(for: traitCollection).borderWidth = 1.0
125
- FeedbackButton.appearance(for: traitCollection).cornerRadius = 4.0
119
+
120
+ // Top Banner - Current Direction Bar (ManeuverView)
121
+ if let primaryColor = customManeuverViewPrimaryColor {
122
+ ManeuverView.appearance(for: traitCollection).primaryColor = primaryColor
123
+ }
124
+ if let secondaryColor = customManeuverViewSecondaryColor {
125
+ ManeuverView.appearance(for: traitCollection).secondaryColor = secondaryColor
126
+ }
127
+
128
+ // Current Direction Background and Text
129
+ if let bgColor = customManeuverViewBackgroundColor {
130
+ ManeuverView.appearance(for: traitCollection).backgroundColor = bgColor
131
+ }
132
+ if let textColor = customManeuverViewTextColor {
133
+ StepInstructionsView.appearance(for: traitCollection).primaryLabel.textColor = textColor
134
+ StepInstructionsView.appearance(for: traitCollection).secondaryLabel.textColor = textColor
135
+ }
126
136
  }
127
137
  }
@@ -209,6 +209,30 @@ public class ExpoMapboxNavigationModule: Module {
209
209
  view.controller.setSpeedLimitBorderColor(hexColor: hexColor)
210
210
  }
211
211
  }
212
+
213
+ Prop("maneuverViewPrimaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
214
+ if let hexColor = color {
215
+ view.controller.setManeuverViewPrimaryColor(hexColor: hexColor)
216
+ }
217
+ }
218
+
219
+ Prop("maneuverViewSecondaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
220
+ if let hexColor = color {
221
+ view.controller.setManeuverViewSecondaryColor(hexColor: hexColor)
222
+ }
223
+ }
224
+
225
+ Prop("maneuverViewTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
226
+ if let hexColor = color {
227
+ view.controller.setManeuverViewTextColor(hexColor: hexColor)
228
+ }
229
+ }
230
+
231
+ Prop("maneuverViewBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
232
+ if let hexColor = color {
233
+ view.controller.setManeuverViewBackgroundColor(hexColor: hexColor)
234
+ }
235
+ }
212
236
  }
213
237
  }
214
238
  }
@@ -344,6 +344,26 @@ class ExpoMapboxNavigationViewController: UIViewController {
344
344
  update()
345
345
  }
346
346
 
347
+ func setManeuverViewPrimaryColor(hexColor: String) {
348
+ customDayStyle.customManeuverViewPrimaryColor = UIColor(hex: hexColor)
349
+ update()
350
+ }
351
+
352
+ func setManeuverViewSecondaryColor(hexColor: String) {
353
+ customDayStyle.customManeuverViewSecondaryColor = UIColor(hex: hexColor)
354
+ update()
355
+ }
356
+
357
+ func setManeuverViewTextColor(hexColor: String) {
358
+ customDayStyle.customManeuverViewTextColor = UIColor(hex: hexColor)
359
+ update()
360
+ }
361
+
362
+ func setManeuverViewBackgroundColor(hexColor: String) {
363
+ customDayStyle.customManeuverViewBackgroundColor = UIColor(hex: hexColor)
364
+ update()
365
+ }
366
+
347
367
  func update(){
348
368
  calculateRoutesTask?.cancel()
349
369
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complexify/expo-mapbox-navigation",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Expo module for Mapbox's Navigation SDK",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -68,4 +68,10 @@ export type ExpoMapboxNavigationViewProps = {
68
68
 
69
69
  // Way Name Label (8)
70
70
  wayNameViewBackgroundColor?: string;
71
+
72
+ // Maneuver View (Direction Arrow and Text)
73
+ maneuverViewPrimaryColor?: string; // Main arrow color
74
+ maneuverViewSecondaryColor?: string; // Secondary arrow color
75
+ maneuverViewTextColor?: string; // Direction text color
76
+ maneuverViewBackgroundColor?: string; // Background of the direction bar
71
77
  };