@mjhls/mjh-framework 1.0.806 → 1.0.807

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.
@@ -1,21 +1,26 @@
1
1
  'use strict';
2
2
 
3
+ var asyncToGenerator = require('./asyncToGenerator-58c289d9.js');
3
4
  var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
4
5
  var React = require('react');
5
6
  var index_esm$1 = require('./index.esm-00a6aade.js');
6
7
  var index_esm = require('./index.esm-f27f80d9.js');
7
8
  var main = require('./main-f1c77adb.js');
8
9
  require('./_commonjsHelpers-06173234.js');
9
- require('./web.dom.iterable-46657b5c.js');
10
10
  require('./es6.string.iterator-c2573ffd.js');
11
11
  require('./_to-object-6de10e57.js');
12
+ require('./web.dom.iterable-46657b5c.js');
13
+ require('./_library-dd23b178.js');
12
14
  require('./core.get-iterator-method-f474eacc.js');
15
+ require('./_iter-detect-55a5657a.js');
13
16
  require('./iconBase-be4097c0.js');
14
17
 
15
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
19
 
17
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
21
 
22
+ var _this = undefined;
23
+
19
24
  var Ustream = function Ustream(_ref) {
20
25
  var _ref$width = _ref.width,
21
26
  width = _ref$width === undefined ? '300px' : _ref$width,
@@ -26,7 +31,9 @@ var Ustream = function Ustream(_ref) {
26
31
  _ref$right = _ref.right,
27
32
  right = _ref$right === undefined ? false : _ref$right,
28
33
  _ref$src = _ref.src,
29
- src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src;
34
+ src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src,
35
+ _ref$logEvent = _ref.logEvent,
36
+ logEvent = _ref$logEvent === undefined ? function () {} : _ref$logEvent;
30
37
 
31
38
  var _useState = React.useState(width),
32
39
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -38,6 +45,11 @@ var Ustream = function Ustream(_ref) {
38
45
  currentHeight = _useState4[0],
39
46
  setHeight = _useState4[1];
40
47
 
48
+ var _useState5 = React.useState(true),
49
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
50
+ isMuted = _useState6[0],
51
+ setIsMuted = _useState6[1];
52
+
41
53
  var ustreamContainer = React.useRef(null);
42
54
 
43
55
  React.useEffect(function () {
@@ -70,6 +82,48 @@ var Ustream = function Ustream(_ref) {
70
82
  }
71
83
  } catch (err) {}
72
84
  }, []);
85
+
86
+ React.useEffect(function () {
87
+
88
+ if (isMuted) {
89
+ var loadUstreamListener = function () {
90
+ var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
91
+ var UstreamEmbed, viewer, reporting;
92
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
93
+ while (1) {
94
+ switch (_context.prev = _context.next) {
95
+ case 0:
96
+ _context.next = 2;
97
+ return Promise.resolve().then(function () { return require('./ustream-api-b2b9092f.js'); });
98
+
99
+ case 2:
100
+ UstreamEmbed = _context.sent;
101
+ viewer = UstreamEmbed('ustream-iframe');
102
+ reporting = setInterval(function () {
103
+ viewer.getProperty('volume', function (content) {
104
+ if (content > 0) {
105
+ logEvent({ category: 'Ustream Unmute', action: 'Unmute Ustream Widget', label: 'Unmute Ustream Widget' });
106
+ setIsMuted(false);
107
+ clearInterval(reporting);
108
+ }
109
+ });
110
+ }, 2000);
111
+
112
+ case 5:
113
+ case 'end':
114
+ return _context.stop();
115
+ }
116
+ }
117
+ }, _callee, _this);
118
+ }));
119
+
120
+ return function loadUstreamListener() {
121
+ return _ref2.apply(this, arguments);
122
+ };
123
+ }();
124
+ loadUstreamListener();
125
+ }
126
+ }, [isMuted]);
73
127
  //return nothing if mobile
