@todesktop/shared 7.83.0 → 7.86.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.
@@ -40,6 +40,7 @@ export interface DesktopifyAppTray {
40
40
  id: string;
41
41
  icon: string;
42
42
  bundledIcon?: string;
43
+ useTemplateImage?: boolean;
43
44
  rightClick: DesktopifyAppTrayAction;
44
45
  leftClick: DesktopifyAppTrayAction;
45
46
  }
@@ -131,6 +132,10 @@ export interface DesktopifyAppWindow {
131
132
  * Does the window have a maximum height. Default is `false`
132
133
  */
133
134
  hasMaxHeight: boolean;
135
+ /**
136
+ * Don't allow tabs in window (macOS only)
137
+ */
138
+ disableTabs: boolean;
134
139
  /**
135
140
  * BrowserWindow Constructor Options
136
141
  */
@@ -159,6 +164,10 @@ export interface DesktopifyApp2 {
159
164
  * The name of the company that the app belongs to
160
165
  */
161
166
  companyName?: string;
167
+ /**
168
+ * Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
169
+ */
170
+ shouldMinimizeToTray?: boolean;
162
171
  /**
163
172
  * Only allow a single instance of this app to run
164
173
  */
@@ -1,4 +1,5 @@
1
1
  import * as yup from "yup";
2
+ import { DesktopifyApp2 } from ".";
2
3
  export declare const appTitleValidation: yup.StringSchema;
3
4
  export declare const forceVersionValidation: yup.StringSchema;
4
5
  export declare const iconValidation: yup.StringSchema;
@@ -49,3 +50,4 @@ export declare const appConfigValidation: yup.ObjectSchema<{
49
50
  publishedVersions: any;
50
51
  };
51
52
  }>;
53
+ export declare const shouldMinimizeToTrayIsActive: (desktopApp: DesktopifyApp2) => boolean;
@@ -131,3 +131,6 @@ exports.appConfigValidation = yup.object({
131
131
  })
132
132
  .required(),
133
133
  });
134
+ exports.shouldMinimizeToTrayIsActive = (desktopApp) => {
135
+ return desktopApp.trays.some((t) => t.leftClick.role === "toggleMenu" || t.rightClick.role === "toggleMenu");
136
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.83.0",
3
+ "version": "7.86.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -65,6 +65,7 @@ export interface DesktopifyAppTray {
65
65
  id: string;
66
66
  icon: string;
67
67
  bundledIcon?: string;
68
+ useTemplateImage?: boolean;
68
69
  rightClick: DesktopifyAppTrayAction;
69
70
  leftClick: DesktopifyAppTrayAction;
70
71
  }
@@ -233,6 +234,10 @@ export interface DesktopifyAppWindow {
233
234
  * Does the window have a maximum height. Default is `false`
234
235
  */
235
236
  hasMaxHeight: boolean;
237
+ /**
238
+ * Don't allow tabs in window (macOS only)
239
+ */
240
+ disableTabs: boolean;
236
241
  /**
237
242
  * BrowserWindow Constructor Options
238
243
  */
@@ -266,6 +271,10 @@ export interface DesktopifyApp2 {
266
271
  * The name of the company that the app belongs to
267
272
  */
268
273
  companyName?: string;
274
+ /**
275
+ * Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
276
+ */
277
+ shouldMinimizeToTray?: boolean;
269
278
  /**
270
279
  * Only allow a single instance of this app to run
271
280
  */
@@ -1,6 +1,7 @@
1
1
  import * as yup from "yup";
2
2
  import * as semver from "semver";
3
3
  import * as isRegex from "is-regex";
4
+ import { DesktopifyApp2, IApp2 } from ".";
4
5
  export const appTitleValidation = yup
5
6
  .string()
6
7
  .label("App title")
@@ -170,3 +171,10 @@ export const appConfigValidation = yup.object({
170
171
  })
171
172
  .required(),
172
173
  });
174
+
175
+ export const shouldMinimizeToTrayIsActive = (desktopApp: DesktopifyApp2) => {
176
+ return desktopApp.trays.some(
177
+ (t) =>
178
+ t.leftClick.role === "toggleMenu" || t.rightClick.role === "toggleMenu"
179
+ );
180
+ };