@santoshpk/react-native-carplay 1.0.3
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 +119 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +17 -0
- package/android/.idea/jarRepositories.xml +25 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +63 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +20 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +31 -0
- package/android/src/main/AndroidManifestNew.xml +31 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayModule.kt +348 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayPackage.kt +18 -0
- package/android/src/main/java/org/birkir/carplay/CarPlayService.kt +34 -0
- package/android/src/main/java/org/birkir/carplay/CarPlaySession.kt +114 -0
- package/android/src/main/java/org/birkir/carplay/parser/Ext.kt +11 -0
- package/android/src/main/java/org/birkir/carplay/parser/Parser.kt +18 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTGridTemplate.kt +28 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTListTemplate.kt +64 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTMapTemplate.kt +185 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTMessageTemplate.kt +36 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTPaneTemplate.kt +24 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTSearchTemplate.kt +41 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTTabTemplate.kt +52 -0
- package/android/src/main/java/org/birkir/carplay/parser/RCTTemplate.kt +434 -0
- package/android/src/main/java/org/birkir/carplay/parser/TemplateParser.kt +35 -0
- package/android/src/main/java/org/birkir/carplay/screens/CarScreen.kt +69 -0
- package/android/src/main/java/org/birkir/carplay/screens/CarScreenContext.kt +10 -0
- package/android/src/main/java/org/birkir/carplay/utils/EventEmitter.kt +174 -0
- package/android/src/main/java/org/birkir/carplay/utils/VirtualRenderer.kt +75 -0
- package/ios/RCTConvert+RNCarPlay.h +18 -0
- package/ios/RCTConvert+RNCarPlay.m +96 -0
- package/ios/RNCPStore.h +24 -0
- package/ios/RNCPStore.m +68 -0
- package/ios/RNCarPlay.h +29 -0
- package/ios/RNCarPlay.m +1839 -0
- package/ios/RNCarPlay.xcodeproj/project.pbxproj +300 -0
- package/lib/CarPlay.d.ts +196 -0
- package/lib/CarPlay.d.ts.map +1 -0
- package/lib/CarPlay.js +176 -0
- package/lib/CarPlay.js.map +1 -0
- package/lib/index.d.ts +44 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +64 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/Action.d.ts +13 -0
- package/lib/interfaces/Action.d.ts.map +1 -0
- package/lib/interfaces/Action.js +3 -0
- package/lib/interfaces/Action.js.map +1 -0
- package/lib/interfaces/AlertAction.d.ts +6 -0
- package/lib/interfaces/AlertAction.d.ts.map +1 -0
- package/lib/interfaces/AlertAction.js +3 -0
- package/lib/interfaces/AlertAction.js.map +1 -0
- package/lib/interfaces/BarButton.d.ts +39 -0
- package/lib/interfaces/BarButton.d.ts.map +1 -0
- package/lib/interfaces/BarButton.js +3 -0
- package/lib/interfaces/BarButton.js.map +1 -0
- package/lib/interfaces/CarColor.d.ts +2 -0
- package/lib/interfaces/CarColor.d.ts.map +1 -0
- package/lib/interfaces/CarColor.js +3 -0
- package/lib/interfaces/CarColor.js.map +1 -0
- package/lib/interfaces/GridButton.d.ts +24 -0
- package/lib/interfaces/GridButton.d.ts.map +1 -0
- package/lib/interfaces/GridButton.js +3 -0
- package/lib/interfaces/GridButton.js.map +1 -0
- package/lib/interfaces/Header.d.ts +15 -0
- package/lib/interfaces/Header.d.ts.map +1 -0
- package/lib/interfaces/Header.js +3 -0
- package/lib/interfaces/Header.js.map +1 -0
- package/lib/interfaces/ListItem.d.ts +61 -0
- package/lib/interfaces/ListItem.d.ts.map +1 -0
- package/lib/interfaces/ListItem.js +3 -0
- package/lib/interfaces/ListItem.js.map +1 -0
- package/lib/interfaces/ListItemUpdate.d.ts +15 -0
- package/lib/interfaces/ListItemUpdate.d.ts.map +1 -0
- package/lib/interfaces/ListItemUpdate.js +3 -0
- package/lib/interfaces/ListItemUpdate.js.map +1 -0
- package/lib/interfaces/ListSection.d.ts +21 -0
- package/lib/interfaces/ListSection.d.ts.map +1 -0
- package/lib/interfaces/ListSection.js +3 -0
- package/lib/interfaces/ListSection.js.map +1 -0
- package/lib/interfaces/Maneuver.d.ts +31 -0
- package/lib/interfaces/Maneuver.d.ts.map +1 -0
- package/lib/interfaces/Maneuver.js +3 -0
- package/lib/interfaces/Maneuver.js.map +1 -0
- package/lib/interfaces/MapButton.d.ts +27 -0
- package/lib/interfaces/MapButton.d.ts.map +1 -0
- package/lib/interfaces/MapButton.js +3 -0
- package/lib/interfaces/MapButton.js.map +1 -0
- package/lib/interfaces/NavigationAlert.d.ts +44 -0
- package/lib/interfaces/NavigationAlert.d.ts.map +1 -0
- package/lib/interfaces/NavigationAlert.js +10 -0
- package/lib/interfaces/NavigationAlert.js.map +1 -0
- package/lib/interfaces/NavigationInfo.d.ts +17 -0
- package/lib/interfaces/NavigationInfo.d.ts.map +1 -0
- package/lib/interfaces/NavigationInfo.js +3 -0
- package/lib/interfaces/NavigationInfo.js.map +1 -0
- package/lib/interfaces/NavigationStep.d.ts +17 -0
- package/lib/interfaces/NavigationStep.d.ts.map +1 -0
- package/lib/interfaces/NavigationStep.js +3 -0
- package/lib/interfaces/NavigationStep.js.map +1 -0
- package/lib/interfaces/Pane.d.ts +29 -0
- package/lib/interfaces/Pane.d.ts.map +1 -0
- package/lib/interfaces/Pane.js +3 -0
- package/lib/interfaces/Pane.js.map +1 -0
- package/lib/interfaces/PauseReason.d.ts +8 -0
- package/lib/interfaces/PauseReason.d.ts.map +1 -0
- package/lib/interfaces/PauseReason.js +12 -0
- package/lib/interfaces/PauseReason.js.map +1 -0
- package/lib/interfaces/Place.d.ts +11 -0
- package/lib/interfaces/Place.d.ts.map +1 -0
- package/lib/interfaces/Place.js +3 -0
- package/lib/interfaces/Place.js.map +1 -0
- package/lib/interfaces/TextConfiguration.d.ts +6 -0
- package/lib/interfaces/TextConfiguration.d.ts.map +1 -0
- package/lib/interfaces/TextConfiguration.js +3 -0
- package/lib/interfaces/TextConfiguration.js.map +1 -0
- package/lib/interfaces/TimeRemainingColor.d.ts +2 -0
- package/lib/interfaces/TimeRemainingColor.d.ts.map +1 -0
- package/lib/interfaces/TimeRemainingColor.js +3 -0
- package/lib/interfaces/TimeRemainingColor.js.map +1 -0
- package/lib/interfaces/TravelEstimates.d.ts +37 -0
- package/lib/interfaces/TravelEstimates.d.ts.map +1 -0
- package/lib/interfaces/TravelEstimates.js +3 -0
- package/lib/interfaces/TravelEstimates.js.map +1 -0
- package/lib/interfaces/VoiceControlState.d.ts +8 -0
- package/lib/interfaces/VoiceControlState.d.ts.map +1 -0
- package/lib/interfaces/VoiceControlState.js +3 -0
- package/lib/interfaces/VoiceControlState.js.map +1 -0
- package/lib/navigation/NavigationSession.d.ts +18 -0
- package/lib/navigation/NavigationSession.d.ts.map +1 -0
- package/lib/navigation/NavigationSession.js +51 -0
- package/lib/navigation/NavigationSession.js.map +1 -0
- package/lib/navigation/Trip.d.ts +22 -0
- package/lib/navigation/Trip.d.ts.map +1 -0
- package/lib/navigation/Trip.js +18 -0
- package/lib/navigation/Trip.js.map +1 -0
- package/lib/templates/ActionSheetTemplate.d.ts +18 -0
- package/lib/templates/ActionSheetTemplate.d.ts.map +1 -0
- package/lib/templates/ActionSheetTemplate.js +16 -0
- package/lib/templates/ActionSheetTemplate.js.map +1 -0
- package/lib/templates/AlertTemplate.d.ts +17 -0
- package/lib/templates/AlertTemplate.d.ts.map +1 -0
- package/lib/templates/AlertTemplate.js +16 -0
- package/lib/templates/AlertTemplate.js.map +1 -0
- package/lib/templates/ContactTemplate.d.ts +36 -0
- package/lib/templates/ContactTemplate.d.ts.map +1 -0
- package/lib/templates/ContactTemplate.js +16 -0
- package/lib/templates/ContactTemplate.js.map +1 -0
- package/lib/templates/GridTemplate.d.ts +38 -0
- package/lib/templates/GridTemplate.d.ts.map +1 -0
- package/lib/templates/GridTemplate.js +17 -0
- package/lib/templates/GridTemplate.js.map +1 -0
- package/lib/templates/InformationTemplate.d.ts +28 -0
- package/lib/templates/InformationTemplate.d.ts.map +1 -0
- package/lib/templates/InformationTemplate.js +28 -0
- package/lib/templates/InformationTemplate.js.map +1 -0
- package/lib/templates/ListTemplate.d.ts +112 -0
- package/lib/templates/ListTemplate.d.ts.map +1 -0
- package/lib/templates/ListTemplate.js +57 -0
- package/lib/templates/ListTemplate.js.map +1 -0
- package/lib/templates/MapTemplate.d.ts +171 -0
- package/lib/templates/MapTemplate.d.ts.map +1 -0
- package/lib/templates/MapTemplate.js +115 -0
- package/lib/templates/MapTemplate.js.map +1 -0
- package/lib/templates/NowPlayingTemplate.d.ts +31 -0
- package/lib/templates/NowPlayingTemplate.d.ts.map +1 -0
- package/lib/templates/NowPlayingTemplate.js +18 -0
- package/lib/templates/NowPlayingTemplate.js.map +1 -0
- package/lib/templates/PointOfInterestTemplate.d.ts +38 -0
- package/lib/templates/PointOfInterestTemplate.d.ts.map +1 -0
- package/lib/templates/PointOfInterestTemplate.js +18 -0
- package/lib/templates/PointOfInterestTemplate.js.map +1 -0
- package/lib/templates/SearchTemplate.d.ts +32 -0
- package/lib/templates/SearchTemplate.d.ts.map +1 -0
- package/lib/templates/SearchTemplate.js +41 -0
- package/lib/templates/SearchTemplate.js.map +1 -0
- package/lib/templates/TabBarTemplate.d.ts +27 -0
- package/lib/templates/TabBarTemplate.d.ts.map +1 -0
- package/lib/templates/TabBarTemplate.js +26 -0
- package/lib/templates/TabBarTemplate.js.map +1 -0
- package/lib/templates/Template.d.ts +83 -0
- package/lib/templates/Template.d.ts.map +1 -0
- package/lib/templates/Template.js +71 -0
- package/lib/templates/Template.js.map +1 -0
- package/lib/templates/VoiceControlTemplate.d.ts +18 -0
- package/lib/templates/VoiceControlTemplate.d.ts.map +1 -0
- package/lib/templates/VoiceControlTemplate.js +20 -0
- package/lib/templates/VoiceControlTemplate.js.map +1 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.d.ts +19 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.d.ts.map +1 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.js +29 -0
- package/lib/templates/android/AndroidNavigationBaseTemplate.js.map +1 -0
- package/lib/templates/android/MessageTemplate.d.ts +16 -0
- package/lib/templates/android/MessageTemplate.d.ts.map +1 -0
- package/lib/templates/android/MessageTemplate.js +11 -0
- package/lib/templates/android/MessageTemplate.js.map +1 -0
- package/lib/templates/android/NavigationTemplate.d.ts +44 -0
- package/lib/templates/android/NavigationTemplate.d.ts.map +1 -0
- package/lib/templates/android/NavigationTemplate.js +17 -0
- package/lib/templates/android/NavigationTemplate.js.map +1 -0
- package/lib/templates/android/PaneTemplate.d.ts +20 -0
- package/lib/templates/android/PaneTemplate.d.ts.map +1 -0
- package/lib/templates/android/PaneTemplate.js +17 -0
- package/lib/templates/android/PaneTemplate.js.map +1 -0
- package/lib/templates/android/PlaceListMapTemplate.d.ts +78 -0
- package/lib/templates/android/PlaceListMapTemplate.d.ts.map +1 -0
- package/lib/templates/android/PlaceListMapTemplate.js +25 -0
- package/lib/templates/android/PlaceListMapTemplate.js.map +1 -0
- package/lib/templates/android/PlaceListNavigationTemplate.d.ts +51 -0
- package/lib/templates/android/PlaceListNavigationTemplate.d.ts.map +1 -0
- package/lib/templates/android/PlaceListNavigationTemplate.js +20 -0
- package/lib/templates/android/PlaceListNavigationTemplate.js.map +1 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.d.ts +60 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.d.ts.map +1 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.js +23 -0
- package/lib/templates/android/RoutePreviewNavigationTemplate.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
- package/react-native-carplay.podspec +21 -0
- package/src/CarPlay.ts +320 -0
- package/src/index.ts +50 -0
- package/src/interfaces/Action.ts +15 -0
- package/src/interfaces/AlertAction.ts +5 -0
- package/src/interfaces/BarButton.ts +41 -0
- package/src/interfaces/CarColor.ts +1 -0
- package/src/interfaces/GridButton.ts +25 -0
- package/src/interfaces/Header.ts +16 -0
- package/src/interfaces/ListItem.ts +61 -0
- package/src/interfaces/ListItemUpdate.ts +14 -0
- package/src/interfaces/ListSection.ts +21 -0
- package/src/interfaces/Maneuver.ts +30 -0
- package/src/interfaces/MapButton.ts +27 -0
- package/src/interfaces/NavigationAlert.ts +46 -0
- package/src/interfaces/NavigationInfo.ts +19 -0
- package/src/interfaces/NavigationStep.ts +17 -0
- package/src/interfaces/Pane.ts +29 -0
- package/src/interfaces/PauseReason.ts +7 -0
- package/src/interfaces/Place.ts +12 -0
- package/src/interfaces/TextConfiguration.ts +5 -0
- package/src/interfaces/TimeRemainingColor.ts +1 -0
- package/src/interfaces/TravelEstimates.ts +39 -0
- package/src/interfaces/VoiceControlState.ts +8 -0
- package/src/navigation/NavigationSession.ts +57 -0
- package/src/navigation/Trip.ts +36 -0
- package/src/templates/ActionSheetTemplate.ts +21 -0
- package/src/templates/AlertTemplate.ts +20 -0
- package/src/templates/ContactTemplate.ts +45 -0
- package/src/templates/GridTemplate.ts +45 -0
- package/src/templates/InformationTemplate.ts +42 -0
- package/src/templates/ListTemplate.ts +150 -0
- package/src/templates/MapTemplate.ts +231 -0
- package/src/templates/NowPlayingTemplate.ts +38 -0
- package/src/templates/PointOfInterestTemplate.ts +42 -0
- package/src/templates/SearchTemplate.ts +70 -0
- package/src/templates/TabBarTemplate.ts +56 -0
- package/src/templates/Template.ts +165 -0
- package/src/templates/VoiceControlTemplate.ts +25 -0
- package/src/templates/android/AndroidNavigationBaseTemplate.ts +46 -0
- package/src/templates/android/MessageTemplate.ts +19 -0
- package/src/templates/android/NavigationTemplate.ts +50 -0
- package/src/templates/android/PaneTemplate.ts +26 -0
- package/src/templates/android/PlaceListMapTemplate.ts +94 -0
- package/src/templates/android/PlaceListNavigationTemplate.ts +57 -0
- package/src/templates/android/RoutePreviewNavigationTemplate.ts +66 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/InformationTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,qBAAqB,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACpE;AAED,qBAAa,mBAAoB,SAAQ,QAAQ,CAAC,yBAAyB,CAAC;IAC1E,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;MAIX;IAEM,8BAA8B,GAAI,OAAO,eAAe,EAAE,UAG/D;IAEK,gCAAgC,GAAI,SAAS,iBAAiB,EAAE,UAGrE;CACH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InformationTemplate = void 0;
|
|
4
|
+
const Template_1 = require("./Template");
|
|
5
|
+
const CarPlay_1 = require("../CarPlay");
|
|
6
|
+
class InformationTemplate extends Template_1.Template {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.updateInformationTemplateItems = (items) => {
|
|
10
|
+
this.config.items = items;
|
|
11
|
+
return CarPlay_1.CarPlay.bridge.updateInformationTemplateItems(this.id, this.parseConfig(items));
|
|
12
|
+
};
|
|
13
|
+
this.updateInformationTemplateActions = (actions) => {
|
|
14
|
+
this.config.actions = actions;
|
|
15
|
+
return CarPlay_1.CarPlay.bridge.updateInformationTemplateActions(this.id, this.parseConfig(actions));
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
get type() {
|
|
19
|
+
return 'information';
|
|
20
|
+
}
|
|
21
|
+
get eventMap() {
|
|
22
|
+
return {
|
|
23
|
+
actionButtonPressed: 'onActionButtonPressed',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.InformationTemplate = InformationTemplate;
|
|
28
|
+
//# sourceMappingURL=InformationTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationTemplate.js","sourceRoot":"","sources":["../../src/templates/InformationTemplate.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AACtD,wCAAqC;AAoBrC,MAAa,mBAAoB,SAAQ,mBAAmC;IAA5E;;QAWS,mCAA8B,GAAG,CAAC,KAAwB,EAAE,EAAE;YACnE,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;YAC1B,OAAO,iBAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QACzF,CAAC,CAAC;QAEK,qCAAgC,GAAG,CAAC,OAA4B,EAAE,EAAE;YACzE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;YAC9B,OAAO,iBAAO,CAAC,MAAM,CAAC,gCAAgC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7F,CAAC,CAAC;IACJ,CAAC;IAnBC,IAAW,IAAI;QACb,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,mBAAmB,EAAE,uBAAuB;SAC7C,CAAC;IACJ,CAAC;CAWF;AApBD,kDAoBC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ListItem } from '../interfaces/ListItem';
|
|
2
|
+
import { ListItemUpdate } from '../interfaces/ListItemUpdate';
|
|
3
|
+
import { ListSection } from '../interfaces/ListSection';
|
|
4
|
+
import { Template, TemplateConfig } from './Template';
|
|
5
|
+
import { Action } from '../interfaces/Action';
|
|
6
|
+
export interface ListTemplateConfig extends TemplateConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The title displayed in the navigation bar while the list template is visible.
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The sections displayed in the list.
|
|
13
|
+
*/
|
|
14
|
+
sections?: ListSection[];
|
|
15
|
+
/**
|
|
16
|
+
* Sets a single ItemList to show in the template.
|
|
17
|
+
* @namespace Android
|
|
18
|
+
*/
|
|
19
|
+
items?: ListItem[];
|
|
20
|
+
/**
|
|
21
|
+
* An optional array of strings, ordered from most to least preferred.
|
|
22
|
+
* The variant strings should be provided as localized, displayable content.
|
|
23
|
+
* The system will select the first variant that fits the available space.
|
|
24
|
+
* If the list template does not contain any items (itemCount == 0), then
|
|
25
|
+
* the template will display an empty view with a title and subtitle to indicate
|
|
26
|
+
* that the template has no list items.
|
|
27
|
+
* If the list template is updated to contain items, the empty view will be automatically
|
|
28
|
+
* removed.
|
|
29
|
+
* @namespace iOS
|
|
30
|
+
*/
|
|
31
|
+
emptyViewTitleVariants?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* An optional array of strings, ordered from most to least preferred.
|
|
34
|
+
* The variant strings should be provided as localized, displayable content.
|
|
35
|
+
* The system will select the first variant that fits the available space.
|
|
36
|
+
* If the list template does not contain any items (itemCount == 0), then
|
|
37
|
+
* the template will display an empty view with a title and subtitle to indicate
|
|
38
|
+
* that the template has no list items.
|
|
39
|
+
* If the list template is updated to contain items, the empty view will be automatically
|
|
40
|
+
* removed.
|
|
41
|
+
* @namespace iOS
|
|
42
|
+
*/
|
|
43
|
+
emptyViewSubtitleVariants?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Fired when list item is selected.
|
|
46
|
+
* Spinner shows by default.
|
|
47
|
+
* When the returned promise is resolved the spinner will hide.
|
|
48
|
+
* @param item Object with the selected index
|
|
49
|
+
*/
|
|
50
|
+
onItemSelect?(item: {
|
|
51
|
+
index: number;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Fired when the back button is pressed
|
|
55
|
+
*/
|
|
56
|
+
onBackButtonPressed?(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Option to hide back button
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
backButtonHidden?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Assistant Configuration
|
|
64
|
+
* @see https://developer.apple.com/documentation/carplay/cplisttemplate#3762508
|
|
65
|
+
* @namespace iOS
|
|
66
|
+
*/
|
|
67
|
+
assistant?: {
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
position: 'top' | 'bottom';
|
|
70
|
+
visibility: 'off' | 'always' | 'limited';
|
|
71
|
+
action: 'playMedia' | 'startCall';
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Sets whether the template is in a loading state.
|
|
75
|
+
* If set to true, the UI will display a loading indicator where the list content would be otherwise. The caller is expected to call invalidate and send the new template content to the host once the data is ready.
|
|
76
|
+
* If set to false, the UI will display the contents of the ItemList instance(s) added via setSingleList or addSectionedList.
|
|
77
|
+
* @namespace Android
|
|
78
|
+
*/
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the Action that will be displayed in the header of the template.
|
|
82
|
+
* @namespace Android
|
|
83
|
+
*/
|
|
84
|
+
headerAction?: Action<'appIcon' | 'back'>;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the ActionStrip for this template or null to not display an .
|
|
87
|
+
* This template allows up to 2 Actions. Of the 2 allowed Actions, one of them can contain a title as set via setTitle. Otherwise, only Actions with icons are allowed.
|
|
88
|
+
*/
|
|
89
|
+
actions?: [Action<'custom'>] | [Action<'custom'>, Action<'custom'>];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A hierarchical list of menu items can be displayed on the CarPlay screen using a list template.
|
|
93
|
+
*
|
|
94
|
+
* The List Template allows navigation apps to present a hierarchical list of menu items. It includes a navigation bar and a list view.
|
|
95
|
+
*
|
|
96
|
+
* The navigation bar includes a title, and up to two (2) leading buttons and two (2) trailing buttons. You can customize the appearance of these buttons with icons or text.
|
|
97
|
+
*
|
|
98
|
+
* Each item in the list view may include an icon, title, subtitle, and an optional disclosure indicator indicating the presence of a submenu. The depth of the menu hierarchy may not exceed 5 levels. Note that some cars limit the total number of items that may be shown in a list.
|
|
99
|
+
*/
|
|
100
|
+
export declare class ListTemplate extends Template<ListTemplateConfig> {
|
|
101
|
+
config: ListTemplateConfig;
|
|
102
|
+
get type(): string;
|
|
103
|
+
get eventMap(): {
|
|
104
|
+
backButtonPressed: string;
|
|
105
|
+
};
|
|
106
|
+
constructor(config: ListTemplateConfig);
|
|
107
|
+
updateSections: (sections: ListSection[]) => void;
|
|
108
|
+
updateListTemplateItem: (config: ListItemUpdate) => void;
|
|
109
|
+
getMaximumListItemCount(): Promise<number>;
|
|
110
|
+
getMaximumListSectionCount(): Promise<number>;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=ListTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AG,MAAM,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;CACrE;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,QAAQ,CAAC,kBAAkB,CAAC;IAWzC,MAAM,EAAE,kBAAkB;IAV7C,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;MAIX;gBAEkB,MAAM,EAAE,kBAAkB;IActC,cAAc,GAAI,UAAU,WAAW,EAAE,UAG9C;IAEK,sBAAsB,GAAI,QAAQ,cAAc,UAMrD;IAEK,uBAAuB;IAIvB,0BAA0B;CAGlC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListTemplate = void 0;
|
|
4
|
+
const CarPlay_1 = require("../CarPlay");
|
|
5
|
+
const Template_1 = require("./Template");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
/**
|
|
8
|
+
* A hierarchical list of menu items can be displayed on the CarPlay screen using a list template.
|
|
9
|
+
*
|
|
10
|
+
* The List Template allows navigation apps to present a hierarchical list of menu items. It includes a navigation bar and a list view.
|
|
11
|
+
*
|
|
12
|
+
* The navigation bar includes a title, and up to two (2) leading buttons and two (2) trailing buttons. You can customize the appearance of these buttons with icons or text.
|
|
13
|
+
*
|
|
14
|
+
* Each item in the list view may include an icon, title, subtitle, and an optional disclosure indicator indicating the presence of a submenu. The depth of the menu hierarchy may not exceed 5 levels. Note that some cars limit the total number of items that may be shown in a list.
|
|
15
|
+
*/
|
|
16
|
+
class ListTemplate extends Template_1.Template {
|
|
17
|
+
get type() {
|
|
18
|
+
return 'list';
|
|
19
|
+
}
|
|
20
|
+
get eventMap() {
|
|
21
|
+
return {
|
|
22
|
+
backButtonPressed: 'onBackButtonPressed',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
constructor(config) {
|
|
26
|
+
super(config);
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.updateSections = (sections) => {
|
|
29
|
+
this.config.sections = sections;
|
|
30
|
+
return CarPlay_1.CarPlay.bridge.updateListTemplateSections(this.id, this.parseConfig(sections));
|
|
31
|
+
};
|
|
32
|
+
this.updateListTemplateItem = (config) => {
|
|
33
|
+
const section = this.config.sections?.[config.sectionIndex];
|
|
34
|
+
if (section) {
|
|
35
|
+
section.items[config.itemIndex] = config;
|
|
36
|
+
}
|
|
37
|
+
return CarPlay_1.CarPlay.bridge.updateListTemplateItem(this.id, this.parseConfig(config));
|
|
38
|
+
};
|
|
39
|
+
CarPlay_1.CarPlay.emitter.addListener('didSelectListItem', (e) => {
|
|
40
|
+
if (config.onItemSelect && e.templateId === this.id) {
|
|
41
|
+
void Promise.resolve(config.onItemSelect(e)).then(() => {
|
|
42
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
43
|
+
CarPlay_1.CarPlay.bridge.reactToSelectedResult(true);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getMaximumListItemCount() {
|
|
50
|
+
return CarPlay_1.CarPlay.bridge.getMaximumListItemCount(this.id);
|
|
51
|
+
}
|
|
52
|
+
getMaximumListSectionCount() {
|
|
53
|
+
return CarPlay_1.CarPlay.bridge.getMaximumListSectionCount(this.id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.ListTemplate = ListTemplate;
|
|
57
|
+
//# sourceMappingURL=ListTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListTemplate.js","sourceRoot":"","sources":["../../src/templates/ListTemplate.ts"],"names":[],"mappings":";;;AACA,wCAAqC;AAGrC,yCAAsD;AAEtD,+CAAwC;AAyFxC;;;;;;;;GAQG;AACH,MA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C;wBAC1B,iBAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;oBAC7C,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAeM,uBAAuB;QAC5B,OAAO,iBAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;IAEM,0BAA0B;QAC/B,OAAO,iBAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF;AA7CD,oCA6CC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { MapButton } from '../interfaces/MapButton';
|
|
2
|
+
import { NavigationAlert } from '../interfaces/NavigationAlert';
|
|
3
|
+
import { TextConfiguration } from '../interfaces/TextConfiguration';
|
|
4
|
+
import { TimeRemainingColor } from '../interfaces/TimeRemainingColor';
|
|
5
|
+
import { TravelEstimates } from '../interfaces/TravelEstimates';
|
|
6
|
+
import { NavigationSession } from '../navigation/NavigationSession';
|
|
7
|
+
import { Trip } from '../navigation/Trip';
|
|
8
|
+
import { Template, TemplateConfig } from './Template';
|
|
9
|
+
import { ListItem } from '../interfaces/ListItem';
|
|
10
|
+
import { Action } from '../interfaces/Action';
|
|
11
|
+
import { Header } from '../interfaces/Header';
|
|
12
|
+
import { Pane } from '../interfaces/Pane';
|
|
13
|
+
export interface MapTemplateConfig extends TemplateConfig {
|
|
14
|
+
/**
|
|
15
|
+
* The background color the map template uses when displaying guidance.
|
|
16
|
+
* @namespace iOS
|
|
17
|
+
*/
|
|
18
|
+
guidanceBackgroundColor?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The style that the map template uses when displaying trip estimates during active nagivation.
|
|
21
|
+
* @default dark
|
|
22
|
+
* @namespace iOS
|
|
23
|
+
*/
|
|
24
|
+
tripEstimateStyle?: 'dark' | 'light';
|
|
25
|
+
/**
|
|
26
|
+
* Your component to render inside CarPlay/Android Auto
|
|
27
|
+
* Example `component: MyComponent`
|
|
28
|
+
*/
|
|
29
|
+
component: React.ComponentType<any>;
|
|
30
|
+
/**
|
|
31
|
+
* An array of map buttons displayed on the trailing bottom corner of the map template.
|
|
32
|
+
* If the array contains more than three buttons, the map template displays only the first three buttons, ignoring the remaining buttons.
|
|
33
|
+
* @namespace iOS
|
|
34
|
+
* @namespace Android
|
|
35
|
+
*/
|
|
36
|
+
mapButtons?: MapButton[];
|
|
37
|
+
/**
|
|
38
|
+
* A Boolean value that indicates whether the navigation bar hides automatically.
|
|
39
|
+
* @namespace iOS
|
|
40
|
+
*/
|
|
41
|
+
automaticallyHidesNavigationBar?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A Boolean value that tells the system to hide the map buttons when hiding the navigation bar.
|
|
44
|
+
* @namespace iOS
|
|
45
|
+
*/
|
|
46
|
+
hidesButtonsWithNavigationBar?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A component that holds onto data associated with a template's header.
|
|
49
|
+
* @namespace Android
|
|
50
|
+
*/
|
|
51
|
+
header?: Header;
|
|
52
|
+
/**
|
|
53
|
+
* Sets an ItemList to show in a list view along with the map.
|
|
54
|
+
* - To show a marker corresponding to a point of interest represented by a row, set the Place instance via setMetadata. The host will display the PlaceMarker in both the map and the list view as the row becomes visible.
|
|
55
|
+
* - Images of type IMAGE_TYPE_LARGE are not allowed in this template.
|
|
56
|
+
* - Rows are not allowed to have both an image and a place marker.
|
|
57
|
+
* @limit The number of items in the ItemList should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PLACE_LIST. The host will ignore any items over that limit. The list itself cannot be selectable as set via setOnSelectedListener. Each Row can add up to 2 lines of texts via addText and cannot contain a Toggle.
|
|
58
|
+
* @namespace Android
|
|
59
|
+
*/
|
|
60
|
+
items?: ListItem[];
|
|
61
|
+
/**
|
|
62
|
+
* Sets the ActionStrip for this template.
|
|
63
|
+
* Unless set with this method, the template will not have an action strip.
|
|
64
|
+
* The Action buttons in Map Based Template are automatically adjusted based on the screen size. On narrow width screen, icon Actions show by default. If no icon specify, showing title Actions instead. On wider width screen, title Actions show by default. If no title specify, showing icon Actions instead.
|
|
65
|
+
* @limit This template allows up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, it can either be a title Action as set via setTitle, or a icon Action as set via setIcon.
|
|
66
|
+
* @namespace Android
|
|
67
|
+
*/
|
|
68
|
+
actions?: Action[];
|
|
69
|
+
/**
|
|
70
|
+
* Sets the Pane for this template. getImage for pane will not be shown in MapTemplate.
|
|
71
|
+
* Unless set with this method, the template will not show a pane.
|
|
72
|
+
* @limit The number of items in the Pane should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PANE. The host via addText and cannot contain either a Toggle or a OnClickListener.
|
|
73
|
+
* Up to 2 Actions are allowed in the Pane. Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported.
|
|
74
|
+
* If none of the header Action, the header title or the action strip have been set on the template, the header is hidden.
|
|
75
|
+
*/
|
|
76
|
+
pane?: Pane;
|
|
77
|
+
/**
|
|
78
|
+
* Fired when Alert Action button is pressed
|
|
79
|
+
* @param e Event
|
|
80
|
+
*/
|
|
81
|
+
onAlertActionPressed?(e: {
|
|
82
|
+
secondary?: boolean;
|
|
83
|
+
primary?: boolean;
|
|
84
|
+
}): void;
|
|
85
|
+
onMapButtonPressed?(e: {
|
|
86
|
+
id: string;
|
|
87
|
+
template: string;
|
|
88
|
+
}): void;
|
|
89
|
+
onPanWithDirection?(e: {
|
|
90
|
+
direction: string;
|
|
91
|
+
}): void;
|
|
92
|
+
onPanBeganWithDirection?(e: {
|
|
93
|
+
direction: string;
|
|
94
|
+
}): void;
|
|
95
|
+
onPanEndedWithDirection?(e: {
|
|
96
|
+
direction: string;
|
|
97
|
+
}): void;
|
|
98
|
+
onSelectedPreviewForTrip?(e: {
|
|
99
|
+
tripId: string;
|
|
100
|
+
routeIndex: number;
|
|
101
|
+
}): void;
|
|
102
|
+
onDidCancelNavigation?(): void;
|
|
103
|
+
onStartedTrip?(e: {
|
|
104
|
+
tripId: string;
|
|
105
|
+
routeIndex: number;
|
|
106
|
+
}): void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The Map Template is a control layer that appears as an overlay over the base view and allows you to present user controls.
|
|
110
|
+
*
|
|
111
|
+
* The control layer consists of a navigation bar and map buttons. By default, the navigation bar appears when the user interacts with the app, and disappears after a period of inactivity.
|
|
112
|
+
*
|
|
113
|
+
* The navigation bar includes up to two leading buttons and two trailing buttons. You can customize the appearance of these buttons with icons or text.
|
|
114
|
+
*
|
|
115
|
+
* The control layer may also include up to four map buttons. The map buttons are always shown as icons.
|
|
116
|
+
*
|
|
117
|
+
* Navigation apps enter panning mode, zoom in or out, and perform other functions by responding to user actions on these buttons.
|
|
118
|
+
*/
|
|
119
|
+
export declare class MapTemplate extends Template<MapTemplateConfig> {
|
|
120
|
+
config: MapTemplateConfig;
|
|
121
|
+
get type(): string;
|
|
122
|
+
get eventMap(): {
|
|
123
|
+
alertActionPressed: string;
|
|
124
|
+
mapButtonPressed: string;
|
|
125
|
+
panWithDirection: string;
|
|
126
|
+
panBeganWithDirection: string;
|
|
127
|
+
panEndedWithDirection: string;
|
|
128
|
+
selectedPreviewForTrip: string;
|
|
129
|
+
didCancelNavigation: string;
|
|
130
|
+
startedTrip: string;
|
|
131
|
+
};
|
|
132
|
+
constructor(config: MapTemplateConfig);
|
|
133
|
+
/**
|
|
134
|
+
* Begins guidance for a trip.
|
|
135
|
+
*
|
|
136
|
+
* Keep a reference to the navigation session to perform guidance updates.
|
|
137
|
+
* @param trip Trip class instance
|
|
138
|
+
*/
|
|
139
|
+
startNavigationSession(trip: Trip): Promise<NavigationSession>;
|
|
140
|
+
updateTravelEstimates(trip: Trip, travelEstimates: TravelEstimates, timeRemainingColor?: TimeRemainingColor): void;
|
|
141
|
+
/**
|
|
142
|
+
* Update MapTemplate configuration
|
|
143
|
+
*/
|
|
144
|
+
updateConfig(config: MapTemplateConfig): void;
|
|
145
|
+
updateMapButtons(mapButtons: MapButton[]): void;
|
|
146
|
+
/**
|
|
147
|
+
* Hides the display of trip previews.
|
|
148
|
+
*/
|
|
149
|
+
hideTripPreviews(): void;
|
|
150
|
+
showTripPreviews(tripPreviews: Trip[], textConfiguration?: TextConfiguration): void;
|
|
151
|
+
showRouteChoicesPreviewForTrip(trip: Trip, textConfiguration?: TextConfiguration): void;
|
|
152
|
+
presentNavigationAlert(config: NavigationAlert, animated?: boolean): void;
|
|
153
|
+
dismissNavigationAlert(animated?: boolean): void;
|
|
154
|
+
/**
|
|
155
|
+
* Shows the panning interface over the map.
|
|
156
|
+
*
|
|
157
|
+
* Calling this method while displaying the panning interface has no effect.
|
|
158
|
+
*
|
|
159
|
+
* While showing the panning interface, the system hides all map buttons. The system doesn't provide a button to dismiss the panning interface. Instead, you must provide a map button in the navigation bar that the user taps to dismiss the panning interface.
|
|
160
|
+
* @param animated A Boolean value that determines whether to animate the panning interface.
|
|
161
|
+
*/
|
|
162
|
+
showPanningInterface(animated?: boolean): void;
|
|
163
|
+
/**
|
|
164
|
+
* Dismisses the panning interface.
|
|
165
|
+
*
|
|
166
|
+
* When dismissing the panning interface, the system shows the previously hidden map buttons.
|
|
167
|
+
* @param animated A Boolean value that determines whether to animate the dismissal of the panning interface.
|
|
168
|
+
*/
|
|
169
|
+
dismissPanningInterface(animated?: boolean): void;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=MapTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/MapTemplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAk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AE,iBAAsB;IAQhF,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,GAAE,iBAAsB;IAIpF,sBAAsB,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,UAAO;IAI/D,sBAAsB,CAAC,QAAQ,UAAO;IAI7C;;;;;;;OAOG;IACI,oBAAoB,CAAC,QAAQ,UAAQ;IAI5C;;;;;OAKG;IACI,uBAAuB,CAAC,QAAQ,UAAQ;CAGhD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MapTemplate = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const CarPlay_1 = require("../CarPlay");
|
|
6
|
+
const NavigationSession_1 = require("../navigation/NavigationSession");
|
|
7
|
+
const Template_1 = require("./Template");
|
|
8
|
+
/**
|
|
9
|
+
* The Map Template is a control layer that appears as an overlay over the base view and allows you to present user controls.
|
|
10
|
+
*
|
|
11
|
+
* The control layer consists of a navigation bar and map buttons. By default, the navigation bar appears when the user interacts with the app, and disappears after a period of inactivity.
|
|
12
|
+
*
|
|
13
|
+
* The navigation bar includes up to two leading buttons and two trailing buttons. You can customize the appearance of these buttons with icons or text.
|
|
14
|
+
*
|
|
15
|
+
* The control layer may also include up to four map buttons. The map buttons are always shown as icons.
|
|
16
|
+
*
|
|
17
|
+
* Navigation apps enter panning mode, zoom in or out, and perform other functions by responding to user actions on these buttons.
|
|
18
|
+
*/
|
|
19
|
+
class MapTemplate extends Template_1.Template {
|
|
20
|
+
get type() {
|
|
21
|
+
return 'map';
|
|
22
|
+
}
|
|
23
|
+
get eventMap() {
|
|
24
|
+
return {
|
|
25
|
+
alertActionPressed: 'onAlertActionPressed',
|
|
26
|
+
mapButtonPressed: 'onMapButtonPressed',
|
|
27
|
+
panWithDirection: 'onPanWithDirection',
|
|
28
|
+
panBeganWithDirection: 'onPanBeganWithDirection',
|
|
29
|
+
panEndedWithDirection: 'onPanEndedWithDirection',
|
|
30
|
+
selectedPreviewForTrip: 'onSelectedPreviewForTrip',
|
|
31
|
+
didCancelNavigation: 'onDidCancelNavigation',
|
|
32
|
+
startedTrip: 'onStartedTrip',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
constructor(config) {
|
|
36
|
+
super(config);
|
|
37
|
+
this.config = config;
|
|
38
|
+
if (config.component) {
|
|
39
|
+
react_native_1.AppRegistry.registerComponent(this.id, () => config.component);
|
|
40
|
+
}
|
|
41
|
+
const callbackFn = react_native_1.Platform.select({
|
|
42
|
+
android: ({ error } = {}) => {
|
|
43
|
+
error && console.error(error);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
CarPlay_1.CarPlay.bridge.createTemplate(this.id, this.parseConfig({ type: this.type, ...config, render: true }), callbackFn);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Begins guidance for a trip.
|
|
50
|
+
*
|
|
51
|
+
* Keep a reference to the navigation session to perform guidance updates.
|
|
52
|
+
* @param trip Trip class instance
|
|
53
|
+
*/
|
|
54
|
+
async startNavigationSession(trip) {
|
|
55
|
+
const res = await CarPlay_1.CarPlay.bridge.startNavigationSession(this.id, trip.id);
|
|
56
|
+
return new NavigationSession_1.NavigationSession(res.navigationSessionId, trip, this);
|
|
57
|
+
}
|
|
58
|
+
updateTravelEstimates(trip, travelEstimates, timeRemainingColor = 0) {
|
|
59
|
+
if (!travelEstimates.distanceUnits) {
|
|
60
|
+
travelEstimates.distanceUnits = 'kilometers';
|
|
61
|
+
}
|
|
62
|
+
CarPlay_1.CarPlay.bridge.updateTravelEstimatesForTrip(this.id, trip.id, travelEstimates, timeRemainingColor);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Update MapTemplate configuration
|
|
66
|
+
*/
|
|
67
|
+
updateConfig(config) {
|
|
68
|
+
this.config = config;
|
|
69
|
+
CarPlay_1.CarPlay.bridge.updateMapTemplateConfig(this.id, this.parseConfig(config));
|
|
70
|
+
}
|
|
71
|
+
updateMapButtons(mapButtons) {
|
|
72
|
+
this.config.mapButtons = mapButtons;
|
|
73
|
+
CarPlay_1.CarPlay.bridge.updateMapTemplateMapButtons(this.id, this.parseConfig(mapButtons));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Hides the display of trip previews.
|
|
77
|
+
*/
|
|
78
|
+
hideTripPreviews() {
|
|
79
|
+
CarPlay_1.CarPlay.bridge.hideTripPreviews(this.id);
|
|
80
|
+
}
|
|
81
|
+
showTripPreviews(tripPreviews, textConfiguration = {}) {
|
|
82
|
+
CarPlay_1.CarPlay.bridge.showTripPreviews(this.id, tripPreviews.map(trip => trip.id), textConfiguration);
|
|
83
|
+
}
|
|
84
|
+
showRouteChoicesPreviewForTrip(trip, textConfiguration = {}) {
|
|
85
|
+
CarPlay_1.CarPlay.bridge.showRouteChoicesPreviewForTrip(this.id, trip.id, textConfiguration);
|
|
86
|
+
}
|
|
87
|
+
presentNavigationAlert(config, animated = true) {
|
|
88
|
+
CarPlay_1.CarPlay.bridge.presentNavigationAlert(this.id, config, animated);
|
|
89
|
+
}
|
|
90
|
+
dismissNavigationAlert(animated = true) {
|
|
91
|
+
CarPlay_1.CarPlay.bridge.dismissNavigationAlert(this.id, animated);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Shows the panning interface over the map.
|
|
95
|
+
*
|
|
96
|
+
* Calling this method while displaying the panning interface has no effect.
|
|
97
|
+
*
|
|
98
|
+
* While showing the panning interface, the system hides all map buttons. The system doesn't provide a button to dismiss the panning interface. Instead, you must provide a map button in the navigation bar that the user taps to dismiss the panning interface.
|
|
99
|
+
* @param animated A Boolean value that determines whether to animate the panning interface.
|
|
100
|
+
*/
|
|
101
|
+
showPanningInterface(animated = false) {
|
|
102
|
+
CarPlay_1.CarPlay.bridge.showPanningInterface(this.id, animated);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Dismisses the panning interface.
|
|
106
|
+
*
|
|
107
|
+
* When dismissing the panning interface, the system shows the previously hidden map buttons.
|
|
108
|
+
* @param animated A Boolean value that determines whether to animate the dismissal of the panning interface.
|
|
109
|
+
*/
|
|
110
|
+
dismissPanningInterface(animated = false) {
|
|
111
|
+
CarPlay_1.CarPlay.bridge.dismissPanningInterface(this.id, animated);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.MapTemplate = MapTemplate;
|
|
115
|
+
//# sourceMappingURL=MapTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapTemplate.js","sourceRoot":"","sources":["../../src/templates/MapTemplate.ts"],"names":[],"mappings":";;;AAAA,+CAAqD;AACrD,wCAAqC;AAMrC,uEAAoE;AAEpE,yCAAsD;AAqFtD;;;;;;;;;;GAUG;AACH,MAAa,WAAY,SAAQ,mBAA2B;IAC1D,IAAW,IAAI;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,kBAAkB,EAAE,sBAAsB;YAC1C,gBAAgB,EAAE,oBAAoB;YACtC,gBAAgB,EAAE,oBAAoB;YACtC,qBAAqB,EAAE,yBAAyB;YAChD,qBAAqB,EAAE,yBAAyB;YAChD,sBAAsB,EAAE,0BAA0B;YAClD,mBAAmB,EAAE,uBAAuB;YAC5C,WAAW,EAAE,eAAe;SAC7B,CAAC;IACJ,CAAC;IAED,YAAmB,MAAyB;QAC1C,KAAK,CAAC,MAAM,CAAC,CAAC;QADG,WAAM,GAAN,MAAM,CAAmB;QAG1C,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,0BAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,UAAU,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjC,OAAO,EAAE,CAAC,EAAE,KAAK,KAAyB,EAAE,EAAE,EAAE;gB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CA6HC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { Template, TemplateConfig } from './Template';
|
|
3
|
+
export type NowPlayingButton = {
|
|
4
|
+
id: string;
|
|
5
|
+
} & ({
|
|
6
|
+
type: 'shuffle' | 'add-to-library' | 'more' | 'playback' | 'repeat';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'image';
|
|
9
|
+
image: ImageSourcePropType;
|
|
10
|
+
});
|
|
11
|
+
export interface NowPlayingTemplateConfig extends TemplateConfig {
|
|
12
|
+
albumArtistButtonEnabled?: boolean;
|
|
13
|
+
upNextButtonTitle?: string;
|
|
14
|
+
upNextButtonEnabled?: boolean;
|
|
15
|
+
onAlbumArtistButtonPressed?(): void;
|
|
16
|
+
onUpNextButtonPressed?(): void;
|
|
17
|
+
onButtonPressed?(e: {
|
|
18
|
+
id: string;
|
|
19
|
+
templateId: string;
|
|
20
|
+
}): void;
|
|
21
|
+
buttons?: NowPlayingButton[];
|
|
22
|
+
}
|
|
23
|
+
export declare class NowPlayingTemplate extends Template<NowPlayingTemplateConfig> {
|
|
24
|
+
get type(): string;
|
|
25
|
+
get eventMap(): {
|
|
26
|
+
albumArtistButtonPressed: string;
|
|
27
|
+
upNextButtonPressed: string;
|
|
28
|
+
buttonPressed: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=NowPlayingTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowPlayingTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/NowPlayingTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,CACA;IACE,IAAI,EAAE,SAAS,GAAG,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;CACrE,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,mBAAmB,CAAC;CAC5B,CACJ,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0BAA0B,CAAC,IAAI,IAAI,CAAC;IACpC,qBAAqB,CAAC,IAAI,IAAI,CAAC;IAC/B,eAAe,CAAC,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,wBAAwB,CAAC;IACxE,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;;;MAMX;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NowPlayingTemplate = void 0;
|
|
4
|
+
const Template_1 = require("./Template");
|
|
5
|
+
class NowPlayingTemplate extends Template_1.Template {
|
|
6
|
+
get type() {
|
|
7
|
+
return 'nowplaying';
|
|
8
|
+
}
|
|
9
|
+
get eventMap() {
|
|
10
|
+
return {
|
|
11
|
+
albumArtistButtonPressed: 'onAlbumArtistButtonPressed',
|
|
12
|
+
upNextButtonPressed: 'onUpNextButtonPressed',
|
|
13
|
+
buttonPressed: 'onButtonPressed',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.NowPlayingTemplate = NowPlayingTemplate;
|
|
18
|
+
//# sourceMappingURL=NowPlayingTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowPlayingTemplate.js","sourceRoot":"","sources":["../../src/templates/NowPlayingTemplate.ts"],"names":[],"mappings":";;;AACA,yCAAsD;AAwBtD,MAAa,kBAAmB,SAAQ,mBAAkC;IACxE,IAAW,IAAI;QACb,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,wBAAwB,EAAE,4BAA4B;YACtD,mBAAmB,EAAE,uBAAuB;YAC5C,aAAa,EAAE,iBAAiB;SACjC,CAAC;IACJ,CAAC;CACF;AAZD,gDAYC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Template, TemplateConfig } from './Template';
|
|
2
|
+
export interface PointOfInterestItem {
|
|
3
|
+
id: string;
|
|
4
|
+
location: {
|
|
5
|
+
latitude: number;
|
|
6
|
+
longitude: number;
|
|
7
|
+
};
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
summary?: string;
|
|
11
|
+
detailTitle?: string;
|
|
12
|
+
detailSubtitle?: string;
|
|
13
|
+
detailSummary?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PointOfInterestTemplateConfig extends TemplateConfig {
|
|
16
|
+
title: string;
|
|
17
|
+
items: PointOfInterestItem[];
|
|
18
|
+
onPointOfInterestSelect?(e: PointOfInterestItem): void;
|
|
19
|
+
onChangeMapRegion(e: {
|
|
20
|
+
latitude: number;
|
|
21
|
+
longitude: number;
|
|
22
|
+
latitudeDelta: number;
|
|
23
|
+
longitudeDelta: number;
|
|
24
|
+
}): void;
|
|
25
|
+
onActionButtonPressed?(e: {
|
|
26
|
+
id: string;
|
|
27
|
+
templateId: string;
|
|
28
|
+
item: PointOfInterestItem;
|
|
29
|
+
}): void;
|
|
30
|
+
}
|
|
31
|
+
export declare class PointOfInterestTemplate extends Template<PointOfInterestTemplateConfig> {
|
|
32
|
+
get type(): string;
|
|
33
|
+
get eventMap(): {
|
|
34
|
+
didSelectPointOfInterest: string;
|
|
35
|
+
actionButtonPressed: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PointOfInterestTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointOfInterestTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/PointOfInterestTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,6BAA8B,SAAQ,cAAc;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,uBAAuB,CAAC,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvD,iBAAiB,CAAC,CAAC,EAAE;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,qBAAqB,CAAC,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,mBAAmB,CAAA;KAAE,GAAG,IAAI,CAAC;CAChG;AAED,qBAAa,uBAAwB,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IAClF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAI,QAAQ;;;MAMX;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PointOfInterestTemplate = void 0;
|
|
4
|
+
const Template_1 = require("./Template");
|
|
5
|
+
class PointOfInterestTemplate extends Template_1.Template {
|
|
6
|
+
get type() {
|
|
7
|
+
return 'poi';
|
|
8
|
+
}
|
|
9
|
+
get eventMap() {
|
|
10
|
+
return {
|
|
11
|
+
didSelectPointOfInterest: 'onPointOfInterestSelect',
|
|
12
|
+
actionButtonPressed: 'onActionButtonPressed',
|
|
13
|
+
// didChangeMapRegion: 'onChangeMapRegion',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.PointOfInterestTemplate = PointOfInterestTemplate;
|
|
18
|
+
//# sourceMappingURL=PointOfInterestTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointOfInterestTemplate.js","sourceRoot":"","sources":["../../src/templates/PointOfInterestTemplate.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AA6BtD,MAAa,uBAAwB,SAAQ,mBAAuC;IAClF,IAAW,IAAI;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,wBAAwB,EAAE,yBAAyB;YACnD,mBAAmB,EAAE,uBAAuB;YAC7C,2CAA2C;SAC3C,CAAC;IACJ,CAAC;CACF;AAZD,0DAYC"}
|