@raydiant/playlist-window-manager 0.0.0-test-2 → 0.0.0-test-3
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/build/BrowserViewRenderer.d.ts +1 -1
- package/build/BrowserViewRenderer.js +4 -3
- package/build/BrowserWindowRenderer.js +1 -1
- package/build/PresentationWindow.js +4 -2
- package/build/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/BrowserViewRenderer.ts +13 -3
- package/src/BrowserWindowRenderer.ts +5 -1
- package/src/PresentationWindow.ts +8 -1
- package/src/types.ts +1 -0
|
@@ -5,7 +5,7 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
|
|
|
5
5
|
private offscreenWindow;
|
|
6
6
|
private windows;
|
|
7
7
|
constructor(mainWindow: BrowserWindow, offscreenWindow: BrowserWindow);
|
|
8
|
-
createWindow({ windowId, parentWindowId, bounds, backgroundColor, receiveMessageCallback, }: CreateWindowOptions): Promise<void>;
|
|
8
|
+
createWindow({ windowId, parentWindowId, bounds, logger, backgroundColor, receiveMessageCallback, }: CreateWindowOptions): Promise<void>;
|
|
9
9
|
loadWindow(windowId: string, url: string): Promise<void>;
|
|
10
10
|
updateWindowBounds(windowId: string, bounds: WindowBounds): void;
|
|
11
11
|
showWindow(windowId: string, isFocused: boolean): void;
|
|
@@ -79,10 +79,11 @@ var BrowserViewRenderer = /** @class */ (function () {
|
|
|
79
79
|
this.windows = {};
|
|
80
80
|
}
|
|
81
81
|
BrowserViewRenderer.prototype.createWindow = function (_a) {
|
|
82
|
-
var windowId = _a.windowId, parentWindowId = _a.parentWindowId, bounds = _a.bounds, backgroundColor = _a.backgroundColor, receiveMessageCallback = _a.receiveMessageCallback;
|
|
82
|
+
var windowId = _a.windowId, parentWindowId = _a.parentWindowId, bounds = _a.bounds, logger = _a.logger, backgroundColor = _a.backgroundColor, receiveMessageCallback = _a.receiveMessageCallback;
|
|
83
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
84
|
var window;
|
|
85
85
|
return __generator(this, function (_b) {
|
|
86
|
+
logger.info("playlist-window-manager/src/BrowserViewRenderer.ts createWindow1 ".concat(JSON.stringify(bounds || __assign(__assign({}, this.mainWindow.getBounds()), { x: 0, y: 0 }))));
|
|
86
87
|
window = {
|
|
87
88
|
view: new electron_1.BrowserView({
|
|
88
89
|
webPreferences: {
|
|
@@ -99,7 +100,7 @@ var BrowserViewRenderer = /** @class */ (function () {
|
|
|
99
100
|
this.windows[windowId] = window;
|
|
100
101
|
electron_1.ipcMain.on(windowId, window.receiveMessageCallback);
|
|
101
102
|
this.offscreenWindow.addBrowserView(window.view);
|
|
102
|
-
|
|
103
|
+
logger.info("playlist-window-manager/src/BrowserViewRenderer.ts createWindow2 ".concat(JSON.stringify(window.bounds)));
|
|
103
104
|
window.view.setBounds(window.bounds);
|
|
104
105
|
if (backgroundColor) {
|
|
105
106
|
window.view.setBackgroundColor(backgroundColor);
|
|
@@ -109,7 +110,7 @@ var BrowserViewRenderer = /** @class */ (function () {
|
|
|
109
110
|
if (!parentWindowId) {
|
|
110
111
|
window.view.setAutoResize({
|
|
111
112
|
width: true,
|
|
112
|
-
height:
|
|
113
|
+
height: true,
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
116
|
return [2 /*return*/];
|
|
@@ -93,7 +93,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
93
93
|
},
|
|
94
94
|
});
|
|
95
95
|
this.proxySettings = null;
|
|
96
|
-
|
|
96
|
+
opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor1 ".concat(JSON.stringify(opts.bounds)));
|
|
97
97
|
this.offscreenWindow.setBounds(opts.bounds);
|
|
98
98
|
if (opts.proxySettings) {
|
|
99
99
|
this.proxySettings = opts.proxySettings;
|
|
@@ -657,15 +657,17 @@ var PresentationWindow = /** @class */ (function () {
|
|
|
657
657
|
};
|
|
658
658
|
PresentationWindow.prototype.createAndLoadWindow = function (url, backgroundColor, receiveMessageCallback) {
|
|
659
659
|
return __awaiter(this, void 0, void 0, function () {
|
|
660
|
-
var _a, windowId, parentWindowId, renderer, bounds;
|
|
660
|
+
var _a, windowId, parentWindowId, renderer, bounds, logger;
|
|
661
661
|
return __generator(this, function (_b) {
|
|
662
662
|
switch (_b.label) {
|
|
663
663
|
case 0:
|
|
664
|
-
_a = this.options, windowId = _a.windowId, parentWindowId = _a.parentWindowId, renderer = _a.renderer, bounds = _a.bounds;
|
|
664
|
+
_a = this.options, windowId = _a.windowId, parentWindowId = _a.parentWindowId, renderer = _a.renderer, bounds = _a.bounds, logger = _a.logger;
|
|
665
|
+
logger.info("playlist-window-manager/src/PresentationWindow.ts createAndLoadWindow1: ".concat(JSON.stringify(bounds)));
|
|
665
666
|
renderer.createWindow({
|
|
666
667
|
windowId: windowId,
|
|
667
668
|
parentWindowId: parentWindowId,
|
|
668
669
|
bounds: bounds,
|
|
670
|
+
logger: logger,
|
|
669
671
|
backgroundColor: backgroundColor,
|
|
670
672
|
receiveMessageCallback: receiveMessageCallback,
|
|
671
673
|
errorCallback: this.handleError,
|
package/build/types.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface CreateWindowOptions {
|
|
|
82
82
|
windowId: string;
|
|
83
83
|
parentWindowId?: string;
|
|
84
84
|
bounds?: WindowBounds;
|
|
85
|
+
logger: Logger;
|
|
85
86
|
backgroundColor?: string;
|
|
86
87
|
receiveMessageCallback?: (type: string, payload?: any) => void;
|
|
87
88
|
errorCallback: (err: any) => void;
|
package/package.json
CHANGED
|
@@ -30,10 +30,15 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
|
|
|
30
30
|
windowId,
|
|
31
31
|
parentWindowId,
|
|
32
32
|
bounds,
|
|
33
|
+
logger,
|
|
33
34
|
backgroundColor,
|
|
34
35
|
receiveMessageCallback,
|
|
35
36
|
}: CreateWindowOptions) {
|
|
36
|
-
|
|
37
|
+
logger.info(
|
|
38
|
+
`playlist-window-manager/src/BrowserViewRenderer.ts createWindow1 ${JSON.stringify(
|
|
39
|
+
bounds || { ...this.mainWindow.getBounds(), x: 0, y: 0 }
|
|
40
|
+
)}`
|
|
41
|
+
);
|
|
37
42
|
|
|
38
43
|
const window = {
|
|
39
44
|
view: new BrowserView({
|
|
@@ -60,7 +65,12 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
|
|
|
60
65
|
ipcMain.on(windowId, window.receiveMessageCallback);
|
|
61
66
|
|
|
62
67
|
this.offscreenWindow.addBrowserView(window.view);
|
|
63
|
-
|
|
68
|
+
logger.info(
|
|
69
|
+
`playlist-window-manager/src/BrowserViewRenderer.ts createWindow2 ${JSON.stringify(
|
|
70
|
+
window.bounds
|
|
71
|
+
)}`
|
|
72
|
+
);
|
|
73
|
+
|
|
64
74
|
window.view.setBounds(window.bounds);
|
|
65
75
|
|
|
66
76
|
if (backgroundColor) {
|
|
@@ -72,7 +82,7 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
|
|
|
72
82
|
if (!parentWindowId) {
|
|
73
83
|
window.view.setAutoResize({
|
|
74
84
|
width: true,
|
|
75
|
-
height:
|
|
85
|
+
height: true,
|
|
76
86
|
});
|
|
77
87
|
}
|
|
78
88
|
}
|
|
@@ -72,7 +72,11 @@ export default class BrowserWindowRenderer
|
|
|
72
72
|
private logger: Logger;
|
|
73
73
|
|
|
74
74
|
constructor(private opts: BrowserWindowRendererOptions) {
|
|
75
|
-
|
|
75
|
+
opts.logger.info(
|
|
76
|
+
`playlist-window-manager/src/BrowserWindowRenderer.ts constructor1 ${JSON.stringify(
|
|
77
|
+
opts.bounds
|
|
78
|
+
)}`
|
|
79
|
+
);
|
|
76
80
|
this.offscreenWindow.setBounds(opts.bounds);
|
|
77
81
|
if (opts.proxySettings) {
|
|
78
82
|
this.proxySettings = opts.proxySettings;
|
|
@@ -490,12 +490,19 @@ export default class PresentationWindow {
|
|
|
490
490
|
backgroundColor?: string,
|
|
491
491
|
receiveMessageCallback?: (type: string, payload?: any) => void
|
|
492
492
|
) {
|
|
493
|
-
const { windowId, parentWindowId, renderer, bounds } = this.options;
|
|
493
|
+
const { windowId, parentWindowId, renderer, bounds, logger } = this.options;
|
|
494
|
+
|
|
495
|
+
logger.info(
|
|
496
|
+
`playlist-window-manager/src/PresentationWindow.ts createAndLoadWindow1: ${JSON.stringify(
|
|
497
|
+
bounds
|
|
498
|
+
)}`
|
|
499
|
+
);
|
|
494
500
|
|
|
495
501
|
renderer.createWindow({
|
|
496
502
|
windowId,
|
|
497
503
|
parentWindowId,
|
|
498
504
|
bounds,
|
|
505
|
+
logger,
|
|
499
506
|
backgroundColor,
|
|
500
507
|
receiveMessageCallback,
|
|
501
508
|
errorCallback: this.handleError,
|