custom-electron-titlebar 4.2.0-beta.0 → 4.2.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.
Files changed (53) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +83 -71
  3. package/package.json +68 -65
  4. package/dist/base/browser/browser.d.ts +0 -26
  5. package/dist/base/browser/browser.js +0 -317
  6. package/dist/base/browser/event.d.ts +0 -12
  7. package/dist/base/browser/event.js +0 -215
  8. package/dist/base/browser/keyboardEvent.d.ts +0 -38
  9. package/dist/base/browser/keyboardEvent.js +0 -466
  10. package/dist/base/browser/mouseEvent.d.ts +0 -61
  11. package/dist/base/browser/mouseEvent.js +0 -327
  12. package/dist/base/common/arrays.d.ts +0 -4
  13. package/dist/base/common/arrays.js +0 -199
  14. package/dist/base/common/async.d.ts +0 -35
  15. package/dist/base/common/async.js +0 -280
  16. package/dist/base/common/charCode.d.ts +0 -405
  17. package/dist/base/common/charCode.js +0 -9
  18. package/dist/base/common/color.d.ts +0 -159
  19. package/dist/base/common/color.js +0 -708
  20. package/dist/base/common/dom.d.ts +0 -185
  21. package/dist/base/common/dom.js +0 -1338
  22. package/dist/base/common/event.d.ts +0 -213
  23. package/dist/base/common/event.js +0 -804
  24. package/dist/base/common/iterator.d.ts +0 -69
  25. package/dist/base/common/iterator.js +0 -381
  26. package/dist/base/common/keyCodes.d.ts +0 -273
  27. package/dist/base/common/keyCodes.js +0 -465
  28. package/dist/base/common/lifecycle.d.ts +0 -17
  29. package/dist/base/common/lifecycle.js +0 -258
  30. package/dist/base/common/linkedList.d.ts +0 -17
  31. package/dist/base/common/linkedList.js +0 -319
  32. package/dist/base/common/platform.d.ts +0 -33
  33. package/dist/base/common/platform.js +0 -302
  34. package/dist/consts.d.ts +0 -11
  35. package/dist/consts.js +0 -199
  36. package/dist/index.d.ts +0 -3
  37. package/dist/index.js +0 -211
  38. package/dist/main/attach-titlebar-to-window.d.ts +0 -3
  39. package/dist/main/attach-titlebar-to-window.js +0 -207
  40. package/dist/main/index.d.ts +0 -3
  41. package/dist/main/index.js +0 -202
  42. package/dist/main/setup-titlebar.d.ts +0 -2
  43. package/dist/main/setup-titlebar.js +0 -232
  44. package/dist/menubar/index.d.ts +0 -16
  45. package/dist/menubar/index.js +0 -236
  46. package/dist/menubar/menubar-options.d.ts +0 -33
  47. package/dist/menubar/menubar-options.js +0 -9
  48. package/dist/titlebar/index.d.ts +0 -88
  49. package/dist/titlebar/index.js +0 -601
  50. package/dist/titlebar/options.d.ts +0 -58
  51. package/dist/titlebar/options.js +0 -9
  52. package/dist/titlebar/themebar.d.ts +0 -20
  53. package/dist/titlebar/themebar.js +0 -267
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 - now Alex Torres
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Alex Torres
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,71 +1,83 @@
1
- # Custom Electron Titlebar
2
-
3
- This project is a typescript library for electron that allows you to configure a fully customizable title bar.
4
-
5
- > ## 📢 NOTE:
6
- > ### This is a Beta version, so it may have some bugs and not all the features of the stable version
7
-
8
- [![LICENSE](https://img.shields.io/github/license/AlexTorresSk/custom-electron-titlebar.svg)](https://github.com/AlexTorresSk/custom-electron-titlebar/blob/master/LICENSE)
9
- [![NPM Version](https://img.shields.io/npm/v/custom-electron-titlebar.svg)](https://npmjs.org/package/custom-electron-titlebar)
10
- [![install size](https://packagephobia.com/badge?p=custom-electron-titlebar@4.2.0-beta.0)](https://packagephobia.com/result?p=custom-electron-titlebar@4.2.0-beta.0)
11
-
12
- Standard Title Bar
13
-
14
- ![Screenshot 1](screenshots/cet-screen-1.png)
15
-
16
- Bottom Menu Bar
17
-
18
- ![Screenshot 2](screenshots/cet-screen-2.png)
19
-
20
- # 📦 Installing
21
- You can install this package with `npm`.
22
- ```sh
23
- npm install custom-electron-titlebar
24
- ```
25
-
26
- # 🛠️ Usage
27
- The implementation is done as follows:
28
-
29
- In the main application file (main.js or .ts)
30
- ```js
31
- import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";
32
-
33
- // setup the titlebar main process
34
- setupTitlebar();
35
-
36
- function createWindow() {
37
- // Create the browser window.
38
- const mainWindow = new BrowserWindow({
39
- width: 800,
40
- height: 600,
41
- titleBarStyle: 'hidden',
42
- //frame: false, // needed if process.versions.electron < 14
43
- webPreferences: {
44
- sandbox: false,
45
- preload: path.join(__dirname, 'preload.js')
46
- }
47
- });
48
-
49
- ...
50
-
51
- // attach fullScreen(f11 and not 'maximized') && focus listeners
52
- attachTitlebarToWindow(mainWindow);
53
- }
54
- ```
55
-
56
- In the preload file (preload.js or .ts)
57
- ```js
58
- import { Titlebar } from "custom-electron-titlebar";
59
-
60
- window.addEventListener('DOMContentLoaded', () => {
61
- // Title bar implementation
62
- new Titlebar();
63
- });
64
- ```
65
- To see the options you can include in the Title Bar constructor, such as color of elements, icons, menu position, and much more, and the methods you can use, go to the [wiki](https://github.com/AlexTorresSk/custom-electron-titlebar/wiki)
66
-
67
- ## 💰 Support
68
- If you want to support my development, you can do so by donating through [Buy me a coffee](https://www.buymeacoffee.com/AlexTorresSk) or [Patreon](https://www.patreon.com/AlexTorresSk)
69
-
70
- ## ✅ License
71
- This project is under the [MIT](https://github.com/AlexTorresSk/custom-electron-titlebar/blob/master/LICENSE) license.
1
+ # Custom Electron Titlebar
2
+
3
+ This project is a typescript library for electron that allows you to configure a fully customizable title bar.
4
+
5
+ [![LICENSE](https://img.shields.io/github/license/AlexTorresDev/custom-electron-titlebar.svg)](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE)
6
+ [![NPM Version](https://img.shields.io/npm/v/custom-electron-titlebar.svg)](https://npmjs.org/package/custom-electron-titlebar)
7
+ [![install size](https://packagephobia.com/badge?p=custom-electron-titlebar)](https://packagephobia.com/result?p=custom-electron-titlebar)
8
+
9
+ [📄 Visit Documentation](https://cet.alextrs.dev)
10
+
11
+ Standard Title Bar
12
+
13
+ ![Screenshot 1](screenshots/cet-1.png)
14
+
15
+ Bottom Menu Bar
16
+
17
+ ![Screenshot 2](screenshots/cet-2.png)
18
+
19
+ Menu
20
+
21
+ ![Screenshot 3](screenshots/cet-3.png)
22
+
23
+ Custom color
24
+
25
+ ![Screenshot 4](screenshots/cet-4.png)
26
+
27
+ # 📦 Installing
28
+ You can install this package with `npm`.
29
+ ```sh
30
+ npm install custom-electron-titlebar
31
+ ```
32
+
33
+ # 🛠️ Usage
34
+ The implementation is done as follows:
35
+
36
+ In the main application file (main.js or .ts)
37
+ ```js
38
+ import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";
39
+
40
+ // setup the titlebar main process
41
+ setupTitlebar();
42
+
43
+ function createWindow() {
44
+ // Create the browser window.
45
+ const mainWindow = new BrowserWindow({
46
+ width: 800,
47
+ height: 600,
48
+ titleBarStyle: 'hidden',
49
+ //frame: false, // needed if process.versions.electron < 14
50
+ webPreferences: {
51
+ sandbox: false,
52
+ preload: path.join(__dirname, 'preload.js')
53
+ }
54
+ });
55
+
56
+ ...
57
+
58
+ // attach fullScreen(f11 and not 'maximized') && focus listeners
59
+ attachTitlebarToWindow(mainWindow);
60
+ }
61
+ ```
62
+
63
+ In the preload file (preload.js or .ts)
64
+ ```js
65
+ import { Titlebar } from "custom-electron-titlebar";
66
+
67
+ window.addEventListener('DOMContentLoaded', () => {
68
+ // Title bar implementation
69
+ new Titlebar();
70
+ });
71
+ ```
72
+ To see the options you can include in the Title Bar constructor, such as color of elements, icons, menu position, and much more, and the methods you can use, go to the [wiki](https://github.com/AlexTorresDev/custom-electron-titlebar/wiki)
73
+
74
+ ## 💰 Support
75
+ If you want to support my development, you can do so by donating through [Buy me a coffee](https://www.buymeacoffee.com/AlexTorresDev)
76
+
77
+
78
+ ## 📝 Collaborators
79
+ I would like to express my sincere gratitude to all the people who have collaborated in the development and advancement of this project. I appreciate your contributions.
80
+
81
+
82
+ ## ✅ License
83
+ This project is under the [MIT](https://github.com/AlexTorresDev/custom-electron-titlebar/blob/master/LICENSE) license.
package/package.json CHANGED
@@ -1,66 +1,69 @@
1
- {
2
- "name": "custom-electron-titlebar",
3
- "version": "4.2.0-beta.0",
4
- "description": "Library for electron that allows you to configure a fully customizable title bar.",
5
- "types": "./dist/index.d.ts",
6
- "typesVersions": {
7
- "*": {
8
- "main": [
9
- "./dist/main/index.d.ts"
10
- ]
11
- }
12
- },
13
- "exports": {
14
- ".": "./dist/index.js",
15
- "./main": "./dist/main/index.js"
16
- },
17
- "scripts": {
18
- "clean": "rimraf ./dist",
19
- "build": "tsc && babel ./dist --out-dir ./dist --extensions \".js\"",
20
- "example": "electron example/main.js",
21
- "start": "npm run clean && npm run build && npm run example"
22
- },
23
- "author": "AlexTorresSk <alextorressk@gmail.com>",
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "https://github.com/AlexTorresSk/custom-electron-titlebar.git"
28
- },
29
- "keywords": [
30
- "typescript",
31
- "electron",
32
- "title bar",
33
- "menubar",
34
- "windows",
35
- "linux"
36
- ],
37
- "bugs": {
38
- "url": "https://github.com/AlexTorresSk/custom-electron-titlebar/issues"
39
- },
40
- "homepage": "https://github.com/AlexTorresSk/custom-electron-titlebar#readme",
41
- "directories": {
42
- "example": "example",
43
- "dist": "dist"
44
- },
45
- "peerDependencies": {
46
- "electron": ">20.0.0"
47
- },
48
- "devDependencies": {
49
- "@babel/cli": "7.20.7",
50
- "@babel/core": "7.20.12",
51
- "@typescript-eslint/eslint-plugin": "5.52.0",
52
- "@typescript-eslint/parser": "5.52.0",
53
- "babel-plugin-import-require-as-string": "1.0.2",
54
- "babel-plugin-module-resolver": "5.0.0",
55
- "babel-plugin-rewire": "1.2.0",
56
- "electron": "23.1.0",
57
- "eslint": "8.34.0",
58
- "eslint-config-prettier": "8.6.0",
59
- "eslint-config-standard": "17.0.0",
60
- "eslint-plugin-import": "2.27.5",
61
- "eslint-plugin-n": "15.6.1",
62
- "eslint-plugin-promise": "6.1.1",
63
- "rimraf": "4.1.2",
64
- "typescript": "4.9.5"
65
- }
1
+ {
2
+ "name": "custom-electron-titlebar",
3
+ "version": "4.2.0",
4
+ "description": "Library for electron that allows you to configure a fully customizable title bar.",
5
+ "types": "./dist/index.d.ts",
6
+ "typesVersions": {
7
+ "*": {
8
+ "main": [
9
+ "./dist/main/index.d.ts"
10
+ ]
11
+ }
12
+ },
13
+ "exports": {
14
+ ".": "./dist/index.js",
15
+ "./main": "./dist/main/index.js"
16
+ },
17
+ "scripts": {
18
+ "clean": "rimraf ./dist",
19
+ "build:package": "tsc && tsc-alias",
20
+ "build:babel": "babel ./dist --out-dir ./dist --extensions \".js\"",
21
+ "start": "electron example/main.js",
22
+ "dev": "npm run build && npm run start",
23
+ "build": "npm run clean && npm run build:package && npm run build:babel"
24
+ },
25
+ "author": "AlexTorresDev <alextorressk@gmail.com>",
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/AlexTorresDev/custom-electron-titlebar.git"
30
+ },
31
+ "keywords": [
32
+ "typescript",
33
+ "electron",
34
+ "title bar",
35
+ "menubar",
36
+ "windows",
37
+ "linux"
38
+ ],
39
+ "bugs": {
40
+ "url": "https://github.com/AlexTorresDev/custom-electron-titlebar/issues"
41
+ },
42
+ "homepage": "https://github.com/AlexTorresDev/custom-electron-titlebar#readme",
43
+ "directories": {
44
+ "example": "example",
45
+ "dist": "dist"
46
+ },
47
+ "peerDependencies": {
48
+ "electron": ">20.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@babel/cli": "7.21.5",
52
+ "@babel/core": "7.21.8",
53
+ "@typescript-eslint/eslint-plugin": "5.59.2",
54
+ "@typescript-eslint/parser": "5.59.2",
55
+ "babel-plugin-import-require-as-string": "1.0.2",
56
+ "babel-plugin-module-resolver": "5.0.0",
57
+ "babel-plugin-rewire": "1.2.0",
58
+ "electron": "24.2.0",
59
+ "eslint": "8.40.0",
60
+ "eslint-config-prettier": "8.8.0",
61
+ "eslint-config-standard": "17.0.0",
62
+ "eslint-plugin-import": "2.27.5",
63
+ "eslint-plugin-n": "15.7.0",
64
+ "eslint-plugin-promise": "6.1.1",
65
+ "rimraf": "5.0.0",
66
+ "tsc-alias": "1.8.6",
67
+ "typescript": "5.0.4"
68
+ }
66
69
  }
@@ -1,26 +0,0 @@
1
- import { Event } from 'base/common/event';
2
- import { IDisposable } from 'base/common/lifecycle';
3
- /** A zoom index, e.g. 1, 2, 3 */
4
- export declare function setZoomLevel(zoomLevel: number, isTrusted: boolean): void;
5
- export declare function getZoomLevel(): number;
6
- /** Returns the time (in ms) since the zoom level was changed */
7
- export declare function getTimeSinceLastZoomLevelChanged(): number;
8
- export declare function onDidChangeZoomLevel(callback: (zoomLevel: number) => void): IDisposable;
9
- /** The zoom scale for an index, e.g. 1, 1.2, 1.4 */
10
- export declare function getZoomFactor(): number;
11
- export declare function setZoomFactor(zoomFactor: number): void;
12
- export declare function getPixelRatio(): number;
13
- export declare function setFullscreen(fullscreen: boolean): void;
14
- export declare function isFullscreen(): boolean;
15
- export declare const onDidChangeFullscreen: Event<void>;
16
- export declare const isIE: boolean;
17
- export declare const isEdge: boolean;
18
- export declare const isEdgeOrIE: boolean;
19
- export declare const isOpera: boolean;
20
- export declare const isFirefox: boolean;
21
- export declare const isWebKit: boolean;
22
- export declare const isChrome: boolean;
23
- export declare const isSafari: boolean;
24
- export declare const isWebkitWebView: boolean;
25
- export declare const isIPad: boolean;
26
- export declare const isEdgeWebView: boolean;