@raydiant/playlist-window-manager 0.0.0-test-30 → 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.
@@ -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;
@@ -133,7 +132,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
133
132
  hasShadow: this.opts.hasShadow,
134
133
  webPreferences: {
135
134
  preload: path.join(__dirname, 'preload.js'),
136
- contextIsolation: false,
137
135
  },
138
136
  }),
139
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
- tags?: Record<string, undefined | null | boolean | number | string>;
147
- idempotencyId?: string;
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-30",
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": "28.1.2",
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
 
@@ -119,7 +115,6 @@ export default class BrowserWindowRenderer
119
115
  hasShadow: this.opts.hasShadow,
120
116
  webPreferences: {
121
117
  preload: path.join(__dirname, 'preload.js'),
122
- contextIsolation: false,
123
118
  },
124
119
  }),
125
120
  // If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
@@ -153,10 +148,7 @@ export default class BrowserWindowRenderer
153
148
  );
154
149
  },
155
150
 
156
- renderProcessGoneCallback: (
157
- _: Event,
158
- details: RenderProcessGoneDetails
159
- ) => {
151
+ renderProcessGoneCallback: (_: Event, details: Details) => {
160
152
  this.logger.error(
161
153
  `Window received 'render-process-gone' event. Reason: ${details.reason}`,
162
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
- tags?: Record<string, undefined | null | boolean | number | string>;
181
- idempotencyId?: string;
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 {
@@ -10,4 +10,4 @@ mkdir build
10
10
  yarn build
11
11
 
12
12
  # Publish
13
- yarn publish --non-interactive --access public
13
+ yarn publish --access public