@ilo-org/react 0.10.6 → 0.11.0
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/CHANGELOG.md +14 -0
- package/lib/cjs/AccordionCtx-be704051.js +9 -0
- package/lib/cjs/{GlobalCtx-97e4b433.js → GlobalCtx-10114bdd.js} +2 -2
- package/lib/cjs/ListCtx-14aa546f.js +9 -0
- package/lib/cjs/TagCtx-690a1d54.js +7 -0
- package/lib/cjs/components/Accordion/Accordion.js +6 -6
- package/lib/cjs/components/Accordion/AccordionButton.js +5 -5
- package/lib/cjs/components/Accordion/AccordionItem.js +2 -2
- package/lib/cjs/components/Accordion/AccordionPanel.js +8 -8
- package/lib/cjs/components/Accordion/index.js +2 -2
- package/lib/cjs/components/Breadcrumb/Breadcrumb.js +5 -5
- package/lib/cjs/components/Breadcrumb/index.js +1 -1
- package/lib/cjs/components/Button/Button.js +1 -1
- package/lib/cjs/components/Button/index.js +1 -1
- package/lib/cjs/components/Callout/Callout.js +4 -4
- package/lib/cjs/components/Callout/index.js +1 -1
- package/lib/cjs/components/Card/Card.js +2 -2
- package/lib/cjs/components/Card/CardGroup.js +2 -2
- package/lib/cjs/components/Card/index.js +2 -2
- package/lib/cjs/components/Checkbox/Checkbox.js +5 -5
- package/lib/cjs/components/Checkbox/index.js +1 -1
- package/lib/cjs/components/Collapse/Collapse.js +1194 -44
- package/lib/cjs/components/Collapse/index.js +0 -1
- package/lib/cjs/components/ContextMenu/ContextMenu.js +1 -1
- package/lib/cjs/components/ContextMenu/index.js +1 -1
- package/lib/cjs/components/Credit/Credit.js +3 -3
- package/lib/cjs/components/Credit/index.js +1 -1
- package/lib/cjs/components/DatePicker/DatePicker.js +4 -4
- package/lib/cjs/components/DatePicker/index.js +1 -1
- package/lib/cjs/components/Dropdown/Dropdown.js +5 -5
- package/lib/cjs/components/Dropdown/index.js +1 -1
- package/lib/cjs/components/Empty/Empty.js +1 -1
- package/lib/cjs/components/Empty/index.js +1 -1
- package/lib/cjs/components/Fieldset/Fieldset.js +5 -5
- package/lib/cjs/components/Fieldset/index.js +1 -1
- package/lib/cjs/components/FileUpload/FileUpload.js +5 -5
- package/lib/cjs/components/FileUpload/index.js +1 -1
- package/lib/cjs/components/Footer/Footer.js +1 -1
- package/lib/cjs/components/Footer/index.js +1 -1
- package/lib/cjs/components/Form/Form.js +3 -3
- package/lib/cjs/components/Form/index.js +1 -1
- package/lib/cjs/components/FormControl/FormControl.js +7 -7
- package/lib/cjs/components/FormControl/index.js +1 -1
- package/lib/cjs/components/GlobalProvider/GlobalProvider.js +1 -1
- package/lib/cjs/components/GlobalProvider/index.js +1 -1
- package/lib/cjs/components/Heading/Heading.js +1 -1
- package/lib/cjs/components/Heading/index.js +1 -1
- package/lib/cjs/components/Hero/Hero.js +1 -1
- package/lib/cjs/components/Hero/HeroCard.js +1 -1
- package/lib/cjs/components/Hero/index.js +1 -1
- package/lib/cjs/components/Icon/Icon.js +3 -3
- package/lib/cjs/components/Icon/index.js +1 -1
- package/lib/cjs/components/Image/Image.js +1 -1
- package/lib/cjs/components/Image/index.js +1 -1
- package/lib/cjs/components/Input/Input.js +1 -1
- package/lib/cjs/components/Input/index.js +1 -1
- package/lib/cjs/components/Link/Link.js +1 -1
- package/lib/cjs/components/Link/index.js +1 -1
- package/lib/cjs/components/LinkList/LinkList.js +1 -1
- package/lib/cjs/components/LinkList/index.js +1 -1
- package/lib/cjs/components/List/List.js +4 -4
- package/lib/cjs/components/List/ListItem.js +2 -2
- package/lib/cjs/components/List/index.js +2 -2
- package/lib/cjs/components/Loading/Loading.js +1 -1
- package/lib/cjs/components/Loading/index.js +1 -1
- package/lib/cjs/components/LocalNav/LocalNav.js +4 -4
- package/lib/cjs/components/LocalNav/index.js +1 -1
- package/lib/cjs/components/Logo/Logo.js +15 -15
- package/lib/cjs/components/Logo/index.js +1 -1
- package/lib/cjs/components/LogoGrid/LogoGrid.js +1 -1
- package/lib/cjs/components/LogoGrid/index.js +1 -1
- package/lib/cjs/components/Navigation/Navigation.js +6 -6
- package/lib/cjs/components/Navigation/index.js +1 -1
- package/lib/cjs/components/Notification/Notification.js +3 -3
- package/lib/cjs/components/Notification/index.js +1 -1
- package/lib/cjs/components/NumberPicker/NumberPicker.js +4 -4
- package/lib/cjs/components/NumberPicker/index.js +1 -1
- package/lib/cjs/components/Pagination/Pagination.js +1 -1
- package/lib/cjs/components/Pagination/index.js +1 -1
- package/lib/cjs/components/Profile/Profile.js +1 -1
- package/lib/cjs/components/Profile/index.js +1 -1
- package/lib/cjs/components/Radio/Radio.js +5 -5
- package/lib/cjs/components/Radio/index.js +1 -1
- package/lib/cjs/components/ReadMore/ReadMore.js +4 -4
- package/lib/cjs/components/ReadMore/index.js +1 -1
- package/lib/cjs/components/RichText/RichText.js +1 -1
- package/lib/cjs/components/RichText/index.js +1 -1
- package/lib/cjs/components/SearchField/SearchField.js +3 -3
- package/lib/cjs/components/SearchField/index.js +1 -1
- package/lib/cjs/components/SocialMedia/SocialMedia.js +1 -1
- package/lib/cjs/components/SocialMedia/index.js +1 -1
- package/lib/cjs/components/TableOfContents/TableOfContents.js +1 -1
- package/lib/cjs/components/TableOfContents/index.js +1 -1
- package/lib/cjs/components/Tabs/Tabs.args.js +156 -0
- package/lib/cjs/components/Tabs/Tabs.js +24 -0
- package/lib/cjs/components/Tabs/index.js +15 -0
- package/lib/cjs/components/Tag/Tag.js +4 -4
- package/lib/cjs/components/Tag/TagSet.js +6 -6
- package/lib/cjs/components/Tag/index.js +2 -2
- package/lib/cjs/components/TextInput/TextInput.js +4 -4
- package/lib/cjs/components/TextInput/index.js +1 -1
- package/lib/cjs/components/Textarea/Textarea.js +4 -4
- package/lib/cjs/components/Textarea/index.js +1 -1
- package/lib/cjs/components/Toggle/Toggle.js +4 -4
- package/lib/cjs/components/Toggle/index.js +1 -1
- package/lib/cjs/components/Tooltip/Tooltip.js +5 -5
- package/lib/cjs/components/Tooltip/index.js +1 -1
- package/lib/cjs/components/Video/Video.js +11 -12
- package/lib/cjs/components/Video/VideoPlayer.js +55 -13
- package/lib/cjs/components/Video/index.js +6 -8
- package/lib/cjs/components/index.js +9 -8
- package/lib/cjs/hooks/index.js +1 -1
- package/lib/cjs/hooks/useGlobalSettings.js +3 -3
- package/lib/cjs/hooks/usePrevious.js +3 -3
- package/lib/cjs/hooks/useVideoPlayer.js +7 -7
- package/lib/cjs/index.js +9 -8
- package/lib/esm/components/Collapse/Collapse.js +1156 -6
- package/lib/esm/components/Collapse/index.js +0 -1
- package/lib/esm/components/FileUpload/FileUpload.js +3 -3
- package/lib/esm/components/NumberPicker/NumberPicker.js +3 -3
- package/lib/esm/components/Radio/Radio.js +3 -3
- package/lib/esm/components/Tabs/Tabs.args.js +154 -0
- package/lib/esm/components/Tabs/Tabs.js +22 -0
- package/lib/esm/components/Tabs/index.js +9 -0
- package/lib/esm/components/TextInput/TextInput.js +3 -3
- package/lib/esm/components/Textarea/Textarea.js +3 -3
- package/lib/esm/components/Video/Video.js +10 -11
- package/lib/esm/components/Video/VideoPlayer.js +57 -11
- package/lib/esm/components/Video/index.js +5 -7
- package/lib/esm/components/index.js +4 -4
- package/lib/esm/index.js +4 -4
- package/lib/types/react/src/components/Tabs/Tabs.args.d.ts +10 -0
- package/lib/types/react/src/components/Tabs/Tabs.d.ts +4 -0
- package/lib/types/react/src/components/Tabs/Tabs.props.d.ts +12 -0
- package/lib/types/react/src/components/Tabs/index.d.ts +1 -0
- package/lib/types/react/src/components/Video/Video.d.ts +2 -2
- package/lib/types/react/src/components/Video/Video.props.d.ts +5 -43
- package/lib/types/react/src/components/Video/VideoPlayer.d.ts +3 -3
- package/lib/types/react/src/components/Video/VideoPlayer.props.d.ts +6 -31
- package/lib/types/react/src/components/index.d.ts +1 -0
- package/package.json +9 -7
- package/src/components/Tabs/Tabs.args.tsx +201 -0
- package/src/components/Tabs/Tabs.props.ts +13 -0
- package/src/components/Tabs/Tabs.tsx +60 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Video/Video.args.ts +18 -24
- package/src/components/Video/Video.props.ts +5 -47
- package/src/components/Video/Video.tsx +24 -19
- package/src/components/Video/VideoPlayer.props.ts +7 -38
- package/src/components/Video/VideoPlayer.tsx +67 -322
- package/src/components/index.ts +1 -0
- package/src/declarations.d.ts +22 -0
- package/lib/cjs/AccordionCtx-fe08ff45.js +0 -9
- package/lib/cjs/DailyMotion-17b56ecb.js +0 -259
- package/lib/cjs/Facebook-0c8d86ee.js +0 -239
- package/lib/cjs/FilePlayer-01d6dc08.js +0 -596
- package/lib/cjs/Kaltura-40e8e581.js +0 -235
- package/lib/cjs/ListCtx-7db7fe04.js +0 -9
- package/lib/cjs/Mixcloud-e23f49d6.js +0 -222
- package/lib/cjs/Preview-8e490f54.js +0 -227
- package/lib/cjs/SoundCloud-2500b6cb.js +0 -249
- package/lib/cjs/Streamable-00723065.js +0 -234
- package/lib/cjs/TagCtx-929c7753.js +0 -7
- package/lib/cjs/Twitch-2c5c5733.js +0 -244
- package/lib/cjs/VideoPlayer-5f0a64c6.js +0 -2067
- package/lib/cjs/Vidyard-d36d6c45.js +0 -237
- package/lib/cjs/Vimeo-d311e3b8.js +0 -285
- package/lib/cjs/Wistia-318b4e43.js +0 -288
- package/lib/cjs/YouTube-a3796a55.js +0 -377
- package/lib/cjs/index-0af02e81.js +0 -1154
- package/lib/esm/DailyMotion-989c2db3.js +0 -257
- package/lib/esm/Facebook-04e9cc59.js +0 -237
- package/lib/esm/FilePlayer-0789336d.js +0 -594
- package/lib/esm/Kaltura-a9ed37a9.js +0 -233
- package/lib/esm/Mixcloud-5a3b4353.js +0 -220
- package/lib/esm/Preview-7ca1835e.js +0 -225
- package/lib/esm/SoundCloud-47bccd79.js +0 -247
- package/lib/esm/Streamable-ee762126.js +0 -232
- package/lib/esm/Twitch-3cd4b54b.js +0 -242
- package/lib/esm/VideoPlayer-96c2b20c.js +0 -2062
- package/lib/esm/Vidyard-258ab0ef.js +0 -235
- package/lib/esm/Vimeo-4b29b580.js +0 -283
- package/lib/esm/Wistia-3cbce669.js +0 -286
- package/lib/esm/YouTube-db52da1c.js +0 -375
- package/lib/esm/index-623ce3f5.js +0 -1152
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-96c2b20c.js';
|
|
2
|
-
import require$$0 from 'react';
|
|
3
|
-
|
|
4
|
-
function _mergeNamespaces(n, m) {
|
|
5
|
-
m.forEach(function (e) {
|
|
6
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
-
if (k !== 'default' && !(k in n)) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return e[k]; }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return Object.freeze(n);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var Kaltura$2 = {};
|
|
20
|
-
|
|
21
|
-
(function (exports) {
|
|
22
|
-
|
|
23
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports["default"] = void 0;
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireWildcard(require$$0);
|
|
31
|
-
|
|
32
|
-
var _utils = utils;
|
|
33
|
-
|
|
34
|
-
var _patterns = patterns;
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
|
-
|
|
38
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
|
-
|
|
42
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
43
|
-
|
|
44
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
|
-
|
|
46
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
47
|
-
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
53
|
-
|
|
54
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
55
|
-
|
|
56
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
57
|
-
|
|
58
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
|
-
|
|
60
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
61
|
-
|
|
62
|
-
var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
|
|
63
|
-
var SDK_GLOBAL = 'playerjs';
|
|
64
|
-
|
|
65
|
-
var Kaltura = /*#__PURE__*/function (_Component) {
|
|
66
|
-
_inherits(Kaltura, _Component);
|
|
67
|
-
|
|
68
|
-
var _super = _createSuper(Kaltura);
|
|
69
|
-
|
|
70
|
-
function Kaltura() {
|
|
71
|
-
var _this;
|
|
72
|
-
|
|
73
|
-
_classCallCheck(this, Kaltura);
|
|
74
|
-
|
|
75
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
76
|
-
args[_key] = arguments[_key];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
80
|
-
|
|
81
|
-
_defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);
|
|
82
|
-
|
|
83
|
-
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
84
|
-
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
90
|
-
_this.callPlayer('mute');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
94
|
-
_this.callPlayer('unmute');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
98
|
-
_this.iframe = iframe;
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
return _this;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_createClass(Kaltura, [{
|
|
105
|
-
key: "componentDidMount",
|
|
106
|
-
value: function componentDidMount() {
|
|
107
|
-
this.props.onMount && this.props.onMount(this);
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "load",
|
|
111
|
-
value: function load(url) {
|
|
112
|
-
var _this2 = this;
|
|
113
|
-
|
|
114
|
-
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
|
|
115
|
-
if (!_this2.iframe) return;
|
|
116
|
-
_this2.player = new playerjs.Player(_this2.iframe);
|
|
117
|
-
|
|
118
|
-
_this2.player.on('ready', function () {
|
|
119
|
-
// An arbitrary timeout is required otherwise
|
|
120
|
-
// the event listeners won’t work
|
|
121
|
-
setTimeout(function () {
|
|
122
|
-
_this2.player.isReady = true;
|
|
123
|
-
|
|
124
|
-
_this2.player.setLoop(_this2.props.loop);
|
|
125
|
-
|
|
126
|
-
if (_this2.props.muted) {
|
|
127
|
-
_this2.player.mute();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
_this2.addListeners(_this2.player, _this2.props);
|
|
131
|
-
|
|
132
|
-
_this2.props.onReady();
|
|
133
|
-
}, 500);
|
|
134
|
-
});
|
|
135
|
-
}, this.props.onError);
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "addListeners",
|
|
139
|
-
value: function addListeners(player, props) {
|
|
140
|
-
var _this3 = this;
|
|
141
|
-
|
|
142
|
-
player.on('play', props.onPlay);
|
|
143
|
-
player.on('pause', props.onPause);
|
|
144
|
-
player.on('ended', props.onEnded);
|
|
145
|
-
player.on('error', props.onError);
|
|
146
|
-
player.on('timeupdate', function (_ref) {
|
|
147
|
-
var duration = _ref.duration,
|
|
148
|
-
seconds = _ref.seconds;
|
|
149
|
-
_this3.duration = duration;
|
|
150
|
-
_this3.currentTime = seconds;
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}, {
|
|
154
|
-
key: "play",
|
|
155
|
-
value: function play() {
|
|
156
|
-
this.callPlayer('play');
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "pause",
|
|
160
|
-
value: function pause() {
|
|
161
|
-
this.callPlayer('pause');
|
|
162
|
-
}
|
|
163
|
-
}, {
|
|
164
|
-
key: "stop",
|
|
165
|
-
value: function stop() {// Nothing to do
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "seekTo",
|
|
169
|
-
value: function seekTo(seconds) {
|
|
170
|
-
this.callPlayer('setCurrentTime', seconds);
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "setVolume",
|
|
174
|
-
value: function setVolume(fraction) {
|
|
175
|
-
this.callPlayer('setVolume', fraction);
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
key: "setLoop",
|
|
179
|
-
value: function setLoop(loop) {
|
|
180
|
-
this.callPlayer('setLoop', loop);
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "getDuration",
|
|
184
|
-
value: function getDuration() {
|
|
185
|
-
return this.duration;
|
|
186
|
-
}
|
|
187
|
-
}, {
|
|
188
|
-
key: "getCurrentTime",
|
|
189
|
-
value: function getCurrentTime() {
|
|
190
|
-
return this.currentTime;
|
|
191
|
-
}
|
|
192
|
-
}, {
|
|
193
|
-
key: "getSecondsLoaded",
|
|
194
|
-
value: function getSecondsLoaded() {
|
|
195
|
-
return this.secondsLoaded;
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
key: "render",
|
|
199
|
-
value: function render() {
|
|
200
|
-
var style = {
|
|
201
|
-
width: '100%',
|
|
202
|
-
height: '100%'
|
|
203
|
-
};
|
|
204
|
-
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
205
|
-
ref: this.ref,
|
|
206
|
-
src: this.props.url,
|
|
207
|
-
frameBorder: "0",
|
|
208
|
-
scrolling: "no",
|
|
209
|
-
style: style,
|
|
210
|
-
allow: "encrypted-media; autoplay; fullscreen;",
|
|
211
|
-
referrerPolicy: "no-referrer-when-downgrade"
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}]);
|
|
215
|
-
|
|
216
|
-
return Kaltura;
|
|
217
|
-
}(_react.Component);
|
|
218
|
-
|
|
219
|
-
exports["default"] = Kaltura;
|
|
220
|
-
|
|
221
|
-
_defineProperty(Kaltura, "displayName", 'Kaltura');
|
|
222
|
-
|
|
223
|
-
_defineProperty(Kaltura, "canPlay", _patterns.canPlay.kaltura);
|
|
224
|
-
} (Kaltura$2));
|
|
225
|
-
|
|
226
|
-
var Kaltura = /*@__PURE__*/getDefaultExportFromCjs(Kaltura$2);
|
|
227
|
-
|
|
228
|
-
var Kaltura$1 = /*#__PURE__*/_mergeNamespaces({
|
|
229
|
-
__proto__: null,
|
|
230
|
-
default: Kaltura
|
|
231
|
-
}, [Kaltura$2]);
|
|
232
|
-
|
|
233
|
-
export { Kaltura$1 as K };
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-96c2b20c.js';
|
|
2
|
-
import require$$0 from 'react';
|
|
3
|
-
|
|
4
|
-
function _mergeNamespaces(n, m) {
|
|
5
|
-
m.forEach(function (e) {
|
|
6
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
-
if (k !== 'default' && !(k in n)) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return e[k]; }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return Object.freeze(n);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var Mixcloud$2 = {};
|
|
20
|
-
|
|
21
|
-
(function (exports) {
|
|
22
|
-
|
|
23
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports["default"] = void 0;
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireWildcard(require$$0);
|
|
31
|
-
|
|
32
|
-
var _utils = utils;
|
|
33
|
-
|
|
34
|
-
var _patterns = patterns;
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
|
-
|
|
38
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
-
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
43
|
-
|
|
44
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
|
-
|
|
46
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
47
|
-
|
|
48
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
49
|
-
|
|
50
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
51
|
-
|
|
52
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
53
|
-
|
|
54
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
55
|
-
|
|
56
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
57
|
-
|
|
58
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
|
-
|
|
60
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
61
|
-
|
|
62
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
63
|
-
|
|
64
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
65
|
-
|
|
66
|
-
var SDK_URL = 'https://widget.mixcloud.com/media/js/widgetApi.js';
|
|
67
|
-
var SDK_GLOBAL = 'Mixcloud';
|
|
68
|
-
|
|
69
|
-
var Mixcloud = /*#__PURE__*/function (_Component) {
|
|
70
|
-
_inherits(Mixcloud, _Component);
|
|
71
|
-
|
|
72
|
-
var _super = _createSuper(Mixcloud);
|
|
73
|
-
|
|
74
|
-
function Mixcloud() {
|
|
75
|
-
var _this;
|
|
76
|
-
|
|
77
|
-
_classCallCheck(this, Mixcloud);
|
|
78
|
-
|
|
79
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
80
|
-
args[_key] = arguments[_key];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
84
|
-
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
90
|
-
|
|
91
|
-
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
92
|
-
|
|
93
|
-
_defineProperty(_assertThisInitialized(_this), "mute", function () {// No volume support
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
_defineProperty(_assertThisInitialized(_this), "unmute", function () {// No volume support
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
100
|
-
_this.iframe = iframe;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
return _this;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
_createClass(Mixcloud, [{
|
|
107
|
-
key: "componentDidMount",
|
|
108
|
-
value: function componentDidMount() {
|
|
109
|
-
this.props.onMount && this.props.onMount(this);
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "load",
|
|
113
|
-
value: function load(url) {
|
|
114
|
-
var _this2 = this;
|
|
115
|
-
|
|
116
|
-
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Mixcloud) {
|
|
117
|
-
_this2.player = Mixcloud.PlayerWidget(_this2.iframe);
|
|
118
|
-
|
|
119
|
-
_this2.player.ready.then(function () {
|
|
120
|
-
_this2.player.events.play.on(_this2.props.onPlay);
|
|
121
|
-
|
|
122
|
-
_this2.player.events.pause.on(_this2.props.onPause);
|
|
123
|
-
|
|
124
|
-
_this2.player.events.ended.on(_this2.props.onEnded);
|
|
125
|
-
|
|
126
|
-
_this2.player.events.error.on(_this2.props.error);
|
|
127
|
-
|
|
128
|
-
_this2.player.events.progress.on(function (seconds, duration) {
|
|
129
|
-
_this2.currentTime = seconds;
|
|
130
|
-
_this2.duration = duration;
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
_this2.props.onReady();
|
|
134
|
-
});
|
|
135
|
-
}, this.props.onError);
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "play",
|
|
139
|
-
value: function play() {
|
|
140
|
-
this.callPlayer('play');
|
|
141
|
-
}
|
|
142
|
-
}, {
|
|
143
|
-
key: "pause",
|
|
144
|
-
value: function pause() {
|
|
145
|
-
this.callPlayer('pause');
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
key: "stop",
|
|
149
|
-
value: function stop() {// Nothing to do
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
key: "seekTo",
|
|
153
|
-
value: function seekTo(seconds) {
|
|
154
|
-
this.callPlayer('seek', seconds);
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
key: "setVolume",
|
|
158
|
-
value: function setVolume(fraction) {// No volume support
|
|
159
|
-
}
|
|
160
|
-
}, {
|
|
161
|
-
key: "getDuration",
|
|
162
|
-
value: function getDuration() {
|
|
163
|
-
return this.duration;
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
key: "getCurrentTime",
|
|
167
|
-
value: function getCurrentTime() {
|
|
168
|
-
return this.currentTime;
|
|
169
|
-
}
|
|
170
|
-
}, {
|
|
171
|
-
key: "getSecondsLoaded",
|
|
172
|
-
value: function getSecondsLoaded() {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
}, {
|
|
176
|
-
key: "render",
|
|
177
|
-
value: function render() {
|
|
178
|
-
var _this$props = this.props,
|
|
179
|
-
url = _this$props.url,
|
|
180
|
-
config = _this$props.config;
|
|
181
|
-
var id = url.match(_patterns.MATCH_URL_MIXCLOUD)[1];
|
|
182
|
-
var style = {
|
|
183
|
-
width: '100%',
|
|
184
|
-
height: '100%'
|
|
185
|
-
};
|
|
186
|
-
var query = (0, _utils.queryString)(_objectSpread(_objectSpread({}, config.options), {}, {
|
|
187
|
-
feed: "/".concat(id, "/")
|
|
188
|
-
})); // We have to give the iframe a key here to prevent a
|
|
189
|
-
// weird dialog appearing when loading a new track
|
|
190
|
-
|
|
191
|
-
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
192
|
-
key: id,
|
|
193
|
-
ref: this.ref,
|
|
194
|
-
style: style,
|
|
195
|
-
src: "https://www.mixcloud.com/widget/iframe/?".concat(query),
|
|
196
|
-
frameBorder: "0"
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}]);
|
|
200
|
-
|
|
201
|
-
return Mixcloud;
|
|
202
|
-
}(_react.Component);
|
|
203
|
-
|
|
204
|
-
exports["default"] = Mixcloud;
|
|
205
|
-
|
|
206
|
-
_defineProperty(Mixcloud, "displayName", 'Mixcloud');
|
|
207
|
-
|
|
208
|
-
_defineProperty(Mixcloud, "canPlay", _patterns.canPlay.mixcloud);
|
|
209
|
-
|
|
210
|
-
_defineProperty(Mixcloud, "loopOnEnded", true);
|
|
211
|
-
} (Mixcloud$2));
|
|
212
|
-
|
|
213
|
-
var Mixcloud = /*@__PURE__*/getDefaultExportFromCjs(Mixcloud$2);
|
|
214
|
-
|
|
215
|
-
var Mixcloud$1 = /*#__PURE__*/_mergeNamespaces({
|
|
216
|
-
__proto__: null,
|
|
217
|
-
default: Mixcloud
|
|
218
|
-
}, [Mixcloud$2]);
|
|
219
|
-
|
|
220
|
-
export { Mixcloud$1 as M };
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './VideoPlayer-96c2b20c.js';
|
|
2
|
-
import require$$0 from 'react';
|
|
3
|
-
|
|
4
|
-
function _mergeNamespaces(n, m) {
|
|
5
|
-
m.forEach(function (e) {
|
|
6
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
-
if (k !== 'default' && !(k in n)) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return e[k]; }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return Object.freeze(n);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var Preview$2 = {};
|
|
20
|
-
|
|
21
|
-
(function (exports) {
|
|
22
|
-
|
|
23
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports["default"] = void 0;
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireWildcard(require$$0);
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
-
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
|
-
|
|
40
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
|
-
|
|
42
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
43
|
-
|
|
44
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
|
-
|
|
46
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
47
|
-
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
53
|
-
|
|
54
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
55
|
-
|
|
56
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
57
|
-
|
|
58
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
|
-
|
|
60
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
61
|
-
|
|
62
|
-
var ICON_SIZE = '64px';
|
|
63
|
-
var cache = {};
|
|
64
|
-
|
|
65
|
-
var Preview = /*#__PURE__*/function (_Component) {
|
|
66
|
-
_inherits(Preview, _Component);
|
|
67
|
-
|
|
68
|
-
var _super = _createSuper(Preview);
|
|
69
|
-
|
|
70
|
-
function Preview() {
|
|
71
|
-
var _this;
|
|
72
|
-
|
|
73
|
-
_classCallCheck(this, Preview);
|
|
74
|
-
|
|
75
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
76
|
-
args[_key] = arguments[_key];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
80
|
-
|
|
81
|
-
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
82
|
-
|
|
83
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
84
|
-
image: null
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (e) {
|
|
88
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
89
|
-
_this.props.onClick();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
return _this;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
_createClass(Preview, [{
|
|
97
|
-
key: "componentDidMount",
|
|
98
|
-
value: function componentDidMount() {
|
|
99
|
-
this.mounted = true;
|
|
100
|
-
this.fetchImage(this.props);
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
key: "componentDidUpdate",
|
|
104
|
-
value: function componentDidUpdate(prevProps) {
|
|
105
|
-
var _this$props = this.props,
|
|
106
|
-
url = _this$props.url,
|
|
107
|
-
light = _this$props.light;
|
|
108
|
-
|
|
109
|
-
if (prevProps.url !== url || prevProps.light !== light) {
|
|
110
|
-
this.fetchImage(this.props);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
key: "componentWillUnmount",
|
|
115
|
-
value: function componentWillUnmount() {
|
|
116
|
-
this.mounted = false;
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
key: "fetchImage",
|
|
120
|
-
value: function fetchImage(_ref) {
|
|
121
|
-
var _this2 = this;
|
|
122
|
-
|
|
123
|
-
var url = _ref.url,
|
|
124
|
-
light = _ref.light,
|
|
125
|
-
oEmbedUrl = _ref.oEmbedUrl;
|
|
126
|
-
|
|
127
|
-
if (typeof light === 'string') {
|
|
128
|
-
this.setState({
|
|
129
|
-
image: light
|
|
130
|
-
});
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (cache[url]) {
|
|
135
|
-
this.setState({
|
|
136
|
-
image: cache[url]
|
|
137
|
-
});
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
this.setState({
|
|
142
|
-
image: null
|
|
143
|
-
});
|
|
144
|
-
return window.fetch(oEmbedUrl.replace('{url}', url)).then(function (response) {
|
|
145
|
-
return response.json();
|
|
146
|
-
}).then(function (data) {
|
|
147
|
-
if (data.thumbnail_url && _this2.mounted) {
|
|
148
|
-
var image = data.thumbnail_url.replace('height=100', 'height=480');
|
|
149
|
-
|
|
150
|
-
_this2.setState({
|
|
151
|
-
image: image
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
cache[url] = image;
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
key: "render",
|
|
160
|
-
value: function render() {
|
|
161
|
-
var _this$props2 = this.props,
|
|
162
|
-
onClick = _this$props2.onClick,
|
|
163
|
-
playIcon = _this$props2.playIcon,
|
|
164
|
-
previewTabIndex = _this$props2.previewTabIndex;
|
|
165
|
-
var image = this.state.image;
|
|
166
|
-
var flexCenter = {
|
|
167
|
-
display: 'flex',
|
|
168
|
-
alignItems: 'center',
|
|
169
|
-
justifyContent: 'center'
|
|
170
|
-
};
|
|
171
|
-
var styles = {
|
|
172
|
-
preview: _objectSpread({
|
|
173
|
-
width: '100%',
|
|
174
|
-
height: '100%',
|
|
175
|
-
backgroundImage: image ? "url(".concat(image, ")") : undefined,
|
|
176
|
-
backgroundSize: 'cover',
|
|
177
|
-
backgroundPosition: 'center',
|
|
178
|
-
cursor: 'pointer'
|
|
179
|
-
}, flexCenter),
|
|
180
|
-
shadow: _objectSpread({
|
|
181
|
-
background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',
|
|
182
|
-
borderRadius: ICON_SIZE,
|
|
183
|
-
width: ICON_SIZE,
|
|
184
|
-
height: ICON_SIZE
|
|
185
|
-
}, flexCenter),
|
|
186
|
-
playIcon: {
|
|
187
|
-
borderStyle: 'solid',
|
|
188
|
-
borderWidth: '16px 0 16px 26px',
|
|
189
|
-
borderColor: 'transparent transparent transparent white',
|
|
190
|
-
marginLeft: '7px'
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
var defaultPlayIcon = /*#__PURE__*/_react["default"].createElement("div", {
|
|
195
|
-
style: styles.shadow,
|
|
196
|
-
className: "react-player__shadow"
|
|
197
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
198
|
-
style: styles.playIcon,
|
|
199
|
-
className: "react-player__play-icon"
|
|
200
|
-
}));
|
|
201
|
-
|
|
202
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
203
|
-
style: styles.preview,
|
|
204
|
-
className: "react-player__preview",
|
|
205
|
-
onClick: onClick,
|
|
206
|
-
tabIndex: previewTabIndex,
|
|
207
|
-
onKeyPress: this.handleKeyPress
|
|
208
|
-
}, playIcon || defaultPlayIcon);
|
|
209
|
-
}
|
|
210
|
-
}]);
|
|
211
|
-
|
|
212
|
-
return Preview;
|
|
213
|
-
}(_react.Component);
|
|
214
|
-
|
|
215
|
-
exports["default"] = Preview;
|
|
216
|
-
} (Preview$2));
|
|
217
|
-
|
|
218
|
-
var Preview = /*@__PURE__*/getDefaultExportFromCjs(Preview$2);
|
|
219
|
-
|
|
220
|
-
var Preview$1 = /*#__PURE__*/_mergeNamespaces({
|
|
221
|
-
__proto__: null,
|
|
222
|
-
default: Preview
|
|
223
|
-
}, [Preview$2]);
|
|
224
|
-
|
|
225
|
-
export { Preview$1 as P };
|