@iternio/react-native-auto-play 0.5.14-beta.1 → 0.6.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 (201) hide show
  1. package/README.md +270 -36
  2. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoSession.kt +5 -0
  3. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplate.kt +9 -2
  4. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/NativeBackdrop.kt +40 -0
  5. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +52 -0
  6. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +47 -13
  7. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +69 -15
  8. package/ios/Types.swift +3 -0
  9. package/ios/extensions/UIImage+Toggle.swift +5 -2
  10. package/ios/hybrid/HybridAutoPlay.swift +28 -16
  11. package/ios/hybrid/HybridMapTemplate.swift +22 -5
  12. package/ios/scenes/AutoPlayInterfaceController.swift +261 -72
  13. package/ios/templates/AutoPlayMapPanelDelegate.swift +190 -0
  14. package/ios/templates/AutoPlayTemplate.swift +24 -2
  15. package/ios/templates/GridTemplate.swift +57 -57
  16. package/ios/templates/InformationTemplate.swift +84 -9
  17. package/ios/templates/ListTemplate.swift +66 -11
  18. package/ios/templates/MapTemplate.swift +83 -68
  19. package/ios/templates/MessageTemplate.swift +72 -6
  20. package/ios/templates/Parser.swift +564 -69
  21. package/ios/templates/SearchTemplate.swift +1 -1
  22. package/ios/templates/TemplateStore.swift +5 -15
  23. package/ios/utils/SymbolFont.swift +13 -28
  24. package/jest.js +2 -0
  25. package/lib/Constants.d.ts +4 -0
  26. package/lib/Constants.js +6 -0
  27. package/lib/index.d.ts +1 -0
  28. package/lib/index.js +1 -0
  29. package/lib/index.web.d.ts +73 -0
  30. package/lib/index.web.js +72 -1
  31. package/lib/specs/MapTemplate.nitro.d.ts +3 -1
  32. package/lib/templates/GridTemplate.d.ts +23 -3
  33. package/lib/templates/GridTemplate.js +8 -0
  34. package/lib/templates/InformationTemplate.d.ts +38 -12
  35. package/lib/templates/ListTemplate.d.ts +16 -47
  36. package/lib/templates/MapTemplate.d.ts +26 -2
  37. package/lib/templates/MapTemplate.js +16 -2
  38. package/lib/templates/MessageTemplate.d.ts +52 -11
  39. package/lib/templates/MessageTemplate.js +1 -1
  40. package/lib/types/Image.d.ts +6 -1
  41. package/lib/utils/NitroColor.d.ts +1 -0
  42. package/lib/utils/NitroColor.js +8 -0
  43. package/lib/utils/NitroImage.js +1 -1
  44. package/lib/utils/NitroManeuver.js +1 -3
  45. package/lib/utils/NitroOptionsPanel.d.ts +103 -0
  46. package/lib/utils/NitroOptionsPanel.js +63 -0
  47. package/lib/utils/NitroSection.d.ts +89 -2
  48. package/lib/utils/NitroSection.js +49 -2
  49. package/lib-cjs/AutoPlayHeadlessJsTask.js +16 -0
  50. package/lib-cjs/Constants.js +9 -0
  51. package/lib-cjs/components/MapTemplateContext.js +10 -0
  52. package/lib-cjs/components/SafeAreaInsetsContext.js +21 -0
  53. package/lib-cjs/components/SafeAreaView.js +22 -0
  54. package/lib-cjs/components/WindowInformationWrapper.js +20 -0
  55. package/lib-cjs/hooks/useAndroidAutoTelemetry.js +115 -0
  56. package/lib-cjs/hooks/useFocusedEffect.js +35 -0
  57. package/lib-cjs/hooks/useMapTemplate.js +13 -0
  58. package/lib-cjs/hooks/useSafeAreaInsets.js +9 -0
  59. package/lib-cjs/hooks/useVoiceInput.js +42 -0
  60. package/lib-cjs/hybrid/HybridAndroidAutoTelemetry.js +4 -0
  61. package/lib-cjs/hybrid/HybridAndroidWindowInformation.js +4 -0
  62. package/lib-cjs/hybrid/HybridAutoPlay.js +5 -0
  63. package/lib-cjs/hybrid/HybridVoice.js +61 -0
  64. package/lib-cjs/index.js +76 -0
  65. package/lib-cjs/index.web.js +98 -0
  66. package/lib-cjs/scenes/AutoPlayCluster.js +140 -0
  67. package/lib-cjs/scenes/CarPlayDashboardScene.js +100 -0
  68. package/lib-cjs/specs/AndroidAutoTelemetry.nitro.js +2 -0
  69. package/lib-cjs/specs/AndroidAutomotive.nitro.js +16 -0
  70. package/lib-cjs/specs/AndroidWindowInformation.nitro.js +2 -0
  71. package/lib-cjs/specs/AutoPlay.nitro.js +2 -0
  72. package/lib-cjs/specs/CarPlayDashboard.nitro.js +2 -0
  73. package/lib-cjs/specs/Cluster.nitro.js +2 -0
  74. package/lib-cjs/specs/GridTemplate.nitro.js +2 -0
  75. package/lib-cjs/specs/InformationTemplate.nitro.js +2 -0
  76. package/lib-cjs/specs/ListTemplate.nitro.js +2 -0
  77. package/lib-cjs/specs/MapTemplate.nitro.js +2 -0
  78. package/lib-cjs/specs/MessageTemplate.nitro.js +2 -0
  79. package/lib-cjs/specs/SearchTemplate.nitro.js +2 -0
  80. package/lib-cjs/specs/SignInTemplate.nitro.js +2 -0
  81. package/lib-cjs/specs/Voice.nitro.js +2 -0
  82. package/lib-cjs/templates/GridTemplate.js +41 -0
  83. package/lib-cjs/templates/InformationTemplate.js +49 -0
  84. package/lib-cjs/templates/ListTemplate.js +33 -0
  85. package/lib-cjs/templates/MapTemplate.js +168 -0
  86. package/lib-cjs/templates/MessageTemplate.js +50 -0
  87. package/lib-cjs/templates/SearchTemplate.js +32 -0
  88. package/lib-cjs/templates/SignInTemplate.js +55 -0
  89. package/lib-cjs/templates/Template.js +40 -0
  90. package/lib-cjs/types/Button.js +12 -0
  91. package/lib-cjs/types/Event.js +2 -0
  92. package/lib-cjs/types/Image.js +2 -0
  93. package/lib-cjs/types/Maneuver.js +77 -0
  94. package/lib-cjs/types/RootComponent.js +2 -0
  95. package/lib-cjs/types/SignInMethod.js +22 -0
  96. package/lib-cjs/types/Telemetry.js +24 -0
  97. package/lib-cjs/types/Text.js +8 -0
  98. package/lib-cjs/types/Trip.js +2 -0
  99. package/lib-cjs/types/Voice.js +2 -0
  100. package/lib-cjs/utils/ErrorUtil.js +34 -0
  101. package/lib-cjs/utils/NitroAction.js +129 -0
  102. package/lib-cjs/utils/NitroAlert.js +19 -0
  103. package/lib-cjs/utils/NitroAttributedString.js +14 -0
  104. package/lib-cjs/utils/NitroColor.js +32 -0
  105. package/lib-cjs/utils/NitroGrid.js +12 -0
  106. package/lib-cjs/utils/NitroImage.js +97 -0
  107. package/lib-cjs/utils/NitroManeuver.js +79 -0
  108. package/lib-cjs/utils/NitroMapButton.js +33 -0
  109. package/lib-cjs/utils/NitroOptionsPanel.js +66 -0
  110. package/lib-cjs/utils/NitroSection.js +112 -0
  111. package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -0
  112. package/nitrogen/generated/android/c++/JChargingConnector.hpp +79 -0
  113. package/nitrogen/generated/android/c++/JGridImageSize.hpp +64 -0
  114. package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +7 -1
  115. package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +4 -0
  116. package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +12 -0
  117. package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +12 -0
  118. package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +78 -3
  119. package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.hpp +2 -1
  120. package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +12 -0
  121. package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +6 -0
  122. package/nitrogen/generated/android/c++/JListImageType.hpp +67 -0
  123. package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +6 -0
  124. package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +115 -0
  125. package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +82 -0
  126. package/nitrogen/generated/android/c++/JNitroColor.hpp +8 -4
  127. package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +112 -0
  128. package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +157 -0
  129. package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +102 -0
  130. package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.cpp +30 -0
  131. package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.hpp +129 -0
  132. package/nitrogen/generated/android/c++/JNitroRow.hpp +33 -3
  133. package/nitrogen/generated/android/c++/JNitroSection.hpp +6 -0
  134. package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +6 -0
  135. package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +65 -0
  136. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ChargingConnector.kt +30 -0
  137. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridImageSize.kt +25 -0
  138. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +9 -4
  139. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +5 -1
  140. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListImageType.kt +26 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerLocation.kt +90 -0
  142. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerOutlet.kt +70 -0
  143. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +9 -4
  144. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelChargerSection.kt +61 -0
  145. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelConfig.kt +61 -0
  146. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelGridSection.kt +56 -0
  147. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection.kt +75 -0
  148. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +36 -6
  149. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WaypointCoordinate.kt +61 -0
  150. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +174 -0
  151. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +27 -0
  152. package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +3 -0
  153. package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +9 -0
  154. package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +9 -0
  155. package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +47 -1
  156. package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +9 -0
  157. package/nitrogen/generated/ios/swift/ChargingConnector.swift +68 -0
  158. package/nitrogen/generated/ios/swift/GridImageSize.swift +48 -0
  159. package/nitrogen/generated/ios/swift/GridTemplateConfig.swift +12 -1
  160. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +2 -1
  161. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +31 -4
  162. package/nitrogen/generated/ios/swift/ListImageType.swift +52 -0
  163. package/nitrogen/generated/ios/swift/NitroChargerLocation.swift +161 -0
  164. package/nitrogen/generated/ios/swift/NitroChargerOutlet.swift +65 -0
  165. package/nitrogen/generated/ios/swift/NitroColor.swift +20 -2
  166. package/nitrogen/generated/ios/swift/NitroOptionsPanelChargerSection.swift +64 -0
  167. package/nitrogen/generated/ios/swift/NitroOptionsPanelConfig.swift +94 -0
  168. package/nitrogen/generated/ios/swift/NitroOptionsPanelGridSection.swift +53 -0
  169. package/nitrogen/generated/ios/swift/NitroOptionsPanelSection.swift +32 -0
  170. package/nitrogen/generated/ios/swift/NitroRow.swift +81 -1
  171. package/nitrogen/generated/ios/swift/WaypointCoordinate.swift +52 -0
  172. package/nitrogen/generated/shared/c++/ChargingConnector.hpp +104 -0
  173. package/nitrogen/generated/shared/c++/GridImageSize.hpp +84 -0
  174. package/nitrogen/generated/shared/c++/GridTemplateConfig.hpp +8 -1
  175. package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.cpp +1 -0
  176. package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.hpp +5 -1
  177. package/nitrogen/generated/shared/c++/ListImageType.hpp +88 -0
  178. package/nitrogen/generated/shared/c++/NitroChargerLocation.hpp +131 -0
  179. package/nitrogen/generated/shared/c++/NitroChargerOutlet.hpp +98 -0
  180. package/nitrogen/generated/shared/c++/NitroColor.hpp +7 -3
  181. package/nitrogen/generated/shared/c++/NitroOptionsPanelChargerSection.hpp +98 -0
  182. package/nitrogen/generated/shared/c++/NitroOptionsPanelConfig.hpp +107 -0
  183. package/nitrogen/generated/shared/c++/NitroOptionsPanelGridSection.hpp +91 -0
  184. package/nitrogen/generated/shared/c++/NitroRow.hpp +39 -2
  185. package/nitrogen/generated/shared/c++/WaypointCoordinate.hpp +91 -0
  186. package/package.json +7 -3
  187. package/src/Constants.ts +9 -0
  188. package/src/index.ts +1 -0
  189. package/src/index.web.ts +166 -0
  190. package/src/specs/MapTemplate.nitro.ts +3 -1
  191. package/src/templates/GridTemplate.ts +38 -3
  192. package/src/templates/InformationTemplate.ts +60 -29
  193. package/src/templates/ListTemplate.ts +27 -55
  194. package/src/templates/MapTemplate.ts +60 -2
  195. package/src/templates/MessageTemplate.ts +71 -24
  196. package/src/types/Image.ts +6 -1
  197. package/src/utils/NitroColor.ts +10 -1
  198. package/src/utils/NitroImage.ts +1 -5
  199. package/src/utils/NitroManeuver.ts +1 -4
  200. package/src/utils/NitroOptionsPanel.ts +218 -0
  201. package/src/utils/NitroSection.ts +160 -5
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { AutoText } from '..';
3
- import type { ActionButtonAndroid, MapButton, MapPanButton } from '../types/Button';
3
+ import type { ActionButtonAndroid, ImageButton, MapButton, MapPanButton, TextButton } from '../types/Button';
4
4
  import type { AutoManeuver, ManeuverState } from '../types/Maneuver';
