@raydiant/playlist-window-manager 0.14.12 → 0.14.13

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.
@@ -89,6 +89,7 @@ export default class PresentationWindow {
89
89
  private loadWindow;
90
90
  private sendMessage;
91
91
  private waitForPesentationReady;
92
+ private buildTheme;
92
93
  private sendRenderMessage;
93
94
  private openChildWindow;
94
95
  private closeChildWindow;
@@ -537,6 +537,24 @@ var PresentationWindow = /** @class */ (function () {
537
537
  }
538
538
  });
539
539
  };
540
+ PresentationWindow.prototype.buildTheme = function () {
541
+ if (!this.theme)
542
+ return;
543
+ var nextTheme = __assign({}, this.theme);
544
+ if (nextTheme.headingFontNew && nextTheme.headingFontNew.fileUpload) {
545
+ nextTheme.headingFont =
546
+ nextTheme.headingFontNew.fileUpload.url || nextTheme.headingFont;
547
+ }
548
+ if (nextTheme.heading2FontNew && nextTheme.heading2FontNew.fileUpload) {
549
+ nextTheme.heading2Font =
550
+ nextTheme.heading2FontNew.fileUpload.url || nextTheme.heading2Font;
551
+ }
552
+ if (nextTheme.bodyFontNew && nextTheme.bodyFontNew.fileUpload) {
553
+ nextTheme.bodyFont =
554
+ nextTheme.bodyFontNew.fileUpload.url || nextTheme.bodyFont;
555
+ }
556
+ return nextTheme;
557
+ };
540
558
  PresentationWindow.prototype.sendRenderMessage = function () {
541
559
  var _a = this.options, applicationVersion = _a.applicationVersion, isPreview = _a.isPreview, device = _a.device;
542
560
  // IFrames do not have a mute/unmute API so we are overriding any mute properties
@@ -548,7 +566,7 @@ var PresentationWindow = /** @class */ (function () {
548
566
  // TODO: We need a better way to identify mute properties (ie. PropType.mute())
549
567
  // Force mute the presentation, existing apps use either mute or muted.
550
568
  mute: true, muted: true }) }),
551
- theme: this.theme,
569
+ theme: this.buildTheme(),
552
570
  applicationVersion: applicationVersion,
553
571
  device: device,
554
572
  isPreview: isPreview
@@ -558,7 +576,7 @@ var PresentationWindow = /** @class */ (function () {
558
576
  this.sendMessage('render', {
559
577
  builderState: this.builderState,
560
578
  presentation: this.presentation,
561
- theme: this.theme,
579
+ theme: this.buildTheme(),
562
580
  applicationVersion: applicationVersion,
563
581
  device: device,
564
582
  isPreview: isPreview
package/build/types.d.ts CHANGED
@@ -28,6 +28,29 @@ export interface ApplicationVersion {
28
28
  configurableDuration: boolean;
29
29
  sourceUrl: string | null;
30
30
  }
31
+ export interface FontResponse {
32
+ id: string;
33
+ name: string;
34
+ weight: string;
35
+ fileUpload: FileUploadResponse;
36
+ }
37
+ export interface FileUploadStepResponse {
38
+ step_name: string;
39
+ created_at: string;
40
+ error: {
41
+ [key: string]: any;
42
+ };
43
+ }
44
+ export interface FileUploadResponse {
45
+ id: string;
46
+ filename: string;
47
+ content_type: string;
48
+ content_length: number;
49
+ url: string;
50
+ deleted_at: null;
51
+ completed_steps: FileUploadStepResponse[];
52
+ created_at: string;
53
+ }
31
54
  export interface Theme {
32
55
  id: string;
33
56
  name: string;
@@ -41,6 +64,9 @@ export interface Theme {
41
64
  bodyTextColor: string;
42
65
  bodyFont: string;
43
66
  borderColor: string;
67
+ headingFontNew: FontResponse;
68
+ heading2FontNew: FontResponse;
69
+ bodyFontNew: FontResponse;
44
70
  }
45
71
  export interface Device {
46
72
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.14.12",
3
+ "version": "0.14.13",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "fast-deep-equal": "^3.1.3",
15
- "@raydiant/playlist-rule-engine": "3.1.10",
15
+ "@raydiant/playlist-rule-engine": "3.1.11",
16
16
  "raydiant-kit": "^4.6.1",
17
17
  "uuid": "^8.3.0",
18
18
  "eventemitter3": "^4.0.7"
@@ -480,6 +480,28 @@ export default class PresentationWindow {
480
480
  });
481
481
  }
482
482
 
483
+ private buildTheme(): Theme | undefined {
484
+ if (!this.theme) return;
485
+
486
+ const nextTheme = { ...this.theme };
487
+
488
+ if (nextTheme.headingFontNew && nextTheme.headingFontNew.fileUpload) {
489
+ nextTheme.headingFont =
490
+ nextTheme.headingFontNew.fileUpload.url || nextTheme.headingFont;
491
+ }
492
+
493
+ if (nextTheme.heading2FontNew && nextTheme.heading2FontNew.fileUpload) {
494
+ nextTheme.heading2Font =
495
+ nextTheme.heading2FontNew.fileUpload.url || nextTheme.heading2Font;
496
+ }
497
+
498
+ if (nextTheme.bodyFontNew && nextTheme.bodyFontNew.fileUpload) {
499
+ nextTheme.bodyFont =
500
+ nextTheme.bodyFontNew.fileUpload.url || nextTheme.bodyFont;
501
+ }
502
+ return nextTheme;
503
+ }
504
+
483
505
  private sendRenderMessage() {
484
506
  const { applicationVersion, isPreview, device } = this.options;
485
507
  // IFrames do not have a mute/unmute API so we are overriding any mute properties
@@ -497,7 +519,7 @@ export default class PresentationWindow {
497
519
  muted: true
498
520
  }
499
521
  },
500
- theme: this.theme,
522
+ theme: this.buildTheme(),
501
523
  applicationVersion,
502
524
  device,
503
525
  isPreview
@@ -506,7 +528,7 @@ export default class PresentationWindow {
506
528
  this.sendMessage('render', {
507
529
  builderState: this.builderState,
508
530
  presentation: this.presentation,
509
- theme: this.theme,
531
+ theme: this.buildTheme(),
510
532
  applicationVersion,
511
533
  device,
512
534
  isPreview
package/src/types.ts CHANGED
@@ -27,6 +27,30 @@ export interface ApplicationVersion {
27
27
  sourceUrl: string | null;
28
28
  }
29
29
 
30
+ export interface FontResponse {
31
+ id: string;
32
+ name: string;
33
+ weight: string;
34
+ fileUpload: FileUploadResponse;
35
+ }
36
+
37
+ export interface FileUploadStepResponse {
38
+ step_name: string;
39
+ created_at: string;
40
+ error: { [key: string]: any };
41
+ }
42
+
43
+ export interface FileUploadResponse {
44
+ id: string;
45
+ filename: string;
46
+ content_type: string;
47
+ content_length: number;
48
+ url: string;
49
+ deleted_at: null;
50
+ completed_steps: FileUploadStepResponse[];
51
+ created_at: string;
52
+ }
53
+
30
54
  export interface Theme {
31
55
  id: string;
32
56
  name: string;
@@ -40,6 +64,9 @@ export interface Theme {
40
64
  bodyTextColor: string;
41
65
  bodyFont: string;
42
66
  borderColor: string;
67
+ headingFontNew: FontResponse;
68
+ heading2FontNew: FontResponse;
69
+ bodyFontNew: FontResponse;
43
70
  }
44
71
 
45
72
  export interface Device {