@raydiant/playlist-window-manager 0.0.0-test-31 → 0.0.0-test-32
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.js +0 -1
- package/build/BrowserWindowRenderer.js +0 -3
- package/build/PlaylistWindowManager.js +3 -1
- package/build/PresentationWindow.js +1 -7
- package/build/types.d.ts +7 -2
- package/package.json +2 -2
- package/src/BrowserViewRenderer.ts +0 -1
- package/src/BrowserWindowRenderer.ts +3 -12
- package/src/PlaylistWindowManager.ts +2 -0
- package/src/PresentationWindow.ts +1 -7
- package/src/types.ts +7 -2
- package/tasks/npm-publish.sh +1 -1
|
@@ -87,7 +87,6 @@ var BrowserViewRenderer = /** @class */ (function () {
|
|
|
87
87
|
view: new electron_1.BrowserView({
|
|
88
88
|
webPreferences: {
|
|
89
89
|
preload: path.join(__dirname, 'preload.js'),
|
|
90
|
-
contextIsolation: false,
|
|
91
90
|
},
|
|
92
91
|
}),
|
|
93
92
|
bounds: bounds || __assign(__assign({}, this.mainWindow.getBounds()), { x: 0, y: 0 }),
|
|
@@ -90,7 +90,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
90
90
|
hasShadow: this.opts.hasShadow,
|
|
91
91
|
webPreferences: {
|
|
92
92
|
preload: path.join(__dirname, 'preload.js'),
|
|
93
|
-
contextIsolation: false,
|
|
94
93
|
},
|
|
95
94
|
});
|
|
96
95
|
this.proxySettings = null;
|
|
@@ -119,7 +118,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
119
118
|
? this.createOrGetPooledBrowserView(windowId, {
|
|
120
119
|
webPreferences: {
|
|
121
120
|
preload: path.join(__dirname, 'preload.js'),
|
|
122
|
-
contextIsolation: false,
|
|
123
121
|
},
|
|
124
122
|
})
|
|
125
123
|
: this.createOrGetPooledBrowserWindow(windowId, {
|
|
@@ -134,7 +132,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
134
132
|
hasShadow: this.opts.hasShadow,
|
|
135
133
|
webPreferences: {
|
|
136
134
|
preload: path.join(__dirname, 'preload.js'),
|
|
137
|
-
contextIsolation: false,
|
|
138
135
|
},
|
|
139
136
|
}),
|
|
140
137
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
|
|
@@ -894,7 +894,7 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
|
|
|
894
894
|
};
|
|
895
895
|
PlaylistWindowManager.prototype.swapWindows = function () {
|
|
896
896
|
return __awaiter(this, void 0, void 0, function () {
|
|
897
|
-
var nextPreviewPresentationId, preview, result, shouldPreload;
|
|
897
|
+
var nextPreviewPresentationId, preview, result, nextPresentation, shouldPreload;
|
|
898
898
|
return __generator(this, function (_a) {
|
|
899
899
|
switch (_a.label) {
|
|
900
900
|
case 0:
|
|
@@ -910,6 +910,7 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
|
|
|
910
910
|
preview = result.preview;
|
|
911
911
|
nextPreviewPresentationId = preview.presentationId;
|
|
912
912
|
}
|
|
913
|
+
nextPresentation = this.nextPresentation;
|
|
913
914
|
// Set this.currentPresentationId before removing the current window to avoid timing issues with previewCheck
|
|
914
915
|
// triggering during removeCurrentWindow. Current presentation id needs to be set to the next
|
|
915
916
|
// presentation before calling shouldPreload().
|
|
@@ -939,6 +940,7 @@ var PlaylistWindowManager = /** @class */ (function (_super) {
|
|
|
939
940
|
// Swap windows.
|
|
940
941
|
this.currentWindow = this.nextWindow;
|
|
941
942
|
if (this.currentWindow) {
|
|
943
|
+
this.currentPresentation = nextPresentation;
|
|
942
944
|
this.currentWindow.onComplete(this.handleCurrentPresentationComplete);
|
|
943
945
|
this.currentWindow.onError(this.handleCurrentPresentationError);
|
|
944
946
|
this.currentWindow.onEnableInterruptLock(this.handleEnableInterruptLock);
|
|
@@ -98,13 +98,7 @@ var isValidChargeRequest = function (value) {
|
|
|
98
98
|
return value &&
|
|
99
99
|
typeof value === 'object' &&
|
|
100
100
|
typeof value.requestId === 'string' &&
|
|
101
|
-
typeof value.amount === 'number'
|
|
102
|
-
(value.tags === undefined ||
|
|
103
|
-
value.tags === null ||
|
|
104
|
-
typeof value.tags === 'object') &&
|
|
105
|
-
(value.idempotencyId === undefined ||
|
|
106
|
-
value.idempotencyId === null ||
|
|
107
|
-
typeof value.idempotencyId === 'string');
|
|
101
|
+
typeof value.amount === 'number';
|
|
108
102
|
};
|
|
109
103
|
var PresentationWindow = /** @class */ (function () {
|
|
110
104
|
function PresentationWindow(options) {
|
package/build/types.d.ts
CHANGED
|
@@ -143,8 +143,13 @@ export interface AnalyticsEvent {
|
|
|
143
143
|
export interface ChargeRequest {
|
|
144
144
|
requestId: string;
|
|
145
145
|
amount: number;
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
items: Array<{
|
|
147
|
+
name: string;
|
|
148
|
+
price: number;
|
|
149
|
+
description?: string;
|
|
150
|
+
sku?: string;
|
|
151
|
+
quantity?: number;
|
|
152
|
+
}>;
|
|
148
153
|
}
|
|
149
154
|
export interface Charge {
|
|
150
155
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raydiant/playlist-window-manager",
|
|
3
|
-
"version": "0.0.0-test-
|
|
3
|
+
"version": "0.0.0-test-32",
|
|
4
4
|
"description": "Window manager for playlist playback.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@types/jschannel": "^1.0.1",
|
|
23
23
|
"@types/jest": "^24.0.15",
|
|
24
24
|
"@types/uuid": "8.3.0",
|
|
25
|
-
"electron": "
|
|
25
|
+
"electron": "10.1.5",
|
|
26
26
|
"jest": "^24.8.0",
|
|
27
27
|
"ts-jest": "^24.0.2",
|
|
28
28
|
"typescript": "^4.1.2"
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
ipcMain,
|
|
6
6
|
IpcMainEvent,
|
|
7
7
|
Event,
|
|
8
|
+
Details,
|
|
8
9
|
BrowserWindowConstructorOptions,
|
|
9
10
|
BrowserViewConstructorOptions,
|
|
10
|
-
RenderProcessGoneDetails,
|
|
11
11
|
} from 'electron';
|
|
12
12
|
import {
|
|
13
13
|
PresentationWindowRenderer,
|
|
@@ -32,10 +32,7 @@ interface BrowserWindowRendererWindow {
|
|
|
32
32
|
payload?: any
|
|
33
33
|
) => void;
|
|
34
34
|
unresponsiveCallback: () => void;
|
|
35
|
-
renderProcessGoneCallback: (
|
|
36
|
-
event: Event,
|
|
37
|
-
details: RenderProcessGoneDetails
|
|
38
|
-
) => void;
|
|
35
|
+
renderProcessGoneCallback: (event: Event, details: Details) => void;
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
interface BrowserWindowRendererOptions {
|
|
@@ -67,7 +64,6 @@ export default class BrowserWindowRenderer
|
|
|
67
64
|
hasShadow: this.opts.hasShadow,
|
|
68
65
|
webPreferences: {
|
|
69
66
|
preload: path.join(__dirname, 'preload.js'),
|
|
70
|
-
contextIsolation: false,
|
|
71
67
|
},
|
|
72
68
|
});
|
|
73
69
|
|
|
@@ -105,7 +101,6 @@ export default class BrowserWindowRenderer
|
|
|
105
101
|
? this.createOrGetPooledBrowserView(windowId, {
|
|
106
102
|
webPreferences: {
|
|
107
103
|
preload: path.join(__dirname, 'preload.js'),
|
|
108
|
-
contextIsolation: false,
|
|
109
104
|
},
|
|
110
105
|
})
|
|
111
106
|
: this.createOrGetPooledBrowserWindow(windowId, {
|
|
@@ -120,7 +115,6 @@ export default class BrowserWindowRenderer
|
|
|
120
115
|
hasShadow: this.opts.hasShadow,
|
|
121
116
|
webPreferences: {
|
|
122
117
|
preload: path.join(__dirname, 'preload.js'),
|
|
123
|
-
contextIsolation: false,
|
|
124
118
|
},
|
|
125
119
|
}),
|
|
126
120
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
|
|
@@ -154,10 +148,7 @@ export default class BrowserWindowRenderer
|
|
|
154
148
|
);
|
|
155
149
|
},
|
|
156
150
|
|
|
157
|
-
renderProcessGoneCallback: (
|
|
158
|
-
_: Event,
|
|
159
|
-
details: RenderProcessGoneDetails
|
|
160
|
-
) => {
|
|
151
|
+
renderProcessGoneCallback: (_: Event, details: Details) => {
|
|
161
152
|
this.logger.error(
|
|
162
153
|
`Window received 'render-process-gone' event. Reason: ${details.reason}`,
|
|
163
154
|
{ windowId }
|
|
@@ -698,6 +698,7 @@ export default class PlaylistWindowManager extends EventEmitter {
|
|
|
698
698
|
nextPreviewPresentationId = preview.presentationId;
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
+
const nextPresentation = this.nextPresentation;
|
|
701
702
|
// Set this.currentPresentationId before removing the current window to avoid timing issues with previewCheck
|
|
702
703
|
// triggering during removeCurrentWindow. Current presentation id needs to be set to the next
|
|
703
704
|
// presentation before calling shouldPreload().
|
|
@@ -734,6 +735,7 @@ export default class PlaylistWindowManager extends EventEmitter {
|
|
|
734
735
|
// Swap windows.
|
|
735
736
|
this.currentWindow = this.nextWindow;
|
|
736
737
|
if (this.currentWindow) {
|
|
738
|
+
this.currentPresentation = nextPresentation;
|
|
737
739
|
this.currentWindow.onComplete(this.handleCurrentPresentationComplete);
|
|
738
740
|
this.currentWindow.onError(this.handleCurrentPresentationError);
|
|
739
741
|
this.currentWindow.onEnableInterruptLock(this.handleEnableInterruptLock);
|
|
@@ -78,13 +78,7 @@ const isValidChargeRequest = (value: any): value is ChargeRequest =>
|
|
|
78
78
|
value &&
|
|
79
79
|
typeof value === 'object' &&
|
|
80
80
|
typeof value.requestId === 'string' &&
|
|
81
|
-
typeof value.amount === 'number'
|
|
82
|
-
(value.tags === undefined ||
|
|
83
|
-
value.tags === null ||
|
|
84
|
-
typeof value.tags === 'object') &&
|
|
85
|
-
(value.idempotencyId === undefined ||
|
|
86
|
-
value.idempotencyId === null ||
|
|
87
|
-
typeof value.idempotencyId === 'string');
|
|
81
|
+
typeof value.amount === 'number';
|
|
88
82
|
|
|
89
83
|
export default class PresentationWindow {
|
|
90
84
|
private didReceiveReady: boolean = false;
|
package/src/types.ts
CHANGED
|
@@ -177,8 +177,13 @@ export interface AnalyticsEvent {
|
|
|
177
177
|
export interface ChargeRequest {
|
|
178
178
|
requestId: string;
|
|
179
179
|
amount: number;
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
items: Array<{
|
|
181
|
+
name: string;
|
|
182
|
+
price: number;
|
|
183
|
+
description?: string;
|
|
184
|
+
sku?: string;
|
|
185
|
+
quantity?: number;
|
|
186
|
+
}>;
|
|
182
187
|
}
|
|
183
188
|
|
|
184
189
|
export interface Charge {
|
package/tasks/npm-publish.sh
CHANGED