5
5
  import type { ColorScheme, RootComponentInitialProps } from '../types/RootComponent';
6
6
  import type { TripConfig, TripPoint, TripPreviewTextConfiguration, TripsConfig } from '../types/Trip';
@@ -8,7 +8,9 @@ import { type NitroAction } from '../utils/NitroAction';
8
8
  import { type NavigationAlert } from '../utils/NitroAlert';
9
9
  import { type NitroColor, type ThemedColor } from '../utils/NitroColor';
10
10
  import { NitroMapButton } from '../utils/NitroMapButton';
11
+ import { type OptionsPanelConfig } from '../utils/NitroOptionsPanel';
11
12
  import { type HeaderActionsIos, type NitroBaseMapTemplateConfig, Template, type TemplateConfig } from './Template';
13
+ export type { ChargerLocation, ChargerOutlet, ChargingConnector, OptionsPanelChargerSection, OptionsPanelConfig, OptionsPanelGridSection, OptionsPanelListSection, OptionsPanelSection, } from '../utils/NitroOptionsPanel';
12
14
  export type Point = {
13
15
  x: number;
14
16
  y: number;
@@ -68,6 +70,17 @@ export type MapHeaderActions<T> = {
68
70
  android?: HeaderActionsAndroidMap<T>;
69
71
  ios?: HeaderActionsIos<T>;
70
72
  };
73
+ /**
74
+ * @namespace iOS - not supported; CarPlay has no separate header for the map behind a panel, so
75
+ * the panel template's own `headerActions` are applied to the root map template's nav bar instead.
76
+ */
77
+ export type PanelHeaderActions<T> = Omit<MapHeaderActions<T>, 'ios'>;
78
+ /**
79
+ * @namespace iOS - a CPMapPanel can only show one CPTextButton (with a title) and one
80
+ * optional icon-only button (any title is dropped natively), so a second action must be an
81
+ * ImageButton rather than a TextButton, and a third action isn't supported at all.
82
+ */
83
+ export type PanelActionsIos<T> = [TextButton<T>] | [TextButton<T>, ImageButton<T>];
71
84
  export type BaseMapTemplateConfig<T> = {
72
85
  /**
73
86
  * buttons that represent actions on the map template, usually on the bottom right corner
@@ -85,6 +98,12 @@ export type MapTemplateConfig = Omit<NitroMapTemplateConfig, 'mapButtons' | 'hea
85
98
  * react component that is rendered
86
99
  */
87
100
  component: React.ComponentType<RootComponentInitialProps>;
101
+ /**
102
+ * the panel shown when tapping the ellipsis button next to the travel estimates during active navigation (iOS 27+).
103
+ * No-op on Android
104
+ * @namespace iOS
105
+ */
106
+ optionsPanel?: OptionsPanelConfig<MapTemplate>;
88
107
  /**
89
108
  * Notification that navigation was stopped. May occur when another source such as the car head unit starts navigating.
90
109
  * The navigation session on Android Auto/CarPlay is stopped already when this callback is triggered, make sure to stop other things like TTS too.
@@ -110,6 +129,11 @@ export declare class MapTemplate extends Template<MapTemplateConfig, MapTemplate
110
129
  id: string;
111
130
  private template;
112
131
  constructor(config: MapTemplateConfig);
132
+ /**
133
+ * @namespace iOS updates the panel shown when tapping the ellipsis button
134
+ * next to the travel estimates during navigation (iOS 27+).
135
+ */
136
+ updateOptionsPanel(optionsPanel?: OptionsPanelConfig<MapTemplate>): Promise<void> | undefined;
113
137
  setMapButtons(mapButtons: MapTemplateConfig['mapButtons']): Promise<void>;
114
138
  setHeaderActions(headerActions: MapTemplateConfig['headerActions']): Promise<void>;
115
139
  /**
@@ -155,7 +179,7 @@ export declare class MapTemplate extends Template<MapTemplateConfig, MapTemplate
155
179
  * either use showTripSelector to show a set of trips and let the user start the navigation session
156
180
  * or use this to start a navigation session without asking the user
157
181
  */
158
- startNavigation(trip: TripConfig): void;
182
+ startNavigation(trip: TripConfig): Promise<void>;
159
183
  stopNavigation(): void;
160
184
  /**
161
185
  * Sets the current maneuver state indicating progress within a maneuver.
@@ -10,6 +10,7 @@ import { NitroAlertUtil } from '../utils/NitroAlert';
10
10
  import { NitroColorUtil } from '../utils/NitroColor';
11
11
  import { NitroManeuverUtil } from '../utils/NitroManeuver';
12
12
  import { NitroMapButton } from '../utils/NitroMapButton';
13
+ import { NitroOptionsPanelUtil } from '../utils/NitroOptionsPanel';
13
14
  import { Template, } from './Template';
14
15
  const HybridMapTemplate = NitroModules.createHybridObject('MapTemplate');
15
16
  export class MapTemplate extends Template {
@@ -17,7 +18,7 @@ export class MapTemplate extends Template {
17
18
  template = this;
18
19
  constructor(config) {
19
20
  super(config);
20
- const { component, mapButtons, headerActions, onStopNavigation, onAutoDriveEnabled, defaultGuidanceBackgroundColor, ...baseConfig } = config;
21
+ const { component, mapButtons, headerActions, onStopNavigation, onAutoDriveEnabled, defaultGuidanceBackgroundColor, optionsPanel, ...baseConfig } = config;
21
22
  AppRegistry.registerComponent(this.id, () => (props) => React.createElement(MapTemplateProvider, {
22
23
  mapTemplate: this.template,
23
24
  // biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
@@ -43,6 +44,19 @@ export class MapTemplate extends Template {
43
44
  : undefined,
44
45
  };
45
46
  HybridMapTemplate.createMapTemplate(nitroConfig);
47
+ // routed through updateOptionsPanel, not embedded in nitroConfig above — nitrogen can't generate
48
+ // a spec for a variant type nested that deep inside NitroMapTemplateConfig.
49
+ this.updateOptionsPanel(optionsPanel);
50
+ }
51
+ /**
52
+ * @namespace iOS updates the panel shown when tapping the ellipsis button
53
+ * next to the travel estimates during navigation (iOS 27+).
54
+ */
55
+ updateOptionsPanel(optionsPanel) {
56
+ if (Platform.OS !== 'ios') {
57
+ return;
58
+ }
59
+ return HybridMapTemplate.updateOptionsPanel(this.id, NitroOptionsPanelUtil.convert(this.template, optionsPanel));
46
60
  }
47
61
  setMapButtons(mapButtons) {
48
62
  const buttons = NitroMapButton.convert(this.template, mapButtons);
@@ -130,7 +144,7 @@ export class MapTemplate extends Template {
130
144
  * or use this to start a navigation session without asking the user
131
145
  */
132
146
  startNavigation(trip) {
133
- HybridMapTemplate.startNavigation(this.id, trip);
147
+ return HybridMapTemplate.startNavigation(this.id, trip);
134
148
  }
135
149
  stopNavigation() {
136
150
  HybridMapTemplate.stopNavigation(this.id);
@@ -1,12 +1,14 @@
1
- import type { AutoImage, BaseMapTemplateConfig, CustomActionButtonAndroid, HeaderActionsAndroid, TextButton } from '..';
1
+ import type { AutoImage, BaseMapTemplateConfig, CustomActionButtonAndroid, HeaderActions, TextButton } from '..';
2
2
  import type { AutoText } from '../types/Text';
3
3
  import { type NitroAction } from '../utils/NitroAction';
4
4
  import { type NitroImage } from '../utils/NitroImage';
5
+ import type { PanelActionsIos, PanelHeaderActions } from './MapTemplate';
5
6
  import type { NitroBaseMapTemplateConfig, TemplateConfig } from './Template';
6
7
  export interface NitroMessageTemplateConfig extends TemplateConfig {
7
8
  headerActions?: Array<NitroAction>;
8
9
  /**
9
10
  * @namespace Android title shown on header
11
+ * @namespace iOS title shown when mapConfig is set, otherwise it isn't supported
10
12
  */
11
13
  title?: AutoText;
12
14
  message: AutoText;
@@ -14,31 +16,69 @@ export interface NitroMessageTemplateConfig extends TemplateConfig {
14
16
  image?: NitroImage;
15
17
  mapConfig?: NitroBaseMapTemplateConfig;
16
18
  }
17
- export type MessageTemplateConfig = Omit<NitroMessageTemplateConfig, 'headerActions' | 'image' | 'mapConfig' | 'actions'> & {
19
+ type MessageActionsAndroid<T> = [CustomActionButtonAndroid<T>] | [CustomActionButtonAndroid<T>, CustomActionButtonAndroid<T>];
20
+ type MessageTemplateBaseConfig = Omit<NitroMessageTemplateConfig, 'headerActions' | 'image' | 'mapConfig' | 'actions'> & {
18
21
  /**
19
22
  * action buttons, usually at the top right on Android
20
- * @namespace Android
23
+ * @namespace iOS `ios` only takes effect once this renders as a CPMapPanel (`mapConfig` set,
24
+ * iOS 27+) and is applied to the root map template's nav bar — without `mapConfig` (or below
25
+ * iOS 27, where `mapConfig` is a no-op) this template is a full-screen `CPAlertTemplate`, which
26
+ * has no nav bar at all, so `ios` is silently unused there.
21
27
  */
22
- headerActions?: HeaderActionsAndroid<MessageTemplate>;
28
+ headerActions?: HeaderActions<MessageTemplate>;
23
29
  /**
24
30
  * image shown at the top of the message on Android
25
31
  * @namespace Android
26
32
  */
27
33
  image?: AutoImage;
34
+ };
35
+ /**
36
+ * `actions`/`mapConfig` are a discriminated union — `mapConfig` restricts `actions.ios` to at
37
+ * most one `TextButton` plus one icon-only `ImageButton` (a `CPMapPanel` can't show more), vs. up
38
+ * to three `TextButton`s otherwise. If your `mapConfig` value comes from a variable/prop rather
39
+ * than an inline literal, TS can't narrow which branch applies — assign it to a local `const` and
40
+ * branch with `if (mapConfig) { ... } else { ... }` into two separate constructor calls instead
41
+ * of passing it straight through to one.
42
+ */
43
+ export type MessageTemplateConfig = MessageTemplateBaseConfig & ({
44
+ mapConfig?: undefined;
28
45
  /**
29
- * If mapConfig is defined, it will use a MapWithContentTemplate with the current template. This results in a MessageTemplate with a map in background. No actions need to be specified, can be empty object.
30
- * @namespace Android
46
+ * @namespace Android up to 2 buttons of type TextButton, TextAndImageButton or ImageButton
47
+ * @namespace iOS - up to 3 buttons of type TextButton
31
48
  */
32
- mapConfig?: BaseMapTemplateConfig<MessageTemplate>;
49
+ actions?: {
50
+ android?: MessageActionsAndroid<MessageTemplate>;
51
+ ios?: [
52
+ TextButton<MessageTemplate>,
53
+ TextButton<MessageTemplate>,
54
+ TextButton<MessageTemplate>
55
+ ] | [TextButton<MessageTemplate>, TextButton<MessageTemplate>] | [TextButton<MessageTemplate>];
56
+ };
57
+ } | {
58
+ /**
59
+ * If mapConfig is defined, it will use a MapWithContentTemplate with the current
60
+ * template. This results in a MessageTemplate with a map in background. No actions
61
+ * need to be specified, can be empty object.
62
+ * @namespace Android - uses MapWithContentTemplate
63
+ * @namespace iOS - renders as a CPMapPanel on the current root map template (iOS 27+),
64
+ * trading the usual full-screen modal alert presentation for panel content;
65
+ * `headerActions` here is Android-only — on iOS this template's own `headerActions` are
66
+ * applied to the root map template's nav bar instead, since CarPlay has no separate
67
+ * header for the map behind a panel.
68
+ */
69
+ mapConfig: Omit<BaseMapTemplateConfig<MessageTemplate>, 'headerActions'> & {
70
+ headerActions?: PanelHeaderActions<MessageTemplate>;
71
+ };
33
72
  /**
34
73
  * @namespace Android up to 2 buttons of type TextButton, TextAndImageButton or ImageButton
35
- * @namespace iOS - up to 3 buttons of type TextButton
74
+ * @namespace iOS - the panel can only show one TextButton plus one optional icon-only
75
+ * ImageButton, see PanelActionsIos
36
76
  */
37
77
  actions?: {
38
- android?: [CustomActionButtonAndroid<MessageTemplate>] | [CustomActionButtonAndroid<MessageTemplate>, CustomActionButtonAndroid<MessageTemplate>];
39
- ios?: [TextButton<MessageTemplate>, TextButton<MessageTemplate>, TextButton<MessageTemplate>] | [TextButton<MessageTemplate>, TextButton<MessageTemplate>] | [TextButton<MessageTemplate>];
78
+ android?: MessageActionsAndroid<MessageTemplate>;
79
+ ios?: PanelActionsIos<MessageTemplate>;
40
80
  };
41
- };
81
+ });
42
82
  /**
43
83
  * This template is always pushed on top and will stay on top until it is popped.
44
84
  * Other templates being pushed will end up below this one on the stack.
@@ -53,3 +93,4 @@ export declare class MessageTemplate {
53
93
  */
54
94
  push(): Promise<void>;
55
95
  }
96
+ export {};
@@ -22,7 +22,7 @@ export class MessageTemplate {
22
22
  const nitroConfig = {
23
23
  ...rest,
24
24
  id: this.id,
25
- headerActions: NitroActionUtil.convert(this.template, { android: headerActions }),
25
+ headerActions: NitroActionUtil.convert(this.template, headerActions),
26
26
  image: NitroImageUtil.convert(image),
27
27
  actions: platformActions,
28
28
  mapConfig: mapConfig
@@ -19,7 +19,8 @@ export type GlyphMapKey = keyof AutoPlayGlyphMap extends never ? string : Extrac
19
19
  type GlyphStyleFields = {
20
20
  /**
21
21
  * Sets the icon dark and light mode color or a single color for both.
22
- * Defaults to white for dark mode and black for light mode if not specified.
22
+ * Defaults to `'default'` if not specified, which is white for dark mode and black for light mode.
23
+ * On Android Auto the host tint that follows the template is not applied when `backgroundColor` is not transparent.
23
24
  * Might not get applied everywhere like MapTemplate buttons on Android.
24
25
  */
25
26
  color?: ThemedColor | string;
@@ -49,6 +50,8 @@ export type AutoImage = AutoGlyph | {
49
50
  /**
50
51
  * if specified the image gets tinted, if not it will just use the original image
51
52
  * Might not get applied everywhere like MapTemplate buttons on Android.
53
+ * Use `'default'` for monochrome icons that must stay readable on both dark and light
54
+ * Android Auto templates (17.8+), see README.
52
55
  */
53
56
  color?: ThemedColor | string;
54
57
  type: 'asset';
@@ -57,6 +60,8 @@ export type AutoImage = AutoGlyph | {
57
60
  uri: string;
58
61
  /**
59
62
  * if specified the image gets tinted, if not it will just use the original image
63
+ * Use `'default'` for monochrome icons that must stay readable on both dark and light
64
+ * Android Auto templates (17.8+), see README.
60
65
  */
61
66
  color?: ThemedColor | string;
62
67
  /**
@@ -1,6 +1,7 @@
1
1
  export type NitroColor = {
2
2
  lightColor: number;
3
3
  darkColor: number;
4
+ isDefault?: boolean;
4
5
  };
5
6
  export type ThemedColor = {
6
7
  lightColor: string;
@@ -1,4 +1,9 @@
1
1
  import { processColor } from 'react-native';
2
+ const DefaultNitroColor = {
3
+ darkColor: convertColor('white'),
4
+ lightColor: convertColor('black'),
5
+ isDefault: true,
6
+ };
2
7
  function convertColor(color) {
3
8
  // since we accept only string it can return a number only
4
9
  return processColor(color);
@@ -8,6 +13,9 @@ function convert(color) {
8
13
  return undefined;
9
14
  }
10
15
  if (typeof color === 'string') {
16
+ if (color === 'default') {
17
+ return DefaultNitroColor;
18
+ }
11
19
  const convertedColor = convertColor(color);
12
20
  return { darkColor: convertedColor, lightColor: convertedColor };
13
21
  }
@@ -59,7 +59,7 @@ function convert(image) {
59
59
  return undefined;
60
60
  }
61
61
  if (image.type === 'glyph') {
62
- const { color = { darkColor: 'white', lightColor: 'black' }, fontScale, backgroundColor = 'transparent', } = image;
62
+ const { color = 'default', fontScale, backgroundColor = 'transparent' } = image;
63
63
  return {
64
64
  glyph: resolveGlyph(image),
65
65
  fontName: getIconFont(),
@@ -6,9 +6,7 @@ function convertManeuverImage(image) {
6
6
  return undefined;
7
7
  }
8
8
  if (image.type === 'glyph') {
9
- const color = typeof image.color === 'string'
10
- ? image.color
11
- : (image.color ?? { darkColor: 'white', lightColor: 'black' });
9
+ const color = typeof image.color === 'string' ? image.color : (image.color ?? 'default');
12
10
  return NitroImageUtil.convert({
13
11
  ...image,
14
12
  color: color,
@@ -0,0 +1,103 @@
1
+ import type { ImageButton, TextButton } from '../types/Button';
2
+ import type { AutoImage } from '../types/Image';
3
+ import type { AutoText, Distance } from '../types/Text';
4
+ import type { DurationWithTimeZone } from '../types/Trip';
5
+ import { type NitroAction } from './NitroAction';
6
+ import { type GridButton, type NitroGridButton } from './NitroGrid';
7
+ import { type NitroImage } from './NitroImage';
8
+ import { type DefaultRow, type NitroSection, type RadioRow, type TextRow, type ToggleRow, type WaypointCoordinate, type WaypointRow } from './NitroSection';
9
+ export type OptionsPanelGridSection<T> = {
10
+ type: 'grid';
11
+ title?: string;
12
+ buttons: Array<GridButton<T>>;
13
+ };
14
+ export type ChargingConnector = 'ccs1' | 'ccs2' | 'j1772' | 'chaDeMo' | 'mennekes' | 'gbtDC' | 'gbtAC' | 'nacsDC' | 'nacsAC';
15
+ /**
16
+ * one outlet (`CPChargingStationConnection`) on a charging station.
17
+ */
18
+ export type ChargerOutlet<T> = {
19
+ connector: ChargingConnector;
20
+ voltage: number;
21
+ /** converted to megawatts on the native side above 1000 kW */
22
+ powerKw: number;
23
+ onPress?: (template: T) => void;
24
+ };
25
+ /**
26
+ * the charging station's own location, shown as an additional `CPMapTemplateWaypoint` item in
27
+ * the charger section, alongside its outlets.
28
+ */
29
+ export type ChargerLocation<T> = {
30
+ /**
31
+ * the item's own label — distinct from the section's `title`, which is already shown as the
32
+ * section header, so this defaults to blank rather than repeating it.
33
+ */
34
+ name?: string;
35
+ /** newline-separated address lines, most-preferred first */
36
+ address?: string;
37
+ coordinate: WaypointCoordinate;
38
+ travelEstimates: {
39
+ distance: Distance;
40
+ duration: DurationWithTimeZone;
41
+ /**
42
+ * by default travel estimates are not shown
43
+ * setting this to true add another row showing CPTravelEstimates
44
+ */
45
+ visible?: boolean;
46
+ };
47
+ image?: AutoImage;
48
+ onPress?: (template: T) => void;
49
+ };
50
+ /**
51
+ * charger section having n-ChargerOutlet
52
+ */
53
+ export type OptionsPanelChargerSection<T> = {
54
+ type: 'charger';
55
+ title?: string;
56
+ outlets: Array<ChargerOutlet<T>>;
57
+ location?: ChargerLocation<T>;
58
+ };
59
+ export type OptionsPanelListSection<T> = {
60
+ type: 'list';
61
+ title?: string;
62
+ items: Array<DefaultRow<T> | ToggleRow<T> | TextRow | WaypointRow<T>> | Array<RadioRow<T>>;
63
+ };
64
+ export type OptionsPanelSection<T> = OptionsPanelListSection<T> | OptionsPanelGridSection<T> | OptionsPanelChargerSection<T>;
65
+ export type OptionsPanelConfig<T> = {
66
+ title?: AutoText;
67
+ sections: Array<OptionsPanelSection<T>>;
68
+ actions?: [TextButton<T>] | [TextButton<T>, ImageButton<T>];
69
+ };
70
+ export type NitroOptionsPanelGridSection = {
71
+ title?: string;
72
+ buttons: Array<NitroGridButton>;
73
+ };
74
+ export type NitroChargerOutlet = {
75
+ connector: ChargingConnector;
76
+ voltage: number;
77
+ powerKw: number;
78
+ onPress?: () => void;
79
+ };
80
+ export type NitroChargerLocation = {
81
+ name?: string;
82
+ address?: string;
83
+ coordinate: WaypointCoordinate;
84
+ distance: Distance;
85
+ duration: DurationWithTimeZone;
86
+ visible?: boolean;
87
+ image?: NitroImage;
88
+ onPress?: () => void;
89
+ };
90
+ export type NitroOptionsPanelChargerSection = {
91
+ title?: string;
92
+ outlets: Array<NitroChargerOutlet>;
93
+ location?: NitroChargerLocation;
94
+ };
95
+ export type NitroOptionsPanelSection = NitroSection | NitroOptionsPanelGridSection | NitroOptionsPanelChargerSection;
96
+ export type NitroOptionsPanelConfig = {
97
+ title?: AutoText;
98
+ sections: Array<NitroOptionsPanelSection>;
99
+ actions?: Array<NitroAction>;
100
+ };
101
+ export declare const NitroOptionsPanelUtil: {
102
+ convert: <T>(template: T, config?: OptionsPanelConfig<T>) => NitroOptionsPanelConfig | undefined;
103
+ };
@@ -0,0 +1,63 @@
1
+ import { NitroActionUtil } from './NitroAction';
2
+ import { NitroGridUtil } from './NitroGrid';
3
+ import { NitroImageUtil } from './NitroImage';
4
+ import { NitroSectionUtil, } from './NitroSection';
5
+ const isRadioSection = (items) => {
6
+ return items.length > 0 && items.every((item) => item.type === 'radio');
7
+ };
8
+ const convertSection = (template, section) => {
9
+ if (section.type === 'grid') {
10
+ return {
11
+ title: section.title,
12
+ buttons: NitroGridUtil.convert(template, section.buttons),
13
+ };
14
+ }
15
+ if (section.type === 'charger') {
16
+ const { location } = section;
17
+ return {
18
+ title: section.title,
19
+ outlets: section.outlets.map((outlet) => ({
20
+ connector: outlet.connector,
21
+ voltage: outlet.voltage,
22
+ powerKw: outlet.powerKw,
23
+ onPress: outlet.onPress ? () => outlet.onPress?.(template) : undefined,
24
+ })),
25
+ location: location
26
+ ? {
27
+ name: location.name,
28
+ address: location.address,
29
+ coordinate: location.coordinate,
30
+ distance: location.travelEstimates.distance,
31
+ duration: location.travelEstimates.duration,
32
+ visible: location.travelEstimates.visible,
33
+ image: NitroImageUtil.convert(location.image),
34
+ onPress: location.onPress ? () => location.onPress?.(template) : undefined,
35
+ }
36
+ : undefined,
37
+ };
38
+ }
39
+ const { items, title = '' } = section;
40
+ const multiSection = isRadioSection(items)
41
+ ? { type: 'radio', title, items }
42
+ : {
43
+ type: 'default',
44
+ title,
45
+ items,
46
+ };
47
+ const [nitroSection] = NitroSectionUtil.convert(template, [multiSection]) ?? [];
48
+ if (nitroSection == null) {
49
+ throw new Error('converting sections failed');
50
+ }
51
+ return nitroSection;
52
+ };
53
+ const convert = (template, config) => {
54
+ if (config == null) {
55
+ return undefined;
56
+ }
57
+ return {
58
+ title: config.title,
59
+ sections: config.sections.map((section) => convertSection(template, section)),
60
+ actions: NitroActionUtil.convert(template, config.actions),
61
+ };
62
+ };
63
+ export const NitroOptionsPanelUtil = { convert };
@@ -1,6 +1,82 @@
1
- import type { Section } from '../templates/ListTemplate';
2
- import type { AutoText } from '../types/Text';
1
+ import type { ListImageType } from '../templates/ListTemplate';
2
+ import type { AutoImage } from '../types/Image';
3
+ import { type AutoText, type Distance } from '../types/Text';
4
+ import type { DurationWithTimeZone } from '../types/Trip';
3
5
  import { type NitroImage } from './NitroImage';
6
+ type BaseRow = {
7
+ title: AutoText;
8
+ enabled?: boolean;
9
+ image?: AutoImage;
10
+ /** @namespace Android */
11
+ imageType?: ListImageType;
12
+ };
13
+ export type DefaultRow<T> = BaseRow & {
14
+ type: 'default';
15
+ /**
16
+ * adds a chevron at the end of the row
17
+ */
18
+ browsable?: boolean;
19
+ onPress: (template: T) => void;
20
+ detailedText?: AutoText;
21
+ };
22
+ export type ToggleRow<T> = BaseRow & {
23
+ type: 'toggle';
24
+ checked: boolean;
25
+ onPress: (template: T, checked: boolean) => void;
26
+ };
27
+ export type RadioRow<T> = BaseRow & {
28
+ type: 'radio';
29
+ onPress: (template: T) => void;
30
+ selected?: boolean;
31
+ };
32
+ export type TextRow = BaseRow & {
33
+ type: 'text';
34
+ detailedText?: AutoText;
35
+ };
36
+ export type WaypointCoordinate = {
37
+ latitude: number;
38
+ longitude: number;
39
+ altitude?: number;
40
+ };
41
+ /**
42
+ * a point of interest, e.g. a charger's location. Renders as a `CPMapTemplateWaypoint` item
43
+ * (showing `title` as the name, `address` as the address, and the travel estimate for reaching
44
+ * it) when part of a `CPMapPanel` (iOS 27+); falls back to a plain row using `title`/`address`
45
+ * as the detail line everywhere else (including Android, which has no equivalent concept).
46
+ */
47
+ export type WaypointRow<T> = BaseRow & {
48
+ type: 'waypoint';
49
+ /**
50
+ * add one of {@link TextPlaceholders} to add travelEstimates
51
+ * prefer travelEstimates.visible over that on iOS 27+
52
+ */
53
+ address?: string;
54
+ coordinate: WaypointCoordinate;
55
+ travelEstimates: {
56
+ distance: Distance;
57
+ duration: DurationWithTimeZone;
58
+ /**
59
+ * by default travel estimates are not shown
60
+ * setting this to true adds another row showing CPTravelEstimates
61
+ * @namespace iOS 27+
62
+ */
63
+ visible?: boolean;
64
+ };
65
+ onPress?: (template: T) => void;
66
+ };
67
+ export type MultiSection<T> = {
68
+ type: 'default';
69
+ title: string;
70
+ items: Array<DefaultRow<T> | ToggleRow<T> | TextRow | WaypointRow<T>>;
71
+ } | {
72
+ type: 'radio';
73
+ title: string;
74
+ items: Array<RadioRow<T>>;
75
+ };
76
+ export type SingleSection<T> = {
77
+ [K in MultiSection<T> as K['type']]: Omit<K, 'title' | 'detailedText'>;
78
+ }[MultiSection<T>['type']];
79
+ export type Section<T> = Array<MultiSection<T>> | SingleSection<T>;
4
80
  type NitroSectionType = 'default' | 'radio';
5
81
  export type NitroRow = {
6
82
  title: AutoText;
@@ -8,9 +84,20 @@ export type NitroRow = {
8
84
  browsable?: boolean;
9
85
  enabled: boolean;
10
86
  image?: NitroImage;
87
+ imageType?: ListImageType;
11
88
  checked?: boolean;
12
89
  onPress?: (checked?: boolean) => void;
13
90
  selected?: boolean;
91
+ coordinate?: WaypointCoordinate;
92
+ distance?: Distance;
93
+ duration?: DurationWithTimeZone;
94
+ /**
95
+ * only meaningful in panel context (iOS 27+, `mapConfig` set) — adds a sibling `CPMapPanelItem`
96
+ * showing `distance`/`duration` as a native `CPTravelEstimates` row. Non-panel/Android rendering
97
+ * relies purely on `title`/`detailedText` opting in via `TextPlaceholders` instead.
98
+ */
99
+ travelEstimatesVisible?: boolean;
100
+ address?: string;
14
101
  };
15
102
  export type NitroSection = {
16
103
  title?: string;
@@ -1,3 +1,4 @@
1
+ import { TextPlaceholders } from '../types/Text';
1
2
  import { NitroImageUtil } from './NitroImage';
2
3
  const validateRadioItems = (type, items) => {
3
4
  if (__DEV__ &&
@@ -31,9 +32,49 @@ const convert = (template, sections) => {
31
32
  },
32
33
  ];
33
34
  };
35
+ /**
36
+ * `AutoText.distance`/`.duration` only take effect if `text` actually uses the matching
37
+ * `TextPlaceholders` marker — populate whichever of those the text references, leaving the rest
38
+ * of `text` untouched, so a title/address that doesn't opt in via a placeholder is unaffected.
39
+ */
40
+ const withTravelEstimates = (text, distance, durationSeconds) => {
41
+ const hasDistance = text.text.includes(TextPlaceholders.Distance);
42
+ const hasDuration = text.text.includes(TextPlaceholders.Duration);
43
+ if (!hasDistance && !hasDuration) {
44
+ return text;
45
+ }
46
+ return {
47
+ ...text,
48
+ distance: hasDistance ? distance : text.distance,
49
+ duration: hasDuration ? durationSeconds : text.duration,
50
+ };
51
+ };
34
52
  const convertRow = (template, item) => {
35
- const { title, type, enabled = true, image } = item;
36
- const detailedText = 'detailedText' in item ? item.detailedText : undefined;
53
+ const { type, enabled = true, image, imageType } = item;
54
+ // `WaypointRow` has no `detailedText` of its own — `address` doubles as the detail line
55
+ // whenever this falls back to a plain row (non-panel context, Android).
56
+ let title = item.title;
57
+ let detailedText = item.type === 'waypoint'
58
+ ? item.address != null
59
+ ? { text: item.address }
60
+ : undefined
61
+ : 'detailedText' in item
62
+ ? item.detailedText
63
+ : undefined;
64
+ // Opt-in only: a title/address using `{distance}`/`{duration}` gets those values filled in,
65
+ // via the same substitution `AutoText` already does everywhere else — no separate "estimate"
66
+ // UI element needed for a row embedded in a list alongside other rows. Deliberately NOT gated
67
+ // on `travelEstimates.visible` — that flag only controls the panel-only sibling
68
+ // `CPTravelEstimates` item (see `Parser.swift`'s `travelEstimatesVisible` check), which has no
69
+ // bearing on the non-panel/Android fallback text this feeds; a placeholder in the text is
70
+ // already its own explicit opt-in regardless of `visible`.
71
+ if (item.type === 'waypoint') {
72
+ const { distance, duration } = item.travelEstimates;
73
+ title = withTravelEstimates(title, distance, duration.seconds);
74
+ if (detailedText != null) {
75
+ detailedText = withTravelEstimates(detailedText, distance, duration.seconds);
76
+ }
77
+ }
37
78
  const selected = type === 'radio' ? (item.selected ?? false) : undefined;
38
79
  const onTogglePress = item.type === 'toggle' ? item.onPress : undefined;
39
80
  const onRowPress = item.type !== 'text' && item.type !== 'toggle' ? item.onPress : undefined;
@@ -53,10 +94,16 @@ const convertRow = (template, item) => {
53
94
  detailedText,
54
95
  enabled,
55
96
  image: NitroImageUtil.convert(image),
97
+ imageType,
56
98
  title,
57
99
  checked: type === 'toggle' ? item.checked : undefined,
58
100
  onPress,
59
101
  selected,
102
+ coordinate: item.type === 'waypoint' ? item.coordinate : undefined,
103
+ distance: item.type === 'waypoint' ? item.travelEstimates.distance : undefined,
104
+ duration: item.type === 'waypoint' ? item.travelEstimates.duration : undefined,
105
+ travelEstimatesVisible: item.type === 'waypoint' ? item.travelEstimates.visible : undefined,
106
+ address: item.type === 'waypoint' ? item.address : undefined,
60
107
  };
61
108
  };
62
109
  export const NitroSectionUtil = { convert };