custom-electron-titlebar 3.2.5 → 3.2.9
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/.vscode/launch.json +49 -0
- package/.vscode/tasks.json +34 -0
- package/README.md +15 -24
- package/_config.yml +1 -0
- package/{lib → build}/browser/browser.d.ts +0 -0
- package/{lib → build}/browser/browser.js +1 -0
- package/build/browser/browser.js.map +1 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +3 -1
- package/build/browser/event.js.map +1 -0
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib/base → build}/browser/iframe.js +1 -0
- package/build/browser/iframe.js.map +1 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +1 -0
- package/build/browser/keyboardEvent.js.map +1 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +1 -0
- package/build/browser/mouseEvent.js.map +1 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +1 -0
- package/build/common/arrays.js.map +1 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +1 -0
- package/build/common/async.js.map +1 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib/base → build}/common/charCode.js +1 -0
- package/build/common/charCode.js.map +1 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +1 -0
- package/build/common/color.js.map +1 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +17 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +2 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +1 -0
- package/build/common/iterator.js.map +1 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +1 -0
- package/build/common/keyCodes.js.map +1 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +1 -0
- package/build/common/lifecycle.js.map +1 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +1 -0
- package/build/common/linkedList.js.map +1 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +1 -0
- package/build/common/platform.js.map +1 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +1 -0
- package/build/index.js.map +1 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +39 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +71 -29
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +38 -34
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +31 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +72 -59
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/base/browser/browser.d.ts +0 -25
- package/lib/base/browser/browser.js +0 -117
- package/lib/base/browser/canIUse.d.ts +0 -18
- package/lib/base/browser/canIUse.js +0 -63
- package/lib/base/browser/dom.d.ts +0 -230
- package/lib/base/browser/dom.js +0 -1080
- package/lib/base/browser/event.d.ts +0 -12
- package/lib/base/browser/event.js +0 -28
- package/lib/base/browser/iframe.d.ts +0 -33
- package/lib/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/base/browser/keyboardEvent.js +0 -256
- package/lib/base/browser/mouseEvent.d.ts +0 -69
- package/lib/base/browser/mouseEvent.js +0 -146
- package/lib/base/common/arrays.d.ts +0 -149
- package/lib/base/common/arrays.js +0 -549
- package/lib/base/common/async.d.ts +0 -259
- package/lib/base/common/async.js +0 -728
- package/lib/base/common/cancellation.d.ts +0 -29
- package/lib/base/common/cancellation.js +0 -114
- package/lib/base/common/charCode.d.ts +0 -415
- package/lib/base/common/color.d.ts +0 -163
- package/lib/base/common/color.js +0 -495
- package/lib/base/common/errors.d.ts +0 -65
- package/lib/base/common/errors.js +0 -164
- package/lib/base/common/event.d.ts +0 -248
- package/lib/base/common/event.js +0 -703
- package/lib/base/common/functional.d.ts +0 -1
- package/lib/base/common/functional.js +0 -21
- package/lib/base/common/iterator.d.ts +0 -16
- package/lib/base/common/iterator.js +0 -82
- package/lib/base/common/keyCodes.d.ts +0 -268
- package/lib/base/common/keyCodes.js +0 -292
- package/lib/base/common/lifecycle.d.ts +0 -67
- package/lib/base/common/lifecycle.js +0 -234
- package/lib/base/common/linkedList.d.ts +0 -16
- package/lib/base/common/linkedList.js +0 -128
- package/lib/base/common/network.d.ts +0 -65
- package/lib/base/common/network.js +0 -124
- package/lib/base/common/path.d.ts +0 -39
- package/lib/base/common/path.js +0 -1407
- package/lib/base/common/platform.d.ts +0 -53
- package/lib/base/common/platform.js +0 -176
- package/lib/base/common/process.d.ts +0 -5
- package/lib/base/common/process.js +0 -18
- package/lib/base/common/sequence.d.ts +0 -27
- package/lib/base/common/sequence.js +0 -32
- package/lib/base/common/uri.d.ts +0 -153
- package/lib/base/common/uri.js +0 -612
- package/lib/browser/iframe.js +0 -109
- package/lib/common/charCode.js +0 -6
- package/lib/menu.d.ts +0 -53
- package/lib/menu.js +0 -532
- package/lib/menuitem.d.ts +0 -46
- package/lib/menuitem.js +0 -295
- package/lib/vs/base/browser/browser.d.ts +0 -25
- package/lib/vs/base/browser/browser.js +0 -117
- package/lib/vs/base/browser/canIUse.d.ts +0 -18
- package/lib/vs/base/browser/canIUse.js +0 -63
- package/lib/vs/base/browser/dom.d.ts +0 -230
- package/lib/vs/base/browser/dom.js +0 -1080
- package/lib/vs/base/browser/event.d.ts +0 -12
- package/lib/vs/base/browser/event.js +0 -28
- package/lib/vs/base/browser/iframe.d.ts +0 -33
- package/lib/vs/base/browser/iframe.js +0 -109
- package/lib/vs/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/vs/base/browser/keyboardEvent.js +0 -256
- package/lib/vs/base/browser/mouseEvent.d.ts +0 -69
- package/lib/vs/base/browser/mouseEvent.js +0 -146
- package/lib/vs/base/common/arrays.d.ts +0 -149
- package/lib/vs/base/common/arrays.js +0 -549
- package/lib/vs/base/common/async.d.ts +0 -259
- package/lib/vs/base/common/async.js +0 -728
- package/lib/vs/base/common/cancellation.d.ts +0 -29
- package/lib/vs/base/common/cancellation.js +0 -114
- package/lib/vs/base/common/charCode.d.ts +0 -415
- package/lib/vs/base/common/charCode.js +0 -6
- package/lib/vs/base/common/color.d.ts +0 -163
- package/lib/vs/base/common/color.js +0 -495
- package/lib/vs/base/common/errors.d.ts +0 -65
- package/lib/vs/base/common/errors.js +0 -164
- package/lib/vs/base/common/event.d.ts +0 -248
- package/lib/vs/base/common/event.js +0 -703
- package/lib/vs/base/common/functional.d.ts +0 -1
- package/lib/vs/base/common/functional.js +0 -21
- package/lib/vs/base/common/iterator.d.ts +0 -16
- package/lib/vs/base/common/iterator.js +0 -82
- package/lib/vs/base/common/keyCodes.d.ts +0 -268
- package/lib/vs/base/common/keyCodes.js +0 -292
- package/lib/vs/base/common/lifecycle.d.ts +0 -67
- package/lib/vs/base/common/lifecycle.js +0 -234
- package/lib/vs/base/common/linkedList.d.ts +0 -16
- package/lib/vs/base/common/linkedList.js +0 -128
- package/lib/vs/base/common/network.d.ts +0 -65
- package/lib/vs/base/common/network.js +0 -124
- package/lib/vs/base/common/path.d.ts +0 -39
- package/lib/vs/base/common/path.js +0 -1407
- package/lib/vs/base/common/platform.d.ts +0 -53
- package/lib/vs/base/common/platform.js +0 -176
- package/lib/vs/base/common/process.d.ts +0 -5
- package/lib/vs/base/common/process.js +0 -18
- package/lib/vs/base/common/sequence.d.ts +0 -27
- package/lib/vs/base/common/sequence.js +0 -32
- package/lib/vs/base/common/uri.d.ts +0 -153
- package/lib/vs/base/common/uri.js +0 -612
package/lib/browser/iframe.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.IframeUtils = void 0;
|
|
8
|
-
let hasDifferentOriginAncestorFlag = false;
|
|
9
|
-
let sameOriginWindowChainCache = null;
|
|
10
|
-
function getParentWindowIfSameOrigin(w) {
|
|
11
|
-
if (!w.parent || w.parent === w) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
// Cannot really tell if we have access to the parent window unless we try to access something in it
|
|
15
|
-
try {
|
|
16
|
-
let location = w.location;
|
|
17
|
-
let parentLocation = w.parent.location;
|
|
18
|
-
if (location.protocol !== parentLocation.protocol || location.hostname !== parentLocation.hostname || location.port !== parentLocation.port) {
|
|
19
|
-
hasDifferentOriginAncestorFlag = true;
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
hasDifferentOriginAncestorFlag = true;
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return w.parent;
|
|
28
|
-
}
|
|
29
|
-
function findIframeElementInParentWindow(parentWindow, childWindow) {
|
|
30
|
-
let parentWindowIframes = parentWindow.document.getElementsByTagName('iframe');
|
|
31
|
-
let iframe;
|
|
32
|
-
for (let i = 0, len = parentWindowIframes.length; i < len; i++) {
|
|
33
|
-
iframe = parentWindowIframes[i];
|
|
34
|
-
if (iframe.contentWindow === childWindow) {
|
|
35
|
-
return iframe;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
class IframeUtils {
|
|
41
|
-
/**
|
|
42
|
-
* Returns a chain of embedded windows with the same origin (which can be accessed programmatically).
|
|
43
|
-
* Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin.
|
|
44
|
-
* To distinguish if at one point the current execution environment is running inside a window with a different origin, see hasDifferentOriginAncestor()
|
|
45
|
-
*/
|
|
46
|
-
static getSameOriginWindowChain() {
|
|
47
|
-
if (!sameOriginWindowChainCache) {
|
|
48
|
-
sameOriginWindowChainCache = [];
|
|
49
|
-
let w = window;
|
|
50
|
-
let parent;
|
|
51
|
-
do {
|
|
52
|
-
parent = getParentWindowIfSameOrigin(w);
|
|
53
|
-
if (parent) {
|
|
54
|
-
sameOriginWindowChainCache.push({
|
|
55
|
-
window: w,
|
|
56
|
-
iframeElement: findIframeElementInParentWindow(parent, w)
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
sameOriginWindowChainCache.push({
|
|
61
|
-
window: w,
|
|
62
|
-
iframeElement: null
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
w = parent;
|
|
66
|
-
} while (w);
|
|
67
|
-
}
|
|
68
|
-
return sameOriginWindowChainCache.slice(0);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Returns true if the current execution environment is chained in a list of iframes which at one point ends in a window with a different origin.
|
|
72
|
-
* Returns false if the current execution environment is not running inside an iframe or if the entire chain of iframes have the same origin.
|
|
73
|
-
*/
|
|
74
|
-
static hasDifferentOriginAncestor() {
|
|
75
|
-
if (!sameOriginWindowChainCache) {
|
|
76
|
-
this.getSameOriginWindowChain();
|
|
77
|
-
}
|
|
78
|
-
return hasDifferentOriginAncestorFlag;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Returns the position of `childWindow` relative to `ancestorWindow`
|
|
82
|
-
*/
|
|
83
|
-
static getPositionOfChildWindowRelativeToAncestorWindow(childWindow, ancestorWindow) {
|
|
84
|
-
if (!ancestorWindow || childWindow === ancestorWindow) {
|
|
85
|
-
return {
|
|
86
|
-
top: 0,
|
|
87
|
-
left: 0
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
let top = 0, left = 0;
|
|
91
|
-
let windowChain = this.getSameOriginWindowChain();
|
|
92
|
-
for (const windowChainEl of windowChain) {
|
|
93
|
-
if (windowChainEl.window === ancestorWindow) {
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
if (!windowChainEl.iframeElement) {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
let boundingRect = windowChainEl.iframeElement.getBoundingClientRect();
|
|
100
|
-
top += boundingRect.top;
|
|
101
|
-
left += boundingRect.left;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
top: top,
|
|
105
|
-
left: left
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
exports.IframeUtils = IframeUtils;
|
package/lib/common/charCode.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/menu.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Color } from "./base/common/color";
|
|
2
|
-
import { CETMenuItem, IMenuItem } from "./menuitem";
|
|
3
|
-
import { Disposable } from "./base/common/lifecycle";
|
|
4
|
-
import { Event } from "./base/common/event";
|
|
5
|
-
import { MenuItem } from "electron";
|
|
6
|
-
export declare const MENU_MNEMONIC_REGEX: RegExp;
|
|
7
|
-
export declare const MENU_ESCAPED_MNEMONIC_REGEX: RegExp;
|
|
8
|
-
export interface IMenuOptions {
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
enableMnemonics?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface IMenuStyle {
|
|
13
|
-
foregroundColor?: Color;
|
|
14
|
-
backgroundColor?: Color;
|
|
15
|
-
selectionForegroundColor?: Color;
|
|
16
|
-
selectionBackgroundColor?: Color;
|
|
17
|
-
separatorColor?: Color;
|
|
18
|
-
}
|
|
19
|
-
interface ISubMenuData {
|
|
20
|
-
parent: CETMenu;
|
|
21
|
-
submenu?: CETMenu;
|
|
22
|
-
}
|
|
23
|
-
export declare class CETMenu extends Disposable {
|
|
24
|
-
items: IMenuItem[];
|
|
25
|
-
private focusedItem?;
|
|
26
|
-
private readonly menuContainer;
|
|
27
|
-
private mnemonics;
|
|
28
|
-
private readonly options;
|
|
29
|
-
private readonly closeSubMenu;
|
|
30
|
-
private triggerKeys;
|
|
31
|
-
parentData: ISubMenuData;
|
|
32
|
-
private _onDidCancel;
|
|
33
|
-
get onDidCancel(): Event<void>;
|
|
34
|
-
constructor(container: HTMLElement, options?: IMenuOptions, closeSubMenu?: () => void);
|
|
35
|
-
private isTriggerKeyEvent;
|
|
36
|
-
private updateFocusedItem;
|
|
37
|
-
getContainer(): HTMLElement;
|
|
38
|
-
createMenu(items: MenuItem[]): void;
|
|
39
|
-
focus(index?: number): void;
|
|
40
|
-
focus(selectFirst?: boolean): void;
|
|
41
|
-
private focusNext;
|
|
42
|
-
private focusPrevious;
|
|
43
|
-
private updateFocus;
|
|
44
|
-
private doTrigger;
|
|
45
|
-
private cancel;
|
|
46
|
-
dispose(): void;
|
|
47
|
-
style(style: IMenuStyle): void;
|
|
48
|
-
private focusItemByElement;
|
|
49
|
-
private setFocusedItem;
|
|
50
|
-
setMnemonics(item: CETMenuItem | null): void;
|
|
51
|
-
}
|
|
52
|
-
export declare function cleanMnemonic(label: string): string;
|
|
53
|
-
export {};
|