@ilo-org/react 0.10.6 → 0.12.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 +25 -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/Cards/Card.js +40 -0
- package/lib/cjs/components/Cards/CardGroup.js +33 -0
- package/lib/cjs/components/Cards/DataCard/index.js +27 -0
- package/lib/cjs/components/Cards/DetailCard/index.js +20 -0
- package/lib/cjs/components/Cards/FactlistCard/index.js +23 -0
- package/lib/cjs/components/Cards/FeatureCard/index.js +24 -0
- package/lib/cjs/components/Cards/MultilinkCard/index.js +24 -0
- package/lib/cjs/components/Cards/PromoCard/index.js +23 -0
- package/lib/cjs/components/Cards/StatCard/index.js +21 -0
- package/lib/cjs/components/Cards/TextCard/index.js +25 -0
- package/lib/cjs/components/Cards/index.js +37 -0
- 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 +2 -2
- 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 +21 -12
- 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 +21 -12
- package/lib/esm/components/Cards/Card.js +38 -0
- package/lib/esm/components/{Card → Cards}/CardGroup.js +14 -6
- package/lib/esm/components/Cards/DataCard/index.js +25 -0
- package/lib/esm/components/Cards/DetailCard/index.js +18 -0
- package/lib/esm/components/Cards/FactlistCard/index.js +21 -0
- package/lib/esm/components/Cards/FeatureCard/index.js +22 -0
- package/lib/esm/components/Cards/MultilinkCard/index.js +22 -0
- package/lib/esm/components/Cards/PromoCard/index.js +21 -0
- package/lib/esm/components/Cards/StatCard/index.js +19 -0
- package/lib/esm/components/Cards/TextCard/index.js +23 -0
- package/lib/esm/components/Cards/index.js +22 -0
- 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/LinkList/LinkList.js +1 -1
- 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 +14 -6
- package/lib/esm/index.js +14 -6
- package/lib/types/react/src/components/Cards/Card.props.d.ts +307 -0
- package/lib/types/react/src/components/{Card → Cards}/CardGroup.props.d.ts +1 -1
- package/lib/types/react/src/components/Cards/DataCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/DetailCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FactlistCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/FeatureCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/MultilinkCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/PromoCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/StatCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/TextCard/index.d.ts +4 -0
- package/lib/types/react/src/components/Cards/index.d.ts +11 -0
- 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 +2 -1
- package/lib/types/react/src/types/index.d.ts +3 -3
- package/package.json +9 -7
- package/src/components/{Card → Cards}/Card.args.ts +41 -36
- package/src/components/Cards/Card.props.ts +382 -0
- package/src/components/Cards/Card.tsx +36 -0
- package/src/components/{Card → Cards}/CardGroup.args.ts +26 -26
- package/src/components/{Card → Cards}/CardGroup.props.ts +1 -1
- package/src/components/{Card → Cards}/CardGroup.tsx +12 -13
- package/src/components/Cards/DataCard/index.tsx +107 -0
- package/src/components/Cards/DetailCard/index.tsx +62 -0
- package/src/components/Cards/FactlistCard/index.tsx +42 -0
- package/src/components/Cards/FeatureCard/index.tsx +69 -0
- package/src/components/Cards/MultilinkCard/index.tsx +76 -0
- package/src/components/Cards/PromoCard/index.tsx +60 -0
- package/src/components/Cards/StatCard/index.tsx +36 -0
- package/src/components/Cards/TextCard/index.tsx +63 -0
- package/src/components/Cards/index.ts +22 -0
- package/src/components/LinkList/LinkList.tsx +1 -1
- 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 +2 -1
- package/src/declarations.d.ts +22 -0
- package/src/types/index.ts +4 -4
- 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/components/Card/Card.js +0 -43
- package/lib/cjs/components/Card/CardGroup.js +0 -25
- package/lib/cjs/components/Card/index.js +0 -21
- 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/components/Card/Card.js +0 -41
- package/lib/esm/components/Card/index.js +0 -14
- package/lib/esm/index-623ce3f5.js +0 -1152
- package/lib/types/react/src/components/Card/Card.props.d.ts +0 -110
- package/lib/types/react/src/components/Card/index.d.ts +0 -2
- package/src/components/Card/Card.props.ts +0 -142
- package/src/components/Card/Card.tsx +0 -183
- package/src/components/Card/index.ts +0 -2
- /package/lib/types/react/src/components/{Card → Cards}/Card.d.ts +0 -0
- /package/lib/types/react/src/components/{Card → Cards}/CardGroup.d.ts +0 -0
|
@@ -1,242 +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 Twitch$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://player.twitch.tv/js/embed/v1.js';
|
|
67
|
-
var SDK_GLOBAL = 'Twitch';
|
|
68
|
-
var PLAYER_ID_PREFIX = 'twitch-player-';
|
|
69
|
-
|
|
70
|
-
var Twitch = /*#__PURE__*/function (_Component) {
|
|
71
|
-
_inherits(Twitch, _Component);
|
|
72
|
-
|
|
73
|
-
var _super = _createSuper(Twitch);
|
|
74
|
-
|
|
75
|
-
function Twitch() {
|
|
76
|
-
var _this;
|
|
77
|
-
|
|
78
|
-
_classCallCheck(this, Twitch);
|
|
79
|
-
|
|
80
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
81
|
-
args[_key] = arguments[_key];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
85
|
-
|
|
86
|
-
_defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);
|
|
87
|
-
|
|
88
|
-
_defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, _utils.randomString)()));
|
|
89
|
-
|
|
90
|
-
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
91
|
-
_this.callPlayer('setMuted', true);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
95
|
-
_this.callPlayer('setMuted', false);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
return _this;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
_createClass(Twitch, [{
|
|
102
|
-
key: "componentDidMount",
|
|
103
|
-
value: function componentDidMount() {
|
|
104
|
-
this.props.onMount && this.props.onMount(this);
|
|
105
|
-
}
|
|
106
|
-
}, {
|
|
107
|
-
key: "load",
|
|
108
|
-
value: function load(url, isReady) {
|
|
109
|
-
var _this2 = this;
|
|
110
|
-
|
|
111
|
-
var _this$props = this.props,
|
|
112
|
-
playsinline = _this$props.playsinline,
|
|
113
|
-
onError = _this$props.onError,
|
|
114
|
-
config = _this$props.config,
|
|
115
|
-
controls = _this$props.controls;
|
|
116
|
-
|
|
117
|
-
var isChannel = _patterns.MATCH_URL_TWITCH_CHANNEL.test(url);
|
|
118
|
-
|
|
119
|
-
var id = isChannel ? url.match(_patterns.MATCH_URL_TWITCH_CHANNEL)[1] : url.match(_patterns.MATCH_URL_TWITCH_VIDEO)[1];
|
|
120
|
-
|
|
121
|
-
if (isReady) {
|
|
122
|
-
if (isChannel) {
|
|
123
|
-
this.player.setChannel(id);
|
|
124
|
-
} else {
|
|
125
|
-
this.player.setVideo('v' + id);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {
|
|
132
|
-
_this2.player = new Twitch.Player(_this2.playerID, _objectSpread({
|
|
133
|
-
video: isChannel ? '' : id,
|
|
134
|
-
channel: isChannel ? id : '',
|
|
135
|
-
height: '100%',
|
|
136
|
-
width: '100%',
|
|
137
|
-
playsinline: playsinline,
|
|
138
|
-
autoplay: _this2.props.playing,
|
|
139
|
-
muted: _this2.props.muted,
|
|
140
|
-
// https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
|
|
141
|
-
controls: isChannel ? true : controls,
|
|
142
|
-
time: (0, _utils.parseStartTime)(url)
|
|
143
|
-
}, config.options));
|
|
144
|
-
var _Twitch$Player = Twitch.Player,
|
|
145
|
-
READY = _Twitch$Player.READY,
|
|
146
|
-
PLAYING = _Twitch$Player.PLAYING,
|
|
147
|
-
PAUSE = _Twitch$Player.PAUSE,
|
|
148
|
-
ENDED = _Twitch$Player.ENDED,
|
|
149
|
-
ONLINE = _Twitch$Player.ONLINE,
|
|
150
|
-
OFFLINE = _Twitch$Player.OFFLINE,
|
|
151
|
-
SEEK = _Twitch$Player.SEEK;
|
|
152
|
-
|
|
153
|
-
_this2.player.addEventListener(READY, _this2.props.onReady);
|
|
154
|
-
|
|
155
|
-
_this2.player.addEventListener(PLAYING, _this2.props.onPlay);
|
|
156
|
-
|
|
157
|
-
_this2.player.addEventListener(PAUSE, _this2.props.onPause);
|
|
158
|
-
|
|
159
|
-
_this2.player.addEventListener(ENDED, _this2.props.onEnded);
|
|
160
|
-
|
|
161
|
-
_this2.player.addEventListener(SEEK, _this2.props.onSeek); // Prevent weird isLoading behaviour when streams are offline
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
_this2.player.addEventListener(ONLINE, _this2.props.onLoaded);
|
|
165
|
-
|
|
166
|
-
_this2.player.addEventListener(OFFLINE, _this2.props.onLoaded);
|
|
167
|
-
}, onError);
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
key: "play",
|
|
171
|
-
value: function play() {
|
|
172
|
-
this.callPlayer('play');
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
key: "pause",
|
|
176
|
-
value: function pause() {
|
|
177
|
-
this.callPlayer('pause');
|
|
178
|
-
}
|
|
179
|
-
}, {
|
|
180
|
-
key: "stop",
|
|
181
|
-
value: function stop() {
|
|
182
|
-
this.callPlayer('pause');
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
key: "seekTo",
|
|
186
|
-
value: function seekTo(seconds) {
|
|
187
|
-
this.callPlayer('seek', seconds);
|
|
188
|
-
}
|
|
189
|
-
}, {
|
|
190
|
-
key: "setVolume",
|
|
191
|
-
value: function setVolume(fraction) {
|
|
192
|
-
this.callPlayer('setVolume', fraction);
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
key: "getDuration",
|
|
196
|
-
value: function getDuration() {
|
|
197
|
-
return this.callPlayer('getDuration');
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "getCurrentTime",
|
|
201
|
-
value: function getCurrentTime() {
|
|
202
|
-
return this.callPlayer('getCurrentTime');
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
key: "getSecondsLoaded",
|
|
206
|
-
value: function getSecondsLoaded() {
|
|
207
|
-
return null;
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "render",
|
|
211
|
-
value: function render() {
|
|
212
|
-
var style = {
|
|
213
|
-
width: '100%',
|
|
214
|
-
height: '100%'
|
|
215
|
-
};
|
|
216
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
217
|
-
style: style,
|
|
218
|
-
id: this.playerID
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}]);
|
|
222
|
-
|
|
223
|
-
return Twitch;
|
|
224
|
-
}(_react.Component);
|
|
225
|
-
|
|
226
|
-
exports["default"] = Twitch;
|
|
227
|
-
|
|
228
|
-
_defineProperty(Twitch, "displayName", 'Twitch');
|
|
229
|
-
|
|
230
|
-
_defineProperty(Twitch, "canPlay", _patterns.canPlay.twitch);
|
|
231
|
-
|
|
232
|
-
_defineProperty(Twitch, "loopOnEnded", true);
|
|
233
|
-
} (Twitch$2));
|
|
234
|
-
|
|
235
|
-
var Twitch = /*@__PURE__*/getDefaultExportFromCjs(Twitch$2);
|
|
236
|
-
|
|
237
|
-
var Twitch$1 = /*#__PURE__*/_mergeNamespaces({
|
|
238
|
-
__proto__: null,
|
|
239
|
-
default: Twitch
|
|
240
|
-
}, [Twitch$2]);
|
|
241
|
-
|
|
242
|
-
export { Twitch$1 as T };
|