@ndla/ui 3.3.7 → 3.3.8
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/es/Breadcrumb/Breadcrumb.js +2 -1
- package/es/NDLAFilm/FilmSlideshow.js +213 -247
- package/es/NDLAFilm/NavigationArrow.js +13 -60
- package/es/NDLAFilm/SlideshowIndicator.js +16 -63
- package/es/NDLAFilm/interfaces.js +0 -0
- package/es/NDLAFilm/shapes.js +0 -10
- package/es/Spinner/Spinner.js +3 -3
- package/lib/Breadcrumb/Breadcrumb.js +2 -1
- package/lib/NDLAFilm/FilmSlideshow.d.ts +16 -0
- package/lib/NDLAFilm/FilmSlideshow.js +214 -248
- package/lib/NDLAFilm/NavigationArrow.d.ts +15 -0
- package/lib/NDLAFilm/NavigationArrow.js +20 -65
- package/lib/NDLAFilm/SlideshowIndicator.d.ts +15 -0
- package/lib/NDLAFilm/SlideshowIndicator.js +16 -69
- package/lib/NDLAFilm/interfaces.d.ts +10 -0
- package/lib/NDLAFilm/interfaces.js +1 -0
- package/lib/NDLAFilm/shapes.d.ts +5 -0
- package/lib/NDLAFilm/shapes.js +1 -14
- package/lib/Spinner/Spinner.d.ts +3 -3
- package/lib/Spinner/Spinner.js +2 -2
- package/package.json +4 -4
- package/src/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/NDLAFilm/FilmSlideshow.tsx +264 -0
- package/src/NDLAFilm/NavigationArrow.tsx +42 -0
- package/src/NDLAFilm/SlideshowIndicator.tsx +40 -0
- package/src/NDLAFilm/interfaces.ts +10 -0
- package/src/NDLAFilm/shapes.ts +6 -0
- package/src/Spinner/Spinner.tsx +9 -5
- package/src/NDLAFilm/FilmSlideshow.jsx +0 -277
- package/src/NDLAFilm/NavigationArrow.jsx +0 -46
- package/src/NDLAFilm/SlideshowIndicator.jsx +0 -43
- package/src/NDLAFilm/shapes.js +0 -17
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
2
|
|
|
5
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
|
-
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); } }
|
|
8
|
-
|
|
9
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
10
|
-
|
|
11
|
-
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); }
|
|
12
|
-
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
-
|
|
15
|
-
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); }; }
|
|
16
|
-
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
18
|
-
|
|
19
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
|
|
21
|
-
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; } }
|
|
22
|
-
|
|
23
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
-
|
|
25
3
|
/**
|
|
26
4
|
* Copyright (c) 2019-present, NDLA.
|
|
27
5
|
*
|
|
@@ -29,53 +7,28 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
29
7
|
* LICENSE file in the root directory of this source tree.
|
|
30
8
|
*
|
|
31
9
|
*/
|
|
32
|
-
import React
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
34
11
|
import BEMHelper from 'react-bem-helper';
|
|
35
|
-
import { movieShape } from './shapes';
|
|
36
12
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
37
13
|
var classes = new BEMHelper({
|
|
38
14
|
name: 'film-slideshow',
|
|
39
15
|
prefix: 'c-'
|
|
40
16
|
});
|
|
41
17
|
|
|
42
|
-
var SlideshowIndicator =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _this$props = this.props,
|
|
57
|
-
slideshow = _this$props.slideshow,
|
|
58
|
-
activeSlide = _this$props.activeSlide,
|
|
59
|
-
gotoSlide = _this$props.gotoSlide;
|
|
60
|
-
return ___EmotionJSX("div", classes('indicator-wrapper'), slideshow.map(function (slide, index) {
|
|
61
|
-
return ___EmotionJSX("button", _extends({
|
|
62
|
-
key: "indicator_".concat(index) // eslint-disable-line react/no-array-index-key
|
|
63
|
-
,
|
|
64
|
-
type: "button"
|
|
65
|
-
}, classes('indicator-dot', index === activeSlide ? 'active' : ''), {
|
|
66
|
-
onClick: function onClick() {
|
|
67
|
-
return gotoSlide(index, true);
|
|
68
|
-
}
|
|
69
|
-
}), ___EmotionJSX("span", null));
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
}]);
|
|
73
|
-
|
|
74
|
-
return SlideshowIndicator;
|
|
75
|
-
}(Component);
|
|
76
|
-
|
|
77
|
-
SlideshowIndicator.propTypes = {
|
|
78
|
-
slideshow: PropTypes.arrayOf(movieShape),
|
|
79
|
-
activeSlide: PropTypes.number
|
|
18
|
+
var SlideshowIndicator = function SlideshowIndicator(_ref) {
|
|
19
|
+
var slideshow = _ref.slideshow,
|
|
20
|
+
activeSlide = _ref.activeSlide,
|
|
21
|
+
gotoSlide = _ref.gotoSlide;
|
|
22
|
+
return ___EmotionJSX("div", classes('indicator-wrapper'), slideshow.map(function (slide, index) {
|
|
23
|
+
return ___EmotionJSX("button", _extends({
|
|
24
|
+
key: "indicator_".concat(index),
|
|
25
|
+
type: "button"
|
|
26
|
+
}, classes('indicator-dot', index === activeSlide ? 'active' : ''), {
|
|
27
|
+
onClick: function onClick() {
|
|
28
|
+
return gotoSlide(index, true);
|
|
29
|
+
}
|
|
30
|
+
}), ___EmotionJSX("span", null));
|
|
31
|
+
}));
|
|
80
32
|
};
|
|
33
|
+
|
|
81
34
|
export default SlideshowIndicator;
|
|
File without changes
|
package/es/NDLAFilm/shapes.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
export var movieShape = PropTypes.shape({
|
|
3
|
-
id: PropTypes.string.isRequired,
|
|
4
|
-
metaDescription: PropTypes.string.isRequired,
|
|
5
|
-
title: PropTypes.string.isRequired,
|
|
6
|
-
metaImage: PropTypes.shape({
|
|
7
|
-
url: PropTypes.string.isRequired,
|
|
8
|
-
alt: PropTypes.string.isRequired
|
|
9
|
-
}),
|
|
10
|
-
path: PropTypes.string.isRequired
|
|
11
|
-
});
|
|
12
2
|
export var topicShape = PropTypes.shape({
|
|
13
3
|
id: PropTypes.string,
|
|
14
4
|
name: PropTypes.string
|
package/es/Spinner/Spinner.js
CHANGED
|
@@ -8,7 +8,7 @@ import _styled from "@emotion/styled-base";
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { colors, spacing } from '@ndla/core';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
13
13
|
|
|
14
14
|
var SpinnerDiv = /*#__PURE__*/_styled('div', {
|
|
@@ -22,9 +22,9 @@ var SpinnerDiv = /*#__PURE__*/_styled('div', {
|
|
|
22
22
|
return spacing[props.size];
|
|
23
23
|
}, ";width:", function (props) {
|
|
24
24
|
return spacing[props.size];
|
|
25
|
-
}, ";
|
|
25
|
+
}, ";margin:", function (props) {
|
|
26
26
|
return props.margin;
|
|
27
|
-
}, ";@keyframes spinnerAnimation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
}, ";display:block;@keyframes spinnerAnimation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNwaW5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uZXJBbmltYXRpb24gMC43cyBsaW5lYXIgaW5maW5pdGU7XG4gIGhlaWdodDogJHsocHJvcHMpID0+IHNwYWNpbmdbcHJvcHMuc2l6ZV19O1xuICB3aWR0aDogJHsocHJvcHMpID0+IHNwYWNpbmdbcHJvcHMuc2l6ZV19O1xuICBtYXJnaW46ICR7KHByb3BzKSA9PiBwcm9wcy5tYXJnaW59O1xuICBkaXNwbGF5OiBibG9jaztcbiAgQGtleWZyYW1lcyBzcGlubmVyQW5pbWF0aW9uIHtcbiAgICAwJSB7XG4gICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTtcbiAgICB9XG4gICAgMTAwJSB7XG4gICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpO1xuICAgIH1cbiAgfVxuYDtcblxuY29uc3QgU3Bpbm5lciA9ICh7IHNpemUgPSAnbGFyZ2UnLCBtYXJnaW4gPSBgJHtzcGFjaW5nLm5vcm1hbH0gYXV0b2AsIGludmVydGVkIH06IFBhcnRpYWw8UHJvcHM+KSA9PiAoXG4gIDxTcGlubmVyRGl2IHNpemU9e3NpemV9IG1hcmdpbj17bWFyZ2lufSBpbnZlcnRlZD17ISFpbnZlcnRlZH0gLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFNwaW5uZXI7XG4iXX0= */"));
|
|
28
28
|
|
|
29
29
|
var Spinner = function Spinner(_ref) {
|
|
30
30
|
var _ref$size = _ref.size,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2016-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { NDLAMovie } from './interfaces';
|
|
9
|
+
interface Props {
|
|
10
|
+
autoSlide: boolean;
|
|
11
|
+
randomStart: boolean;
|
|
12
|
+
slideshow: NDLAMovie[];
|
|
13
|
+
slideInterval: number;
|
|
14
|
+
}
|
|
15
|
+
declare const FilmSlideshow: ({ autoSlide, slideshow, slideInterval }: Props) => JSX.Element;
|
|
16
|
+
export default FilmSlideshow;
|