@raydiant/playlist-window-manager 0.0.0-electron-upgrade-1

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 (55) hide show
  1. package/.eslintrc +6 -0
  2. package/README.md +16 -0
  3. package/babel.config.js +13 -0
  4. package/build/BrowserViewRenderer.d.ts +19 -0
  5. package/build/BrowserViewRenderer.js +213 -0
  6. package/build/BrowserWindowRenderer.d.ts +47 -0
  7. package/build/BrowserWindowRenderer.js +524 -0
  8. package/build/IFrameRenderer.d.ts +20 -0
  9. package/build/IFrameRenderer.js +226 -0
  10. package/build/PlaylistWindowManager.d.ts +111 -0
  11. package/build/PlaylistWindowManager.js +1056 -0
  12. package/build/PlaylistWindowManagerState.d.ts +28 -0
  13. package/build/PlaylistWindowManagerState.js +60 -0
  14. package/build/PresentationWindow.d.ts +149 -0
  15. package/build/PresentationWindow.js +1235 -0
  16. package/build/PresentationWindow.test.d.ts +1 -0
  17. package/build/PresentationWindow.test.js +340 -0
  18. package/build/WindowLoadError.d.ts +3 -0
  19. package/build/WindowLoadError.js +29 -0
  20. package/build/WindowTimeoutError.d.ts +3 -0
  21. package/build/WindowTimeoutError.js +29 -0
  22. package/build/WindowUnresponsiveError.d.ts +3 -0
  23. package/build/WindowUnresponsiveError.js +29 -0
  24. package/build/embeddedApps.d.ts +2 -0
  25. package/build/embeddedApps.js +59 -0
  26. package/build/embeddedApps.test.d.ts +1 -0
  27. package/build/embeddedApps.test.js +123 -0
  28. package/build/index.d.ts +10 -0
  29. package/build/index.js +30 -0
  30. package/build/preload.d.ts +1 -0
  31. package/build/preload.js +20 -0
  32. package/build/testUtils.d.ts +43 -0
  33. package/build/testUtils.js +209 -0
  34. package/build/types.d.ts +162 -0
  35. package/build/types.js +2 -0
  36. package/jest.config.js +6 -0
  37. package/package.json +30 -0
  38. package/src/BrowserViewRenderer.ts +180 -0
  39. package/src/BrowserWindowRenderer.ts +595 -0
  40. package/src/IFrameRenderer.ts +251 -0
  41. package/src/PlaylistWindowManager.ts +1094 -0
  42. package/src/PlaylistWindowManagerState.ts +70 -0
  43. package/src/PresentationWindow.test.ts +333 -0
  44. package/src/PresentationWindow.ts +1434 -0
  45. package/src/WindowLoadError.ts +8 -0
  46. package/src/WindowTimeoutError.ts +8 -0
  47. package/src/WindowUnresponsiveError.ts +8 -0
  48. package/src/embeddedApps.test.ts +231 -0
  49. package/src/embeddedApps.ts +74 -0
  50. package/src/index.ts +13 -0
  51. package/src/preload.ts +27 -0
  52. package/src/testUtils.ts +160 -0
  53. package/src/types.ts +199 -0
  54. package/tasks/npm-publish.sh +13 -0
  55. package/tsconfig.json +7 -0
