electron-screenshots 0.5.9 → 0.5.12

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 (2) hide show
  1. package/lib/screenshots.js +21 -12
  2. package/package.json +4 -4
@@ -16,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
18
  if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
20
24
  }) : (function(o, m, k, k2) {
21
25
  if (k2 === undefined) k2 = k;
22
26
  o[k2] = m[k];
@@ -149,7 +153,6 @@ var Screenshots = /** @class */ (function (_super) {
149
153
  }
150
154
  // 先清除 Kiosk 模式,然后取消全屏才有效
151
155
  this.$win.setKiosk(false);
152
- this.$win.setFullScreen(false);
153
156
  this.$win.setSimpleFullScreen(false);
154
157
  this.$win.blur();
155
158
  this.$win.blurWebView();
@@ -234,14 +237,17 @@ var Screenshots = /** @class */ (function (_super) {
234
237
  show: false,
235
238
  autoHideMenuBar: true,
236
239
  transparent: true,
237
- // resizable 设置为 false 会导致页面崩溃
238
- // resizable: false,
240
+ // mac resizable 设置为 false 会导致页面崩溃
241
+ resizable: process.platform !== 'darwin',
239
242
  movable: false,
240
243
  // focusable: true, 否则窗口不能及时响应esc按键,输入框也不能输入
241
244
  focusable: true,
242
- // linux 下必须设置为false,否则不能全屏显示在最上层
243
- // mac 下设置为true,鼠标移动到屏幕上方菜单栏处,才不会唤出菜单栏
244
- fullscreen: process.platform === 'darwin',
245
+ /**
246
+ * linux 下必须设置为false,否则不能全屏显示在最上层
247
+ * mac 下设置为false,否则可能会导致程序坞不恢复问题
248
+ * https://github.com/nashaofu/screenshots/issues/148
249
+ */
250
+ // fullscreen: process.platform === 'darwin',
245
251
  // 设为true 防止mac新开一个桌面,影响效果
246
252
  simpleFullscreen: process.platform === 'darwin',
247
253
  backgroundColor: '#00000000',
@@ -256,9 +262,11 @@ var Screenshots = /** @class */ (function (_super) {
256
262
  this.$win.on('show', function () {
257
263
  var _a, _b;
258
264
  (_a = _this.$win) === null || _a === void 0 ? void 0 : _a.focus();
259
- // 在窗口显示时设置,防止与 fullscreen、x、y、width、height 等冲突
260
- // 导致显示效果不符合预期
261
- (_b = _this.$win) === null || _b === void 0 ? void 0 : _b.setKiosk(true);
265
+ /**
266
+ * 在窗口显示时设置,防止与 fullscreen、x、y、width、height 等冲突, 导致显示效果不符合预期
267
+ * mac 下不设置 kiosk 模式,https://github.com/nashaofu/screenshots/issues/148
268
+ */
269
+ (_b = _this.$win) === null || _b === void 0 ? void 0 : _b.setKiosk(process.platform !== 'darwin');
262
270
  });
263
271
  this.$win.on('closed', function () {
264
272
  _this.$win = null;
@@ -277,8 +285,9 @@ var Screenshots = /** @class */ (function (_super) {
277
285
  }
278
286
  this.$win.blur();
279
287
  this.$win.setKiosk(false);
280
- this.$win.setFullScreen(process.platform === 'darwin');
281
- this.$win.setSimpleFullScreen(process.platform === 'darwin');
288
+ if (process.platform === 'darwin') {
289
+ this.$win.setSimpleFullScreen(true);
290
+ }
282
291
  this.$win.setBounds(display);
283
292
  this.$view.setBounds({
284
293
  x: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-screenshots",
3
- "version": "0.5.9",
3
+ "version": "0.5.12",
4
4
  "description": "electron 截图插件",
5
5
  "types": "lib/screenshots.d.ts",
6
6
  "main": "lib/screenshots.js",
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "debug": "^4.3.3",
39
39
  "fs-extra": "^10.1.0",
40
- "node-screenshots": "^0.0.9",
41
- "react-screenshots": "^0.5.9"
40
+ "node-screenshots": "^0.0.11",
41
+ "react-screenshots": "^0.5.10"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "electron": ">=14"
@@ -58,5 +58,5 @@
58
58
  "rimraf": "^3.0.2",
59
59
  "typescript": "^4.5.5"
60
60
  },
61
- "gitHead": "9ecc9c6db0e6cf2929525ced3e6f3c60555ab051"
61
+ "gitHead": "9e8c448e2255ac3c10cfc98af4306ad952cf2e64"
62
62
  }