@todesktop/shared 7.184.17 → 7.184.19
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/.eslintrc.js +33 -0
- package/.github/workflows/main.yml +19 -19
- package/.github/workflows/test.yml +14 -0
- package/.prettierignore +3 -0
- package/.prettierrc +5 -0
- package/lib/base.d.ts +23 -23
- package/lib/desktopify.d.ts +16 -16
- package/lib/desktopify.js +8 -8
- package/lib/desktopify2.d.ts +21 -21
- package/lib/desktopify2.js +61 -59
- package/lib/getSiteInfo.d.ts +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/plans.d.ts +11 -11
- package/lib/plans.js +42 -42
- package/lib/plugin.d.ts +3 -3
- package/lib/toDesktop.d.ts +8 -8
- package/lib/translation.d.ts +2 -2
- package/lib/validations.d.ts +2 -2
- package/lib/validations.js +26 -26
- package/package.json +10 -6
- package/src/base.ts +25 -25
- package/src/desktopify.ts +53 -52
- package/src/desktopify2.ts +99 -97
- package/src/getSiteInfo.ts +1 -1
- package/src/index.ts +7 -7
- package/src/json.d.ts +2 -2
- package/src/plans.ts +61 -61
- package/src/plugin.ts +3 -3
- package/src/toDesktop.ts +12 -12
- package/src/translation.ts +3 -3
- package/src/validations.ts +36 -39
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
root: true,
|
|
5
|
+
|
|
6
|
+
extends: [
|
|
7
|
+
'eslint:recommended',
|
|
8
|
+
'plugin:@typescript-eslint/recommended',
|
|
9
|
+
'prettier',
|
|
10
|
+
],
|
|
11
|
+
|
|
12
|
+
parser: '@typescript-eslint/parser',
|
|
13
|
+
parserOptions: {
|
|
14
|
+
ecmaVersion: 2020,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
project: './tsconfig.json',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
env: {
|
|
20
|
+
es6: true,
|
|
21
|
+
node: true,
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
plugins: ['@typescript-eslint', 'prettier'],
|
|
25
|
+
|
|
26
|
+
rules: {
|
|
27
|
+
'prettier/prettier': 'error',
|
|
28
|
+
'@typescript-eslint/no-misused-promises': [
|
|
29
|
+
'error',
|
|
30
|
+
{ checksVoidReturn: false },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
on:
|
|
2
2
|
push:
|
|
3
3
|
branches:
|
|
4
|
-
|
|
4
|
+
- master
|
|
5
5
|
|
|
6
6
|
jobs:
|
|
7
7
|
release:
|
|
@@ -9,23 +9,23 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
if: "!contains(github.event.head_commit.message, '#no-publish')"
|
|
11
11
|
steps:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
- uses: actions/setup-node@v3
|
|
14
|
+
- run: npm ci
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if [ "${current_ver}" != "${latest_ver}" ]; then
|
|
23
|
-
npm version "${latest_ver}" --no-git-tag-version -f
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
npm version --no-git-tag-version patch
|
|
16
|
+
- name: Bump version
|
|
17
|
+
run: |
|
|
18
|
+
current_ver="$(node -p -e "require('./package.json').version")"
|
|
19
|
+
npm_ver="$(npm view @todesktop/shared version)"
|
|
20
|
+
latest_ver="$(npx semver "${current_ver}" ${npm_ver} | tail -n 1)"
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
if [ "${current_ver}" != "${latest_ver}" ]; then
|
|
23
|
+
npm version "${latest_ver}" --no-git-tag-version -f
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
npm version --no-git-tag-version patch
|
|
27
|
+
|
|
28
|
+
- name: Publish
|
|
29
|
+
run: |
|
|
30
|
+
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_AUTH_TOKEN }}"
|
|
31
|
+
npm publish
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/lib/base.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ExtraFileReference, FilePath, IAppBuilderLib, Release } from
|
|
1
|
+
import { ExtraFileReference, FilePath, IAppBuilderLib, Release } from './desktopify';
|
|
2
2
|
export interface Schemable {
|
|
3
3
|
schemaVersion?: number;
|
|
4
4
|
}
|
|
5
|
-
export declare type ProgressTypes =
|
|
5
|
+
export declare type ProgressTypes = 'progress' | 'done' | 'error';
|
|
6
6
|
export interface IChecklistItem {
|
|
7
7
|
[id: string]: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface IDownloadButtonOptions {
|
|
10
|
-
buttonSize:
|
|
11
|
-
fontFamily:
|
|
10
|
+
buttonSize: 'small' | 'medium' | 'large';
|
|
11
|
+
fontFamily: 'serif' | 'sans-serif';
|
|
12
12
|
bgColor: string;
|
|
13
13
|
fgColor: string;
|
|
14
14
|
borderRadius: number;
|
|
15
15
|
showAppIcon: {
|
|
16
16
|
enabled: boolean;
|
|
17
|
-
alignment:
|
|
17
|
+
alignment: 'right' | 'left';
|
|
18
18
|
};
|
|
19
19
|
showDownloadIcon: {
|
|
20
20
|
enabled: boolean;
|
|
21
|
-
alignment:
|
|
21
|
+
alignment: 'right' | 'left';
|
|
22
22
|
};
|
|
23
23
|
btnText: string;
|
|
24
24
|
}
|
|
25
25
|
export declare enum WindowsEVOnboardingSteps {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
'hasChosenProvider' = "hasChosenProvider",
|
|
27
|
+
'hasOrderedCert' = "hasOrderedCert",
|
|
28
|
+
'hasBeenVerified' = "hasBeenVerified",
|
|
29
|
+
'hasGeneratedCert' = "hasGeneratedCert",
|
|
30
|
+
'hasUploadedCert' = "hasUploadedCert"
|
|
31
31
|
}
|
|
32
32
|
export declare enum WindowsEVOnboardingProvider {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
'globalsign' = "globalsign",
|
|
34
|
+
'other' = "other"
|
|
35
35
|
}
|
|
36
36
|
export interface IAppBuildProgress {
|
|
37
37
|
isBuilding: boolean;
|
|
@@ -46,7 +46,7 @@ export interface IAppMeta {
|
|
|
46
46
|
currentBuildProgress?: {
|
|
47
47
|
channel?: string;
|
|
48
48
|
id?: string;
|
|
49
|
-
releaseId?: Release[
|
|
49
|
+
releaseId?: Release['id'];
|
|
50
50
|
linux?: IAppBuildProgress;
|
|
51
51
|
mac?: IAppBuildProgress;
|
|
52
52
|
projectConfig?: {
|
|
@@ -65,14 +65,14 @@ export interface IAppMeta {
|
|
|
65
65
|
iconSize?: number;
|
|
66
66
|
iconTextSize?: number;
|
|
67
67
|
title?: string;
|
|
68
|
-
contents?: IAppBuilderLib[
|
|
69
|
-
window?: IAppBuilderLib[
|
|
68
|
+
contents?: IAppBuilderLib['config']['dmg']['contents'];
|
|
69
|
+
window?: IAppBuilderLib['config']['dmg']['window'];
|
|
70
70
|
};
|
|
71
71
|
extraContentFiles?: ExtraFileReference[];
|
|
72
72
|
electronMirror?: string;
|
|
73
73
|
electronVersion?: string;
|
|
74
74
|
extraResources?: ExtraFileReference[];
|
|
75
|
-
fileAssociations?: IAppBuilderLib[
|
|
75
|
+
fileAssociations?: IAppBuilderLib['config']['fileAssociations'];
|
|
76
76
|
filesForDistribution?: string[];
|
|
77
77
|
icon: FilePath;
|
|
78
78
|
id: string;
|
|
@@ -86,14 +86,14 @@ export interface IAppMeta {
|
|
|
86
86
|
category?: string;
|
|
87
87
|
dmgBackground?: FilePath;
|
|
88
88
|
entitlements?: FilePath;
|
|
89
|
-
extendInfo?: IAppBuilderLib[
|
|
89
|
+
extendInfo?: IAppBuilderLib['config']['mac']['extendInfo'];
|
|
90
90
|
icon?: FilePath;
|
|
91
91
|
};
|
|
92
92
|
nodeVersion?: string;
|
|
93
|
-
packageManager?:
|
|
93
|
+
packageManager?: 'npm' | 'yarn' | 'pnpm';
|
|
94
94
|
productName?: string;
|
|
95
95
|
schemaVersion: number;
|
|
96
|
-
snap?: IAppBuilderLib[
|
|
96
|
+
snap?: IAppBuilderLib['config']['snap'];
|
|
97
97
|
windows?: {
|
|
98
98
|
icon?: FilePath;
|
|
99
99
|
nsisCustomBinary?: {
|
|
@@ -153,7 +153,7 @@ export interface CustomWindowsCodeSignFile {
|
|
|
153
153
|
certUrl?: URL;
|
|
154
154
|
}
|
|
155
155
|
export interface CustomWindowsCodeSignEV {
|
|
156
|
-
certType:
|
|
156
|
+
certType: 'hsm';
|
|
157
157
|
hsmCertType: WindowsHSMCertType.ev;
|
|
158
158
|
hsmCertName: string;
|
|
159
159
|
}
|
|
@@ -195,8 +195,8 @@ export interface BaseApp extends Schemable {
|
|
|
195
195
|
shouldCreateRPMPackages?: boolean;
|
|
196
196
|
shouldCreateSnapFiles?: boolean;
|
|
197
197
|
shouldCreateMacUniversalInstaller?: boolean;
|
|
198
|
-
appxConfig?: Partial<IAppBuilderLib[
|
|
199
|
-
nsisConfig?: Partial<IAppBuilderLib[
|
|
198
|
+
appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
|
|
199
|
+
nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
|
|
200
200
|
snapStore?: {
|
|
201
201
|
login?: string;
|
|
202
202
|
description?: string;
|
package/lib/desktopify.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IApp2 } from
|
|
2
|
-
import { IApp } from
|
|
3
|
-
import { Configuration, PackagerOptions, PublishOptions } from
|
|
1
|
+
import { IApp2 } from './desktopify2';
|
|
2
|
+
import { IApp } from './toDesktop';
|
|
3
|
+
import { Configuration, PackagerOptions, PublishOptions } from 'app-builder-lib';
|
|
4
4
|
declare type appBuilderLib = PackagerOptions & PublishOptions;
|
|
5
5
|
export interface IAppBuilderLib extends appBuilderLib {
|
|
6
6
|
config: Configuration;
|
|
@@ -31,11 +31,11 @@ export declare enum BuildStatus {
|
|
|
31
31
|
succeeded = "succeeded",
|
|
32
32
|
cancelled = "cancelled"
|
|
33
33
|
}
|
|
34
|
-
export declare type Arch =
|
|
35
|
-
export declare type MacArch =
|
|
36
|
-
export declare type LinuxArtifactName =
|
|
37
|
-
export declare type MacArtifactName =
|
|
38
|
-
export declare type WindowsArtifactName =
|
|
34
|
+
export declare type Arch = 'ia32' | 'x64' | 'arm64';
|
|
35
|
+
export declare type MacArch = 'ia32' | 'x64' | 'arm64' | 'universal';
|
|
36
|
+
export declare type LinuxArtifactName = 'appImage' | 'deb' | 'rpm' | 'snap';
|
|
37
|
+
export declare type MacArtifactName = 'dmg' | 'zip' | 'installer';
|
|
38
|
+
export declare type WindowsArtifactName = 'msi' | 'nsis' | 'nsis-web' | 'nsis-web-7z' | 'appx';
|
|
39
39
|
declare type ArtifactDownload = Record<Arch, {
|
|
40
40
|
size: number;
|
|
41
41
|
standardUrl: URL;
|
|
@@ -44,7 +44,7 @@ declare type ArtifactDownload = Record<Arch, {
|
|
|
44
44
|
export declare type LinuxArtifactDownloads = Record<LinuxArtifactName, ArtifactDownload>;
|
|
45
45
|
export declare type MacArtifactDownloads = Record<MacArtifactName, ArtifactDownload>;
|
|
46
46
|
export declare type WindowsArtifactDownloads = Record<WindowsArtifactName, ArtifactDownload>;
|
|
47
|
-
export declare type CodeSignSkipReason =
|
|
47
|
+
export declare type CodeSignSkipReason = 'no-cert' | 'user-disabled';
|
|
48
48
|
export interface PlatformBuild {
|
|
49
49
|
appBuilderLibConfig?: IAppBuilderLib;
|
|
50
50
|
artifactDownloads?: LinuxArtifactDownloads | MacArtifactDownloads | WindowsArtifactDownloads;
|
|
@@ -71,7 +71,7 @@ export interface PlatformBuild {
|
|
|
71
71
|
startedAt: ISODate;
|
|
72
72
|
status: BuildStatus;
|
|
73
73
|
}
|
|
74
|
-
export declare type CIRunner =
|
|
74
|
+
export declare type CIRunner = 'circle' | 'azure';
|
|
75
75
|
export interface Build {
|
|
76
76
|
appCustomDomain?: string;
|
|
77
77
|
appName: string;
|
|
@@ -88,7 +88,7 @@ export interface Build {
|
|
|
88
88
|
endedAt?: ISODate;
|
|
89
89
|
electronVersionSpecified?: SemanticVersion;
|
|
90
90
|
electronVersionUsed?: SemanticVersion;
|
|
91
|
-
environmentVariables?: IApp[
|
|
91
|
+
environmentVariables?: IApp['environmentVariables'];
|
|
92
92
|
errorMessage?: string;
|
|
93
93
|
icon?: string;
|
|
94
94
|
id: string;
|
|
@@ -123,7 +123,7 @@ export interface Build {
|
|
|
123
123
|
};
|
|
124
124
|
windows?: PlatformBuild;
|
|
125
125
|
}
|
|
126
|
-
export declare type ComputedBuildProperties = Pick<Build,
|
|
126
|
+
export declare type ComputedBuildProperties = Pick<Build, 'desktopifyVersion' | 'electronVersionUsed' | 'endedAt' | 'errorMessage' | 'releasedAt' | 'standardUniversalDownloadUrl' | 'startedAt' | 'status' | 'universalDownloadUrl'>;
|
|
127
127
|
export declare enum ManifestCategory {
|
|
128
128
|
primary = "primary",
|
|
129
129
|
buildStamped = "build-stamped",
|
|
@@ -155,7 +155,7 @@ export interface SmokeTestProgress {
|
|
|
155
155
|
message?: string;
|
|
156
156
|
progress: number;
|
|
157
157
|
screenshot?: string;
|
|
158
|
-
state:
|
|
158
|
+
state: 'progress' | 'done' | 'error' | 'skipped';
|
|
159
159
|
updatedAppHasNoMainErrors?: boolean;
|
|
160
160
|
}
|
|
161
161
|
export declare const hasBuildKickedOff: (build: Build) => boolean;
|
|
@@ -179,7 +179,7 @@ export interface DesktopifyApp {
|
|
|
179
179
|
maxWidth?: number;
|
|
180
180
|
singleInstance: boolean;
|
|
181
181
|
disableContextMenu: boolean;
|
|
182
|
-
titleBarStyle?:
|
|
182
|
+
titleBarStyle?: 'hidden' | 'hiddenInset' | 'customButtonsOnHover';
|
|
183
183
|
alwaysOnTop: boolean;
|
|
184
184
|
internalUrls?: string;
|
|
185
185
|
isNativeWindowOpenDisabled?: boolean;
|
|
@@ -202,8 +202,8 @@ export interface DesktopifyApp {
|
|
|
202
202
|
shouldReuseRendererProcess?: boolean;
|
|
203
203
|
shouldMakeSameDomainAnExternalLink?: boolean;
|
|
204
204
|
enablePushNotifications?: boolean;
|
|
205
|
-
themeSource?:
|
|
206
|
-
themeSourceMac?:
|
|
205
|
+
themeSource?: 'system' | 'light' | 'dark';
|
|
206
|
+
themeSourceMac?: 'system' | 'light' | 'dark';
|
|
207
207
|
crashReporter?: string;
|
|
208
208
|
companyName?: string;
|
|
209
209
|
pollForAppUpdatesEveryXMinutes?: number;
|
package/lib/desktopify.js
CHANGED
|
@@ -39,8 +39,8 @@ exports.isPlatformBuildRunning = (platformBuild) => {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
return (!platformBuild.shouldSkip && // <-- Noteworthy
|
|
42
|
-
![
|
|
43
|
-
(
|
|
42
|
+
!['cancelled', 'succeeded'].includes(platformBuild.status) &&
|
|
43
|
+
('failed' !== platformBuild.status ||
|
|
44
44
|
platformBuild.numberOfAttemptedBuilds < 2));
|
|
45
45
|
};
|
|
46
46
|
// NOTE: this relies on Firestore solely
|
|
@@ -48,16 +48,16 @@ exports.isCiBuildRunning = (build) => {
|
|
|
48
48
|
if (!build) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
|
-
return (build.status ===
|
|
52
|
-
(build.status ===
|
|
53
|
-
[
|
|
54
|
-
(build.status ===
|
|
51
|
+
return (build.status === 'building' ||
|
|
52
|
+
(build.status === 'failed' &&
|
|
53
|
+
['linux', 'mac', 'windows'].some((platform) => build.status === 'building' ||
|
|
54
|
+
(build.status === 'failed' && exports.isPlatformBuildRunning(build[platform])))));
|
|
55
55
|
};
|
|
56
56
|
exports.isBuildRunning = (build) => {
|
|
57
57
|
if (!build) {
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
60
|
-
return (![
|
|
61
|
-
[
|
|
60
|
+
return (!['cancelled', 'succeeded'].includes(build.status) &&
|
|
61
|
+
['linux', 'mac', 'windows'].some((platform) => exports.isPlatformBuildRunning(build[platform])));
|
|
62
62
|
};
|
|
63
63
|
exports.isBuildCancellable = (build) => exports.hasBuildKickedOff(build) && exports.isBuildRunning(build);
|
package/lib/desktopify2.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ISwitchableValue } from
|
|
3
|
-
import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences } from
|
|
4
|
-
import { BaseApp } from
|
|
5
|
-
import { DesktopAppPlugin } from
|
|
6
|
-
import { ValidTranslationKeys, ValidTranslationLanguages } from
|
|
2
|
+
import { ISwitchableValue } from './toDesktop';
|
|
3
|
+
import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences } from '@todesktop/client-electron-types';
|
|
4
|
+
import { BaseApp } from './base';
|
|
5
|
+
import { DesktopAppPlugin } from './plugin';
|
|
6
|
+
import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
|
|
7
7
|
interface BaseAssetDetails {
|
|
8
8
|
/**
|
|
9
9
|
* Remote URL where the asset can be downloaded
|
|
@@ -15,36 +15,36 @@ interface BaseAssetDetails {
|
|
|
15
15
|
relativeLocalPath: string;
|
|
16
16
|
}
|
|
17
17
|
export interface AppIconAssetDetails extends BaseAssetDetails {
|
|
18
|
-
type:
|
|
18
|
+
type: 'appIcon';
|
|
19
19
|
}
|
|
20
20
|
export interface MenuIconAssetDetails extends BaseAssetDetails {
|
|
21
|
-
type:
|
|
21
|
+
type: 'menuIcon';
|
|
22
22
|
}
|
|
23
23
|
export interface TrayMenubarIconAssetDetails extends BaseAssetDetails {
|
|
24
|
-
type:
|
|
24
|
+
type: 'trayMenubarIcon';
|
|
25
25
|
}
|
|
26
26
|
export interface FileAssetDetails extends BaseAssetDetails {
|
|
27
27
|
md5Hash: string;
|
|
28
|
-
type:
|
|
28
|
+
type: 'file';
|
|
29
29
|
}
|
|
30
30
|
export declare type AssetDetails = AppIconAssetDetails | MenuIconAssetDetails | TrayMenubarIconAssetDetails | FileAssetDetails;
|
|
31
31
|
/**
|
|
32
32
|
* Custom ToDesktop Roles for Application & Tray Menus
|
|
33
33
|
*/
|
|
34
|
-
declare type todesktopRoles =
|
|
35
|
-
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions,
|
|
34
|
+
declare type todesktopRoles = 'todesktop:launch-at-startup' | 'todesktop:check-for-updates' | 'todesktop:quit' | 'todesktop:quit-completely' | 'todesktop:new-window' | 'todesktop:new-tab' | 'todesktop:check-for-updates' | 'todesktop:history-home' | 'todesktop:history-back' | 'todesktop:history-forward' | 'todesktop:show-window' | 'todesktop:hide-window' | 'todesktop:toggle-window' | 'todesktop:toggle-window0' | 'todesktop:toggle-window1' | 'todesktop:toggle-window2' | 'todesktop:toggle-window3' | 'todesktop:toggle-window4';
|
|
35
|
+
export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConstructorOptions, 'role' | 'submenu'> {
|
|
36
36
|
platforms?: NodeJS.Platform[];
|
|
37
37
|
submenu?: DesktopifyMenuItemConstructorOptions[];
|
|
38
|
-
role?: MenuItemConstructorOptions[
|
|
38
|
+
role?: MenuItemConstructorOptions['role'] | todesktopRoles;
|
|
39
39
|
useSystemLabel?: boolean;
|
|
40
40
|
event?: string;
|
|
41
41
|
targetWindowId?: string;
|
|
42
|
-
actionType?:
|
|
42
|
+
actionType?: 'jsEvent' | 'role';
|
|
43
43
|
iconUrl?: string;
|
|
44
44
|
bundledIcon?: string;
|
|
45
45
|
iconAssetDetails?: MenuIconAssetDetails;
|
|
46
46
|
useTemplateImage?: boolean;
|
|
47
|
-
acceleratorBehaviour?:
|
|
47
|
+
acceleratorBehaviour?: 'none' | 'default' | 'custom';
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Toggle Window Tray Action
|
|
@@ -52,7 +52,7 @@ export interface DesktopifyMenuItemConstructorOptions extends Omit<MenuItemConst
|
|
|
52
52
|
* @param windowId - The id of the window to toggle
|
|
53
53
|
*/
|
|
54
54
|
export declare type DesktopifyAppTrayToggleWindowAction = {
|
|
55
|
-
role:
|
|
55
|
+
role: 'toggleWindow';
|
|
56
56
|
windowId: string;
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
@@ -61,14 +61,14 @@ export declare type DesktopifyAppTrayToggleWindowAction = {
|
|
|
61
61
|
* @param menu - The menu to show when action triggered
|
|
62
62
|
*/
|
|
63
63
|
export declare type DesktopifyAppTrayToggleMenuAction = {
|
|
64
|
-
role:
|
|
64
|
+
role: 'toggleMenu';
|
|
65
65
|
menu: DesktopifyMenuItemConstructorOptions[];
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
68
|
* No Action Tray Action
|
|
69
69
|
*/
|
|
70
70
|
export declare type DesktopifyAppTrayNoAction = {
|
|
71
|
-
role:
|
|
71
|
+
role: 'noAction';
|
|
72
72
|
};
|
|
73
73
|
export declare type DesktopifyAppTrayAction = DesktopifyAppTrayToggleMenuAction | DesktopifyAppTrayToggleWindowAction | DesktopifyAppTrayNoAction;
|
|
74
74
|
export interface DesktopifyAppTray {
|
|
@@ -126,7 +126,7 @@ export interface DesktopifyAppWindow {
|
|
|
126
126
|
/**
|
|
127
127
|
* The type of window
|
|
128
128
|
*/
|
|
129
|
-
type:
|
|
129
|
+
type: 'menubar' | 'app' | 'panel';
|
|
130
130
|
/**
|
|
131
131
|
* Keyboard shortcut to toggle window visibility
|
|
132
132
|
*/
|
|
@@ -151,7 +151,7 @@ export interface DesktopifyAppWindow {
|
|
|
151
151
|
/**
|
|
152
152
|
* Inital visibility of window
|
|
153
153
|
*/
|
|
154
|
-
visibility:
|
|
154
|
+
visibility: 'visible' | 'hidden' | 'show-when-contents-loaded';
|
|
155
155
|
/**
|
|
156
156
|
* MacOS option for whether the window should be visible on all workspaces
|
|
157
157
|
*/
|
|
@@ -333,13 +333,13 @@ export interface DesktopifyApp2 {
|
|
|
333
333
|
*
|
|
334
334
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
335
335
|
*/
|
|
336
|
-
themeSource?:
|
|
336
|
+
themeSource?: 'system' | 'light' | 'dark';
|
|
337
337
|
/**
|
|
338
338
|
* Sets theme source for only mac
|
|
339
339
|
*
|
|
340
340
|
* See {@link https://www.electronjs.org/docs/api/native-theme#nativethemethemesource}
|
|
341
341
|
*/
|
|
342
|
-
themeSourceMac?:
|
|
342
|
+
themeSourceMac?: 'system' | 'light' | 'dark';
|
|
343
343
|
/**
|
|
344
344
|
* URL that crash reports will be POSTed to
|
|
345
345
|
*/
|
package/lib/desktopify2.js
CHANGED
|
@@ -7,50 +7,52 @@ exports.allowedWebPreferencesOptions = exports.allowedBrowserWindowConstructorOp
|
|
|
7
7
|
* when the window is created
|
|
8
8
|
*/
|
|
9
9
|
exports.allowedBrowserWindowConstructorOptions = [
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
'width',
|
|
11
|
+
'height',
|
|
12
12
|
// "x",
|
|
13
13
|
// "y",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
14
|
+
'useContentSize',
|
|
15
|
+
'center',
|
|
16
|
+
'minWidth',
|
|
17
|
+
'minHeight',
|
|
18
|
+
'maxWidth',
|
|
19
|
+
'maxHeight',
|
|
20
|
+
'resizable',
|
|
21
|
+
'movable',
|
|
22
|
+
'minimizable',
|
|
23
|
+
'maximizable',
|
|
24
|
+
'closable',
|
|
25
|
+
'focusable',
|
|
26
|
+
'alwaysOnTop',
|
|
27
|
+
'fullscreen',
|
|
28
|
+
'fullscreenable',
|
|
29
|
+
'simpleFullscreen',
|
|
30
|
+
'skipTaskbar',
|
|
31
|
+
'kiosk',
|
|
32
|
+
'icon',
|
|
33
|
+
'paintWhenInitiallyHidden',
|
|
34
|
+
'frame',
|
|
35
|
+
'acceptFirstMouse',
|
|
36
|
+
'disableAutoHideCursor',
|
|
37
|
+
'autoHideMenuBar',
|
|
38
|
+
'enableLargerThanScreen',
|
|
39
|
+
'backgroundColor',
|
|
40
|
+
'hasShadow',
|
|
41
|
+
'opacity',
|
|
42
|
+
'darkTheme',
|
|
43
|
+
'transparent',
|
|
44
|
+
'visualEffectState',
|
|
45
|
+
'titleBarStyle',
|
|
46
|
+
'trafficLightPosition',
|
|
47
47
|
// "roundedCorners",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
'fullscreenWindowTitle',
|
|
49
|
+
'thickFrame',
|
|
50
|
+
'type',
|
|
51
|
+
'vibrancy',
|
|
52
|
+
'zoomToPageWidth',
|
|
53
|
+
'tabbingIdentifier',
|
|
54
|
+
'webPreferences',
|
|
55
|
+
'titleBarOverlay',
|
|
54
56
|
];
|
|
55
57
|
/**
|
|
56
58
|
* Whitelist of allowed DesktopifyWindow Web Preferences Options.
|
|
@@ -58,22 +60,22 @@ exports.allowedBrowserWindowConstructorOptions = [
|
|
|
58
60
|
* when the window is created
|
|
59
61
|
*/
|
|
60
62
|
exports.allowedWebPreferencesOptions = [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
'devTools',
|
|
64
|
+
'zoomFactor',
|
|
65
|
+
'textAreasAreResizable',
|
|
66
|
+
'scrollBounce',
|
|
67
|
+
'defaultFontFamily',
|
|
68
|
+
'defaultFontSize',
|
|
69
|
+
'defaultMonospaceFontSize',
|
|
70
|
+
'minimumFontSize',
|
|
71
|
+
'defaultEncoding',
|
|
72
|
+
'backgroundThrottling',
|
|
73
|
+
'offscreen',
|
|
74
|
+
'safeDialogs',
|
|
75
|
+
'safeDialogsMessage',
|
|
76
|
+
'navigateOnDragDrop',
|
|
77
|
+
'autoplayPolicy',
|
|
78
|
+
'disableHtmlFullscreenWindowResize',
|
|
79
|
+
'accessibleTitle',
|
|
80
|
+
'spellcheck',
|
|
79
81
|
];
|
package/lib/getSiteInfo.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface IAppFromServerProps {
|
|
|
7
7
|
html?: string;
|
|
8
8
|
iconUrl?: string;
|
|
9
9
|
secret: string;
|
|
10
|
-
appType:
|
|
10
|
+
appType: 'app' | 'menubar' | 'tabbed' | 'electron';
|
|
11
11
|
}
|
|
12
12
|
interface IAppFromServerPropsMeta {
|
|
13
13
|
isFrameBlocked: boolean;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './toDesktop';
|
|
2
|
+
export * from './desktopify';
|
|
3
|
+
export * from './validations';
|
|
4
|
+
export * from './getSiteInfo';
|
|
5
|
+
export * from './plans';
|
|
6
6
|
export * from './base';
|
|
7
7
|
export * from './plugin';
|
|
8
|
-
export * from
|
|
8
|
+
export * from './desktopify2';
|
|
9
9
|
declare const schemaVersion: string;
|
|
10
10
|
export { schemaVersion };
|