package/build/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.PresentationWindow = exports.PlaylistWindowManagerState = exports.PlaylistWindowManager = void 0;
21
+ var PlaylistWindowManager_1 = __importDefault(require("./PlaylistWindowManager"));
22
+ exports.PlaylistWindowManager = PlaylistWindowManager_1.default;
23
+ __exportStar(require("./PlaylistWindowManager"), exports);
24
+ var PlaylistWindowManagerState_1 = __importDefault(require("./PlaylistWindowManagerState"));
25
+ exports.PlaylistWindowManagerState = PlaylistWindowManagerState_1.default;
26
+ __exportStar(require("./PlaylistWindowManagerState"), exports);
27
+ var PresentationWindow_1 = __importDefault(require("./PresentationWindow"));
28
+ exports.PresentationWindow = PresentationWindow_1.default;
29
+ __exportStar(require("./PresentationWindow"), exports);
30
+ __exportStar(require("./types"), exports);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var electron_1 = require("electron");
4
+ var internals = {
5
+ sendMessage: function (windowId, type, payload) {
6
+ electron_1.ipcRenderer.send(windowId, type, payload);
7
+ }
8
+ };
9
+ // Set __RAYDIANT_INTERNALS on window so it is accessible in to the running application.
10
+ window.__RAYDIANT_INTERNALS = internals;
11
+ // Forward messages from the main process to the app (render process) via receiveMessage.
12
+ // __RAYDIANT_INTERNALS.receiveMessage is required to be set by the app with the Raydiant SDK.
13
+ electron_1.ipcRenderer.on('electron-main', function (_, message) {
14
+ if (typeof internals.receiveMessage === 'function') {
15
+ internals.receiveMessage(message);
16
+ }
17
+ else {
18
+ console.error('Failed to handle message from main process, receiveMessage is not defined');
19
+ }
20
+ });
@@ -0,0 +1,43 @@
1
+ /// <reference types="jest" />
2
+ import * as re from '@raydiant/playlist-rule-engine';
3
+ import PresentationWindow, { PresentationWindowOptions } from './PresentationWindow';
4
+ import PlaylistWindowManagerState, { PlaylistWindowManagerStateOptions } from './PlaylistWindowManagerState';
5
+ import { Presentation, ApplicationVersion, Logger, CreateWindowOptions } from './types';
6
+ export declare function createPresentationWindow(overrides?: Partial<PresentationWindowOptions>): PresentationWindow;
7
+ export declare function createPresentation(overrides?: Partial<Presentation>): Presentation;
8
+ export declare function createPresentationRelationships(overrides?: Partial<Presentation['r']>): Presentation['r'];
9
+ export declare function createApplicationVersion(overrides?: Partial<ApplicationVersion>): ApplicationVersion;
10
+ export declare function createPlaylistWindowManagerState(overrides?: Partial<PlaylistWindowManagerStateOptions>): PlaylistWindowManagerState;
11
+ export declare function createRuleEngineState(playlists?: {
12
+ [index: string]: re.Playlist;
13
+ }, presentations?: {
14
+ [index: string]: re.Presentation;
15
+ }, rulesDataStore?: re.RulesDataStore, isMultitimezoneEnabled?: boolean): re.State;
16
+ export declare function createLogger(overrides?: Partial<Logger>): {
17
+ debug: (message: any, context?: {
18
+ [key: string]: any;
19
+ } | undefined) => void;
20
+ info: (message: any, context?: {
21
+ [key: string]: any;
22
+ } | undefined) => void;
23
+ warn: (message: any, context?: {
24
+ [key: string]: any;
25
+ } | undefined) => void;
26
+ error: (message: any, context?: {
27
+ [key: string]: any;
28
+ } | undefined) => void;
29
+ };
30
+ export declare function createRenderer(): {
31
+ createWindow: jest.Mock<void, [opts: CreateWindowOptions]>;
32
+ loadWindow: jest.Mock<any, any>;
33
+ updateWindowBounds: jest.Mock<any, any>;
34
+ showWindow: jest.Mock<any, any>;
35
+ hideWindow: jest.Mock<any, any>;
36
+ removeWindow: jest.Mock<any, any>;
37
+ sendMessageString: jest.Mock<any, any>;
38
+ sendMessageObject: jest.Mock<any, any>;
39
+ muteWindow: jest.Mock<any, any>;
40
+ unMuteWindow: jest.Mock<any, any>;
41
+ runReceiveMessageCallback(type: string, payload: any): void;
42
+ runErrorCallback(error: Error): void;
43
+ };
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ var __importDefault = (this && this.__importDefault) || function (mod) {
62
+ return (mod && mod.__esModule) ? mod : { "default": mod };
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.createRenderer = exports.createLogger = exports.createRuleEngineState = exports.createPlaylistWindowManagerState = exports.createApplicationVersion = exports.createPresentationRelationships = exports.createPresentation = exports.createPresentationWindow = void 0;
66
+ var re = __importStar(require("@raydiant/playlist-rule-engine"));
67
+ var PresentationWindow_1 = __importDefault(require("./PresentationWindow"));
68
+ var PlaylistWindowManagerState_1 = __importDefault(require("./PlaylistWindowManagerState"));
69
+ function createPresentationWindow(overrides) {
70
+ var _a, _b, _c, _d, _e, _f;
71
+ if (overrides === void 0) { overrides = {}; }
72
+ return new PresentationWindow_1.default({
73
+ windowId: (_a = overrides.windowId) !== null && _a !== void 0 ? _a : 'test',
74
+ presentation: createPresentation(overrides.presentation),
75
+ applicationVersion: createApplicationVersion(overrides.applicationVersion),
76
+ publishedAt: (_b = overrides.publishedAt) !== null && _b !== void 0 ? _b : 'publishedAt',
77
+ playlistWindowManagerState: (_c = overrides.playlistWindowManagerState) !== null && _c !== void 0 ? _c : createPlaylistWindowManagerState(),
78
+ ruleEngineState: (_d = overrides.ruleEngineState) !== null && _d !== void 0 ? _d : createRuleEngineState(),
79
+ logger: createLogger(),
80
+ workerState: (_e = overrides.workerState) !== null && _e !== void 0 ? _e : {},
81
+ renderer: (_f = overrides.renderer) !== null && _f !== void 0 ? _f : {
82
+ createWindow: function () { },
83
+ loadWindow: function () {
84
+ return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
85
+ return [2 /*return*/];
86
+ }); });
87
+ },
88
+ updateWindowBounds: function () { },
89
+ showWindow: function () { },
90
+ hideWindow: function () { },
91
+ removeWindow: function () {
92
+ return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
93
+ return [2 /*return*/];
94
+ }); });
95
+ },
96
+ sendMessageString: function () { },
97
+ sendMessageObject: function () { },
98
+ muteWindow: function () { },
99
+ unMuteWindow: function () { },
100
+ },
101
+ getTerminal: overrides.getTerminal,
102
+ });
103
+ }
104
+ exports.createPresentationWindow = createPresentationWindow;
105
+ function createPresentation(overrides) {
106
+ var _a, _b, _c, _d, _e, _f;
107
+ if (overrides === void 0) { overrides = {}; }
108
+ return {
109
+ id: (_a = overrides.id) !== null && _a !== void 0 ? _a : 'id',
110
+ name: (_b = overrides.name) !== null && _b !== void 0 ? _b : 'name',
111
+ applicationDeploymentId: (_c = overrides.applicationDeploymentId) !== null && _c !== void 0 ? _c : 'applicationDeploymentId',
112
+ themeId: (_d = overrides.themeId) !== null && _d !== void 0 ? _d : null,
113
+ applicationVariables: (_e = overrides.applicationVariables) !== null && _e !== void 0 ? _e : {},
114
+ duration: (_f = overrides.duration) !== null && _f !== void 0 ? _f : 1,
115
+ r: createPresentationRelationships(overrides.r),
116
+ };
117
+ }
118
+ exports.createPresentation = createPresentation;
119
+ function createPresentationRelationships(overrides) {
120
+ var _a, _b;
121
+ if (overrides === void 0) { overrides = {}; }
122
+ return {
123
+ resource: (_a = overrides.resource) !== null && _a !== void 0 ? _a : {
124
+ updatedAt: 'updatedAt',
125
+ createdAt: 'createdAt',
126
+ },
127
+ presentationsPlaylists: (_b = overrides.presentationsPlaylists) !== null && _b !== void 0 ? _b : [],
128
+ };
129
+ }
130
+ exports.createPresentationRelationships = createPresentationRelationships;
131
+ function createApplicationVersion(overrides) {
132
+ var _a, _b, _c, _d, _e, _f, _g;
133
+ if (overrides === void 0) { overrides = {}; }
134
+ return {
135
+ id: (_a = overrides.id) !== null && _a !== void 0 ? _a : 'id',
136
+ name: (_b = overrides.name) !== null && _b !== void 0 ? _b : 'name',
137
+ applicationId: (_c = overrides.applicationId) !== null && _c !== void 0 ? _c : 'applicationId',
138
+ embeddedUrlFormat: (_d = overrides.embeddedUrlFormat) !== null && _d !== void 0 ? _d : null,
139
+ configurableDuration: (_e = overrides.configurableDuration) !== null && _e !== void 0 ? _e : false,
140
+ sourceUrl: (_f = overrides.sourceUrl) !== null && _f !== void 0 ? _f : null,
141
+ presentationProperties: (_g = overrides.presentationProperties) !== null && _g !== void 0 ? _g : [],
142
+ };
143
+ }
144
+ exports.createApplicationVersion = createApplicationVersion;
145
+ function createPlaylistWindowManagerState(overrides) {
146
+ var _a, _b, _c, _d;
147
+ if (overrides === void 0) { overrides = {}; }
148
+ return new PlaylistWindowManagerState_1.default({
149
+ presentations: (_a = overrides.presentations) !== null && _a !== void 0 ? _a : {},
150
+ applicationVersions: (_b = overrides.applicationVersions) !== null && _b !== void 0 ? _b : {},
151
+ themes: (_c = overrides.themes) !== null && _c !== void 0 ? _c : {},
152
+ publishedAt: (_d = overrides.publishedAt) !== null && _d !== void 0 ? _d : 'publishedAt',
153
+ });
154
+ }
155
+ exports.createPlaylistWindowManagerState = createPlaylistWindowManagerState;
156
+ function createRuleEngineState(playlists, presentations, rulesDataStore, isMultitimezoneEnabled) {
157
+ if (playlists === void 0) { playlists = {}; }
158
+ if (presentations === void 0) { presentations = {}; }
159
+ if (rulesDataStore === void 0) { rulesDataStore = {}; }
160
+ if (isMultitimezoneEnabled === void 0) { isMultitimezoneEnabled = false; }
161
+ return new re.State(playlists, presentations, rulesDataStore, isMultitimezoneEnabled);
162
+ }
163
+ exports.createRuleEngineState = createRuleEngineState;
164
+ function createLogger(overrides) {
165
+ var _a, _b, _c, _d;
166
+ if (overrides === void 0) { overrides = {}; }
167
+ var noop = function () { };
168
+ return {
169
+ debug: (_a = overrides.debug) !== null && _a !== void 0 ? _a : noop,
170
+ info: (_b = overrides.info) !== null && _b !== void 0 ? _b : noop,
171
+ warn: (_c = overrides.warn) !== null && _c !== void 0 ? _c : noop,
172
+ error: (_d = overrides.error) !== null && _d !== void 0 ? _d : noop,
173
+ };
174
+ }
175
+ exports.createLogger = createLogger;
176
+ function createRenderer() {
177
+ var createWindowOpts = null;
178
+ return {
179
+ createWindow: jest.fn(function (opts) {
180
+ createWindowOpts = opts;
181
+ }),
182
+ loadWindow: jest.fn(),
183
+ updateWindowBounds: jest.fn(),
184
+ showWindow: jest.fn(),
185
+ hideWindow: jest.fn(),
186
+ removeWindow: jest.fn(),
187
+ sendMessageString: jest.fn(),
188
+ sendMessageObject: jest.fn(),
189
+ muteWindow: jest.fn(),
190
+ unMuteWindow: jest.fn(),
191
+ runReceiveMessageCallback: function (type, payload) {
192
+ if (createWindowOpts === null || createWindowOpts === void 0 ? void 0 : createWindowOpts.receiveMessageCallback) {
193
+ createWindowOpts.receiveMessageCallback(type, payload);
194
+ }
195
+ else {
196
+ throw new Error('No receiveMessageCallback defined, make sure to call window.load first');
197
+ }
198
+ },
199
+ runErrorCallback: function (error) {
200
+ if (createWindowOpts === null || createWindowOpts === void 0 ? void 0 : createWindowOpts.errorCallback) {
201
+ createWindowOpts.errorCallback(error);
202
+ }
203
+ else {
204
+ throw new Error('No errorCallback defined, make sure to call window.load first');
205
+ }
206
+ },
207
+ };
208
+ }
209
+ exports.createRenderer = createRenderer;
@@ -0,0 +1,162 @@
1
+ export interface Playlist {
2
+ id: string;
3
+ }
4
+ export interface Presentation {
5
+ id: string;
6
+ name: string;
7
+ applicationDeploymentId: string;
8
+ themeId: string | null;
9
+ applicationVariables: {
10
+ [key: string]: any;
11
+ };
12
+ duration: number;
13
+ r: {
14
+ resource: {
15
+ updatedAt: string;
16
+ createdAt: string;
17
+ };
18
+ presentationsPlaylists: Array<{
19
+ playlistId: string;
20
+ }>;
21
+ };
22
+ }
23
+ export interface ApplicationVersion {
24
+ id: string;
25
+ name: string;
26
+ applicationId: string;
27
+ embeddedUrlFormat: string | null;
28
+ configurableDuration: boolean;
29
+ sourceUrl: string | null;
30
+ presentationProperties: Array<{
31
+ name: string;
32
+ type: string;
33
+ encode?: boolean;
34
+ }>;
35
+ }
36
+ export interface Font {
37
+ id: string;
38
+ name: string;
39
+ weight: string;
40
+ fileUpload: {
41
+ url: string;
42
+ };
43
+ }
44
+ export interface Theme {
45
+ id: string;
46
+ name: string;
47
+ backgroundColor: string;
48
+ backgroundImage: string;
49
+ backgroundImagePortrait: string;
50
+ headingTextColor: string;
51
+ headingFont: string;
52
+ heading2TextColor: string;
53
+ heading2Font: string;
54
+ bodyTextColor: string;
55
+ bodyFont: string;
56
+ borderColor: string;
57
+ headingFontNew: Font | null;
58
+ heading2FontNew: Font | null;
59
+ bodyFontNew: Font | null;
60
+ backgroundImageFileUpload: {
61
+ url: string;
62
+ } | null;
63
+ backgroundScale: 'fit' | 'fill' | null;
64
+ }
65
+ export interface Device {
66
+ id: string;
67
+ name: string | null;
68
+ }
69
+ export interface WindowBounds {
70
+ x: number;
71
+ y: number;
72
+ width: number;
73
+ height: number;
74
+ }
75
+ export interface WorkerState {
76
+ [key: string]: any;
77
+ }
78
+ export interface PreviewState {
79
+ inputs: Record<string, any>;
80
+ }
81
+ export interface CreateWindowOptions {
82
+ windowId: string;
83
+ parentWindowId?: string;
84
+ bounds?: WindowBounds;
85
+ backgroundColor?: string;
86
+ receiveMessageCallback?: (type: string, payload?: any) => void;
87
+ errorCallback: (err: any) => void;
88
+ }
89
+ export interface Logger {
90
+ debug(message: any, context?: {
91
+ [key: string]: any;
92
+ }): void;
93
+ info(message: any, context?: {
94
+ [key: string]: any;
95
+ }): void;
96
+ warn(message: any, context?: {
97
+ [key: string]: any;
98
+ }): void;
99
+ error(message: any, context?: {
100
+ [key: string]: any;
101
+ }): void;
102
+ }
103
+ export interface PresentationWindowRenderer {
104
+ createWindow(options: CreateWindowOptions): void;
105
+ loadWindow(windowId: string, url: string): Promise<void>;
106
+ updateWindowBounds(windowId: string, bounds: WindowBounds): void;
107
+ showWindow(windowId: string, isFocused: boolean): void;
108
+ hideWindow(windowId: string): void;
109
+ removeWindow(windowId: string): Promise<void>;
110
+ sendMessageString(windowId: string, message: string): void;
111
+ sendMessageObject(windowId: string, type: string, payload?: any): void;
112
+ muteWindow(windowId: string): void;
113
+ unMuteWindow(windowId: string): void;
114
+ }
115
+ export interface OpenChildWindowOptions {
116
+ windowId: string;
117
+ playlistId: string;
118
+ x: number;
119
+ y: number;
120
+ width: number;
121
+ height: number;
122
+ isFocused: boolean;
123
+ isMuted: boolean;
124
+ theme?: Theme;
125
+ }
126
+ export type Path = Array<string | number>;
127
+ export interface BuilderState {
128
+ inputs: InputState[];
129
+ profileId?: string;
130
+ }
131
+ export interface InputState {
132
+ path: Path;
133
+ state: any;
134
+ }
135
+ export interface EmbeddedAppMetadata {
136
+ renderMode: 'preview' | 'live';
137
+ }
138
+ export interface AnalyticsEvent {
139
+ type: string;
140
+ source: string;
141
+ productCategory?: string | null;
142
+ }
143
+ export interface ChargeRequest {
144
+ requestId: string;
145
+ amount: number;
146
+ tags?: Record<string, undefined | null | boolean | number | string>;
147
+ idempotencyId?: string;
148
+ }
149
+ export interface Charge {
150
+ id: string;
151
+ status: string;
152
+ }
153
+ export interface ChargeResponse {
154
+ requestId: string;
155
+ charge?: Charge;
156
+ error?: {
157
+ message: string;
158
+ };
159
+ }
160
+ export interface Terminal {
161
+ status: string;
162
+ }
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/jest.config.js ADDED
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ roots: ['<rootDir>/src'],
3
+ transform: {
4
+ '^.+\\.tsx?$': 'ts-jest'
5
+ }
6
+ };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@raydiant/playlist-window-manager",
3
+ "version": "0.0.0-electron-upgrade-1",
4
+ "description": "Window manager for playlist playback.",
5
+ "main": "build/index.js",
6
+ "scripts": {
7
+ "build": "rm -rf build && tsc",
8
+ "lint": "eslint -c ./.eslintrc **/*.ts",
9
+ "tsc": "tsc",
10
+ "test": "jest",
11
+ "deploy": "sh tasks/npm-publish.sh"
12
+ },
13
+ "dependencies": {
14
+ "fast-deep-equal": "^3.1.3",
15
+ "@raydiant/playlist-rule-engine": "3.2.2",
16
+ "raydiant-kit": "4.7.3",
17
+ "uuid": "^8.3.0",
18
+ "eventemitter3": "^4.0.7"
19
+ },
20
+ "devDependencies": {
21
+ "@babel/core": "^7.5.5",
22
+ "@types/jschannel": "^1.0.1",
23
+ "@types/jest": "^24.0.15",
24
+ "@types/uuid": "8.3.0",
25
+ "electron": "28.1.2",
26
+ "jest": "^24.8.0",
27
+ "ts-jest": "^24.0.2",
28
+ "typescript": "^4.1.2"
29
+ }
30
+ }