@bubblewrap/core 1.20.0 → 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.
@@ -19,6 +19,7 @@ exports.ImageHelper = void 0;
19
19
  const path = require("path");
20
20
  const fs = require("fs");
21
21
  const Jimp = require("jimp");
22
+ const plugin_color_1 = require("@jimp/plugin-color");
22
23
  const FetchUtils_1 = require("./FetchUtils");
23
24
  const util_1 = require("util");
24
25
  const svg2img_1 = require("./wrappers/svg2img");
@@ -73,13 +74,13 @@ class ImageHelper {
73
74
  const image = await Jimp.read(icon.data);
74
75
  image.color([
75
76
  // Set all pixels to black/0
76
- { apply: 'red', params: [-255] },
77
- { apply: 'green', params: [-255] },
78
- { apply: 'blue', params: [-255] },
77
+ { apply: plugin_color_1.ColorActionName.RED, params: [-255] },
78
+ { apply: plugin_color_1.ColorActionName.GREEN, params: [-255] },
79
+ { apply: plugin_color_1.ColorActionName.BLUE, params: [-255] },
79
80
  // Add to channels using theme color
80
- { apply: 'red', params: [themeColor.red()] },
81
- { apply: 'green', params: [themeColor.green()] },
82
- { apply: 'blue', params: [themeColor.blue()] },
81
+ { apply: plugin_color_1.ColorActionName.RED, params: [themeColor.red()] },
82
+ { apply: plugin_color_1.ColorActionName.GREEN, params: [themeColor.green()] },
83
+ { apply: plugin_color_1.ColorActionName.BLUE, params: [themeColor.blue()] },
83
84
  ]);
84
85
  return { url: icon.url, data: image };
85
86
  }
@@ -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
- * navigationColor: '<%= themeColor %>', // The color used for the navigation bar.
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;
@@ -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
- * navigationColor: '<%= themeColor %>', // The color used for the navigation bar.
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((_a = data.navigationColorDark) !== null && _a !== void 0 ? _a : DEFAULT_NAVIGATION_COLOR);
115
- this.navigationDividerColor = new Color((_b = data.navigationDividerColor) !== null && _b !== void 0 ? _b : DEFAULT_NAVIGATION_DIVIDER_COLOR);
116
- this.navigationDividerColorDark = new Color((_c = data.navigationDividerColorDark) !== null && _c !== void 0 ? _c : DEFAULT_NAVIGATION_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,
@@ -23,8 +23,8 @@ const FirstRunFlagFeature_1 = require("./FirstRunFlagFeature");
23
23
  const Log_1 = require("../Log");
24
24
  const ArCoreFeature_1 = require("./ArCoreFeature");
25
25
  const ANDROID_BROWSER_HELPER_VERSIONS = {
26
- stable: 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0',
27
- alpha: 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0',
26
+ stable: 'com.google.androidbrowserhelper:androidbrowserhelper:2.5.0',
27
+ alpha: 'com.google.androidbrowserhelper:androidbrowserhelper:2.5.0',
28
28
  };
29
29
  /**
30
30
  * Analyzes a TwaManifest to collect enable features and aggregates all customizations that will
@@ -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.0.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' +
@@ -20,7 +20,7 @@ const EmptyFeature_1 = require("./EmptyFeature");
20
20
  class PlayBillingFeature extends EmptyFeature_1.EmptyFeature {
21
21
  constructor() {
22
22
  super('playbilling');
23
- this.buildGradle.dependencies.push('com.google.androidbrowserhelper:billing:1.0.0-alpha09');
23
+ this.buildGradle.dependencies.push('com.google.androidbrowserhelper:billing:1.0.0-alpha10');
24
24
  this.androidManifest.components.push(`
25
25
  <activity
26
26
  android:name="com.google.androidbrowserhelper.playbilling.provider.PaymentActivity"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bubblewrap/core",
3
- "version": "1.20.0",
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"
@@ -50,12 +50,12 @@
50
50
  "fetch-h2": "^2.5.1",
51
51
  "googleapis": "^81.0.0",
52
52
  "inquirer": "^7.3.3",
53
- "jimp": "^0.14.0",
53
+ "jimp": "^0.22.7",
54
54
  "lodash.template": "^4.5.0",
55
55
  "mime-types": "^2.1.28",
56
56
  "node-fetch": "^2.6.1",
57
57
  "tar": "^6.1.0",
58
58
  "valid-url": "^1.0.9"
59
59
  },
60
- "gitHead": "8e1716ce14bbc2b06e175753094b7ffccbafd19d"
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" />