74
128
  if (main.main_43) {
75
129
  return null;
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ var stringify = require('./stringify-c9ac1214.js');
4
+ var keys = require('./keys-7f2c2108.js');
5
+ require('./_commonjsHelpers-06173234.js');
6
+ require('./_to-object-6de10e57.js');
7
+ require('./_object-sap-a175b4a9.js');
8
+
9
+ var UstreamEmbed = function () {
10
+ function a(a) {
11
+ return b(a);
12
+ }function b(a) {
13
+ var b = c(a),
14
+ m = function (a) {
15
+ function b(b) {
16
+ if ("socialstream" !== b) {
17
+ if (!w) return y || (y = []), y.push(arguments), void 0;var d = i(arguments).slice(1);d[0] && "function" == typeof d[0] && (z[b] || (z[b] = []), z[b].push(d[0])), g(a, t, { cmd: b, args: d });
18
+ } else if (j(window, "message", n), v = c(arguments[1]), u = h(v.getAttribute("src")), x = !0, B.length) for (var e = 0, k = B.length; k > e; e++) {
19
+ f(B[e]);
20
+ }
21
+ }function m() {
22
+ if (y) {
23
+ for (; y.length;) {
24
+ b.apply(this, y.shift());
25
+ }y = null;
26
+ }
27
+ }function n(a) {
28
+ var b = v;b && b.contentWindow && b.contentWindow === a.source ? s.onmessage(a) : a.source === v.id && s.onmessage(a);
29
+ }function o(a) {
30
+ var c,
31
+ d = JSON.parse(a.data);return d.cmd && "ready" == d.cmd ? (g(v, u, { cmd: "ready" }), void 0) : (c = [d.cmd], c = c.concat(d.args), b.apply(this, c), void 0);
32
+ }function p() {
33
+ g(a, t, { cmd: "ready" });
34
+ }function q() {
35
+ w = !0, g(a, t, { cmd: "apihandshake", args: [] }), m(), v && g(v, u, { cmd: "viewer_ready" });
36
+ }function r() {
37
+ b.apply(this, arguments);
38
+ }var s,
39
+ t,
40
+ u,
41
+ v,
42
+ w = !1,
43
+ x = !1,
44
+ y = [],
45
+ z = {},
46
+ A = {},
47
+ B = [];return t = h(a.getAttribute("src")).toLowerCase(), a.onload = p, s = { host: t, callMethod: r, getProperty: function getProperty() {
48
+ r.apply(this, arguments);
49
+ }, addListener: function addListener(a, b) {
50
+ A[a] || (A[a] = []), A[a].push(b);
51
+ }, removeListener: function removeListener(a, b) {
52
+ if (b) for (var c = 0, d = A[a].length; d > c; c++) {
53
+ A[a][c] === b && A[a].splice(c, 1);
54
+ } else A[a] = null;
55
+ }, onmessage: function onmessage(a) {
56
+ var b;if (t || u || B.push({ origin: a.origin, data: a.data }), a.origin.toLowerCase() == t) {
57
+ try {
58
+ b = JSON.parse(a.data);
59
+ } catch (c) {
60
+ return;
61
+ }if (b.sstream) return o(a), void 0;if (b.event && b.event.ready && (q(), d(A, "ready")), b.event && b.event.live === !0) return d(A, "live"), void 0;if (b.event && b.event.live === !1) return d(A, "offline"), void 0;if (b.event && !b.event.ready) if (k) keys._Object$keys(b.event).forEach(function (a) {
62
+ d(A, a, b.event[a]);
63
+ });else for (var f in b.event) {
64
+ b.event.hasOwnProperty(f) && d(A, f, b.event[f]);
65
+ }if (b.property) if (k) keys._Object$keys(b.property).forEach(function (a) {
66
+ e(z, a, b.property[a]);
67
+ });else for (var f in b.property) {
68
+ b.property.hasOwnProperty(f) && e(z, f, b.property[f]);
69
+ }
70
+ } else if (x && a.origin == u) return o(a), void 0;
71
+ }, destroy: function destroy() {
72
+ w = !1, t = "", x = !1, u = "", v = null, y = [], z = {}, A = {}, B = [], l[a.id] && (l[a.id] = null), a = null;
73
+ } };
74
+ }(b);return b.id || (b.id = "UstreamEmbed" + Math.ceil(1e5 * Math.random())), m.id = b.id, l[b.id] = m, m;
75
+ }function c(a) {
76
+ return "string" == typeof a && (a = document.getElementById(a)), a;
77
+ }function d(a, b, c) {
78
+ for (var d in a[b]) {
79
+ a[b].hasOwnProperty(d) && a[b][d].call(window, b, c);
80
+ }
81
+ }function e(a, b, c) {
82
+ if (a[b]) {
83
+ var d = a[b];a[b] = null, delete a[b], d.forEach(function (a) {
84
+ a.call(window, c);
85
+ });
86
+ }
87
+ }function f(a) {
88
+ var b, c;for (b in l) {
89
+ l.hasOwnProperty(b) && l[b] && (c = document.getElementById(b), c && c.contentWindow ? c.contentWindow === a.source && l[b].onmessage(a) : "string" == typeof a.source && a.source == b && l[b].onmessage(a));
90
+ }
91
+ }function g(a, b, c) {
92
+ a.contentWindow.postMessage(stringify._JSON$stringify(c), b);
93
+ }function h(a) {
94
+ return a.indexOf("http") < 0 && (a = location.protocol + a), a.match(m)[1].toString();
95
+ }function i(a) {
96
+ return Array.prototype.slice.call(a, 0);
97
+ }function j(a, b, c) {
98
+ a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent("on" + b, c);
99
+ }var k = "undefined" != typeof keys._Object$keys,
100
+ l = {},
101
+ m = new RegExp("^(http(?:s)?://[^/]+)", "im");return j(window, "message", f), "function" == typeof define && define.amd && define([], function () {
102
+ return a;
103
+ }), window.UstreamEmbed = a;
104
+ }();
105
+
106
+ exports.default = UstreamEmbed;
@@ -1,15 +1,20 @@
1
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7f8f9219.js';
1
2
  import { _ as _slicedToArray } from './slicedToArray-be2f7a22.js';
2
3
  import React__default, { useState, useRef, useEffect } from 'react';
3
4
  import { c as IoIosOpen } from './index.esm-f6156a57.js';
4
5
  import { F as FaRegWindowClose } from './index.esm-d4932dea.js';
5
6
  import { m as main_43 } from './main-d4165069.js';
6
7
  import './_commonjsHelpers-0c4b6f40.js';
7
- import './web.dom.iterable-4109ff68.js';
8
8
  import './es6.string.iterator-bc33758b.js';
9
9
  import './_to-object-b50e61c3.js';
10
+ import './web.dom.iterable-4109ff68.js';
11
+ import './_library-528f1934.js';
10
12
  import './core.get-iterator-method-133dfacd.js';
13
+ import './_iter-detect-7e5e5ce2.js';
11
14
  import './iconBase-ccc56b97.js';
12
15
 
16
+ var _this = undefined;
17
+
13
18
  var Ustream = function Ustream(_ref) {
14
19
  var _ref$width = _ref.width,
15
20
  width = _ref$width === undefined ? '300px' : _ref$width,
@@ -20,7 +25,9 @@ var Ustream = function Ustream(_ref) {
20
25
  _ref$right = _ref.right,
21
26
  right = _ref$right === undefined ? false : _ref$right,
22
27
  _ref$src = _ref.src,
23
- src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src;
28
+ src = _ref$src === undefined ? 'https://video.ibm.com/embed/23627444?volume=0&autoplay=true' : _ref$src,
29
+ _ref$logEvent = _ref.logEvent,
30
+ logEvent = _ref$logEvent === undefined ? function () {} : _ref$logEvent;
24
31
 
25
32
  var _useState = useState(width),
26
33
  _useState2 = _slicedToArray(_useState, 2),
@@ -32,6 +39,11 @@ var Ustream = function Ustream(_ref) {
32
39
  currentHeight = _useState4[0],
33
40
  setHeight = _useState4[1];
34
41
 
42
+ var _useState5 = useState(true),
43
+ _useState6 = _slicedToArray(_useState5, 2),
44
+ isMuted = _useState6[0],
45
+ setIsMuted = _useState6[1];
46
+
35
47
  var ustreamContainer = useRef(null);
36
48
 
37
49
  useEffect(function () {
@@ -64,6 +76,48 @@ var Ustream = function Ustream(_ref) {
64
76
  }
65
77
  } catch (err) {}
66
78
  }, []);
79
+
80
+ useEffect(function () {
81
+
82
+ if (isMuted) {
83
+ var loadUstreamListener = function () {
84
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
85
+ var UstreamEmbed, viewer, reporting;
86
+ return regenerator.wrap(function _callee$(_context) {
87
+ while (1) {
88
+ switch (_context.prev = _context.next) {
89
+ case 0:
90
+ _context.next = 2;
91
+ return import('./ustream-api-33a866b6.js');
92
+
93
+ case 2:
94
+ UstreamEmbed = _context.sent;
95
+ viewer = UstreamEmbed('ustream-iframe');
96
+ reporting = setInterval(function () {
97
+ viewer.getProperty('volume', function (content) {
98
+ if (content > 0) {
99
+ logEvent({ category: 'Ustream Unmute', action: 'Unmute Ustream Widget', label: 'Unmute Ustream Widget' });
100
+ setIsMuted(false);
101
+ clearInterval(reporting);
102
+ }
103
+ });
104
+ }, 2000);
105
+
106
+ case 5:
107
+ case 'end':
108
+ return _context.stop();
109
+ }
110
+ }
111
+ }, _callee, _this);
112
+ }));
113
+
114
+ return function loadUstreamListener() {
115
+ return _ref2.apply(this, arguments);
116
+ };
117
+ }();
118
+ loadUstreamListener();
119
+ }
120
+ }, [isMuted]);
67
121
  //return nothing if mobile
