@raydiant/playlist-window-manager 0.14.17 → 0.14.21

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/README.md CHANGED
@@ -1,4 +1,10 @@
1
- Usage:
1
+ ## Deployment
2
+
3
+ ```
4
+ yarn deploy
5
+ ```
6
+
7
+ ## Usage
2
8
 
3
9
  ```js
4
10
 
@@ -63,7 +63,7 @@ var PlaylistWindowManager_1 = __importDefault(require("./PlaylistWindowManager")
63
63
  var WindowTimeoutError_1 = __importDefault(require("./WindowTimeoutError"));
64
64
  var WindowLoadError_1 = __importDefault(require("./WindowLoadError"));
65
65
  // TODO: Automatically inject latest version when building in CI.
66
- var defaultAppRendererUrl = 'https://apps.raydiant.com/1.4.4/index.html';
66
+ var defaultAppRendererUrl = 'https://apps.raydiant.com/1.4.5/index.html';
67
67
  var isValidNumber = function (value) {
68
68
  return typeof value === 'number' && !isNaN(value);
69
69
  };
@@ -21,9 +21,8 @@ function createEmbeddedApp(presentation, embeddedUrlFormat) {
21
21
  if (!isNaN(Number(variableName)))
22
22
  return;
23
23
  var value = presentation.applicationVariables[m[2]];
24
- if (value === undefined)
25
- value = '';
26
- url = url.replace(variable, value);
24
+ var encodedValue = value === undefined ? '' : encodeURIComponent(value);
25
+ url = url.replace(variable, encodedValue);
27
26
  });
28
27
  return url;
29
28
  }
@@ -37,3 +37,8 @@ test('Replaces variable with underscore', function () {
37
37
  test('Does not replace variable that is a number', function () {
38
38
  expect(embeddedApps_1.default(createPresentation({ applicationVariables: { foo: 'bar' } }), 'http://localhost:8080?foo=:foo')).toBe('http://localhost:8080?foo=bar');
39
39
  });
40
+ test('Encodes a variables containing special characters', function () {
41
+ var fooValue = 'Lorem Ipsum. !@#$%^&*()-. More Text';
42
+ var fooValueEncoded = 'Lorem%20Ipsum.%20!%40%23%24%25%5E%26*()-.%20More%20Text';
43
+ expect(embeddedApps_1.default(createPresentation({ applicationVariables: { foo: fooValue } }), "http://localhost:8080?foo=:foo")).toBe("http://localhost:8080?foo=" + fooValueEncoded);
44
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.14.17",
3
+ "version": "0.14.21",
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.13",
15
+ "@raydiant/playlist-rule-engine": "3.1.15",
16
16
  "raydiant-kit": "^4.6.1",
17
17
  "uuid": "^8.3.0",
18
18
  "eventemitter3": "^4.0.7"
@@ -49,7 +49,7 @@ export interface PresentationWindowOptions {
49
49
  }
50
50
 
51
51
  // TODO: Automatically inject latest version when building in CI.
52
- const defaultAppRendererUrl = 'https://apps.raydiant.com/1.4.4/index.html';
52
+ const defaultAppRendererUrl = 'https://apps.raydiant.com/1.4.5/index.html';
53
53
 
54
54
  const isValidNumber = (value: any) =>
55
55
  typeof value === 'number' && !isNaN(value);
@@ -64,3 +64,16 @@ test('Does not replace variable that is a number', () => {
64
64
  )
65
65
  ).toBe('http://localhost:8080?foo=bar');
66
66
  });
67
+
68
+ test('Encodes a variables containing special characters', () => {
69
+ const fooValue = 'Lorem Ipsum. !@#$%^&*()-. More Text';
70
+ const fooValueEncoded =
71
+ 'Lorem%20Ipsum.%20!%40%23%24%25%5E%26*()-.%20More%20Text';
72
+
73
+ expect(
74
+ createEmbeddedApp(
75
+ createPresentation({ applicationVariables: { foo: fooValue } }),
76
+ `http://localhost:8080?foo=:foo`
77
+ )
78
+ ).toBe(`http://localhost:8080?foo=${fooValueEncoded}`);
79
+ });
@@ -25,9 +25,9 @@ export default function createEmbeddedApp(
25
25
  // port numbers in the embedded app url.
26
26
  if (!isNaN(Number(variableName))) return;
27
27
 
28
- let value = presentation.applicationVariables[m[2]];
29
- if (value === undefined) value = '';
30
- url = url.replace(variable, value);
28
+ const value = presentation.applicationVariables[m[2]];
29
+ const encodedValue = value === undefined ? '' : encodeURIComponent(value);
30
+ url = url.replace(variable, encodedValue);
31
31
  });
32
32
 
33
33
  return url;