custom-electron-titlebar 4.2.2 → 4.2.4

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 (65) hide show
  1. package/{dist/base → base}/browser/keyboardEvent.js +0 -2
  2. package/{dist/menubar → menubar}/index.js +7 -4
  3. package/package.json +13 -11
  4. package/{dist/titlebar → titlebar}/index.js +4 -0
  5. /package/{dist/base → base}/browser/browser.d.ts +0 -0
  6. /package/{dist/base → base}/browser/browser.js +0 -0
  7. /package/{dist/base → base}/browser/event.d.ts +0 -0
  8. /package/{dist/base → base}/browser/event.js +0 -0
  9. /package/{dist/base → base}/browser/keyboardEvent.d.ts +0 -0
  10. /package/{dist/base → base}/browser/mouseEvent.d.ts +0 -0
  11. /package/{dist/base → base}/browser/mouseEvent.js +0 -0
  12. /package/{dist/base → base}/browser/touch.d.ts +0 -0
  13. /package/{dist/base → base}/browser/touch.js +0 -0
  14. /package/{dist/base → base}/common/arrays.d.ts +0 -0
  15. /package/{dist/base → base}/common/arrays.js +0 -0
  16. /package/{dist/base → base}/common/async.d.ts +0 -0
  17. /package/{dist/base → base}/common/async.js +0 -0
  18. /package/{dist/base → base}/common/charCode.d.ts +0 -0
  19. /package/{dist/base → base}/common/charCode.js +0 -0
  20. /package/{dist/base → base}/common/color.d.ts +0 -0
  21. /package/{dist/base → base}/common/color.js +0 -0
  22. /package/{dist/base → base}/common/decorators.d.ts +0 -0
  23. /package/{dist/base → base}/common/decorators.js +0 -0
  24. /package/{dist/base → base}/common/dom.d.ts +0 -0
  25. /package/{dist/base → base}/common/dom.js +0 -0
  26. /package/{dist/base → base}/common/event.d.ts +0 -0
  27. /package/{dist/base → base}/common/event.js +0 -0
  28. /package/{dist/base → base}/common/iterator.d.ts +0 -0
  29. /package/{dist/base → base}/common/iterator.js +0 -0
  30. /package/{dist/base → base}/common/keyCodes.d.ts +0 -0
  31. /package/{dist/base → base}/common/keyCodes.js +0 -0
  32. /package/{dist/base → base}/common/lifecycle.d.ts +0 -0
  33. /package/{dist/base → base}/common/lifecycle.js +0 -0
  34. /package/{dist/base → base}/common/linkedList.d.ts +0 -0
  35. /package/{dist/base → base}/common/linkedList.js +0 -0
  36. /package/{dist/base → base}/common/platform.d.ts +0 -0
  37. /package/{dist/base → base}/common/platform.js +0 -0
  38. /package/{dist/base → base}/common/strings.d.ts +0 -0
  39. /package/{dist/base → base}/common/strings.js +0 -0
  40. /package/{dist/consts.d.ts → consts.d.ts} +0 -0
  41. /package/{dist/consts.js → consts.js} +0 -0
  42. /package/{dist/index.d.ts → index.d.ts} +0 -0
  43. /package/{dist/index.js → index.js} +0 -0
  44. /package/{dist/main → main}/attach-titlebar-to-window.d.ts +0 -0
  45. /package/{dist/main → main}/attach-titlebar-to-window.js +0 -0
  46. /package/{dist/main → main}/index.d.ts +0 -0
  47. /package/{dist/main → main}/index.js +0 -0
  48. /package/{dist/main → main}/setup-titlebar.d.ts +0 -0
  49. /package/{dist/main → main}/setup-titlebar.js +0 -0
  50. /package/{dist/menubar → menubar}/index.d.ts +0 -0
  51. /package/{dist/menubar → menubar}/menu/index.d.ts +0 -0
  52. /package/{dist/menubar → menubar}/menu/index.js +0 -0
  53. /package/{dist/menubar → menubar}/menu/item.d.ts +0 -0
  54. /package/{dist/menubar → menubar}/menu/item.js +0 -0
  55. /package/{dist/menubar → menubar}/menu/separator.d.ts +0 -0
  56. /package/{dist/menubar → menubar}/menu/separator.js +0 -0
  57. /package/{dist/menubar → menubar}/menu/submenu.d.ts +0 -0
  58. /package/{dist/menubar → menubar}/menu/submenu.js +0 -0
  59. /package/{dist/menubar → menubar}/menubar-options.d.ts +0 -0
  60. /package/{dist/menubar → menubar}/menubar-options.js +0 -0
  61. /package/{dist/titlebar → titlebar}/index.d.ts +0 -0
  62. /package/{dist/titlebar → titlebar}/options.d.ts +0 -0
  63. /package/{dist/titlebar → titlebar}/options.js +0 -0
  64. /package/{dist/titlebar → titlebar}/themebar.d.ts +0 -0
  65. /package/{dist/titlebar → titlebar}/themebar.js +0 -0