68
122
  if (main_43) {
69
123
  return null;
@@ -0,0 +1,104 @@
1
+ import { _ as _JSON$stringify } from './stringify-59c8f690.js';
2
+ import { _ as _Object$keys } from './keys-7a3adabf.js';
3
+ import './_commonjsHelpers-0c4b6f40.js';
4
+ import './_to-object-b50e61c3.js';
5
+ import './_object-sap-f353c2a9.js';
6
+
7
+ var UstreamEmbed = function () {
8
+ function a(a) {
9
+ return b(a);
10
+ }function b(a) {
11
+ var b = c(a),
12
+ m = function (a) {
13
+ function b(b) {
14
+ if ("socialstream" !== b) {
15
+ if (!w) return y || (y = []), y.push(arguments), void 0;var d = i(arguments).slice(1);d[0] && "function" == typeof d[0] && (z[b] || (z[b] = []), z[b].push(d[0])), g(a, t, { cmd: b, args: d });
16
+ } else if (j(window, "message", n), v = c(arguments[1]), u = h(v.getAttribute("src")), x = !0, B.length) for (var e = 0, k = B.length; k > e; e++) {
17
+ f(B[e]);
18
+ }
19
+ }function m() {
20
+ if (y) {
21
+ for (; y.length;) {
22
+ b.apply(this, y.shift());
23
+ }y = null;
24
+ }
25
+ }function n(a) {
26
+ var b = v;b && b.contentWindow && b.contentWindow === a.source ? s.onmessage(a) : a.source === v.id && s.onmessage(a);
27
+ }function o(a) {
28
+ var c,
29
+ d = JSON.parse(a.data);return d.cmd && "ready" == d.cmd ? (g(v, u, { cmd: "ready" }), void 0) : (c = [d.cmd], c = c.concat(d.args), b.apply(this, c), void 0);
30
+ }function p() {
31
+ g(a, t, { cmd: "ready" });
32
+ }function q() {
33
+ w = !0, g(a, t, { cmd: "apihandshake", args: [] }), m(), v && g(v, u, { cmd: "viewer_ready" });
34
+ }function r() {
35
+ b.apply(this, arguments);
36
+ }var s,
37
+ t,
38
+ u,
39
+ v,
40
+ w = !1,
41
+ x = !1,
42
+ y = [],
43
+ z = {},
44
+ A = {},
45
+ B = [];return t = h(a.getAttribute("src")).toLowerCase(), a.onload = p, s = { host: t, callMethod: r, getProperty: function getProperty() {
46
+ r.apply(this, arguments);
47
+ }, addListener: function addListener(a, b) {
48
+ A[a] || (A[a] = []), A[a].push(b);
49
+ }, removeListener: function removeListener(a, b) {
50
+ if (b) for (var c = 0, d = A[a].length; d > c; c++) {
51
+ A[a][c] === b && A[a].splice(c, 1);
52
+ } else A[a] = null;
53
+ }, onmessage: function onmessage(a) {
54
+ var b;if (t || u || B.push({ origin: a.origin, data: a.data }), a.origin.toLowerCase() == t) {
55
+ try {
56
+ b = JSON.parse(a.data);
57
+ } catch (c) {
58
+ return;
59
+ }if (b.sstream) return o(a), void 0;if (b.event && b.event.ready && (q(), d(A, "ready")), b.event && b.event.live === !0) return d(A, "live"), void 0;if (b.event && b.event.live === !1) return d(A, "offline"), void 0;if (b.event && !b.event.ready) if (k) _Object$keys(b.event).forEach(function (a) {
60
+ d(A, a, b.event[a]);
61
+ });else for (var f in b.event) {
62
+ b.event.hasOwnProperty(f) && d(A, f, b.event[f]);
63
+ }if (b.property) if (k) _Object$keys(b.property).forEach(function (a) {
64
+ e(z, a, b.property[a]);
65
+ });else for (var f in b.property) {
66
+ b.property.hasOwnProperty(f) && e(z, f, b.property[f]);
67
+ }
68
+ } else if (x && a.origin == u) return o(a), void 0;
69
+ }, destroy: function destroy() {
70
+ w = !1, t = "", x = !1, u = "", v = null, y = [], z = {}, A = {}, B = [], l[a.id] && (l[a.id] = null), a = null;
71
+ } };
72
+ }(b);return b.id || (b.id = "UstreamEmbed" + Math.ceil(1e5 * Math.random())), m.id = b.id, l[b.id] = m, m;
73
+ }function c(a) {
74
+ return "string" == typeof a && (a = document.getElementById(a)), a;
75
+ }function d(a, b, c) {
76
+ for (var d in a[b]) {
77
+ a[b].hasOwnProperty(d) && a[b][d].call(window, b, c);
78
+ }
79
+ }function e(a, b, c) {
80
+ if (a[b]) {
81
+ var d = a[b];a[b] = null, delete a[b], d.forEach(function (a) {
82
+ a.call(window, c);
83
+ });
84
+ }
85
+ }function f(a) {
86
+ var b, c;for (b in l) {
87
+ l.hasOwnProperty(b) && l[b] && (c = document.getElementById(b), c && c.contentWindow ? c.contentWindow === a.source && l[b].onmessage(a) : "string" == typeof a.source && a.source == b && l[b].onmessage(a));
88
+ }
89
+ }function g(a, b, c) {
90
+ a.contentWindow.postMessage(_JSON$stringify(c), b);
91
+ }function h(a) {
92
+ return a.indexOf("http") < 0 && (a = location.protocol + a), a.match(m)[1].toString();
93
+ }function i(a) {
94
+ return Array.prototype.slice.call(a, 0);
95
+ }function j(a, b, c) {
96
+ a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent("on" + b, c);
97
+ }var k = "undefined" != typeof _Object$keys,
98
+ l = {},
99
+ m = new RegExp("^(http(?:s)?://[^/]+)", "im");return j(window, "message", f), "function" == typeof define && define.amd && define([], function () {
100
+ return a;
101
+ }), window.UstreamEmbed = a;
102
+ }();
103
+
104
+ export default UstreamEmbed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.806",
3
+ "version": "1.0.807",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -99,11 +99,11 @@
99
99
  "nookies": "^2.4.0",
100
100
  "react-cookies": "^0.1.1",
101
101
  "react-instantsearch-dom": "^6.10.3",
102
+ "react-script-tag": "^1.1.2",
102
103
  "rollup-plugin-peer-deps-external": "^2.2.4",
103
104
  "shortid": "^2.2.15",
104
105
  "smoothscroll-polyfill": "^0.4.4",
105
106
  "striptags": "^3.1.1",
106
- "superagent": "^5.2.2",
107
- "react-script-tag": "^1.1.2"
107
+ "superagent": "^5.2.2"
108
108
  }
109
109
  }