@todesktop/shared 7.84.0 → 7.87.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.
@@ -10,6 +10,7 @@ export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConst
10
10
  platforms?: NodeJS.Platform[];
11
11
  submenu?: DesktopifyMenuItemConstructorOptions[];
12
12
  role?: MenuItemConstructorOptions["role"] | todesktopRoles;
13
+ useSystemLabel?: Boolean;
13
14
  }
14
15
  /**
15
16
  * Toggle Window Tray Action
@@ -132,6 +133,10 @@ export interface DesktopifyAppWindow {
132
133
  * Does the window have a maximum height. Default is `false`
133
134
  */
134
135
  hasMaxHeight: boolean;
136
+ /**
137
+ * Don't allow tabs in window (macOS only)
138
+ */
139
+ disableTabs: boolean;
135
140
  /**
136
141
  * BrowserWindow Constructor Options
137
142
  */
@@ -160,6 +165,10 @@ export interface DesktopifyApp2 {
160
165
  * The name of the company that the app belongs to
161
166
  */
162
167
  companyName?: string;
168
+ /**
169
+ * Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
170
+ */
171
+ shouldMinimizeToTray?: boolean;
163
172
  /**
164
173
  * Only allow a single instance of this app to run
165
174
  */
@@ -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.84.0",
3
+ "version": "7.87.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -27,6 +27,7 @@ export interface DesktopifyMenuItemConstructorOptions
27
27
  platforms?: NodeJS.Platform[];
28
28
  submenu?: DesktopifyMenuItemConstructorOptions[];
29
29
  role?: MenuItemConstructorOptions["role"] | todesktopRoles;
30
+ useSystemLabel?: Boolean;
30
31
  }
31
32
 
32
33
  /**
@@ -234,6 +235,10 @@ export interface DesktopifyAppWindow {
234
235
  * Does the window have a maximum height. Default is `false`
235
236
  */
236
237
  hasMaxHeight: boolean;
238
+ /**
239
+ * Don't allow tabs in window (macOS only)
240
+ */
241
+ disableTabs: boolean;
237
242
  /**
238
243
  * BrowserWindow Constructor Options
239
244
  */
@@ -267,6 +272,10 @@ export interface DesktopifyApp2 {
267
272
  * The name of the company that the app belongs to
268
273
  */
269
274
  companyName?: string;
275
+ /**
276
+ * Whether the app should minimize to tray when all windows are closed. Requires at least one tray.
277
+ */
278
+ shouldMinimizeToTray?: boolean;
270
279
  /**
271
280
  * Only allow a single instance of this app to run
272
281
  */
@@ -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
+ };