@ndla/ui 3.3.13 → 3.3.17
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 +0 -3
- package/es/Article/Article.js +3 -3
- package/es/Article/ArticleByline.js +4 -5
- package/es/Article/ArticleNotions.js +5 -6
- package/es/Article/ArticleSideBar.js +11 -12
- package/es/AudioPlayer/AudioPlayer.js +15 -16
- package/es/AudioPlayer/SpeechControl.js +2 -3
- package/es/BlogPosts/BlogPost.js +6 -8
- package/es/BlogPosts/BlogPostWrapper.js +1 -1
- package/es/Breadcrumb/Breadcrumb.js +1 -2
- package/es/Breadcrumb/BreadcrumbItem.js +2 -3
- package/es/Breadcrumblist/Breadcrumblist.js +7 -8
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +6 -7
- package/es/CompetenceGoalTab/CompetenceItem.js +11 -13
- package/es/ComponentCursor/ComponentCursor.js +8 -8
- package/es/CopyParagraphButton/CopyParagraphButton.js +3 -4
- package/es/CreatedBy/CreatedBy.js +5 -6
- package/es/Dialog/Dialog.js +1 -2
- package/es/Embedded/Twitter.js +5 -5
- package/es/ErrorMessage/ErrorMessage.js +5 -5
- package/es/Figure/Figure.js +3 -1
- package/es/Figure/FigureLicenseDialog.js +1 -2
- package/es/Filter/FilterButtons.js +11 -13
- package/es/Footer/Footer.js +8 -9
- package/es/Footer/FooterLinks.js +7 -8
- package/es/Footer/FooterPrivacy.js +2 -3
- package/es/Footer/FooterText.js +1 -1
- package/es/Frontpage/FrontpageAllSubjects.js +10 -11
- package/es/Frontpage/FrontpageFilm.js +6 -8
- package/es/Frontpage/FrontpageHeader.js +5 -6
- package/es/Frontpage/FrontpageInfo.js +1 -1
- package/es/Frontpage/FrontpageMultidisciplinarySubject.js +8 -9
- package/es/Frontpage/FrontpageSearch.js +4 -6
- package/es/Frontpage/FrontpageToolbox.js +5 -6
- package/es/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
- package/es/LanguageSelector/LanguageSelector.js +8 -9
- package/es/LearningPaths/LearningPathContent.js +1 -1
- package/es/LearningPaths/LearningPathInformation.js +1 -1
- package/es/LearningPaths/LearningPathLastStepNavigation.js +4 -4
- package/es/LearningPaths/LearningPathMenu.js +5 -7
- package/es/LearningPaths/LearningPathMenuAside.js +7 -8
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
- package/es/LearningPaths/LearningPathMenuContent.js +6 -8
- package/es/LearningPaths/LearningPathMenuIntro.js +7 -8
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +3 -5
- package/es/LearningPaths/LearningPathMobileHeader.js +4 -5
- package/es/LearningPaths/LearningPathMobileStepInfo.js +1 -1
- package/es/LearningPaths/LearningPathSticky.js +4 -5
- package/es/LearningPaths/LearningPathWrapper.js +2 -2
- package/es/Masthead/MastheadSearchModal.js +5 -7
- package/es/NDLAFilm/AboutNdlaFilm.js +6 -17
- package/es/NDLAFilm/AllMoviesAlphabetically.js +14 -15
- package/es/NDLAFilm/CategorySelect.js +17 -18
- package/es/NDLAFilm/FilmContentCard.js +8 -23
- package/es/NDLAFilm/FilmContentCardTags.js +4 -8
- package/es/NDLAFilm/FilmMovieList.js +6 -21
- package/es/NDLAFilm/FilmMovieSearch.js +18 -26
- package/es/NDLAFilm/FilmSlideshow.js +3 -3
- package/es/NDLAFilm/MovieGrid.js +10 -19
- package/es/NDLAFilm/VisualElement.js +22 -29
- package/es/Navigation/NavigationBox.js +19 -19
- package/es/Navigation/NavigationHeading.js +4 -4
- package/es/Navigation/NavigationTopicAbout.js +15 -16
- package/es/Notion/Notion.js +4 -4
- package/es/RelatedArticleList/RelatedArticleList.js +4 -4
- package/es/ResourceGroup/ResourceItem.js +12 -14
- package/es/ResourceGroup/ResourceList.js +3 -4
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +5 -6
- package/es/Search/ContentTypeResult.js +4 -7
- package/es/Search/LoadingWrapper.js +2 -3
- package/es/Search/SearchFieldForm.js +3 -3
- package/es/Search/SearchPage.js +2 -2
- package/es/Search/SearchResultSleeve.js +8 -8
- package/es/SearchTypeResult/ActiveFilterContent.js +1 -2
- package/es/SearchTypeResult/ActiveFilters.js +6 -7
- package/es/SearchTypeResult/PopupFilter.js +9 -11
- package/es/SearchTypeResult/ResultNavigation.js +2 -3
- package/es/SearchTypeResult/SearchFieldHeader.js +7 -9
- package/es/SearchTypeResult/SearchItem.js +20 -24
- package/es/SearchTypeResult/SearchItems.js +4 -4
- package/es/SearchTypeResult/SearchNotionItem.js +16 -20
- package/es/SearchTypeResult/SearchNotionsResult.js +6 -8
- package/es/SearchTypeResult/SearchSubjectItem.js +3 -4
- package/es/SearchTypeResult/SearchTypeHeader.js +9 -10
- package/es/SearchTypeResult/SearchTypeResult.js +5 -6
- package/es/ToolboxPage/ToolboxInfo.js +2 -2
- package/es/Topic/Loader.js +1 -2
- package/es/Topic/Topic.js +21 -22
- package/es/TopicIntroductionList/TopicIntroduction.js +14 -33
- package/es/TopicIntroductionList/TopicIntroductionList.js +6 -23
- package/es/TopicIntroductionList/TopicIntroductionShortcuts.js +71 -110
- package/es/TopicIntroductionList/TopicShortcutItem.js +0 -9
- package/es/Translation/TranslationBox.js +1 -2
- package/es/User/AuthModal.js +9 -10
- package/es/all.css +1 -4
- package/es/index-javascript.js +1 -5
- package/es/index.js +4 -0
- package/es/shapes.js +0 -6
- package/lib/Article/Article.d.ts +2 -2
- package/lib/Article/Article.js +2 -4
- package/lib/Article/ArticleByline.d.ts +2 -2
- package/lib/Article/ArticleByline.js +4 -4
- package/lib/Article/ArticleNotions.d.ts +2 -2
- package/lib/Article/ArticleNotions.js +4 -4
- package/lib/Article/ArticleSideBar.d.ts +4 -4
- package/lib/Article/ArticleSideBar.js +10 -11
- package/lib/Aside/Aside.d.ts +2 -2
- package/lib/AudioPlayer/AudioPlayer.js +14 -14
- package/lib/AudioPlayer/SpeechControl.js +1 -2
- package/lib/BlogPosts/BlogPost.d.ts +1 -2
- package/lib/BlogPosts/BlogPost.js +4 -6
- package/lib/BlogPosts/BlogPostWrapper.d.ts +3 -3
- package/lib/BlogPosts/BlogPostWrapper.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.d.ts +4 -4
- package/lib/Breadcrumb/Breadcrumb.js +0 -1
- package/lib/Breadcrumb/BreadcrumbBlock.d.ts +3 -3
- package/lib/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/lib/Breadcrumb/BreadcrumbItem.js +1 -2
- package/lib/Breadcrumblist/Breadcrumblist.d.ts +4 -4
- package/lib/Breadcrumblist/Breadcrumblist.js +6 -6
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +5 -5
- package/lib/CompetenceGoalTab/CompetenceItem.js +10 -10
- package/lib/ComponentCursor/ComponentCursor.js +8 -8
- package/lib/CopyParagraphButton/CopyParagraphButton.js +2 -2
- package/lib/CreatedBy/CreatedBy.js +4 -4
- package/lib/Embedded/Twitter.js +5 -5
- package/lib/ErrorMessage/ErrorMessage.d.ts +2 -2
- package/lib/ErrorMessage/ErrorMessage.js +5 -5
- package/lib/Figure/Figure.js +3 -1
- package/lib/Filter/FilterButtons.js +9 -9
- package/lib/Footer/EditorName.d.ts +1 -2
- package/lib/Footer/Footer.d.ts +5 -5
- package/lib/Footer/Footer.js +7 -7
- package/lib/Footer/FooterLinks.d.ts +3 -3
- package/lib/Footer/FooterLinks.js +6 -6
- package/lib/Footer/FooterPrivacy.d.ts +1 -2
- package/lib/Footer/FooterPrivacy.js +2 -3
- package/lib/Footer/FooterText.d.ts +3 -3
- package/lib/Footer/FooterText.js +1 -1
- package/lib/Footer/privacy_en.d.ts +1 -2
- package/lib/Footer/privacy_nb.d.ts +1 -2
- package/lib/Footer/privacy_nn.d.ts +1 -2
- package/lib/Frontpage/FrontpageAllSubjects.js +15 -9
- package/lib/Frontpage/FrontpageFilm.d.ts +1 -1
- package/lib/Frontpage/FrontpageFilm.js +4 -6
- package/lib/Frontpage/FrontpageHeader.d.ts +3 -2
- package/lib/Frontpage/FrontpageHeader.js +4 -5
- package/lib/Frontpage/FrontpageInfo.d.ts +3 -3
- package/lib/Frontpage/FrontpageInfo.js +1 -1
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.d.ts +1 -1
- package/lib/Frontpage/FrontpageMultidisciplinarySubject.js +7 -7
- package/lib/Frontpage/FrontpageSearch.d.ts +3 -3
- package/lib/Frontpage/FrontpageSearch.js +2 -4
- package/lib/Frontpage/FrontpageToolbox.d.ts +1 -1
- package/lib/Frontpage/FrontpageToolbox.js +4 -5
- package/lib/Frontpage/illustrations/Fellesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageHeaderIllustration.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.d.ts +1 -2
- package/lib/Frontpage/illustrations/FrontpageSubjectIllustration.js +1 -1
- package/lib/Frontpage/illustrations/MenuFellesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/MenuStudiespesialiserende.d.ts +1 -2
- package/lib/Frontpage/illustrations/MenuYrkesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/Studiespesialiserende.d.ts +1 -2
- package/lib/Frontpage/illustrations/Yrkesfag.d.ts +1 -2
- package/lib/Frontpage/illustrations/index.d.ts +6 -6
- package/lib/LanguageSelector/LanguageSelector.js +7 -7
- package/lib/LearningPaths/LearningPathContent.d.ts +3 -3
- package/lib/LearningPaths/LearningPathContent.js +1 -1
- package/lib/LearningPaths/LearningPathInformation.d.ts +1 -2
- package/lib/LearningPaths/LearningPathInformation.js +1 -1
- package/lib/LearningPaths/LearningPathLastStepNavigation.d.ts +3 -3
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +4 -4
- package/lib/LearningPaths/LearningPathMenu.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenu.js +3 -3
- package/lib/LearningPaths/LearningPathMenuAside.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMenuAside.js +6 -7
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +1 -2
- package/lib/LearningPaths/LearningPathMenuContent.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuContent.js +5 -7
- package/lib/LearningPaths/LearningPathMenuIntro.d.ts +1 -2
- package/lib/LearningPaths/LearningPathMenuIntro.js +6 -6
- package/lib/LearningPaths/LearningPathMenuModalWrapper.d.ts +3 -3
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +1 -3
- package/lib/LearningPaths/LearningPathMobileHeader.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMobileHeader.js +4 -5
- package/lib/LearningPaths/LearningPathMobileStepInfo.d.ts +1 -1
- package/lib/LearningPaths/LearningPathMobileStepInfo.js +1 -1
- package/lib/LearningPaths/LearningPathSticky.d.ts +11 -5
- package/lib/LearningPaths/LearningPathSticky.js +3 -4
- package/lib/LearningPaths/LearningPathWrapper.d.ts +3 -3
- package/lib/LearningPaths/LearningPathWrapper.js +2 -2
- package/lib/Masthead/MastheadSearchModal.d.ts +3 -3
- package/lib/Masthead/MastheadSearchModal.js +3 -5
- package/lib/NDLAFilm/AboutNdlaFilm.d.ts +15 -0
- package/lib/NDLAFilm/AboutNdlaFilm.js +6 -18
- package/lib/NDLAFilm/AllMoviesAlphabetically.d.ts +3 -4
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +12 -13
- package/lib/NDLAFilm/CategorySelect.d.ts +11 -0
- package/lib/NDLAFilm/CategorySelect.js +20 -19
- package/lib/NDLAFilm/FilmContentCard.d.ts +11 -0
- package/lib/NDLAFilm/FilmContentCard.js +8 -24
- package/lib/NDLAFilm/FilmContentCardTags.d.ts +7 -0
- package/lib/NDLAFilm/FilmContentCardTags.js +4 -9
- package/lib/NDLAFilm/FilmMovieList.d.ts +19 -0
- package/lib/NDLAFilm/FilmMovieList.js +5 -21
- package/lib/NDLAFilm/FilmMovieSearch.d.ts +21 -0
- package/lib/NDLAFilm/FilmMovieSearch.js +25 -30
- package/lib/NDLAFilm/FilmSlideshow.d.ts +5 -5
- package/lib/NDLAFilm/FilmSlideshow.js +2 -1
- package/lib/NDLAFilm/MovieGrid.d.ts +13 -0
- package/lib/NDLAFilm/MovieGrid.js +9 -21
- package/lib/NDLAFilm/SlideshowIndicator.d.ts +2 -2
- package/lib/NDLAFilm/VisualElement.d.ts +16 -0
- package/lib/NDLAFilm/VisualElement.js +22 -30
- package/lib/NDLAFilm/index.d.ts +14 -0
- package/lib/NDLAFilm/types.d.ts +8 -6
- package/lib/Navigation/NavigationBox.d.ts +3 -3
- package/lib/Navigation/NavigationBox.js +19 -19
- package/lib/Navigation/NavigationHeading.d.ts +2 -2
- package/lib/Navigation/NavigationHeading.js +4 -4
- package/lib/Navigation/NavigationTopicAbout.d.ts +2 -2
- package/lib/Navigation/NavigationTopicAbout.js +14 -14
- package/lib/Notion/Notion.d.ts +4 -4
- package/lib/Notion/Notion.js +4 -4
- package/lib/RadioButtonGroup/RadioButtonGroup.d.ts +2 -2
- package/lib/RelatedArticleList/RelatedArticleList.js +3 -3
- package/lib/ResourceGroup/ResourceItem.js +11 -11
- package/lib/ResourceGroup/ResourceList.js +2 -2
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +4 -4
- package/lib/Search/ContentTypeResult.d.ts +1 -2
- package/lib/Search/ContentTypeResult.js +1 -1
- package/lib/Search/LoadingWrapper.d.ts +1 -2
- package/lib/Search/LoadingWrapper.js +1 -2
- package/lib/Search/SearchFieldForm.d.ts +4 -4
- package/lib/Search/SearchFieldForm.js +3 -3
- package/lib/Search/SearchPage.js +1 -1
- package/lib/Search/SearchResultSleeve.d.ts +1 -2
- package/lib/Search/SearchResultSleeve.js +8 -8
- package/lib/SearchTypeResult/ActiveFilterContent.js +1 -2
- package/lib/SearchTypeResult/ActiveFilters.d.ts +2 -2
- package/lib/SearchTypeResult/ActiveFilters.js +5 -5
- package/lib/SearchTypeResult/PopupFilter.js +8 -8
- package/lib/SearchTypeResult/ResultNavigation.js +2 -3
- package/lib/SearchTypeResult/SearchFieldHeader.d.ts +2 -2
- package/lib/SearchTypeResult/SearchFieldHeader.js +5 -5
- package/lib/SearchTypeResult/SearchItem.d.ts +2 -2
- package/lib/SearchTypeResult/SearchItem.js +17 -17
- package/lib/SearchTypeResult/SearchItems.js +10 -4
- package/lib/SearchTypeResult/SearchNotionItem.d.ts +4 -4
- package/lib/SearchTypeResult/SearchNotionItem.js +12 -12
- package/lib/SearchTypeResult/SearchNotionsResult.d.ts +2 -2
- package/lib/SearchTypeResult/SearchNotionsResult.js +4 -4
- package/lib/SearchTypeResult/SearchSubjectItem.js +3 -3
- package/lib/SearchTypeResult/SearchTypeHeader.js +14 -8
- package/lib/SearchTypeResult/SearchTypeResult.d.ts +2 -2
- package/lib/SearchTypeResult/SearchTypeResult.js +10 -5
- package/lib/ToolboxPage/ToolboxInfo.d.ts +2 -2
- package/lib/ToolboxPage/ToolboxInfo.js +2 -2
- package/lib/Topic/Loader.js +0 -1
- package/lib/Topic/Topic.d.ts +5 -5
- package/lib/Topic/Topic.js +20 -20
- package/lib/TopicIntroductionList/TopicIntroduction.d.ts +21 -0
- package/lib/TopicIntroductionList/TopicIntroduction.js +16 -36
- package/lib/TopicIntroductionList/TopicIntroductionList.d.ts +35 -0
- package/lib/TopicIntroductionList/TopicIntroductionList.js +6 -25
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.d.ts +8 -0
- package/lib/TopicIntroductionList/TopicIntroductionShortcuts.js +72 -110
- package/lib/TopicIntroductionList/TopicShortcutItem.d.ts +6 -0
- package/lib/TopicIntroductionList/TopicShortcutItem.js +0 -11
- package/lib/TopicIntroductionList/index.d.ts +9 -0
- package/lib/Translation/TranslationBox.js +0 -1
- package/lib/User/AuthModal.js +8 -8
- package/lib/all.css +1 -4
- package/lib/index-javascript.js +3 -137
- package/lib/index.d.ts +4 -0
- package/lib/index.js +155 -0
- package/lib/locale/LocaleProvider.d.ts +2 -2
- package/lib/shapes.js +1 -10
- package/lib/types.d.ts +2 -1
- package/package.json +15 -15
- package/src/Article/Article.tsx +3 -3
- package/src/Article/ArticleByline.tsx +2 -3
- package/src/Article/ArticleNotions.tsx +2 -4
- package/src/Article/ArticleSideBar.tsx +7 -8
- package/src/Aside/Aside.tsx +2 -2
- package/src/AudioPlayer/AudioPlayer.tsx +0 -1
- package/src/AudioPlayer/SpeechControl.tsx +0 -1
- package/src/BlogPosts/BlogPost.tsx +2 -4
- package/src/BlogPosts/BlogPostWrapper.tsx +3 -3
- package/src/Breadcrumb/Breadcrumb.tsx +4 -5
- package/src/Breadcrumb/BreadcrumbBlock.tsx +3 -3
- package/src/Breadcrumb/BreadcrumbItem.tsx +3 -4
- package/src/Breadcrumblist/Breadcrumblist.tsx +5 -6
- package/src/CompetenceGoalTab/CompetenceGoalTab.tsx +0 -1
- package/src/CompetenceGoalTab/CompetenceItem.tsx +1 -5
- package/src/ComponentCursor/ComponentCursor.tsx +2 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +2 -3
- package/src/CreatedBy/CreatedBy.tsx +0 -1
- package/src/Dialog/Dialog.tsx +0 -1
- package/src/Embedded/Twitter.jsx +3 -3
- package/src/ErrorMessage/ErrorMessage.tsx +2 -7
- package/src/Figure/Figure.tsx +2 -1
- package/src/Figure/FigureLicenseDialog.tsx +0 -1
- package/src/Figure/component.figure.scss +37 -3
- package/src/Filter/FilterButtons.tsx +0 -3
- package/src/Footer/EditorName.tsx +1 -1
- package/src/Footer/Footer.tsx +4 -5
- package/src/Footer/FooterLinks.tsx +4 -8
- package/src/Footer/FooterPrivacy.tsx +1 -2
- package/src/Footer/FooterText.tsx +3 -5
- package/src/Footer/privacy_en.tsx +1 -1
- package/src/Footer/privacy_nb.tsx +1 -1
- package/src/Footer/privacy_nn.tsx +1 -1
- package/src/Frontpage/FrontpageAllSubjects.tsx +5 -6
- package/src/Frontpage/FrontpageFilm.tsx +1 -3
- package/src/Frontpage/FrontpageHeader.tsx +3 -8
- package/src/Frontpage/FrontpageInfo.tsx +3 -3
- package/src/Frontpage/FrontpageMultidisciplinarySubject.tsx +1 -2
- package/src/Frontpage/FrontpageSearch.tsx +4 -6
- package/src/Frontpage/FrontpageToolbox.tsx +1 -2
- package/src/Frontpage/illustrations/Fellesfag.tsx +1 -1
- package/src/Frontpage/illustrations/FrontpageHeaderIllustration.tsx +1 -1
- package/src/Frontpage/illustrations/FrontpageSubjectIllustration.tsx +1 -1
- package/src/Frontpage/illustrations/MenuFellesfag.tsx +1 -1
- package/src/Frontpage/illustrations/MenuStudiespesialiserende.tsx +1 -1
- package/src/Frontpage/illustrations/MenuYrkesfag.tsx +1 -1
- package/src/Frontpage/illustrations/Studiespesialiserende.tsx +1 -1
- package/src/Frontpage/illustrations/Yrkesfag.tsx +1 -1
- package/src/LanguageSelector/LanguageSelector.tsx +0 -1
- package/src/LearningPaths/LearningPathContent.tsx +3 -5
- package/src/LearningPaths/LearningPathInformation.tsx +1 -6
- package/src/LearningPaths/LearningPathLastStepNavigation.tsx +3 -9
- package/src/LearningPaths/LearningPathMenu.tsx +2 -4
- package/src/LearningPaths/LearningPathMenuAside.tsx +2 -3
- package/src/LearningPaths/LearningPathMenuAsideCopyright.tsx +1 -2
- package/src/LearningPaths/LearningPathMenuContent.tsx +2 -4
- package/src/LearningPaths/LearningPathMenuIntro.tsx +1 -2
- package/src/LearningPaths/LearningPathMenuModalWrapper.tsx +3 -5
- package/src/LearningPaths/LearningPathMobileHeader.tsx +2 -3
- package/src/LearningPaths/LearningPathMobileStepInfo.tsx +1 -1
- package/src/LearningPaths/LearningPathSticky.tsx +5 -14
- package/src/LearningPaths/LearningPathWrapper.tsx +3 -3
- package/src/Masthead/MastheadSearchModal.tsx +4 -6
- package/src/NDLAFilm/{AboutNdlaFilm.jsx → AboutNdlaFilm.tsx} +19 -18
- package/src/NDLAFilm/AllMoviesAlphabetically.tsx +6 -7
- package/src/NDLAFilm/{CategorySelect.jsx → CategorySelect.tsx} +23 -20
- package/src/NDLAFilm/{FilmContentCard.jsx → FilmContentCard.tsx} +21 -22
- package/src/NDLAFilm/{FilmContentCardTags.jsx → FilmContentCardTags.tsx} +7 -7
- package/src/NDLAFilm/{FilmMovieList.jsx → FilmMovieList.tsx} +17 -27
- package/src/NDLAFilm/FilmMovieSearch.tsx +71 -0
- package/src/NDLAFilm/FilmSlideshow.tsx +9 -10
- package/src/NDLAFilm/MovieGrid.tsx +76 -0
- package/src/NDLAFilm/SlideshowIndicator.tsx +2 -2
- package/src/NDLAFilm/VisualElement.tsx +40 -0
- package/src/NDLAFilm/{index.js → index.ts} +0 -0
- package/src/NDLAFilm/types.ts +9 -6
- package/src/Navigation/NavigationBox.tsx +4 -4
- package/src/Navigation/NavigationHeading.tsx +2 -2
- package/src/Navigation/NavigationTopicAbout.tsx +2 -3
- package/src/Notion/Notion.tsx +4 -4
- package/src/RadioButtonGroup/RadioButtonGroup.tsx +2 -2
- package/src/RelatedArticleList/RelatedArticleList.tsx +4 -4
- package/src/ResourceGroup/ResourceItem.tsx +0 -3
- package/src/ResourceGroup/ResourceList.tsx +0 -1
- package/src/ResourcesWrapper/ResourcesTopicTitle.tsx +0 -1
- package/src/Search/ContentTypeResult.tsx +4 -7
- package/src/Search/LoadingWrapper.tsx +1 -2
- package/src/Search/SearchFieldForm.tsx +4 -4
- package/src/Search/SearchPage.jsx +2 -2
- package/src/Search/SearchResultSleeve.tsx +2 -2
- package/src/SearchTypeResult/ActiveFilterContent.tsx +0 -1
- package/src/SearchTypeResult/ActiveFilters.tsx +2 -3
- package/src/SearchTypeResult/PopupFilter.tsx +0 -2
- package/src/SearchTypeResult/ResultNavigation.tsx +0 -1
- package/src/SearchTypeResult/SearchFieldHeader.tsx +1 -3
- package/src/SearchTypeResult/SearchItem.tsx +3 -8
- package/src/SearchTypeResult/SearchItems.tsx +2 -2
- package/src/SearchTypeResult/SearchNotionItem.tsx +4 -8
- package/src/SearchTypeResult/SearchNotionsResult.tsx +2 -4
- package/src/SearchTypeResult/SearchSubjectItem.tsx +0 -1
- package/src/SearchTypeResult/SearchTypeHeader.tsx +3 -4
- package/src/SearchTypeResult/SearchTypeResult.tsx +3 -4
- package/src/ToolboxPage/ToolboxInfo.tsx +2 -2
- package/src/Topic/Loader.tsx +0 -1
- package/src/Topic/Topic.tsx +5 -6
- package/src/TopicIntroductionList/{TopicIntroduction.jsx → TopicIntroduction.tsx} +22 -35
- package/src/TopicIntroductionList/{TopicIntroductionList.jsx → TopicIntroductionList.tsx} +32 -26
- package/src/TopicIntroductionList/TopicIntroductionShortcuts.tsx +71 -0
- package/src/TopicIntroductionList/{TopicShortcutItem.jsx → TopicShortcutItem.tsx} +5 -13
- package/src/TopicIntroductionList/{index.js → index.ts} +0 -0
- package/src/Translation/TranslationBox.tsx +0 -1
- package/src/User/AuthModal.tsx +0 -1
- package/src/index-javascript.js +0 -30
- package/src/index.ts +31 -0
- package/src/locale/LocaleProvider.tsx +2 -2
- package/src/shapes.js +0 -7
- package/src/types.ts +3 -1
- package/es/NDLAFilm/interfaces.js +0 -0
- package/es/NDLAFilm/shapes.js +0 -15
- package/lib/NDLAFilm/interfaces.d.ts +0 -10
- package/lib/NDLAFilm/interfaces.js +0 -1
- package/lib/NDLAFilm/shapes.d.ts +0 -15
- package/lib/NDLAFilm/shapes.js +0 -30
- package/src/NDLAFilm/FilmMovieSearch.jsx +0 -66
- package/src/NDLAFilm/MovieGrid.jsx +0 -75
- package/src/NDLAFilm/VisualElement.jsx +0 -48
- package/src/NDLAFilm/interfaces.ts +0 -10
- package/src/NDLAFilm/shapes.ts +0 -17
- package/src/TopicIntroductionList/TopicIntroductionShortcuts.jsx +0 -92
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import BEMHelper from 'react-bem-helper';
|
|
4
|
+
import { Forward } from '@ndla/icons/common';
|
|
5
|
+
|
|
6
|
+
import ShortcutItem from './TopicShortcutItem';
|
|
7
|
+
|
|
8
|
+
import { Shortcut } from './TopicIntroductionList';
|
|
9
|
+
|
|
10
|
+
const classes = new BEMHelper({
|
|
11
|
+
name: 'topic-shortcuts',
|
|
12
|
+
prefix: 'c-',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
id: string;
|
|
17
|
+
alwaysExpanded?: boolean;
|
|
18
|
+
shortcuts: Shortcut[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const TopicIntroductionShortcuts = ({ id, alwaysExpanded = false, shortcuts }: Props) => {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const [open, setOpen] = useState(alwaysExpanded);
|
|
24
|
+
const [returned, setReturned] = useState(false);
|
|
25
|
+
const [showButtonText, setShowButtonText] = useState(true);
|
|
26
|
+
|
|
27
|
+
const handleOnToggle = (newOpen: boolean) => {
|
|
28
|
+
setOpen(newOpen);
|
|
29
|
+
setShowButtonText(!newOpen);
|
|
30
|
+
setReturned(!newOpen);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
let onMouseEnter = undefined;
|
|
34
|
+
let onMouseLeave = undefined;
|
|
35
|
+
|
|
36
|
+
let buttonView = null;
|
|
37
|
+
|
|
38
|
+
if (!alwaysExpanded) {
|
|
39
|
+
onMouseEnter = () => handleOnToggle(true);
|
|
40
|
+
onMouseLeave = () => handleOnToggle(false);
|
|
41
|
+
|
|
42
|
+
buttonView = (
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
aria-expanded={open}
|
|
46
|
+
aria-label={t('resource.label')}
|
|
47
|
+
aria-controls={id}
|
|
48
|
+
{...classes('button', returned ? 're-enter' : '')}
|
|
49
|
+
onClick={() => handleOnToggle(!open)}>
|
|
50
|
+
<Forward />
|
|
51
|
+
{showButtonText && <span {...classes('label')}>{t('resource.label')}</span>}
|
|
52
|
+
</button>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return (
|
|
56
|
+
<div onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} {...classes()}>
|
|
57
|
+
{buttonView}
|
|
58
|
+
{open && (
|
|
59
|
+
<ul className={classes('list', open ? 'visible' : '').className}>
|
|
60
|
+
{shortcuts.map((shortcut) => (
|
|
61
|
+
<li {...classes('item')} key={shortcut.id}>
|
|
62
|
+
<ShortcutItem shortcut={shortcut} />
|
|
63
|
+
</li>
|
|
64
|
+
))}
|
|
65
|
+
</ul>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default TopicIntroductionShortcuts;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import BEMHelper from 'react-bem-helper';
|
|
4
3
|
import Tooltip from '@ndla/tooltip';
|
|
5
4
|
import SafeLink from '@ndla/safelink';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
7
6
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
8
|
-
|
|
9
|
-
import { ShortcutShape } from '../shapes';
|
|
7
|
+
import { Shortcut } from './TopicIntroductionList';
|
|
10
8
|
|
|
11
9
|
const classes = new BEMHelper({
|
|
12
10
|
name: 'topic-shortcuts',
|
|
13
11
|
prefix: 'c-',
|
|
14
12
|
});
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
interface Props {
|
|
15
|
+
shortcut: Shortcut;
|
|
16
|
+
}
|
|
17
|
+
const ShortcutItem = ({ shortcut: { id, tooltip, contentType, url, count } }: Props) => {
|
|
17
18
|
const { t } = useTranslation();
|
|
18
19
|
return (
|
|
19
20
|
<Tooltip
|
|
@@ -29,13 +30,4 @@ const ShortcutItem = ({ shortcut: { id, tooltip, contentType, url, count } }) =>
|
|
|
29
30
|
);
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
ShortcutItem.propTypes = {
|
|
33
|
-
shortcut: ShortcutShape.isRequired,
|
|
34
|
-
disableToolTip: PropTypes.bool,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
ShortcutItem.defaultProps = {
|
|
38
|
-
disableToolTip: false,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
33
|
export default ShortcutItem;
|
|
File without changes
|
package/src/User/AuthModal.tsx
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import React, { ReactElement, ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { useTranslation } from 'react-i18next';
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
import Modal, { ModalCloseButton } from '@ndla/modal';
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
import Button from '@ndla/button';
|
package/src/index-javascript.js
CHANGED
|
@@ -23,16 +23,6 @@ export {
|
|
|
23
23
|
ToggleSearchButton,
|
|
24
24
|
} from './Search';
|
|
25
25
|
|
|
26
|
-
export {
|
|
27
|
-
default as ContentTypeBadge,
|
|
28
|
-
SubjectMaterialBadge,
|
|
29
|
-
TasksAndActivitiesBadge,
|
|
30
|
-
AssessmentResourcesBadge,
|
|
31
|
-
LearningPathBadge,
|
|
32
|
-
SubjectBadge,
|
|
33
|
-
ExternalLearningResourcesBadge,
|
|
34
|
-
SourceMaterialBadge,
|
|
35
|
-
} from './ContentTypeBadge';
|
|
36
26
|
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
37
27
|
export { default as TopicMenu, TopicMenuButton } from './TopicMenu';
|
|
38
28
|
export {
|
|
@@ -43,24 +33,4 @@ export {
|
|
|
43
33
|
CompetenceGoalsDialog,
|
|
44
34
|
} from './CompetenceGoals';
|
|
45
35
|
|
|
46
|
-
export {
|
|
47
|
-
MediaList,
|
|
48
|
-
MediaListItem,
|
|
49
|
-
MediaListItemBody,
|
|
50
|
-
MediaListItemActions,
|
|
51
|
-
MediaListItemImage,
|
|
52
|
-
MediaListItemMeta,
|
|
53
|
-
} from './MediaList';
|
|
54
|
-
|
|
55
36
|
export { EmbeddedTwitter, EmbeddedFacebook, EmbeddedFacebookPage } from './Embedded';
|
|
56
|
-
|
|
57
|
-
export { DisplayOnPageYOffset } from './Animation';
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
FilmSlideshow,
|
|
61
|
-
MovieGrid,
|
|
62
|
-
AboutNdlaFilm,
|
|
63
|
-
FilmMovieSearch,
|
|
64
|
-
FilmMovieList,
|
|
65
|
-
AllMoviesAlphabetically,
|
|
66
|
-
} from './NDLAFilm';
|
package/src/index.ts
CHANGED
|
@@ -158,6 +158,37 @@ export { default as ResourceGroup } from './ResourceGroup';
|
|
|
158
158
|
|
|
159
159
|
export { default as LayoutItem, OneColumn, PageContainer, Content } from './Layout';
|
|
160
160
|
|
|
161
|
+
export {
|
|
162
|
+
FilmSlideshow,
|
|
163
|
+
MovieGrid,
|
|
164
|
+
AboutNdlaFilm,
|
|
165
|
+
FilmMovieSearch,
|
|
166
|
+
FilmMovieList,
|
|
167
|
+
AllMoviesAlphabetically,
|
|
168
|
+
} from './NDLAFilm';
|
|
169
|
+
|
|
170
|
+
export { DisplayOnPageYOffset } from './Animation';
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
MediaList,
|
|
174
|
+
MediaListItem,
|
|
175
|
+
MediaListItemBody,
|
|
176
|
+
MediaListItemActions,
|
|
177
|
+
MediaListItemImage,
|
|
178
|
+
MediaListItemMeta,
|
|
179
|
+
} from './MediaList';
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
default as ContentTypeBadge,
|
|
183
|
+
SubjectMaterialBadge,
|
|
184
|
+
TasksAndActivitiesBadge,
|
|
185
|
+
AssessmentResourcesBadge,
|
|
186
|
+
LearningPathBadge,
|
|
187
|
+
SubjectBadge,
|
|
188
|
+
ExternalLearningResourcesBadge,
|
|
189
|
+
SourceMaterialBadge,
|
|
190
|
+
} from './ContentTypeBadge';
|
|
191
|
+
|
|
161
192
|
export {
|
|
162
193
|
SubjectAbout,
|
|
163
194
|
SubjectArchive,
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
10
10
|
import { I18nextProvider, useTranslation } from 'react-i18next';
|
|
11
11
|
import { i18nInstance } from '../i18n';
|
|
12
12
|
import { Locale } from '../types';
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
15
15
|
locale: Locale;
|
|
16
|
-
children:
|
|
16
|
+
children: ReactNode;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const InitI18nWrapper = ({ locale, children }: Props) => {
|
package/src/shapes.js
CHANGED
|
@@ -69,13 +69,6 @@ export const ResourceShape = PropTypes.shape({
|
|
|
69
69
|
type: PropTypes.string,
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
export const ShortcutShape = PropTypes.shape({
|
|
73
|
-
tooltip: PropTypes.string.isRequired,
|
|
74
|
-
contentType: PropTypes.string.isRequired,
|
|
75
|
-
url: PropTypes.string.isRequired,
|
|
76
|
-
count: PropTypes.number.isRequired,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
72
|
export const ContentTypeShape = PropTypes.oneOf([
|
|
80
73
|
contentTypes.SUBJECT_MATERIAL,
|
|
81
74
|
contentTypes.TASKS_AND_ACTIVITIES,
|
package/src/types.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
|
|
9
11
|
const locales = ['nb', 'nn', 'en'] as const;
|
|
10
12
|
export type Locale = typeof locales[number];
|
|
11
13
|
|
|
@@ -114,5 +116,5 @@ export type CompetenceGoalsItemType = {
|
|
|
114
116
|
|
|
115
117
|
export type NotionMedia = {
|
|
116
118
|
type: 'video' | 'other';
|
|
117
|
-
element:
|
|
119
|
+
element: ReactNode;
|
|
118
120
|
};
|
|
File without changes
|
package/es/NDLAFilm/shapes.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
export var topicShape = PropTypes.shape({
|
|
13
|
-
id: PropTypes.string,
|
|
14
|
-
name: PropTypes.string
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/lib/NDLAFilm/shapes.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
export declare const movieShape: PropTypes.Requireable<PropTypes.InferProps<{
|
|
3
|
-
id: PropTypes.Validator<string>;
|
|
4
|
-
metaDescription: PropTypes.Validator<string>;
|
|
5
|
-
title: PropTypes.Validator<string>;
|
|
6
|
-
metaImage: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
-
url: PropTypes.Validator<string>;
|
|
8
|
-
alt: PropTypes.Validator<string>;
|
|
9
|
-
}>>;
|
|
10
|
-
path: PropTypes.Validator<string>;
|
|
11
|
-
}>>;
|
|
12
|
-
export declare const topicShape: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
-
id: PropTypes.Requireable<string>;
|
|
14
|
-
name: PropTypes.Requireable<string>;
|
|
15
|
-
}>>;
|
package/lib/NDLAFilm/shapes.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.topicShape = exports.movieShape = void 0;
|
|
7
|
-
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
var movieShape = _propTypes["default"].shape({
|
|
13
|
-
id: _propTypes["default"].string.isRequired,
|
|
14
|
-
metaDescription: _propTypes["default"].string.isRequired,
|
|
15
|
-
title: _propTypes["default"].string.isRequired,
|
|
16
|
-
metaImage: _propTypes["default"].shape({
|
|
17
|
-
url: _propTypes["default"].string.isRequired,
|
|
18
|
-
alt: _propTypes["default"].string.isRequired
|
|
19
|
-
}),
|
|
20
|
-
path: _propTypes["default"].string.isRequired
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
exports.movieShape = movieShape;
|
|
24
|
-
|
|
25
|
-
var topicShape = _propTypes["default"].shape({
|
|
26
|
-
id: _propTypes["default"].string,
|
|
27
|
-
name: _propTypes["default"].string
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
exports.topicShape = topicShape;
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import BEMHelper from 'react-bem-helper';
|
|
12
|
-
import { OneColumn } from '@ndla/ui';
|
|
13
|
-
import SafeLink from '@ndla/safelink';
|
|
14
|
-
import { withTranslation } from 'react-i18next';
|
|
15
|
-
import CategorySelect from './CategorySelect';
|
|
16
|
-
|
|
17
|
-
import { topicShape } from './shapes';
|
|
18
|
-
|
|
19
|
-
const classes = new BEMHelper({
|
|
20
|
-
name: 'film-moviesearch',
|
|
21
|
-
prefix: 'c-',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const classesMovieList = new BEMHelper({
|
|
25
|
-
name: 'film-movielist',
|
|
26
|
-
prefix: 'c-',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const FilmMovieSearch = ({ topics, t, ...props }) => (
|
|
30
|
-
<div {...classes('')}>
|
|
31
|
-
<OneColumn>
|
|
32
|
-
<div {...classes('topic-navigation')}>
|
|
33
|
-
<h2 {...classesMovieList('heading', '', 'u-12/12 u-4/12@tablet')}>{t('ndlaFilm.subjectsInMovies')}:</h2>
|
|
34
|
-
<nav className="u-12/12 u-8/12@tablet">
|
|
35
|
-
<ul>
|
|
36
|
-
{topics.map((topic) => (
|
|
37
|
-
<li key={topic.id}>
|
|
38
|
-
<SafeLink to={topic.path} key={topic.id}>
|
|
39
|
-
<span>{topic.name}</span>
|
|
40
|
-
</SafeLink>
|
|
41
|
-
</li>
|
|
42
|
-
))}
|
|
43
|
-
</ul>
|
|
44
|
-
</nav>
|
|
45
|
-
</div>
|
|
46
|
-
<CategorySelect {...props} />
|
|
47
|
-
</OneColumn>
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
FilmMovieSearch.propTypes = {
|
|
52
|
-
topics: PropTypes.arrayOf(topicShape),
|
|
53
|
-
onChangeResourceType: PropTypes.func.isRequired,
|
|
54
|
-
resourceTypeSelected: PropTypes.shape({
|
|
55
|
-
name: PropTypes.string,
|
|
56
|
-
id: PropTypes.string,
|
|
57
|
-
}),
|
|
58
|
-
ariaControlId: PropTypes.string.isRequired,
|
|
59
|
-
t: PropTypes.func.isRequired,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
FilmMovieSearch.defaultProps = {
|
|
63
|
-
topics: [],
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default withTranslation()(FilmMovieSearch);
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import BEMHelper from 'react-bem-helper';
|
|
4
|
-
import { css } from '@emotion/core';
|
|
5
|
-
import { withTranslation } from 'react-i18next';
|
|
6
|
-
import FilmContentCard from './FilmContentCard';
|
|
7
|
-
|
|
8
|
-
const movieListClasses = new BEMHelper({
|
|
9
|
-
name: 'film-movielist',
|
|
10
|
-
prefix: 'c-',
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const MovieGrid = ({
|
|
14
|
-
resourceTypeName,
|
|
15
|
-
fetchingMoviesByType,
|
|
16
|
-
moviesByType,
|
|
17
|
-
resourceTypes,
|
|
18
|
-
loadingPlaceholderHeight,
|
|
19
|
-
autoSizedProps,
|
|
20
|
-
resizeThumbnailImages,
|
|
21
|
-
t,
|
|
22
|
-
}) => (
|
|
23
|
-
<section>
|
|
24
|
-
<h1
|
|
25
|
-
{...movieListClasses('heading')}
|
|
26
|
-
css={css`
|
|
27
|
-
margin-left: ${autoSizedProps.margin}px;
|
|
28
|
-
`}>
|
|
29
|
-
{resourceTypeName && resourceTypeName.name}
|
|
30
|
-
<small>
|
|
31
|
-
{fetchingMoviesByType
|
|
32
|
-
? t('ndlaFilm.loadingMovies')
|
|
33
|
-
: `${moviesByType.length} ${t('ndlaFilm.movieMatchInCategory')}`}
|
|
34
|
-
</small>
|
|
35
|
-
</h1>
|
|
36
|
-
<div
|
|
37
|
-
{...movieListClasses('movie-listing')}
|
|
38
|
-
css={css`
|
|
39
|
-
margin-left: ${autoSizedProps.margin}px;
|
|
40
|
-
`}>
|
|
41
|
-
{fetchingMoviesByType && (
|
|
42
|
-
<div
|
|
43
|
-
css={css`
|
|
44
|
-
height: ${loadingPlaceholderHeight};
|
|
45
|
-
`}
|
|
46
|
-
/>
|
|
47
|
-
)}
|
|
48
|
-
{!fetchingMoviesByType &&
|
|
49
|
-
moviesByType.map((movie) => (
|
|
50
|
-
<FilmContentCard
|
|
51
|
-
hideTags
|
|
52
|
-
movie={movie}
|
|
53
|
-
columnWidth={autoSizedProps.columnWidth}
|
|
54
|
-
distanceBetweenItems={autoSizedProps.distanceBetweenItems}
|
|
55
|
-
resourceTypes={resourceTypes}
|
|
56
|
-
resizeThumbnailImages={resizeThumbnailImages}
|
|
57
|
-
/>
|
|
58
|
-
))}
|
|
59
|
-
</div>
|
|
60
|
-
</section>
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
MovieGrid.propTypes = {
|
|
64
|
-
autoSizedProps: PropTypes.shape({}),
|
|
65
|
-
resourceTypeName: PropTypes.shape({
|
|
66
|
-
name: PropTypes.string,
|
|
67
|
-
}),
|
|
68
|
-
fetchingMoviesByType: PropTypes.bool,
|
|
69
|
-
moviesByType: PropTypes.array,
|
|
70
|
-
classes: PropTypes.func,
|
|
71
|
-
resourceTypes: PropTypes.array,
|
|
72
|
-
loadingPlaceholderHeight: PropTypes.string,
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default withTranslation()(MovieGrid);
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import { Image } from '@ndla/ui';
|
|
12
|
-
import styled from '@emotion/styled';
|
|
13
|
-
|
|
14
|
-
const StylediFrame = styled.iframe`
|
|
15
|
-
height: 100%;
|
|
16
|
-
width: 100%;
|
|
17
|
-
border: 0;
|
|
18
|
-
margin: 0;
|
|
19
|
-
padding: 0;
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
const VisualElement = ({ visualElement }) => {
|
|
23
|
-
switch (visualElement.type) {
|
|
24
|
-
case 'image':
|
|
25
|
-
return <Image src={visualElement.url} alt={visualElement.alt} />;
|
|
26
|
-
case 'brightcove':
|
|
27
|
-
return (
|
|
28
|
-
<StylediFrame
|
|
29
|
-
allowfullscreen="true"
|
|
30
|
-
webkitallowfullscreen="true"
|
|
31
|
-
mozallowfullscreen="true"
|
|
32
|
-
src={visualElement.url}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
default:
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
VisualElement.propTypes = {
|
|
41
|
-
visualElement: PropTypes.shape({
|
|
42
|
-
url: PropTypes.string,
|
|
43
|
-
alt: PropTypes.string,
|
|
44
|
-
type: PropTypes.string,
|
|
45
|
-
}).isRequired,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default VisualElement;
|
package/src/NDLAFilm/shapes.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
3
|
-
export const movieShape = PropTypes.shape({
|
|
4
|
-
id: PropTypes.string.isRequired,
|
|
5
|
-
metaDescription: PropTypes.string.isRequired,
|
|
6
|
-
title: PropTypes.string.isRequired,
|
|
7
|
-
metaImage: PropTypes.shape({
|
|
8
|
-
url: PropTypes.string.isRequired,
|
|
9
|
-
alt: PropTypes.string.isRequired,
|
|
10
|
-
}),
|
|
11
|
-
path: PropTypes.string.isRequired,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const topicShape = PropTypes.shape({
|
|
15
|
-
id: PropTypes.string,
|
|
16
|
-
name: PropTypes.string,
|
|
17
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import BEMHelper from 'react-bem-helper';
|
|
4
|
-
import { Forward } from '@ndla/icons/common';
|
|
5
|
-
|
|
6
|
-
import ShortcutItem from './TopicShortcutItem';
|
|
7
|
-
|
|
8
|
-
import { ShortcutShape } from '../shapes';
|
|
9
|
-
|
|
10
|
-
const classes = new BEMHelper({
|
|
11
|
-
name: 'topic-shortcuts',
|
|
12
|
-
prefix: 'c-',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
class TopicIntroductionShortcuts extends Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = {
|
|
19
|
-
open: props.alwaysExpanded,
|
|
20
|
-
returned: false,
|
|
21
|
-
showButtonText: true,
|
|
22
|
-
};
|
|
23
|
-
this.handleOnToggle = this.handleOnToggle.bind(this);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
handleOnToggle(open) {
|
|
27
|
-
this.setState({
|
|
28
|
-
open,
|
|
29
|
-
showButtonText: !open,
|
|
30
|
-
returned: !open,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
render() {
|
|
35
|
-
const { shortcuts, messages, id, alwaysExpanded } = this.props;
|
|
36
|
-
const { open, returned, showButtonText } = this.state;
|
|
37
|
-
|
|
38
|
-
let onMouseEnter = null;
|
|
39
|
-
let onMouseLeave = null;
|
|
40
|
-
|
|
41
|
-
let buttonView = null;
|
|
42
|
-
|
|
43
|
-
if (!alwaysExpanded) {
|
|
44
|
-
onMouseEnter = () => this.handleOnToggle(true);
|
|
45
|
-
onMouseLeave = () => this.handleOnToggle(false);
|
|
46
|
-
|
|
47
|
-
buttonView = (
|
|
48
|
-
<button
|
|
49
|
-
type="button"
|
|
50
|
-
aria-expanded={this.state.open}
|
|
51
|
-
aria-label={messages.toggleButtonText}
|
|
52
|
-
aria-controls={id}
|
|
53
|
-
{...classes('button', returned ? 're-enter' : '')}
|
|
54
|
-
onClick={() => {
|
|
55
|
-
this.handleOnToggle(!open);
|
|
56
|
-
}}>
|
|
57
|
-
<Forward />
|
|
58
|
-
{showButtonText && <span {...classes('label')}>{messages.toggleButtonText}</span>}
|
|
59
|
-
</button>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
return (
|
|
63
|
-
<div onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} {...classes()}>
|
|
64
|
-
{buttonView}
|
|
65
|
-
{open && (
|
|
66
|
-
<ul className={classes('list', open ? 'visible' : '').className}>
|
|
67
|
-
{shortcuts.map((shortcut) => (
|
|
68
|
-
<li {...classes('item')} key={shortcut.id}>
|
|
69
|
-
<ShortcutItem shortcut={shortcut} />
|
|
70
|
-
</li>
|
|
71
|
-
))}
|
|
72
|
-
</ul>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
TopicIntroductionShortcuts.propTypes = {
|
|
80
|
-
id: PropTypes.string.isRequired,
|
|
81
|
-
alwaysExpanded: PropTypes.bool,
|
|
82
|
-
messages: PropTypes.shape({
|
|
83
|
-
toggleButtonText: PropTypes.string.isRequired,
|
|
84
|
-
}),
|
|
85
|
-
shortcuts: PropTypes.arrayOf(ShortcutShape).isRequired,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
TopicIntroductionShortcuts.defaultProps = {
|
|
89
|
-
alwaysExpanded: false,
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export default TopicIntroductionShortcuts;
|