@mjhls/mjh-framework 1.0.713 → 1.0.715
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 +1 -1
- package/dist/cjs/AdSlotsProvider.js +112 -7
- package/dist/cjs/ArticleCarousel.js +2 -1
- package/dist/cjs/ArticleSeriesListing.js +2 -1
- package/dist/cjs/BrowseVideosListing.js +2 -1
- package/dist/cjs/ExternalResources.js +3 -2
- package/dist/cjs/GroupDeck.js +13 -12
- package/dist/cjs/PartnerDetailListing.js +3 -2
- package/dist/cjs/TaxonomyDescription.js +3 -2
- package/dist/cjs/VideoProgramLandingPage.js +251 -0
- package/dist/cjs/VideoSeriesLandingPage.js +178 -0
- package/dist/cjs/VideoSeriesListing.js +2 -1
- package/dist/cjs/View.js +3 -2
- package/dist/cjs/YoutubeGroup.js +17 -16
- package/dist/cjs/getSerializers.js +3 -2
- package/dist/cjs/index-187c967e.js +54 -0
- package/dist/cjs/{index-bb09dc7c.js → index-27f9e7ef.js} +11 -11
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/{smoothscroll-1abb448e.js → smoothscroll-99df7f93.js} +0 -50
- package/dist/esm/AdSlotsProvider.js +114 -9
- package/dist/esm/ArticleCarousel.js +2 -1
- package/dist/esm/ArticleSeriesListing.js +2 -1
- package/dist/esm/BrowseVideosListing.js +2 -1
- package/dist/esm/ExternalResources.js +3 -2
- package/dist/esm/GroupDeck.js +2 -1
- package/dist/esm/PartnerDetailListing.js +3 -2
- package/dist/esm/TaxonomyDescription.js +3 -2
- package/dist/esm/VideoProgramLandingPage.js +242 -0
- package/dist/esm/VideoSeriesLandingPage.js +172 -0
- package/dist/esm/VideoSeriesListing.js +2 -1
- package/dist/esm/View.js +3 -2
- package/dist/esm/YoutubeGroup.js +2 -1
- package/dist/esm/getSerializers.js +3 -2
- package/dist/esm/index-c7e2ac95.js +52 -0
- package/dist/esm/{index-48a08226.js → index-db270302.js} +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/{smoothscroll-ab6e0238.js → smoothscroll-fa4e3f8c.js} +2 -51
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-acd1cc47.js';
|
|
2
|
+
import { _ as _typeof } from './typeof-64422756.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { m as moment } from './moment-bc12cb97.js';
|
|
5
|
+
import { g as getYoutubeId } from './index-c7e2ac95.js';
|
|
6
|
+
import Breadcrumbs from './Breadcrumbs.js';
|
|
7
|
+
import MasterDeck from './MasterDeck.js';
|
|
8
|
+
import VideoSeriesCard from './VideoSeriesCard.js';
|
|
9
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
10
|
+
import './es6.string.iterator-b24a54f2.js';
|
|
11
|
+
import './_to-object-9bef3b62.js';
|
|
12
|
+
import './web.dom.iterable-ca37144a.js';
|
|
13
|
+
import './_library-528f1934.js';
|
|
14
|
+
import './core.get-iterator-method-1b116089.js';
|
|
15
|
+
import './_set-species-0b056cff.js';
|
|
16
|
+
import './_iter-detect-d4d262ee.js';
|
|
17
|
+
import './_is-array-9383b394.js';
|
|
18
|
+
import './_object-pie-71ac75a4.js';
|
|
19
|
+
import './slicedToArray-34468155.js';
|
|
20
|
+
import 'react-bootstrap/Breadcrumb';
|
|
21
|
+
import './toConsumableArray-5212fee7.js';
|
|
22
|
+
import './extends-c2b1c9d7.js';
|
|
23
|
+
import './inherits-18d4a779.js';
|
|
24
|
+
import './_object-sap-6a003379.js';
|
|
25
|
+
import './define-property-9a008401.js';
|
|
26
|
+
import './index-669ff425.js';
|
|
27
|
+
import 'prop-types';
|
|
28
|
+
import 'react-bootstrap/Container';
|
|
29
|
+
import 'react-bootstrap/Row';
|
|
30
|
+
import 'react-bootstrap/Col';
|
|
31
|
+
import 'react-bootstrap/Card';
|
|
32
|
+
import 'next/router';
|
|
33
|
+
import './lodash-ad27652f.js';
|
|
34
|
+
import './debounce-1a993acf.js';
|
|
35
|
+
import './isSymbol-807e927e.js';
|
|
36
|
+
import './index.es-c6222053.js';
|
|
37
|
+
import './visibility-sensor-082c757b.js';
|
|
38
|
+
import 'react-dom';
|
|
39
|
+
import './index-3f5c03b2.js';
|
|
40
|
+
import './ADlgInfeed-ce2e0e3a.js';
|
|
41
|
+
import './stringify-8a4f19f7.js';
|
|
42
|
+
import './AdSlot.js';
|
|
43
|
+
import './Beam.js';
|
|
44
|
+
import './Segment.js';
|
|
45
|
+
import './main-1450d277.js';
|
|
46
|
+
import './ADInfeed-a9a35a5c.js';
|
|
47
|
+
import './index-752d1dae.js';
|
|
48
|
+
import './style-inject.es-1f59c1d0.js';
|
|
49
|
+
|
|
50
|
+
var _this = undefined;
|
|
51
|
+
|
|
52
|
+
var VideoSeriesLandingPage = function VideoSeriesLandingPage(props) {
|
|
53
|
+
var summary = props.summary,
|
|
54
|
+
client = props.client,
|
|
55
|
+
posts = props.posts,
|
|
56
|
+
_props$variant = props.variant,
|
|
57
|
+
variant = _props$variant === undefined ? 'left' : _props$variant,
|
|
58
|
+
_props$defaultImage = props.defaultImage,
|
|
59
|
+
defaultImage = _props$defaultImage === undefined ? '/placeholder.jpg' : _props$defaultImage,
|
|
60
|
+
mapping = props.mapping,
|
|
61
|
+
query = props.query,
|
|
62
|
+
params = props.params,
|
|
63
|
+
_props$currentPage = props.currentPage,
|
|
64
|
+
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
65
|
+
pageview = props.pageview,
|
|
66
|
+
_props$autoScroll = props.autoScroll,
|
|
67
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
|
|
68
|
+
rightItems = props.rightItems,
|
|
69
|
+
brandInsightAd = props.brandInsightAd,
|
|
70
|
+
_props$showBI = props.showBI,
|
|
71
|
+
showBI = _props$showBI === undefined ? false : _props$showBI,
|
|
72
|
+
_props$lgInfeedAd = props.lgInfeedAd,
|
|
73
|
+
lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd;
|
|
74
|
+
|
|
75
|
+
return React.createElement(
|
|
76
|
+
'div',
|
|
77
|
+
null,
|
|
78
|
+
summary && React.createElement(
|
|
79
|
+
'div',
|
|
80
|
+
{ style: { fontSize: '1rem' }, className: 'series-summary px-1 my-4' },
|
|
81
|
+
summary
|
|
82
|
+
),
|
|
83
|
+
React.createElement(Breadcrumbs, null),
|
|
84
|
+
posts && React.createElement(MasterDeck, {
|
|
85
|
+
deck: VideoSeriesCard,
|
|
86
|
+
variant: variant,
|
|
87
|
+
client: client,
|
|
88
|
+
defaultImage: defaultImage,
|
|
89
|
+
mapping: mapping,
|
|
90
|
+
dataRecord: posts,
|
|
91
|
+
query: query,
|
|
92
|
+
params: params,
|
|
93
|
+
currentPage: currentPage,
|
|
94
|
+
pageview: pageview,
|
|
95
|
+
autoScroll: autoScroll,
|
|
96
|
+
rightItems: rightItems,
|
|
97
|
+
brandInsightAd: brandInsightAd,
|
|
98
|
+
showBI: showBI,
|
|
99
|
+
lgInfeedAd: lgInfeedAd
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
VideoSeriesLandingPage.getInitialData = function () {
|
|
105
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(context, client) {
|
|
106
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
107
|
+
var today, urlQuery, seriesName, currentPage, start, params, query, posts, seriesTitle, summary, url;
|
|
108
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
109
|
+
while (1) {
|
|
110
|
+
switch (_context.prev = _context.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
today = moment().utc().format();
|
|
113
|
+
urlQuery = context.query;
|
|
114
|
+
seriesName = urlQuery.series;
|
|
115
|
+
currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
116
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
117
|
+
params = {
|
|
118
|
+
from: start,
|
|
119
|
+
to: start + itemsPerPage,
|
|
120
|
+
itemsPerPage: itemsPerPage
|
|
121
|
+
};
|
|
122
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && dateTime(published) <= dateTime(now()) \n && references(\'02c6c999-e6fe-4275-98ca-ceef28f91e14\') \n && is_visible == true \n && url.current == \'' + seriesName + '\'\n ][$from...$to] | order(published desc) {\n\t\ttitle,\n\t\tsummary,\n\t\tpublished,\n\t\tthumbnail,\n\t\turl,\n\t\ttaxonomy,\n\t\tbody[_type == "youtubeGallery"]\n\t}';
|
|
123
|
+
_context.next = 9;
|
|
124
|
+
return client.fetch(query, params);
|
|
125
|
+
|
|
126
|
+
case 9:
|
|
127
|
+
posts = _context.sent;
|
|
128
|
+
seriesTitle = '';
|
|
129
|
+
summary = '';
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
if (posts.length > 0 && posts[0].body.length > 0 && posts[0].body[0].videos) {
|
|
133
|
+
url = posts[0].url.current + '?seriesVid=';
|
|
134
|
+
|
|
135
|
+
seriesTitle = posts[0].title;
|
|
136
|
+
summary = posts[0].summary;
|
|
137
|
+
posts = posts[0].body[0].videos.filter(function (video) {
|
|
138
|
+
if ((video.is_visible === true || !video.hasOwnProperty('is_visible')) && (today >= video.published || !video.hasOwnProperty('published'))) {
|
|
139
|
+
return video;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
//start youtube thumbnail fix
|
|
143
|
+
posts.map(function (post, index) {
|
|
144
|
+
if (post.thumbnail && _typeof(post.thumbnail) !== 'object' || !post.thumbnail) {
|
|
145
|
+
var id = getYoutubeId(post.url);
|
|
146
|
+
var imageURL = 'https://img.youtube.com/vi/' + id + '/hqdefault.jpg';
|
|
147
|
+
return post['thumbnail'] = imageURL, post['url'] = {
|
|
148
|
+
current: url + (index + 1)
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return post['url'] = {
|
|
152
|
+
current: url + (index + 1)
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
//end
|
|
156
|
+
}
|
|
157
|
+
return _context.abrupt('return', { posts: posts, query: query, params: params, seriesTitle: seriesTitle, summary: summary, seriesName: seriesName });
|
|
158
|
+
|
|
159
|
+
case 14:
|
|
160
|
+
case 'end':
|
|
161
|
+
return _context.stop();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}, _callee, _this);
|
|
165
|
+
}));
|
|
166
|
+
|
|
167
|
+
return function (_x, _x2) {
|
|
168
|
+
return _ref.apply(this, arguments);
|
|
169
|
+
};
|
|
170
|
+
}();
|
|
171
|
+
|
|
172
|
+
export default VideoSeriesLandingPage;
|
|
@@ -25,8 +25,9 @@ import 'react-dom';
|
|
|
25
25
|
import './iconBase-602d52fe.js';
|
|
26
26
|
import './slicedToArray-34468155.js';
|
|
27
27
|
import './core.get-iterator-method-1b116089.js';
|
|
28
|
-
import './
|
|
28
|
+
import './index-c7e2ac95.js';
|
|
29
29
|
import './index-752d1dae.js';
|
|
30
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
30
31
|
import './index-3f5c03b2.js';
|
|
31
32
|
import './main-1450d277.js';
|
|
32
33
|
import './isSymbol-807e927e.js';
|
package/dist/esm/View.js
CHANGED
|
@@ -13,7 +13,7 @@ import 'react-bootstrap/Dropdown';
|
|
|
13
13
|
import Form from 'react-bootstrap/Form';
|
|
14
14
|
import FormControl from 'react-bootstrap/FormControl';
|
|
15
15
|
import Button from 'react-bootstrap/Button';
|
|
16
|
-
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-
|
|
16
|
+
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-db270302.js';
|
|
17
17
|
import SocialShare from './SocialShare.js';
|
|
18
18
|
import DFPAdSlot from './AdSlot.js';
|
|
19
19
|
import { g as getTargeting, a as getContentPlacementUrl } from './getTargeting-b1a7be54.js';
|
|
@@ -41,12 +41,13 @@ import './_object-pie-71ac75a4.js';
|
|
|
41
41
|
import 'prop-types';
|
|
42
42
|
import './index-3f5c03b2.js';
|
|
43
43
|
import 'react-bootstrap';
|
|
44
|
-
import './
|
|
44
|
+
import './index-c7e2ac95.js';
|
|
45
45
|
import './util-3ab476bf.js';
|
|
46
46
|
import './Beam.js';
|
|
47
47
|
import './Segment.js';
|
|
48
48
|
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
49
49
|
import './GroupDeck.js';
|
|
50
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
50
51
|
import './_is-array-9383b394.js';
|
|
51
52
|
import 'react-bootstrap/Pagination';
|
|
52
53
|
import './entities-932b50cf.js';
|
package/dist/esm/YoutubeGroup.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { _ as _typeof } from './typeof-64422756.js';
|
|
2
2
|
import { _ as _slicedToArray } from './slicedToArray-34468155.js';
|
|
3
3
|
import React, { useRef, useState, useEffect } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { g as getYoutubeId } from './index-c7e2ac95.js';
|
|
5
5
|
import { L as LazyLoad } from './index-752d1dae.js';
|
|
6
|
+
import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
|
|
6
7
|
import { i as imageUrlBuilder } from './index-3f5c03b2.js';
|
|
7
8
|
import { m as main_40, a as main_45, b as main_39 } from './main-1450d277.js';
|
|
8
9
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { g as default } from './index-
|
|
2
|
+
export { g as default } from './index-db270302.js';
|
|
3
3
|
import './BlockContent-d8cd739c.js';
|
|
4
4
|
import './entities-932b50cf.js';
|
|
5
5
|
import './slicedToArray-34468155.js';
|
|
@@ -13,7 +13,7 @@ import './index-3f5c03b2.js';
|
|
|
13
13
|
import './index-669ff425.js';
|
|
14
14
|
import 'prop-types';
|
|
15
15
|
import 'next/router';
|
|
16
|
-
import './
|
|
16
|
+
import './index-c7e2ac95.js';
|
|
17
17
|
import './util-3ab476bf.js';
|
|
18
18
|
import './Beam.js';
|
|
19
19
|
import './stringify-8a4f19f7.js';
|
|
@@ -31,6 +31,7 @@ import './typeof-64422756.js';
|
|
|
31
31
|
import './_is-array-9383b394.js';
|
|
32
32
|
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
33
33
|
import './GroupDeck.js';
|
|
34
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
34
35
|
import './moment-bc12cb97.js';
|
|
35
36
|
import './toConsumableArray-5212fee7.js';
|
|
36
37
|
import 'react-bootstrap/Pagination';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
|
|
3
|
+
var getYoutubeId = createCommonjsModule(function (module, exports) {
|
|
4
|
+
(function (root, factory) {
|
|
5
|
+
{
|
|
6
|
+
module.exports = factory();
|
|
7
|
+
}
|
|
8
|
+
}(commonjsGlobal, function (exports) {
|
|
9
|
+
|
|
10
|
+
return function (url, opts) {
|
|
11
|
+
if (opts == undefined) {
|
|
12
|
+
opts = {fuzzy: true};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (/youtu\.?be/.test(url)) {
|
|
16
|
+
|
|
17
|
+
// Look first for known patterns
|
|
18
|
+
var i;
|
|
19
|
+
var patterns = [
|
|
20
|
+
/youtu\.be\/([^#\&\?]{11})/, // youtu.be/<id>
|
|
21
|
+
/\?v=([^#\&\?]{11})/, // ?v=<id>
|
|
22
|
+
/\&v=([^#\&\?]{11})/, // &v=<id>
|
|
23
|
+
/embed\/([^#\&\?]{11})/, // embed/<id>
|
|
24
|
+
/\/v\/([^#\&\?]{11})/ // /v/<id>
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
// If any pattern matches, return the ID
|
|
28
|
+
for (i = 0; i < patterns.length; ++i) {
|
|
29
|
+
if (patterns[i].test(url)) {
|
|
30
|
+
return patterns[i].exec(url)[1];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (opts.fuzzy) {
|
|
35
|
+
// If that fails, break it apart by certain characters and look
|
|
36
|
+
// for the 11 character key
|
|
37
|
+
var tokens = url.split(/[\/\&\?=#\.\s]/g);
|
|
38
|
+
for (i = 0; i < tokens.length; ++i) {
|
|
39
|
+
if (/^[^#\&\?]{11}$/.test(tokens[i])) {
|
|
40
|
+
return tokens[i];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { getYoutubeId as g };
|
|
@@ -4,7 +4,7 @@ import { Carousel, Table, Figure as Figure$1, Button, ProgressBar, Card, Row as
|
|
|
4
4
|
import { i as imageUrlBuilder } from './index-3f5c03b2.js';
|
|
5
5
|
import { l as lib_3 } from './index-669ff425.js';
|
|
6
6
|
import Router, { useRouter } from 'next/router';
|
|
7
|
-
import { g as getYoutubeId } from './
|
|
7
|
+
import { g as getYoutubeId } from './index-c7e2ac95.js';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
10
10
|
import { u as util } from './util-3ab476bf.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -70,7 +70,7 @@ export { default as VerticalHero } from './VerticalHero.js';
|
|
|
70
70
|
export { default as YahooHero } from './YahooHero.js';
|
|
71
71
|
export { default as GridHero } from './GridHero.js';
|
|
72
72
|
export { default as ConferenceArticleCard } from './ConferenceArticleCard.js';
|
|
73
|
-
export { g as getSerializers } from './index-
|
|
73
|
+
export { g as getSerializers } from './index-db270302.js';
|
|
74
74
|
export { default as Beam } from './Beam.js';
|
|
75
75
|
export { default as Segment } from './Segment.js';
|
|
76
76
|
export { default as KMTracker } from './KMTracker.js';
|
|
@@ -80,6 +80,8 @@ export { default as getRelatedArticle } from './getRelatedArticle.js';
|
|
|
80
80
|
export { default as Auth } from './Auth.js';
|
|
81
81
|
export { default as View } from './View.js';
|
|
82
82
|
export { default as PartnerDetailListing } from './PartnerDetailListing.js';
|
|
83
|
+
export { default as VideoProgramLandingPage } from './VideoProgramLandingPage.js';
|
|
84
|
+
export { default as VideoSeriesLandingPage } from './VideoSeriesLandingPage.js';
|
|
83
85
|
export { default as urlFor } from './urlFor.js';
|
|
84
86
|
export { g as getTargeting } from './getTargeting-b1a7be54.js';
|
|
85
87
|
export { default as getKeywords } from './getKeywords.js';
|
|
@@ -128,7 +130,8 @@ import './AuthorComponent-c29a0075.js';
|
|
|
128
130
|
import 'react-bootstrap/Media';
|
|
129
131
|
import './BlockContent-d8cd739c.js';
|
|
130
132
|
import './react-social-icons-91f9716f.js';
|
|
131
|
-
import './
|
|
133
|
+
import './index-c7e2ac95.js';
|
|
134
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
132
135
|
import 'react-bootstrap';
|
|
133
136
|
import './timeDifferenceCalc.js';
|
|
134
137
|
import './index.esm-3fdda599.js';
|
|
@@ -173,3 +176,4 @@ import 'passport-local';
|
|
|
173
176
|
import 'mysql';
|
|
174
177
|
import './style-inject.es-1f59c1d0.js';
|
|
175
178
|
import 'react-twitter-embed';
|
|
179
|
+
import './VideoSeriesCard.js';
|
|
@@ -1,53 +1,4 @@
|
|
|
1
|
-
import { c as createCommonjsModule
|
|
2
|
-
|
|
3
|
-
var getYoutubeId = createCommonjsModule(function (module, exports) {
|
|
4
|
-
(function (root, factory) {
|
|
5
|
-
{
|
|
6
|
-
module.exports = factory();
|
|
7
|
-
}
|
|
8
|
-
}(commonjsGlobal, function (exports) {
|
|
9
|
-
|
|
10
|
-
return function (url, opts) {
|
|
11
|
-
if (opts == undefined) {
|
|
12
|
-
opts = {fuzzy: true};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (/youtu\.?be/.test(url)) {
|
|
16
|
-
|
|
17
|
-
// Look first for known patterns
|
|
18
|
-
var i;
|
|
19
|
-
var patterns = [
|
|
20
|
-
/youtu\.be\/([^#\&\?]{11})/, // youtu.be/<id>
|
|
21
|
-
/\?v=([^#\&\?]{11})/, // ?v=<id>
|
|
22
|
-
/\&v=([^#\&\?]{11})/, // &v=<id>
|
|
23
|
-
/embed\/([^#\&\?]{11})/, // embed/<id>
|
|
24
|
-
/\/v\/([^#\&\?]{11})/ // /v/<id>
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
// If any pattern matches, return the ID
|
|
28
|
-
for (i = 0; i < patterns.length; ++i) {
|
|
29
|
-
if (patterns[i].test(url)) {
|
|
30
|
-
return patterns[i].exec(url)[1];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (opts.fuzzy) {
|
|
35
|
-
// If that fails, break it apart by certain characters and look
|
|
36
|
-
// for the 11 character key
|
|
37
|
-
var tokens = url.split(/[\/\&\?=#\.\s]/g);
|
|
38
|
-
for (i = 0; i < tokens.length; ++i) {
|
|
39
|
-
if (/^[^#\&\?]{11}$/.test(tokens[i])) {
|
|
40
|
-
return tokens[i];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return null;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
}));
|
|
50
|
-
});
|
|
1
|
+
import { c as createCommonjsModule } from './_commonjsHelpers-0c4b6f40.js';
|
|
51
2
|
|
|
52
3
|
var smoothscroll = createCommonjsModule(function (module, exports) {
|
|
53
4
|
/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */
|
|
@@ -482,4 +433,4 @@ var smoothscroll = createCommonjsModule(function (module, exports) {
|
|
|
482
433
|
});
|
|
483
434
|
smoothscroll.polyfill;
|
|
484
435
|
|
|
485
|
-
export {
|
|
436
|
+
export { smoothscroll as s };
|