@bubblewrap/core 1.20.1 → 1.21.0
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.
|
@@ -34,7 +34,8 @@ declare type alphaDependencies = {
|
|
|
34
34
|
* name: '<%= name %>', // The name shown on the Android Launcher.
|
|
35
35
|
* display: '<%= display %>', // The display mode for the TWA.
|
|
36
36
|
* themeColor: '<%= themeColor %>', // The color used for the status bar.
|
|
37
|
-
*
|
|
37
|
+
* themeColorDark: '<%= themeColorDark %>', // The color used for the dark status bar.
|
|
38
|
+
* navigationColor: '<%= navigationColor %>', // The color used for the navigation bar.
|
|
38
39
|
* navigationColorDark: '<%= navigationColorDark %>', // The color used for the dark navbar.
|
|
39
40
|
* navigationDividerColor: '<%= navigationDividerColor %>', // The color used for the
|
|
40
41
|
* navbar divider.
|
|
@@ -68,6 +69,7 @@ export declare class TwaManifest {
|
|
|
68
69
|
launcherName: string;
|
|
69
70
|
display: DisplayMode;
|
|
70
71
|
themeColor: Color;
|
|
72
|
+
themeColorDark: Color;
|
|
71
73
|
navigationColor: Color;
|
|
72
74
|
navigationColorDark: Color;
|
|
73
75
|
navigationDividerColor: Color;
|
|
@@ -195,6 +197,7 @@ export interface TwaManifestJson {
|
|
|
195
197
|
launcherName?: string;
|
|
196
198
|
display?: string;
|
|
197
199
|
themeColor: string;
|
|
200
|
+
themeColorDark?: string;
|
|
198
201
|
navigationColor: string;
|
|
199
202
|
navigationColorDark?: string;
|
|
200
203
|
navigationDividerColor?: string;
|
package/dist/lib/TwaManifest.js
CHANGED
|
@@ -52,6 +52,7 @@ const DEFAULT_SPLASHSCREEN_FADEOUT_DURATION = 300;
|
|
|
52
52
|
const DEFAULT_APP_NAME = 'My TWA';
|
|
53
53
|
const DEFAULT_DISPLAY_MODE = 'standalone';
|
|
54
54
|
const DEFAULT_THEME_COLOR = '#FFFFFF';
|
|
55
|
+
const DEFAULT_THEME_COLOR_DARK = '#000000';
|
|
55
56
|
const DEFAULT_NAVIGATION_COLOR = '#000000';
|
|
56
57
|
const DEFAULT_NAVIGATION_DIVIDER_COLOR = '#00000000';
|
|
57
58
|
const DEFAULT_BACKGROUND_COLOR = '#FFFFFF';
|
|
@@ -72,7 +73,8 @@ const DEFAULT_ORIENTATION = 'default';
|
|
|
72
73
|
* name: '<%= name %>', // The name shown on the Android Launcher.
|
|
73
74
|
* display: '<%= display %>', // The display mode for the TWA.
|
|
74
75
|
* themeColor: '<%= themeColor %>', // The color used for the status bar.
|
|
75
|
-
*
|
|
76
|
+
* themeColorDark: '<%= themeColorDark %>', // The color used for the dark status bar.
|
|
77
|
+
* navigationColor: '<%= navigationColor %>', // The color used for the navigation bar.
|
|
76
78
|
* navigationColorDark: '<%= navigationColorDark %>', // The color used for the dark navbar.
|
|
77
79
|
* navigationDividerColor: '<%= navigationDividerColor %>', // The color used for the
|
|
78
80
|
* navbar divider.
|
|
@@ -101,7 +103,7 @@ const DEFAULT_ORIENTATION = 'default';
|
|
|
101
103
|
*/
|
|
102
104
|
class TwaManifest {
|
|
103
105
|
constructor(data) {
|
|
104
|
-
var _a, _b, _c;
|
|
106
|
+
var _a, _b, _c, _d;
|
|
105
107
|
this.packageId = data.packageId;
|
|
106
108
|
this.host = data.host;
|
|
107
109
|
this.name = data.name;
|
|
@@ -110,10 +112,11 @@ class TwaManifest {
|
|
|
110
112
|
// Older manifests may not have this field:
|
|
111
113
|
this.display = asDisplayMode(data.display) || DEFAULT_DISPLAY_MODE;
|
|
112
114
|
this.themeColor = new Color(data.themeColor);
|
|
115
|
+
this.themeColorDark = new Color((_a = data.themeColorDark) !== null && _a !== void 0 ? _a : DEFAULT_THEME_COLOR_DARK);
|
|
113
116
|
this.navigationColor = new Color(data.navigationColor);
|
|
114
|
-
this.navigationColorDark = new Color((
|
|
115
|
-
this.navigationDividerColor = new Color((
|
|
116
|
-
this.navigationDividerColorDark = new Color((
|
|
117
|
+
this.navigationColorDark = new Color((_b = data.navigationColorDark) !== null && _b !== void 0 ? _b : DEFAULT_NAVIGATION_COLOR);
|
|
118
|
+
this.navigationDividerColor = new Color((_c = data.navigationDividerColor) !== null && _c !== void 0 ? _c : DEFAULT_NAVIGATION_DIVIDER_COLOR);
|
|
119
|
+
this.navigationDividerColorDark = new Color((_d = data.navigationDividerColorDark) !== null && _d !== void 0 ? _d : DEFAULT_NAVIGATION_COLOR);
|
|
117
120
|
this.backgroundColor = new Color(data.backgroundColor);
|
|
118
121
|
this.enableNotifications = data.enableNotifications;
|
|
119
122
|
this.startUrl = data.startUrl;
|
|
@@ -153,6 +156,7 @@ class TwaManifest {
|
|
|
153
156
|
toJson() {
|
|
154
157
|
return Object.assign({}, this, {
|
|
155
158
|
themeColor: this.themeColor.hex(),
|
|
159
|
+
themeColorDark: this.themeColorDark.hex(),
|
|
156
160
|
navigationColor: this.navigationColor.hex(),
|
|
157
161
|
navigationColorDark: this.navigationColorDark.hex(),
|
|
158
162
|
navigationDividerColor: this.navigationDividerColor.hex(),
|
|
@@ -230,6 +234,7 @@ class TwaManifest {
|
|
|
230
234
|
launcherName: webManifest['short_name'] || ((_a = webManifest['name']) === null || _a === void 0 ? void 0 : _a.substring(0, SHORT_NAME_MAX_SIZE)) || DEFAULT_APP_NAME,
|
|
231
235
|
display: asDisplayMode(webManifest['display']) || DEFAULT_DISPLAY_MODE,
|
|
232
236
|
themeColor: webManifest['theme_color'] || DEFAULT_THEME_COLOR,
|
|
237
|
+
themeColorDark: DEFAULT_THEME_COLOR_DARK,
|
|
233
238
|
navigationColor: DEFAULT_NAVIGATION_COLOR,
|
|
234
239
|
navigationColorDark: DEFAULT_NAVIGATION_COLOR,
|
|
235
240
|
navigationDividerColor: DEFAULT_NAVIGATION_DIVIDER_COLOR,
|
|
@@ -20,7 +20,7 @@ const EmptyFeature_1 = require("./EmptyFeature");
|
|
|
20
20
|
class LocationDelegationFeature extends EmptyFeature_1.EmptyFeature {
|
|
21
21
|
constructor() {
|
|
22
22
|
super('locationDelegation');
|
|
23
|
-
this.buildGradle.dependencies.push('com.google.androidbrowserhelper:locationdelegation:1.
|
|
23
|
+
this.buildGradle.dependencies.push('com.google.androidbrowserhelper:locationdelegation:1.1.1');
|
|
24
24
|
this.androidManifest.components.push(`<activity android:name=
|
|
25
25
|
"com.google.androidbrowserhelper.locationdelegation.PermissionRequestActivity"/>`);
|
|
26
26
|
this.delegationService.imports.push('com.google.androidbrowserhelper.locationdelegation' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bubblewrap/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Core Library to generate, build and sign TWA projects",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=14.15.0"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"tar": "^6.1.0",
|
|
58
58
|
"valid-url": "^1.0.9"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "940bb2a0426b1e4cd8b76872fe48697a1508f5b8"
|
|
61
61
|
}
|
|
@@ -27,6 +27,7 @@ def twaManifest = [
|
|
|
27
27
|
name: '<%= escapeGradleString(name) %>', // The application name.
|
|
28
28
|
launcherName: '<%= escapeGradleString(launcherName) %>', // The name shown on the Android Launcher.
|
|
29
29
|
themeColor: '<%= themeColor.hex() %>', // The color used for the status bar.
|
|
30
|
+
themeColorDark: '<%= themeColorDark.hex() %>', // The color used for the dark status bar.
|
|
30
31
|
navigationColor: '<%= navigationColor.hex() %>', // The color used for the navigation bar.
|
|
31
32
|
navigationColorDark: '<%= navigationColorDark.hex() %>', // The color used for the dark navbar.
|
|
32
33
|
navigationDividerColor: '<%= navigationDividerColor.hex() %>', // The navbar divider color.
|
|
@@ -94,6 +95,11 @@ android {
|
|
|
94
95
|
// compile. If not set, the status bar color defaults to #FFFFFF - white.
|
|
95
96
|
resValue "color", "colorPrimary", twaManifest.themeColor
|
|
96
97
|
|
|
98
|
+
// This attribute sets the dark status bar color for the TWA. It can be either set here or in
|
|
99
|
+
// `res/values/colors.xml`. Setting in both places is an error and the app will not
|
|
100
|
+
// compile. If not set, the status bar color defaults to #000000 - white.
|
|
101
|
+
resValue "color", "colorPrimaryDark", twaManifest.themeColorDark
|
|
102
|
+
|
|
97
103
|
// This attribute sets the navigation bar color for the TWA. It can be either set here or
|
|
98
104
|
// in `res/values/colors.xml`. Setting in both places is an error and the app will not
|
|
99
105
|
// compile. If not set, the navigation bar color defaults to #FFFFFF - white.
|
|
@@ -109,6 +109,10 @@
|
|
|
109
109
|
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
|
|
110
110
|
android:resource="@color/colorPrimary" />
|
|
111
111
|
|
|
112
|
+
<meta-data
|
|
113
|
+
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR_DARK"
|
|
114
|
+
android:resource="@color/colorPrimaryDark" />
|
|
115
|
+
|
|
112
116
|
<meta-data
|
|
113
117
|
android:name="android.support.customtabs.trusted.NAVIGATION_BAR_COLOR"
|
|
114
118
|
android:resource="@color/navigationColor" />
|