@javascriptcommon/react-native-carplay 2.4.7 → 2.4.9
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 +633 -0
- package/ios/RNCarPlay.h +1 -0
- package/ios/RNCarPlay.m +556 -122
- package/ios/RNCarPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNCarPlay.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNCarPlay.xcodeproj/project.xcworkspace/xcuserdata/birkir.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNCarPlay.xcodeproj/xcuserdata/birkir.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/lib/templates/Template.d.ts.map +1 -1
- package/lib/templates/Template.js +14 -5
- package/package.json +1 -1
- package/src/templates/Template.ts +14 -5
|
Binary file
|
package/ios/RNCarPlay.xcodeproj/xcuserdata/birkir.xcuserdatad/xcschemes/xcschememanagement.plist
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>RNCarPlay 2.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>1</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
<key>RNCarPlay.xcscheme_^#shared#^_</key>
|
|
13
|
+
<dict>
|
|
14
|
+
<key>orderHint</key>
|
|
15
|
+
<integer>37</integer>
|
|
16
|
+
</dict>
|
|
17
|
+
</dict>
|
|
18
|
+
</dict>
|
|
19
|
+
</plist>
|
|
@@ -1 +1 @@
|
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IAUF,MAAM,EAAE,cAAc,GAAG,CAAC;IAT7C,IAAW,IAAI,IAAI,MAAM,CAExB;IACM,EAAE,EAAG,MAAM,CAAC;IAEnB,IAAW,QAAQ,OAElB;gBAEkB,MAAM,EAAE,cAAc,GAAG,CAAC;IAiD7C,cAAc,WAAY,CAAC,UAEzB;IAGK,WAAW,CAAC,MAAM,EAAE,GAAG;CAmC/B"}
|
|
@@ -49,7 +49,6 @@ class Template {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
updateTemplate = (config) => {
|
|
52
|
-
console.log('LETSGO!', config, this.type);
|
|
53
52
|
CarPlay_1.CarPlay.bridge.updateTemplate(this.id, this.parseConfig({ type: this.type, ...config }));
|
|
54
53
|
};
|
|
55
54
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -58,14 +57,11 @@ class Template {
|
|
|
58
57
|
function traverse(obj) {
|
|
59
58
|
for (const i in obj) {
|
|
60
59
|
if (String(i).match(/[Ii]mages$/)) {
|
|
61
|
-
console.log('array parsing', i, obj[i]);
|
|
62
60
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
63
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
62
|
obj[i] = obj[i].map((asset) => resolveAssetSource(asset));
|
|
65
|
-
console.log('array parsed', i, obj[i]);
|
|
66
63
|
}
|
|
67
64
|
else if (String(i).match(/[Ii]mage$/)) {
|
|
68
|
-
console.log('single image parsing', i, obj[i]);
|
|
69
65
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
70
66
|
obj[i] = resolveAssetSource(obj[i]);
|
|
71
67
|
}
|
|
@@ -74,7 +70,20 @@ class Template {
|
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
|
-
|
|
73
|
+
// Handle templates array specially - extract id and tabTitle from Template instances
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
|
+
const configToSerialize = { ...config };
|
|
76
|
+
if (Array.isArray(config.templates)) {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
configToSerialize.templates = config.templates.map((tpl) => ({
|
|
79
|
+
id: tpl.id,
|
|
80
|
+
tabTitle: tpl.config?.tabTitle,
|
|
81
|
+
tabImage: tpl.config?.tabImage,
|
|
82
|
+
tabSystemItem: tpl.config?.tabSystemItem,
|
|
83
|
+
tabSystemImageName: tpl.config?.tabSystemImageName,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
const result = JSON.parse(JSON.stringify(configToSerialize));
|
|
78
87
|
traverse(result);
|
|
79
88
|
return result;
|
|
80
89
|
}
|
package/package.json
CHANGED
|
@@ -139,7 +139,6 @@ export class Template<P> {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
updateTemplate = (config: P) => {
|
|
142
|
-
console.log('LETSGO!', config, this.type);
|
|
143
142
|
CarPlay.bridge.updateTemplate(this.id, this.parseConfig({ type: this.type, ...config }));
|
|
144
143
|
};
|
|
145
144
|
|
|
@@ -149,14 +148,11 @@ export class Template<P> {
|
|
|
149
148
|
function traverse(obj: any) {
|
|
150
149
|
for (const i in obj) {
|
|
151
150
|
if (String(i).match(/[Ii]mages$/)) {
|
|
152
|
-
console.log('array parsing', i, obj[i])
|
|
153
151
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
154
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
153
|
obj[i] = obj[i].map((asset: any) => resolveAssetSource(asset));
|
|
156
|
-
console.log('array parsed', i, obj[i])
|
|
157
154
|
}
|
|
158
155
|
else if (String(i).match(/[Ii]mage$/)) {
|
|
159
|
-
console.log('single image parsing', i, obj[i])
|
|
160
156
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
161
157
|
obj[i] = resolveAssetSource(obj[i]);
|
|
162
158
|
}
|
|
@@ -165,7 +161,20 @@ export class Template<P> {
|
|
|
165
161
|
}
|
|
166
162
|
}
|
|
167
163
|
}
|
|
168
|
-
|
|
164
|
+
// Handle templates array specially - extract id and tabTitle from Template instances
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
const configToSerialize = { ...config };
|
|
167
|
+
if (Array.isArray(config.templates)) {
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
|
+
configToSerialize.templates = config.templates.map((tpl: any) => ({
|
|
170
|
+
id: tpl.id,
|
|
171
|
+
tabTitle: tpl.config?.tabTitle,
|
|
172
|
+
tabImage: tpl.config?.tabImage,
|
|
173
|
+
tabSystemItem: tpl.config?.tabSystemItem,
|
|
174
|
+
tabSystemImageName: tpl.config?.tabSystemImageName,
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
const result = JSON.parse(JSON.stringify(configToSerialize));
|
|
169
178
|
traverse(result);
|
|
170
179
|
return result;
|
|
171
180
|
}
|