@@ -210,9 +210,7 @@ class StandardKeyboardEvent {
210
210
  this.metaKey = this.metaKey || this.keyCode === 57 /* KeyCode.Meta */;
211
211
  this._asKeybinding = this._computeKeybinding();
212
212
  this._asRuntimeKeybinding = this._computeRuntimeKeybinding();
213
- // console.log(`code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`);
214
213
  }
215
-
216
214
  preventDefault() {
217
215
  if (this.browserEvent && this.browserEvent.preventDefault) {
218
216
  this.browserEvent.preventDefault();
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", {
39
39
  value: true
40
40
  });
41
41
  exports.MenuBar = void 0;
42
+ const electron_1 = require("electron");
42
43
  const DOM = _get__("__importStar")(require("../base/common/dom"));
43
44
  const event_1 = require("../base/common/event");
44
45
  const lifecycle_1 = require("../base/common/lifecycle");
@@ -153,7 +154,6 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
153
154
  if (!this.options.enableMnemonics || !e.altKey || e.ctrlKey || e.defaultPrevented) {
154
155
  return;
155
156
  }
156
- console.log(this.mnemonics);
157
157
  const key = e.key.toLocaleLowerCase();
158
158
  if (!this.mnemonics.has(key)) {
159
159
  return;
@@ -730,9 +730,6 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
730
730
  }
731
731
  }
732
732
  updateMnemonicVisibility(visible) {
733
- console.log({
734
- visible
735
- });
736
733
  if (this.menus) {
737
734
  this.menus.forEach(menuBarMenu => {
738
735
  if (menuBarMenu.titleElement && menuBarMenu.titleElement.children.length) {
@@ -769,6 +766,10 @@ class MenuBar extends _get__("lifecycle_1").Disposable {
769
766
  return this._onFocusStateChange.event;
770
767
  }
771
768
  onMenuTriggered(menuIndex, clicked) {
769
+ if (!this.menus[menuIndex].actions) {
770
+ _get__("electron_1").ipcRenderer.send('menu-event', menuIndex + 1);
771
+ return;
772
+ }
772
773
  if (this.isOpen) {
773
774
  if (this.isCurrentMenu(menuIndex)) {
774
775
  this.setUnfocusedState();
@@ -1019,6 +1020,8 @@ function _get_original__(variableName) {
1019
1020
  return lifecycle_1;
1020
1021
  case "strings":
1021
1022
  return strings;
1023
+ case "electron_1":
1024
+ return electron_1;
1022
1025
  case "keyCodes_1":
1023
1026
  return keyCodes_1;
1024
1027
  }
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "custom-electron-titlebar",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "Library for electron that allows you to configure a fully customizable title bar.",
5
- "types": "./dist/index.d.ts",
5
+ "types": "./index.d.ts",
6
+ "main": "./index.js",
6
7
  "typesVersions": {
7
8
  "*": {
8
9
  "main": [
9
- "./dist/main/index.d.ts"
10
+ "./main/index.d.ts"
10
11
  ]
11
12
  }
12
13
  },
13
14
  "exports": {
14
- ".": "./dist/index.js",
15
- "./main": "./dist/main/index.js"
15
+ ".": "./index.js",
16
+ "./main": "./main/index.js"
16
17
  },
17
18
  "scripts": {
18
19
  "clean": "rimraf ./dist",
@@ -20,7 +21,8 @@
20
21
  "build:babel": "babel ./dist --out-dir ./dist --extensions \".js\"",
21
22
  "start": "electron example/main.js",
22
23
  "dev": "npm run build && npm run start",
23
- "build": "npm run clean && npm run build:package && npm run build:babel"
24
+ "build": "npm run clean && npm run build:package && npm run build:babel",
25
+ "test": ""
24
26
  },
25
27
  "author": "AlexTorresDev <alextorressk@gmail.com>",
26
28
  "license": "MIT",
@@ -40,10 +42,6 @@
40
42
  "url": "https://github.com/AlexTorresDev/custom-electron-titlebar/issues"
41
43
  },
42
44
  "homepage": "https://github.com/AlexTorresDev/custom-electron-titlebar#readme",
43
- "directories": {
44
- "example": "example",
45
- "dist": "dist"
46
- },
47
45
  "peerDependencies": {
48
46
  "electron": ">20.0.0"
49
47
  },
@@ -63,7 +61,11 @@
63
61
  "eslint-plugin-n": "15.7.0",
64
62
  "eslint-plugin-promise": "6.1.1",
65
63
  "rimraf": "5.0.0",
64
+ "standard": "17.1.0",
66
65
  "tsc-alias": "1.8.6",
67
66
  "typescript": "5.0.4"
67
+ },
68
+ "eslintConfig": {
69
+ "extends": "./node_modules/standard/eslintrc.json"
68
70
  }
69
- }
71
+ }
@@ -178,6 +178,10 @@ class CustomTitlebar extends _get__("themebar_1").ThemeBar {
178
178
  (0, _get__("dom_1").append)(this.titlebar, this.controlsContainer);
179
179
  }
180
180
  setupContainer() {
181
+ const containerOverflow = this.currentOptions.containerOverflow;
182
+ if (containerOverflow) {
183
+ this.container.style.overflow = containerOverflow;
184
+ }
181
185
  while (document.body.firstChild) {
182
186
  (0, _get__("dom_1").append)(this.container, document.body.firstChild);
183
187
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes