@raydiant/playlist-window-manager 0.21.1 → 0.21.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/package.json +1 -1
- package/src/PresentationWindow.ts +1 -1
- package/tasks/npm-publish.sh +1 -1
- package/build/BrowserViewRenderer.d.ts +0 -19
- package/build/BrowserViewRenderer.js +0 -212
- package/build/BrowserWindowRenderer.d.ts +0 -47
- package/build/BrowserWindowRenderer.js +0 -521
- package/build/IFrameRenderer.d.ts +0 -20
- package/build/IFrameRenderer.js +0 -226
- package/build/PlaylistWindowManager.d.ts +0 -106
- package/build/PlaylistWindowManager.js +0 -1017
- package/build/PlaylistWindowManagerState.d.ts +0 -28
- package/build/PlaylistWindowManagerState.js +0 -60
- package/build/PresentationWindow.d.ts +0 -142
- package/build/PresentationWindow.js +0 -1138
- package/build/PresentationWindow.test.d.ts +0 -1
- package/build/PresentationWindow.test.js +0 -241
- package/build/WindowLoadError.d.ts +0 -3
- package/build/WindowLoadError.js +0 -29
- package/build/WindowTimeoutError.d.ts +0 -3
- package/build/WindowTimeoutError.js +0 -29
- package/build/WindowUnresponsiveError.d.ts +0 -3
- package/build/WindowUnresponsiveError.js +0 -29
- package/build/embeddedApps.d.ts +0 -2
- package/build/embeddedApps.js +0 -59
- package/build/embeddedApps.test.d.ts +0 -1
- package/build/embeddedApps.test.js +0 -123
- package/build/index.d.ts +0 -10
- package/build/index.js +0 -30
- package/build/preload.d.ts +0 -1
- package/build/preload.js +0 -20
- package/build/testUtils.d.ts +0 -43
- package/build/testUtils.js +0 -208
- package/build/types.d.ts +0 -142
- package/build/types.js +0 -2
package/build/testUtils.js
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
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
|
-
});
|
|
102
|
-
}
|
|
103
|
-
exports.createPresentationWindow = createPresentationWindow;
|
|
104
|
-
function createPresentation(overrides) {
|
|
105
|
-
var _a, _b, _c, _d, _e, _f;
|
|
106
|
-
if (overrides === void 0) { overrides = {}; }
|
|
107
|
-
return {
|
|
108
|
-
id: (_a = overrides.id) !== null && _a !== void 0 ? _a : 'id',
|
|
109
|
-
name: (_b = overrides.name) !== null && _b !== void 0 ? _b : 'name',
|
|
110
|
-
applicationDeploymentId: (_c = overrides.applicationDeploymentId) !== null && _c !== void 0 ? _c : 'applicationDeploymentId',
|
|
111
|
-
themeId: (_d = overrides.themeId) !== null && _d !== void 0 ? _d : null,
|
|
112
|
-
applicationVariables: (_e = overrides.applicationVariables) !== null && _e !== void 0 ? _e : {},
|
|
113
|
-
duration: (_f = overrides.duration) !== null && _f !== void 0 ? _f : 1,
|
|
114
|
-
r: createPresentationRelationships(overrides.r),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
exports.createPresentation = createPresentation;
|
|
118
|
-
function createPresentationRelationships(overrides) {
|
|
119
|
-
var _a, _b;
|
|
120
|
-
if (overrides === void 0) { overrides = {}; }
|
|
121
|
-
return {
|
|
122
|
-
resource: (_a = overrides.resource) !== null && _a !== void 0 ? _a : {
|
|
123
|
-
updatedAt: 'updatedAt',
|
|
124
|
-
createdAt: 'createdAt',
|
|
125
|
-
},
|
|
126
|
-
presentationsPlaylists: (_b = overrides.presentationsPlaylists) !== null && _b !== void 0 ? _b : [],
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
exports.createPresentationRelationships = createPresentationRelationships;
|
|
130
|
-
function createApplicationVersion(overrides) {
|
|
131
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
132
|
-
if (overrides === void 0) { overrides = {}; }
|
|
133
|
-
return {
|
|
134
|
-
id: (_a = overrides.id) !== null && _a !== void 0 ? _a : 'id',
|
|
135
|
-
name: (_b = overrides.name) !== null && _b !== void 0 ? _b : 'name',
|
|
136
|
-
applicationId: (_c = overrides.applicationId) !== null && _c !== void 0 ? _c : 'applicationId',
|
|
137
|
-
embeddedUrlFormat: (_d = overrides.embeddedUrlFormat) !== null && _d !== void 0 ? _d : null,
|
|
138
|
-
configurableDuration: (_e = overrides.configurableDuration) !== null && _e !== void 0 ? _e : false,
|
|
139
|
-
sourceUrl: (_f = overrides.sourceUrl) !== null && _f !== void 0 ? _f : null,
|
|
140
|
-
presentationProperties: (_g = overrides.presentationProperties) !== null && _g !== void 0 ? _g : [],
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
exports.createApplicationVersion = createApplicationVersion;
|
|
144
|
-
function createPlaylistWindowManagerState(overrides) {
|
|
145
|
-
var _a, _b, _c, _d;
|
|
146
|
-
if (overrides === void 0) { overrides = {}; }
|
|
147
|
-
return new PlaylistWindowManagerState_1.default({
|
|
148
|
-
presentations: (_a = overrides.presentations) !== null && _a !== void 0 ? _a : {},
|
|
149
|
-
applicationVersions: (_b = overrides.applicationVersions) !== null && _b !== void 0 ? _b : {},
|
|
150
|
-
themes: (_c = overrides.themes) !== null && _c !== void 0 ? _c : {},
|
|
151
|
-
publishedAt: (_d = overrides.publishedAt) !== null && _d !== void 0 ? _d : 'publishedAt',
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
exports.createPlaylistWindowManagerState = createPlaylistWindowManagerState;
|
|
155
|
-
function createRuleEngineState(playlists, presentations, rulesDataStore, isMultitimezoneEnabled) {
|
|
156
|
-
if (playlists === void 0) { playlists = {}; }
|
|
157
|
-
if (presentations === void 0) { presentations = {}; }
|
|
158
|
-
if (rulesDataStore === void 0) { rulesDataStore = {}; }
|
|
159
|
-
if (isMultitimezoneEnabled === void 0) { isMultitimezoneEnabled = false; }
|
|
160
|
-
return new re.State(playlists, presentations, rulesDataStore, isMultitimezoneEnabled);
|
|
161
|
-
}
|
|
162
|
-
exports.createRuleEngineState = createRuleEngineState;
|
|
163
|
-
function createLogger(overrides) {
|
|
164
|
-
var _a, _b, _c, _d;
|
|
165
|
-
if (overrides === void 0) { overrides = {}; }
|
|
166
|
-
var noop = function () { };
|
|
167
|
-
return {
|
|
168
|
-
debug: (_a = overrides.debug) !== null && _a !== void 0 ? _a : noop,
|
|
169
|
-
info: (_b = overrides.info) !== null && _b !== void 0 ? _b : noop,
|
|
170
|
-
warn: (_c = overrides.warn) !== null && _c !== void 0 ? _c : noop,
|
|
171
|
-
error: (_d = overrides.error) !== null && _d !== void 0 ? _d : noop,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
exports.createLogger = createLogger;
|
|
175
|
-
function createRenderer() {
|
|
176
|
-
var createWindowOpts = null;
|
|
177
|
-
return {
|
|
178
|
-
createWindow: jest.fn(function (opts) {
|
|
179
|
-
createWindowOpts = opts;
|
|
180
|
-
}),
|
|
181
|
-
loadWindow: jest.fn(),
|
|
182
|
-
updateWindowBounds: jest.fn(),
|
|
183
|
-
showWindow: jest.fn(),
|
|
184
|
-
hideWindow: jest.fn(),
|
|
185
|
-
removeWindow: jest.fn(),
|
|
186
|
-
sendMessageString: jest.fn(),
|
|
187
|
-
sendMessageObject: jest.fn(),
|
|
188
|
-
muteWindow: jest.fn(),
|
|
189
|
-
unMuteWindow: jest.fn(),
|
|
190
|
-
runReceiveMessageCallback: function (type, payload) {
|
|
191
|
-
if (createWindowOpts === null || createWindowOpts === void 0 ? void 0 : createWindowOpts.receiveMessageCallback) {
|
|
192
|
-
createWindowOpts.receiveMessageCallback(type, payload);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
throw new Error('No receiveMessageCallback defined, make sure to call window.load first');
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
runErrorCallback: function (error) {
|
|
199
|
-
if (createWindowOpts === null || createWindowOpts === void 0 ? void 0 : createWindowOpts.errorCallback) {
|
|
200
|
-
createWindowOpts.errorCallback(error);
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
throw new Error('No errorCallback defined, make sure to call window.load first');
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
exports.createRenderer = createRenderer;
|
package/build/types.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
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
|
-
}
|
package/build/types.js
DELETED