@ndla/ui 3.2.1-alpha.3 → 3.2.2
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/Article/ArticleAuthorContent.js +1 -2
- package/es/AuthorInfo/AuthorInfo.js +1 -2
- package/es/BackgroundImage/BackgroundImage.js +5 -15
- package/es/ContentLoader/index.js +14 -27
- package/es/Dialog/Dialog.js +10 -28
- package/es/FactBox/FactBox.js +7 -11
- package/es/Figure/Figure.js +9 -41
- package/es/Figure/FigureExpandButton.js +2 -11
- package/es/Figure/FigureLicense.js +4 -24
- package/es/Figure/FigureLicenseDialog.js +2 -20
- package/es/FileList/File.js +0 -13
- package/es/FileList/FileList.js +0 -13
- package/es/Hero/Hero.js +0 -6
- package/es/Image/Image.js +4 -27
- package/es/Image/ImageLink.js +3 -12
- package/es/Image/LazyLoadImage.js +4 -13
- package/es/InfoBox/InfoBox.js +0 -4
- package/es/InfoWidget/InfoWidget.js +2 -21
- package/es/Logo/Logo.js +6 -22
- package/es/Logo/SvgLogo.js +4 -12
- package/es/Masthead/Masthead.js +12 -33
- package/es/NoContentBox/NoContentBox.js +2 -11
- package/es/Portrait/Portrait.js +0 -11
- package/es/RelatedArticleList/RelatedArticleList.js +4 -23
- package/es/Topic/Topic.js +20 -20
- package/es/Translation/Translation.js +0 -5
- package/es/Translation/TranslationBox.js +7 -3
- package/es/Translation/TranslationLine.js +4 -15
- package/es/index-javascript.js +1 -18
- package/es/index.js +17 -0
- package/es/locale/messages-en.js +4 -0
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/lib/BackgroundImage/BackgroundImage.d.ts +11 -0
- package/lib/BackgroundImage/BackgroundImage.js +5 -17
- package/lib/BackgroundImage/index.d.ts +2 -0
- package/lib/ContentLoader/index.d.ts +20 -0
- package/lib/ContentLoader/index.js +14 -28
- package/lib/Dialog/Dialog.d.ts +23 -0
- package/lib/Dialog/Dialog.js +9 -29
- package/lib/Dialog/index.d.ts +10 -0
- package/lib/FactBox/FactBox.d.ts +16 -0
- package/lib/FactBox/FactBox.js +5 -11
- package/lib/FactBox/index.d.ts +2 -0
- package/lib/Figure/Figure.d.ts +50 -0
- package/lib/Figure/Figure.js +7 -41
- package/lib/Figure/FigureExpandButton.d.ts +16 -0
- package/lib/Figure/FigureExpandButton.js +2 -13
- package/lib/Figure/FigureLicense.d.ts +33 -0
- package/lib/Figure/FigureLicense.js +5 -27
- package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
- package/lib/Figure/FigureLicenseDialog.js +1 -22
- package/lib/Figure/index.d.ts +12 -0
- package/lib/FileList/File.d.ts +7 -0
- package/lib/FileList/File.js +0 -14
- package/lib/FileList/FileList.d.ts +17 -0
- package/lib/FileList/FileList.js +0 -14
- package/lib/FileList/index.d.ts +3 -0
- package/lib/Hero/Hero.d.ts +26 -0
- package/lib/Hero/Hero.js +0 -8
- package/lib/Hero/index.d.ts +8 -0
- package/lib/Image/Image.d.ts +25 -0
- package/lib/Image/Image.js +4 -28
- package/lib/Image/ImageLink.d.ts +18 -0
- package/lib/Image/ImageLink.js +3 -15
- package/lib/Image/LazyLoadImage.d.ts +17 -0
- package/lib/Image/LazyLoadImage.js +3 -13
- package/lib/Image/index.d.ts +11 -0
- package/lib/InfoBox/InfoBox.d.ts +6 -0
- package/lib/InfoBox/InfoBox.js +0 -5
- package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
- package/lib/InfoWidget/InfoWidget.d.ts +19 -0
- package/lib/InfoWidget/InfoWidget.js +2 -22
- package/lib/InfoWidget/index.d.ts +2 -0
- package/lib/Logo/Logo.d.ts +24 -0
- package/lib/Logo/Logo.js +6 -29
- package/lib/Logo/SvgLogo.d.ts +14 -0
- package/lib/Logo/SvgLogo.js +4 -13
- package/lib/Logo/index.d.ts +9 -0
- package/lib/Masthead/Masthead.d.ts +27 -0
- package/lib/Masthead/Masthead.js +10 -34
- package/lib/Masthead/index.d.ts +10 -0
- package/lib/NoContentBox/NoContentBox.d.ts +14 -0
- package/lib/NoContentBox/NoContentBox.js +1 -11
- package/lib/NoContentBox/index.d.ts +9 -0
- package/lib/Portrait/Portrait.d.ts +15 -0
- package/lib/Portrait/Portrait.js +0 -12
- package/lib/Portrait/index.d.ts +9 -0
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
- package/lib/RelatedArticleList/index.d.ts +10 -0
- package/lib/Topic/Topic.d.ts +3 -2
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/Translation.d.ts +14 -0
- package/lib/Translation/Translation.js +0 -6
- package/lib/Translation/TranslationBox.d.ts +10 -0
- package/lib/Translation/TranslationBox.js +6 -2
- package/lib/Translation/TranslationLine.d.ts +16 -0
- package/lib/Translation/TranslationLine.js +4 -22
- package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
- package/lib/index-javascript.js +0 -230
- package/lib/index.d.ts +17 -0
- package/lib/index.js +263 -0
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +4 -0
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +5 -1
- package/lib/types.d.ts +10 -0
- package/lib/utils/createUniversalPortal.d.ts +9 -0
- package/package.json +6 -6
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/AuthorInfo/AuthorInfo.tsx +0 -1
- package/src/BackgroundImage/BackgroundImage.tsx +32 -0
- package/src/BackgroundImage/{index.js → index.ts} +0 -0
- package/src/ContentLoader/{index.js → index.tsx} +20 -30
- package/src/Dialog/{Dialog.jsx → Dialog.tsx} +20 -32
- package/src/Dialog/{index.js → index.ts} +0 -0
- package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{index.js → index.ts} +0 -0
- package/src/Figure/{Figure.js → Figure.tsx} +44 -54
- package/src/Figure/{FigureExpandButton.js → FigureExpandButton.tsx} +8 -9
- package/src/Figure/{FigureLicense.js → FigureLicense.tsx} +32 -30
- package/src/Figure/{FigureLicenseDialog.js → FigureLicenseDialog.tsx} +22 -22
- package/src/Figure/{index.js → index.ts} +0 -0
- package/src/FileList/{File.jsx → File.tsx} +8 -18
- package/src/FileList/FileList.tsx +36 -0
- package/src/FileList/{index.js → index.ts} +0 -0
- package/src/Hero/Hero.tsx +56 -0
- package/src/Hero/{index.js → index.ts} +0 -0
- package/src/Image/{Image.jsx → Image.tsx} +30 -30
- package/src/Image/{ImageLink.js → ImageLink.tsx} +11 -12
- package/src/Image/LazyLoadImage.tsx +40 -0
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +4 -3
- package/src/Image/{index.js → index.ts} +0 -0
- package/src/InfoBox/InfoBox.tsx +11 -0
- package/src/InfoBox/index.ts +1 -0
- package/src/InfoWidget/{InfoWidget.jsx → InfoWidget.tsx} +19 -26
- package/src/InfoWidget/{index.js → index.ts} +0 -0
- package/src/Logo/{Logo.jsx → Logo.tsx} +21 -28
- package/src/Logo/{SvgLogo.jsx → SvgLogo.tsx} +8 -14
- package/src/Logo/{index.js → index.ts} +0 -0
- package/src/Masthead/{Masthead.jsx → Masthead.tsx} +33 -35
- package/src/Masthead/{index.js → index.ts} +0 -0
- package/src/NoContentBox/{NoContentBox.jsx → NoContentBox.tsx} +7 -13
- package/src/NoContentBox/{index.js → index.ts} +0 -0
- package/src/Portrait/{Portrait.jsx → Portrait.tsx} +8 -14
- package/src/Portrait/{index.js → index.ts} +0 -0
- package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
- package/src/RelatedArticleList/{index.js → index.ts} +0 -0
- package/src/Topic/Topic.tsx +3 -2
- package/src/Translation/{Translation.jsx → Translation.tsx} +7 -8
- package/src/Translation/TranslationBox.tsx +20 -0
- package/src/Translation/{TranslationLine.jsx → TranslationLine.tsx} +11 -18
- package/src/Translation/index.ts +3 -0
- package/src/index-javascript.js +0 -32
- package/src/index.ts +41 -0
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +5 -1
- package/src/locale/messages-nn.ts +5 -1
- package/src/types.ts +12 -0
- package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
- package/es/Image/shapes.js +0 -18
- package/lib/Image/shapes.js +0 -33
- package/src/BackgroundImage/BackgroundImage.jsx +0 -39
- package/src/FileList/FileList.jsx +0 -36
- package/src/Hero/Hero.jsx +0 -38
- package/src/Image/LazyLoadImage.jsx +0 -39
- package/src/Image/shapes.js +0 -21
- package/src/InfoBox/InfoBox.jsx +0 -13
- package/src/Translation/TranslationBox.jsx +0 -12
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
9
|
import BEMHelper from 'react-bem-helper';
|
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
12
11
|
var classes = new BEMHelper({
|
|
@@ -20,8 +19,4 @@ var Translation = function Translation(_ref) {
|
|
|
20
19
|
return ___EmotionJSX("div", classes(''), ___EmotionJSX("div", classes('index'), index), ___EmotionJSX("dl", classes('wrapper'), children));
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
Translation.propTypes = {
|
|
24
|
-
index: PropTypes.number.isRequired,
|
|
25
|
-
children: PropTypes.node.isRequired
|
|
26
|
-
};
|
|
27
22
|
export default Translation;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React from 'react'; //@ts-ignore
|
|
2
|
+
|
|
2
3
|
import { ArticleTabs } from '@ndla/tabs';
|
|
3
4
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
4
5
|
|
|
5
|
-
var TranslationBox = function TranslationBox(
|
|
6
|
+
var TranslationBox = function TranslationBox(_ref) {
|
|
7
|
+
var tabs = _ref.tabs;
|
|
6
8
|
return ___EmotionJSX("div", {
|
|
7
9
|
className: "c-translation-box"
|
|
8
10
|
}, ___EmotionJSX("div", {
|
|
9
11
|
className: "c-bodybox c-bodybox--translation"
|
|
10
|
-
}, ___EmotionJSX(ArticleTabs,
|
|
12
|
+
}, ___EmotionJSX(ArticleTabs, {
|
|
13
|
+
tabs: tabs
|
|
14
|
+
})));
|
|
11
15
|
};
|
|
12
16
|
|
|
13
17
|
export default TranslationBox;
|
|
@@ -7,8 +7,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
import React
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
12
11
|
import BEMHelper from 'react-bem-helper';
|
|
13
12
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
14
13
|
var classes = new BEMHelper({
|
|
@@ -20,10 +19,11 @@ var TranslationLine = function TranslationLine(_ref) {
|
|
|
20
19
|
var children = _ref.children,
|
|
21
20
|
lang = _ref.lang,
|
|
22
21
|
langName = _ref.langName,
|
|
23
|
-
isTerm = _ref.isTerm
|
|
22
|
+
_ref$isTerm = _ref.isTerm,
|
|
23
|
+
isTerm = _ref$isTerm === void 0 ? false : _ref$isTerm;
|
|
24
24
|
var hasLang = langName && lang;
|
|
25
25
|
|
|
26
|
-
var content = ___EmotionJSX(Fragment, null, ___EmotionJSX("div", _extends({}, classes('line-body'), {
|
|
26
|
+
var content = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", _extends({}, classes('line-body'), {
|
|
27
27
|
lang: lang
|
|
28
28
|
}), children), hasLang && ___EmotionJSX("div", classes('line-lang'), langName));
|
|
29
29
|
|
|
@@ -34,15 +34,4 @@ var TranslationLine = function TranslationLine(_ref) {
|
|
|
34
34
|
return ___EmotionJSX("dd", classes('line', hasLang ? 'lang' : ''), content);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
TranslationLine.propTypes = {
|
|
38
|
-
isTerm: PropTypes.bool,
|
|
39
|
-
children: PropTypes.node.isRequired,
|
|
40
|
-
lang: PropTypes.string,
|
|
41
|
-
langName: PropTypes.string
|
|
42
|
-
};
|
|
43
|
-
TranslationLine.defaultProps = {
|
|
44
|
-
isTerm: false,
|
|
45
|
-
lang: undefined,
|
|
46
|
-
langName: undefined
|
|
47
|
-
};
|
|
48
37
|
export default TranslationLine;
|
package/es/index-javascript.js
CHANGED
|
@@ -5,32 +5,15 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export { InfoBox } from './InfoBox';
|
|
9
|
-
export { default as Logo } from './Logo';
|
|
10
8
|
export { default as Table } from './Table';
|
|
11
9
|
export { FilterList, FilterListPhone, FilterButtons } from './Filter';
|
|
12
|
-
export { default as FactBox } from './FactBox';
|
|
13
|
-
export { default as FileList, File } from './FileList';
|
|
14
10
|
export { SearchOverlay, SearchField, SearchPage, SearchResult, SearchResultAuthor, SearchResultList, SearchResultItem, SearchFilter, SearchFilterList, SearchPopoverFilter, ActiveFilters, ToggleSearchButton } from './Search';
|
|
15
11
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, ExternalLearningResourcesBadge, SourceMaterialBadge } from './ContentTypeBadge';
|
|
16
|
-
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
17
12
|
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
18
13
|
export { default as TopicMenu, TopicMenuButton } from './TopicMenu';
|
|
19
|
-
export { default as RelatedArticleList, RelatedArticle } from './RelatedArticleList';
|
|
20
14
|
export { default as CompetenceGoals, CompetenceGoalList, CompetenceGoalListHeading, CompetenceGoal, CompetenceGoalsDialog } from './CompetenceGoals';
|
|
21
|
-
export { default as NoContentBox } from './NoContentBox';
|
|
22
15
|
export { default as ResourcesWrapper, ResourcesTitle, ResourcesTopicTitle } from './ResourcesWrapper';
|
|
23
|
-
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero } from './Hero';
|
|
24
|
-
export { default as Masthead, MastheadItem } from './Masthead';
|
|
25
|
-
export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton } from './Figure';
|
|
26
16
|
export { MediaList, MediaListItem, MediaListItemBody, MediaListItemActions, MediaListItemImage, MediaListItemMeta } from './MediaList';
|
|
27
17
|
export { EmbeddedTwitter, EmbeddedFacebook, EmbeddedFacebookPage } from './Embedded';
|
|
28
|
-
export { default as Image, ImageLink } from './Image';
|
|
29
|
-
export { makeSrcQueryString } from './Image';
|
|
30
|
-
export { default as Portrait } from './Portrait';
|
|
31
|
-
export { Translation, TranslationLine, TranslationBox } from './Translation';
|
|
32
|
-
export { default as ContentLoader } from './ContentLoader';
|
|
33
18
|
export { DisplayOnPageYOffset } from './Animation';
|
|
34
|
-
export {
|
|
35
|
-
export { FilmSlideshow, MovieGrid, AboutNdlaFilm, FilmMovieSearch, FilmMovieList, AllMoviesAlphabetically } from './NDLAFilm';
|
|
36
|
-
export { default as Spinner } from './Spinner';
|
|
19
|
+
export { FilmSlideshow, MovieGrid, AboutNdlaFilm, FilmMovieSearch, FilmMovieList, AllMoviesAlphabetically } from './NDLAFilm';
|
package/es/index.js
CHANGED
|
@@ -11,12 +11,29 @@
|
|
|
11
11
|
/** @ts-ignore */
|
|
12
12
|
export * from './index-javascript';
|
|
13
13
|
export { ArticleByline, ArticleContent, ArticleFootNotes, ArticleIntroduction, ArticleTitle, ArticleWrapper, ArticleHeaderWrapper, ArticleSideBar, default as Article } from './Article';
|
|
14
|
+
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
15
|
+
export { default as NoContentBox } from './NoContentBox';
|
|
16
|
+
export { default as Masthead, MastheadItem } from './Masthead';
|
|
17
|
+
export { default as Portrait } from './Portrait';
|
|
18
|
+
export { default as ContentLoader } from './ContentLoader';
|
|
19
|
+
export { default as RelatedArticleList, RelatedArticle } from './RelatedArticleList';
|
|
14
20
|
export { ErrorResourceAccessDenied, default as ErrorMessage } from './ErrorMessage';
|
|
21
|
+
export { default as FileList, File } from './FileList';
|
|
15
22
|
export { BlogPost, BlogPostWrapper } from './BlogPosts';
|
|
23
|
+
export { default as Logo } from './Logo';
|
|
24
|
+
export { InfoBox } from './InfoBox';
|
|
25
|
+
export { default as InfoWidget } from './InfoWidget';
|
|
16
26
|
export { FrontpageInfo, FrontpageFilm, FrontpageToolbox, FrontpageMultidisciplinarySubject, FrontpageHeader, FrontpageSubjectIllustration, FrontpageSearch, FrontpageProgramMenu } from './Frontpage';
|
|
27
|
+
export { default as FactBox } from './FactBox';
|
|
28
|
+
export { default as Image, ImageLink } from './Image';
|
|
29
|
+
export { makeSrcQueryString } from './Image';
|
|
30
|
+
export { SubjectMaterialHero, TasksAndActivitiesHero, AssessmentResourcesHero, SubjectHero, ExternalLearningResourcesHero, SourceMaterialHero, Hero, NdlaFilmHero } from './Hero';
|
|
17
31
|
export { Footer, EditorName, FooterText, FooterAuth } from './Footer';
|
|
32
|
+
export { Figure, FigureCaption, FigureLicenseDialog, FigureExpandButton } from './Figure';
|
|
18
33
|
export { LanguageSelector } from './LanguageSelector';
|
|
19
34
|
export { LearningPathWrapper, LearningPathContent, LearningPathMenu, LearningPathSticky, LearningPathInformation, LearningPathStickySibling, LearningPathStickyPlaceholder, LearningPathLastStepNavigation, LearningPathMobileStepInfo, LearningPathMobileHeader } from './LearningPaths';
|
|
35
|
+
export { Translation, TranslationLine, TranslationBox } from './Translation';
|
|
36
|
+
export { default as Spinner } from './Spinner';
|
|
20
37
|
export { default as SearchResultSleeve } from './Search/SearchResultSleeve';
|
|
21
38
|
export { default as ContentTypeResult } from './Search/ContentTypeResult';
|
|
22
39
|
export { SearchFieldForm } from './Search/SearchFieldForm';
|
package/es/locale/messages-en.js
CHANGED
|
@@ -774,6 +774,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
774
774
|
reuse: 'Use video',
|
|
775
775
|
error: 'Sorry, an error occurred while loading the video or metadata about the video.'
|
|
776
776
|
},
|
|
777
|
+
other: {
|
|
778
|
+
download: 'Download content',
|
|
779
|
+
reuse: 'Use content'
|
|
780
|
+
},
|
|
777
781
|
concept: {
|
|
778
782
|
showDescription: 'Show concept description',
|
|
779
783
|
error: {
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -510,7 +510,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
510
510
|
es: 'Spansk',
|
|
511
511
|
zh: 'Kinesisk',
|
|
512
512
|
unknown: 'Ukjent',
|
|
513
|
-
prefixChangeLanguage: 'Velg
|
|
513
|
+
prefixChangeLanguage: 'Velg språk'
|
|
514
514
|
},
|
|
515
515
|
changeLanguage: {
|
|
516
516
|
nb: 'Endre språk til bokmål',
|
|
@@ -774,6 +774,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
774
774
|
reuse: 'Bruk video',
|
|
775
775
|
error: 'Beklager, en feil oppstod ved lasting av videoen eller metadata om videoen.'
|
|
776
776
|
},
|
|
777
|
+
other: {
|
|
778
|
+
download: 'Last ned innhold',
|
|
779
|
+
reuse: 'Bruk innhold'
|
|
780
|
+
},
|
|
777
781
|
concept: {
|
|
778
782
|
showDescription: 'Vis beskrivelsen av forklaringen.',
|
|
779
783
|
error: {
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -510,7 +510,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
510
510
|
es: 'Spansk',
|
|
511
511
|
zh: 'Kinesisk',
|
|
512
512
|
unknown: 'Ukjent',
|
|
513
|
-
prefixChangeLanguage: 'Vel
|
|
513
|
+
prefixChangeLanguage: 'Vel språk'
|
|
514
514
|
},
|
|
515
515
|
changeLanguage: {
|
|
516
516
|
nb: 'Endre språk til bokmål',
|
|
@@ -774,6 +774,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
774
774
|
reuse: 'Bruk video',
|
|
775
775
|
error: 'Orsak, ein feil oppstod ved lasting av videoen eller metadata om videoen.'
|
|
776
776
|
},
|
|
777
|
+
other: {
|
|
778
|
+
download: 'Last ned innhald',
|
|
779
|
+
reuse: 'Bruk innhald'
|
|
780
|
+
},
|
|
777
781
|
concept: {
|
|
778
782
|
showDescription: 'Vis skildring av forklaringa',
|
|
779
783
|
error: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare type ImageType = 'mobile' | 'tablet' | 'desktop' | 'wide';
|
|
2
|
+
interface Props {
|
|
3
|
+
showOverlay?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
images: {
|
|
6
|
+
url: string;
|
|
7
|
+
types: ImageType[];
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
declare const BackgroundImage: ({ images, showOverlay }: Props) => JSX.Element;
|
|
11
|
+
export default BackgroundImage;
|
|
@@ -7,12 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
13
11
|
|
|
14
|
-
var _util = require("@ndla/util");
|
|
15
|
-
|
|
16
12
|
var _core = require("@emotion/core");
|
|
17
13
|
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -23,8 +19,11 @@ var classes = (0, _reactBemHelper["default"])('c-background-image');
|
|
|
23
19
|
|
|
24
20
|
var BackgroundImage = function BackgroundImage(_ref) {
|
|
25
21
|
var images = _ref.images,
|
|
26
|
-
showOverlay = _ref.showOverlay
|
|
27
|
-
|
|
22
|
+
_ref$showOverlay = _ref.showOverlay,
|
|
23
|
+
showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay;
|
|
24
|
+
return (0, _core.jsx)("div", classes('', {
|
|
25
|
+
showOverlay: showOverlay
|
|
26
|
+
}), images && images.map(function (image) {
|
|
28
27
|
return image.types.map(function (type) {
|
|
29
28
|
return (0, _core.jsx)("div", _extends({
|
|
30
29
|
key: "".concat(image.url).concat(type)
|
|
@@ -37,16 +36,5 @@ var BackgroundImage = function BackgroundImage(_ref) {
|
|
|
37
36
|
}));
|
|
38
37
|
};
|
|
39
38
|
|
|
40
|
-
BackgroundImage.propTypes = {
|
|
41
|
-
showOverlay: _propTypes["default"].bool,
|
|
42
|
-
className: _propTypes["default"].string,
|
|
43
|
-
images: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
44
|
-
url: _propTypes["default"].string.isRequired,
|
|
45
|
-
types: _propTypes["default"].arrayOf(_propTypes["default"].oneOf(Object.keys(_util.breakpoints))).isRequired
|
|
46
|
-
})).isRequired
|
|
47
|
-
};
|
|
48
|
-
BackgroundImage.defaultProps = {
|
|
49
|
-
showOverlay: false
|
|
50
|
-
};
|
|
51
39
|
var _default = BackgroundImage;
|
|
52
40
|
exports["default"] = _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
speed?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
primaryColor?: string;
|
|
15
|
+
secondaryColor?: string;
|
|
16
|
+
preserveAspectRatio?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const ContentLoader: ({ children, width, height, preserveAspectRatio, className, primaryColor, secondaryColor, speed, ...rest }: Props) => JSX.Element;
|
|
20
|
+
export default ContentLoader;
|
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _util = require("@ndla/util");
|
|
13
11
|
|
|
14
12
|
var _core = require("@emotion/core");
|
|
@@ -23,13 +21,20 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
23
21
|
|
|
24
22
|
var ContentLoader = function ContentLoader(_ref) {
|
|
25
23
|
var children = _ref.children,
|
|
26
|
-
width = _ref.width,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
_ref$width = _ref.width,
|
|
25
|
+
width = _ref$width === void 0 ? 400 : _ref$width,
|
|
26
|
+
_ref$height = _ref.height,
|
|
27
|
+
height = _ref$height === void 0 ? 130 : _ref$height,
|
|
28
|
+
_ref$preserveAspectRa = _ref.preserveAspectRatio,
|
|
29
|
+
preserveAspectRatio = _ref$preserveAspectRa === void 0 ? 'xMidYMid meet' : _ref$preserveAspectRa,
|
|
30
|
+
_ref$className = _ref.className,
|
|
31
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
32
|
+
_ref$primaryColor = _ref.primaryColor,
|
|
33
|
+
primaryColor = _ref$primaryColor === void 0 ? '#f0f0f0' : _ref$primaryColor,
|
|
34
|
+
_ref$secondaryColor = _ref.secondaryColor,
|
|
35
|
+
secondaryColor = _ref$secondaryColor === void 0 ? '#e0e0e0' : _ref$secondaryColor,
|
|
36
|
+
_ref$speed = _ref.speed,
|
|
37
|
+
speed = _ref$speed === void 0 ? 2 : _ref$speed,
|
|
33
38
|
rest = _objectWithoutProperties(_ref, ["children", "width", "height", "preserveAspectRatio", "className", "primaryColor", "secondaryColor", "speed"]);
|
|
34
39
|
|
|
35
40
|
var idClip = (0, _util.uuid)();
|
|
@@ -79,24 +84,5 @@ var ContentLoader = function ContentLoader(_ref) {
|
|
|
79
84
|
})))));
|
|
80
85
|
};
|
|
81
86
|
|
|
82
|
-
ContentLoader.propTypes = {
|
|
83
|
-
children: _propTypes["default"].node,
|
|
84
|
-
speed: _propTypes["default"].number,
|
|
85
|
-
width: _propTypes["default"].number,
|
|
86
|
-
height: _propTypes["default"].number,
|
|
87
|
-
primaryColor: _propTypes["default"].string,
|
|
88
|
-
secondaryColor: _propTypes["default"].string,
|
|
89
|
-
preserveAspectRatio: _propTypes["default"].string,
|
|
90
|
-
className: _propTypes["default"].string
|
|
91
|
-
};
|
|
92
|
-
ContentLoader.defaultProps = {
|
|
93
|
-
speed: 2,
|
|
94
|
-
width: 400,
|
|
95
|
-
height: 130,
|
|
96
|
-
primaryColor: '#f0f0f0',
|
|
97
|
-
secondaryColor: '#e0e0e0',
|
|
98
|
-
preserveAspectRatio: 'xMidYMid meet',
|
|
99
|
-
className: ''
|
|
100
|
-
};
|
|
101
87
|
var _default = ContentLoader;
|
|
102
88
|
exports["default"] = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
id: string;
|
|
11
|
+
labelledby?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
messages?: {
|
|
16
|
+
close: string;
|
|
17
|
+
};
|
|
18
|
+
modifier?: string | string[];
|
|
19
|
+
disablePortal?: boolean;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const Dialog: ({ children, messages, id, labelledby, label, modifier, disablePortal, hidden, onClose, ...rest }: Props) => JSX.Element;
|
|
23
|
+
export {};
|
package/lib/Dialog/Dialog.js
CHANGED
|
@@ -7,8 +7,6 @@ exports.Dialog = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
13
11
|
|
|
14
12
|
var _createUniversalPortal = require("../utils/createUniversalPortal");
|
|
@@ -30,13 +28,18 @@ var classes = new _reactBemHelper["default"]({
|
|
|
30
28
|
|
|
31
29
|
var Dialog = function Dialog(_ref) {
|
|
32
30
|
var children = _ref.children,
|
|
33
|
-
messages = _ref.messages,
|
|
31
|
+
_ref$messages = _ref.messages,
|
|
32
|
+
messages = _ref$messages === void 0 ? {
|
|
33
|
+
close: 'Lukk'
|
|
34
|
+
} : _ref$messages,
|
|
34
35
|
id = _ref.id,
|
|
35
36
|
labelledby = _ref.labelledby,
|
|
36
37
|
label = _ref.label,
|
|
37
38
|
modifier = _ref.modifier,
|
|
38
|
-
disablePortal = _ref.disablePortal,
|
|
39
|
-
|
|
39
|
+
_ref$disablePortal = _ref.disablePortal,
|
|
40
|
+
disablePortal = _ref$disablePortal === void 0 ? false : _ref$disablePortal,
|
|
41
|
+
_ref$hidden = _ref.hidden,
|
|
42
|
+
hidden = _ref$hidden === void 0 ? true : _ref$hidden,
|
|
40
43
|
onClose = _ref.onClose,
|
|
41
44
|
rest = _objectWithoutProperties(_ref, ["children", "messages", "id", "labelledby", "label", "modifier", "disablePortal", "hidden", "onClose"]);
|
|
42
45
|
|
|
@@ -64,27 +67,4 @@ var Dialog = function Dialog(_ref) {
|
|
|
64
67
|
return (0, _createUniversalPortal.createUniversalPortal)(content, 'body');
|
|
65
68
|
};
|
|
66
69
|
|
|
67
|
-
exports.Dialog = Dialog;
|
|
68
|
-
Dialog.propTypes = {
|
|
69
|
-
id: _propTypes["default"].string.isRequired,
|
|
70
|
-
labelledby: _propTypes["default"].string,
|
|
71
|
-
label: _propTypes["default"].string,
|
|
72
|
-
hidden: _propTypes["default"].bool,
|
|
73
|
-
children: _propTypes["default"].node,
|
|
74
|
-
messages: _propTypes["default"].shape({
|
|
75
|
-
close: _propTypes["default"].string.isRequired
|
|
76
|
-
}),
|
|
77
|
-
modifier: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array]),
|
|
78
|
-
disablePortal: _propTypes["default"].bool,
|
|
79
|
-
onClose: _propTypes["default"].func
|
|
80
|
-
};
|
|
81
|
-
Dialog.defaultProps = {
|
|
82
|
-
disablePortal: false,
|
|
83
|
-
labelledby: null,
|
|
84
|
-
label: null,
|
|
85
|
-
hidden: true,
|
|
86
|
-
onClose: null,
|
|
87
|
-
messages: {
|
|
88
|
-
close: 'Lukk'
|
|
89
|
-
}
|
|
90
|
-
};
|
|
70
|
+
exports.Dialog = Dialog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-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 { Dialog } from './Dialog';
|
|
9
|
+
export { Dialog };
|
|
10
|
+
export default Dialog;
|
|
@@ -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 { ReactNode } from 'react';
|
|
9
|
+
interface Props {
|
|
10
|
+
dangerouslySetInnerHTML?: {
|
|
11
|
+
__html: string;
|
|
12
|
+
};
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const FactBox: ({ children, dangerouslySetInnerHTML }: Props) => JSX.Element;
|
|
16
|
+
export default FactBox;
|
package/lib/FactBox/FactBox.js
CHANGED
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
13
11
|
|
|
14
12
|
var _button = _interopRequireDefault(require("@ndla/button"));
|
|
@@ -20,9 +18,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
20
18
|
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); }
|
|
21
19
|
|
|
22
20
|
var toggleFactBox = function toggleFactBox(event) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
var _button$previousSibli, _aside$classList;
|
|
22
|
+
|
|
23
|
+
var button = event.currentTarget;
|
|
24
|
+
var aside = button === null || button === void 0 ? void 0 : (_button$previousSibli = button.previousSibling) === null || _button$previousSibli === void 0 ? void 0 : _button$previousSibli.parentElement;
|
|
25
|
+
aside === null || aside === void 0 ? void 0 : (_aside$classList = aside.classList) === null || _aside$classList === void 0 ? void 0 : _aside$classList.toggle('expanded');
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
var classes = new _reactBemHelper["default"]({
|
|
@@ -40,11 +40,5 @@ var FactBox = function FactBox(_ref) {
|
|
|
40
40
|
})));
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
FactBox.propTypes = {
|
|
44
|
-
dangerouslySetInnerHTML: _propTypes["default"].shape({
|
|
45
|
-
__html: _propTypes["default"].string.isRequired
|
|
46
|
-
}),
|
|
47
|
-
children: _propTypes["default"].node
|
|
48
|
-
};
|
|
49
43
|
var _default = FactBox;
|
|
50
44
|
exports["default"] = _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { ReactNode } from 'react';
|
|
9
|
+
import { License } from '../types';
|
|
10
|
+
export declare const FigureCaption: ({ figureId, id, children, caption, authors, reuseLabel, licenseRights, locale, link, hideFigcaption, hasLinkedVideo, }: FigureCaptionProps) => JSX.Element;
|
|
11
|
+
export interface FigureLicense extends License {
|
|
12
|
+
short: string;
|
|
13
|
+
title: string;
|
|
14
|
+
userFriendlyTitle: string;
|
|
15
|
+
description: string;
|
|
16
|
+
rights: string[];
|
|
17
|
+
linkText?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}
|
|
20
|
+
interface FigureCaptionProps {
|
|
21
|
+
figureId: string;
|
|
22
|
+
id: string;
|
|
23
|
+
caption?: string;
|
|
24
|
+
reuseLabel: string;
|
|
25
|
+
licenseRights: string[];
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
authors?: {
|
|
28
|
+
name: string;
|
|
29
|
+
}[];
|
|
30
|
+
link?: {
|
|
31
|
+
url: string;
|
|
32
|
+
text: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
external?: boolean;
|
|
35
|
+
};
|
|
36
|
+
locale?: string;
|
|
37
|
+
hideFigcaption?: boolean;
|
|
38
|
+
hasLinkedVideo?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const Figure: ({ children, type, resizeIframe, ...rest }: Props) => JSX.Element;
|
|
41
|
+
interface Props {
|
|
42
|
+
id: string;
|
|
43
|
+
children: (params: {
|
|
44
|
+
typeClass: string;
|
|
45
|
+
}) => ReactNode | ReactNode;
|
|
46
|
+
type: 'full' | 'full-column' | 'left' | 'small-left' | 'right' | 'small-right' | 'xsmall-right' | 'xsmall-left';
|
|
47
|
+
resizeIframe?: boolean;
|
|
48
|
+
noFigcaption?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export default Figure;
|
package/lib/Figure/Figure.js
CHANGED
|
@@ -7,8 +7,6 @@ exports["default"] = exports.FigureCaption = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
13
11
|
|
|
14
12
|
var _util = require("@ndla/util");
|
|
@@ -54,11 +52,11 @@ var FigureCaption = function FigureCaption(_ref) {
|
|
|
54
52
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
55
53
|
t = _useTranslation.t;
|
|
56
54
|
|
|
57
|
-
return (0, _core.jsx)("figcaption", classes('caption', hideFigcaption
|
|
55
|
+
return (0, _core.jsx)("figcaption", classes('caption', hideFigcaption ? 'hidden-caption' : undefined), caption ? (0, _core.jsx)("div", classes('info'), (0, _util.parseMarkdown)(caption)) : null, (0, _core.jsx)("footer", classes('byline'), (0, _core.jsx)("div", classes('byline-licenselist'), (0, _core.jsx)(_licenses.LicenseByline, {
|
|
58
56
|
licenseRights: licenseRights,
|
|
59
57
|
locale: locale,
|
|
60
58
|
marginRight: true
|
|
61
|
-
}, (0, _core.jsx)("div", classes('byline-author-buttons'), (0, _core.jsx)("span", classes('byline-authors'), authors.map(function (author) {
|
|
59
|
+
}, (0, _core.jsx)("div", classes('byline-author-buttons'), (0, _core.jsx)("span", classes('byline-authors'), authors === null || authors === void 0 ? void 0 : authors.map(function (author) {
|
|
62
60
|
return author.name;
|
|
63
61
|
}).join(', ')), (0, _core.jsx)("div", null, (0, _core.jsx)(_button["default"], {
|
|
64
62
|
borderShape: "rounded",
|
|
@@ -79,39 +77,17 @@ var FigureCaption = function FigureCaption(_ref) {
|
|
|
79
77
|
}, t('figure.button.original')))), children)), link && (0, _core.jsx)("div", classes('link-wrapper'), (0, _core.jsx)(_safelink["default"], _extends({
|
|
80
78
|
to: link.url
|
|
81
79
|
}, classes('link'), {
|
|
82
|
-
target: link.external ? '_blank' :
|
|
83
|
-
rel: link.external ? 'noopener noreferrer' :
|
|
80
|
+
target: link.external ? '_blank' : undefined,
|
|
81
|
+
rel: link.external ? 'noopener noreferrer' : undefined
|
|
84
82
|
}), (0, _core.jsx)("span", classes('link-text'), link.text), (0, _core.jsx)(_common.Link, null)), link.description && (0, _core.jsx)("p", classes('link-description'), link.description)))));
|
|
85
83
|
};
|
|
86
84
|
|
|
87
85
|
exports.FigureCaption = FigureCaption;
|
|
88
|
-
FigureCaption.propTypes = {
|
|
89
|
-
figureId: _propTypes["default"].string.isRequired,
|
|
90
|
-
id: _propTypes["default"].string.isRequired,
|
|
91
|
-
caption: _propTypes["default"].string,
|
|
92
|
-
reuseLabel: _propTypes["default"].string.isRequired,
|
|
93
|
-
licenseRights: _propTypes["default"].arrayOf(_propTypes["default"].string).isRequired,
|
|
94
|
-
children: _propTypes["default"].node,
|
|
95
|
-
authors: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
96
|
-
name: _propTypes["default"].string.isRequired
|
|
97
|
-
})),
|
|
98
|
-
link: _propTypes["default"].shape({
|
|
99
|
-
url: _propTypes["default"].string.isRequired,
|
|
100
|
-
text: _propTypes["default"].string.isRequired,
|
|
101
|
-
description: _propTypes["default"].string,
|
|
102
|
-
external: _propTypes["default"].bool
|
|
103
|
-
}),
|
|
104
|
-
locale: _propTypes["default"].string,
|
|
105
|
-
hideFigcaption: _propTypes["default"].bool,
|
|
106
|
-
hasLinkedVideo: _propTypes["default"].bool
|
|
107
|
-
};
|
|
108
|
-
FigureCaption.defaultProps = {
|
|
109
|
-
link: null
|
|
110
|
-
};
|
|
111
86
|
|
|
112
87
|
var Figure = function Figure(_ref2) {
|
|
113
88
|
var children = _ref2.children,
|
|
114
|
-
type = _ref2.type,
|
|
89
|
+
_ref2$type = _ref2.type,
|
|
90
|
+
type = _ref2$type === void 0 ? 'full' : _ref2$type,
|
|
115
91
|
resizeIframe = _ref2.resizeIframe,
|
|
116
92
|
rest = _objectWithoutProperties(_ref2, ["children", "type", "resizeIframe"]);
|
|
117
93
|
|
|
@@ -119,21 +95,11 @@ var Figure = function Figure(_ref2) {
|
|
|
119
95
|
return (0, _core.jsx)("figure", _extends({
|
|
120
96
|
"data-sizetype": type
|
|
121
97
|
}, classes('', {
|
|
122
|
-
resize: resizeIframe
|
|
98
|
+
resize: !!resizeIframe
|
|
123
99
|
}, typeClass), rest), (0, _util.isFunction)(children) ? children({
|
|
124
100
|
typeClass: typeClass
|
|
125
101
|
}) : children);
|
|
126
102
|
};
|
|
127
103
|
|
|
128
|
-
Figure.propTypes = {
|
|
129
|
-
id: _propTypes["default"].string.isRequired,
|
|
130
|
-
children: _propTypes["default"].oneOfType([_propTypes["default"].node.isRequired, _propTypes["default"].func.isRequired]).isRequired,
|
|
131
|
-
type: _propTypes["default"].oneOf(['full', 'full-column', 'left', 'small-left', 'right', 'small-right', 'xsmall-right', 'xsmall-left']),
|
|
132
|
-
resizeIframe: _propTypes["default"].bool,
|
|
133
|
-
noFigcaption: _propTypes["default"].bool
|
|
134
|
-
};
|
|
135
|
-
Figure.defaultProps = {
|
|
136
|
-
type: 'full'
|
|
137
|
-
};
|
|
138
104
|
var _default = Figure;
|
|
139
105
|
exports["default"] = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2019-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
|
+
export declare function FigureExpandButton({ messages, typeClass }: Props): JSX.Element;
|
|
9
|
+
interface Props {
|
|
10
|
+
messages: {
|
|
11
|
+
zoomImageButtonLabel: string;
|
|
12
|
+
zoomOutImageButtonLabel: string;
|
|
13
|
+
};
|
|
14
|
+
typeClass: string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|