@ndla/ui 50.1.1 → 50.1.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/Article.js +73 -76
- package/es/Article/ArticleAccessMessage.js +6 -4
- package/es/Article/ArticleByline.js +42 -58
- package/es/Article/ArticleFootNotes.js +17 -17
- package/es/Article/ArticleHeaderWrapper.js +11 -14
- package/es/Article/ArticleNotions.js +13 -10
- package/es/Aside/Aside.js +19 -24
- package/es/AudioPlayer/AudioPlayer.js +40 -53
- package/es/AudioPlayer/Controls.js +74 -97
- package/es/AudioPlayer/SpeechControl.js +11 -8
- package/es/BannerCard/BannerCard.js +19 -25
- package/es/BlogPost/BlogPost.js +18 -17
- package/es/Breadcrumb/Breadcrumb.js +42 -55
- package/es/Breadcrumb/BreadcrumbItem.js +32 -26
- package/es/Breadcrumb/HeaderBreadcrumb.js +15 -12
- package/es/Breadcrumb/HomeBreadcrumb.js +33 -21
- package/es/CampaignBlock/CampaignBlock.js +18 -18
- package/es/CompetenceGoalTab/CompetenceGoalItem.js +22 -21
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +21 -27
- package/es/CompetenceGoalTab/CompetenceItem.js +49 -52
- package/es/CompetenceGoalTab/CoreElementItem.js +11 -8
- package/es/CompetenceGoalTab/SearchButton.js +8 -6
- package/es/CompetenceGoalTab/styles.js +5 -5
- package/es/ContactBlock/ContactBlock.js +46 -45
- package/es/ContentLoader/index.js +26 -40
- package/es/ContentPlaceholder/ContentPlaceholder.js +4 -4
- package/es/ContentTypeBadge/ContentTypeBadge.js +48 -61
- package/es/CopyParagraphButton/CopyParagraphButton.js +24 -33
- package/es/CreatedBy/CreatedBy.js +14 -13
- package/es/DefinitionList/DefinitionDescription.js +10 -17
- package/es/DefinitionList/DefinitionTerm.js +10 -17
- package/es/Embed/AudioEmbed.js +27 -32
- package/es/Embed/BrightcoveEmbed.js +63 -85
- package/es/Embed/ConceptEmbed.js +84 -85
- package/es/Embed/ConceptListEmbed.js +19 -12
- package/es/Embed/ContentLinkEmbed.js +14 -9
- package/es/Embed/EmbedErrorPlaceholder.js +9 -7
- package/es/Embed/ExternalEmbed.js +26 -26
- package/es/Embed/FootnoteEmbed.js +10 -7
- package/es/Embed/H5pEmbed.js +9 -8
- package/es/Embed/IframeEmbed.js +37 -33
- package/es/Embed/ImageEmbed.js +80 -97
- package/es/Embed/RelatedContentEmbed.js +23 -24
- package/es/Embed/UnknownEmbed.js +8 -5
- package/es/Embed/conceptComponents.js +53 -64
- package/es/ErrorMessage/ErrorMessage.js +14 -14
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +8 -5
- package/es/ExpandableBox/ExpandableBox.js +16 -20
- package/es/FactBox/FactBox.js +21 -35
- package/es/Figure/Figure.js +21 -28
- package/es/Figure/FigureOpenDialogButton.js +5 -3
- package/es/FileList/File.js +27 -22
- package/es/FileList/FileList.js +10 -7
- package/es/FileList/PdfFile.js +5 -3
- package/es/Filter/FilterButtons.js +65 -83
- package/es/Filter/FilterCarousel.js +42 -64
- package/es/Filter/FilterList.js +47 -69
- package/es/Filter/FilterListPhone.js +134 -176
- package/es/Filter/ToggleItem.js +25 -26
- package/es/Filter/filterClasses.js +1 -1
- package/es/Footer/EditorName.js +6 -4
- package/es/Footer/Footer.js +23 -22
- package/es/Footer/FooterLinks.js +31 -32
- package/es/Footer/FooterPrivacy.js +17 -17
- package/es/Footer/FooterText.js +5 -3
- package/es/FramedContent/FramedContent.js +12 -19
- package/es/Frontpage/FrontpageAllSubjects.js +65 -76
- package/es/FrontpageArticle/FrontpageArticle.js +22 -20
- package/es/Gloss/Gloss.js +34 -36
- package/es/Grid/Grid.js +24 -29
- package/es/Hero/Hero.js +38 -48
- package/es/Hero/HeroContent.js +1 -1
- package/es/Image/Image.js +37 -51
- package/es/Image/ImageLink.js +12 -19
- package/es/KeyFigure/KeyFigure.js +13 -11
- package/es/LanguageSelector/LanguageSelector.js +32 -33
- package/es/Layout/Content.js +4 -2
- package/es/Layout/LayoutItem.js +10 -17
- package/es/Layout/OneColumn.js +16 -23
- package/es/Layout/PageContainer.js +19 -28
- package/es/LearningPaths/LearningPathContent.js +5 -3
- package/es/LearningPaths/LearningPathInformation.js +17 -14
- package/es/LearningPaths/LearningPathLastStepNavigation.js +15 -12
- package/es/LearningPaths/LearningPathMenu.js +61 -69
- package/es/LearningPaths/LearningPathMenuAside.js +18 -17
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +12 -11
- package/es/LearningPaths/LearningPathMenuContent.js +86 -50
- package/es/LearningPaths/LearningPathMenuIntro.js +17 -20
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +13 -19
- package/es/LearningPaths/LearningPathMobileHeader.js +6 -5
- package/es/LearningPaths/LearningPathMobileStepInfo.js +9 -6
- package/es/LearningPaths/LearningPathSticky.js +24 -21
- package/es/LearningPaths/LearningPathWrapper.js +6 -4
- package/es/LetterFilter/LetterFilter.js +17 -20
- package/es/LetterFilter/alphabet.js +1 -1
- package/es/LicenseByline/EmbedByline.js +31 -36
- package/es/LicenseByline/LicenseDescription.js +6 -4
- package/es/LicenseByline/LicenseLink.js +7 -6
- package/es/LinkBlock/LinkBlock.js +17 -15
- package/es/LinkBlock/LinkBlockSection.js +12 -20
- package/es/List/OrderedList.js +17 -22
- package/es/List/UnOrderedList.js +10 -17
- package/es/Logo/Logo.js +17 -22
- package/es/Logo/SvgLogo.js +10 -15
- package/es/Masthead/Masthead.js +17 -23
- package/es/Masthead/SkipToMainContent.js +9 -6
- package/es/Masthead/utils.js +12 -24
- package/es/MediaList/MediaList.js +83 -72
- package/es/Messages/MessageBanner.js +14 -10
- package/es/Messages/MessageBox.js +20 -20
- package/es/MyNdla/Resource/Folder.js +35 -30
- package/es/MyNdla/Resource/FolderInput.js +23 -31
- package/es/NDLAFilm/AboutNdlaFilm.js +10 -7
- package/es/NDLAFilm/AllMoviesAlphabetically.js +49 -60
- package/es/NDLAFilm/FilmContentCard.js +28 -40
- package/es/NDLAFilm/FilmContentCardTags.js +14 -16
- package/es/NDLAFilm/FilmMovieList.js +15 -17
- package/es/NDLAFilm/FilmMovieSearch.js +34 -36
- package/es/NDLAFilm/FilmSlideshow.js +32 -51
- package/es/NDLAFilm/MovieGrid.js +23 -26
- package/es/NDLAFilm/VisualElement.js +11 -7
- package/es/NDLAFilm/filmStyles.js +14 -12
- package/es/NDLAFilm/isLetter.js +3 -3
- package/es/Navigation/NavigationBox.js +80 -94
- package/es/NoContentBox/NoContentBox.js +6 -4
- package/es/Notion/Notion.js +24 -26
- package/es/Notion/NotionImage.js +13 -10
- package/es/Programme/Programme.js +39 -21
- package/es/Programme/ProgrammeSubjects.js +19 -25
- package/es/ProgrammeCard/ProgrammeCard.js +10 -8
- package/es/RelatedArticleList/RelatedArticleList.js +51 -69
- package/es/Resource/BlockResource.js +34 -30
- package/es/Resource/ListResource.js +43 -37
- package/es/Resource/resourceComponents.js +69 -78
- package/es/Resource/storyComponents.js +28 -30
- package/es/ResourceBox/ResourceBox.js +14 -12
- package/es/ResourceGroup/ResourceGroup.js +14 -13
- package/es/ResourceGroup/ResourceItem.js +56 -36
- package/es/ResourceGroup/ResourceList.js +23 -31
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +29 -25
- package/es/ResourcesWrapper/ResourcesWrapper.js +10 -16
- package/es/Search/ActiveFilterContent.js +9 -9
- package/es/Search/ActiveFilters.js +31 -24
- package/es/Search/ContentTypeResult.js +49 -66
- package/es/Search/ContentTypeResultStyles.js +19 -27
- package/es/Search/IsPathToHighlight.js +2 -2
- package/es/Search/LoadingWrapper.js +5 -3
- package/es/Search/SearchField.js +42 -48
- package/es/Search/SearchFieldForm.js +9 -9
- package/es/Search/SearchResult.js +53 -59
- package/es/Search/SearchResultSleeve.js +67 -89
- package/es/SearchTypeResult/ActiveFilterContent.js +11 -10
- package/es/SearchTypeResult/ActiveFilters.js +38 -33
- package/es/SearchTypeResult/PopupFilter.js +33 -47
- package/es/SearchTypeResult/ResultNavigation.js +22 -22
- package/es/SearchTypeResult/SearchFieldHeader.js +28 -41
- package/es/SearchTypeResult/SearchFilterContent.js +13 -10
- package/es/SearchTypeResult/SearchHeader.js +47 -57
- package/es/SearchTypeResult/SearchItem.js +30 -29
- package/es/SearchTypeResult/SearchItemList.js +39 -40
- package/es/SearchTypeResult/SearchItems.js +18 -19
- package/es/SearchTypeResult/SearchNotionsResult.js +16 -13
- package/es/SearchTypeResult/SearchSubjectItem.js +23 -14
- package/es/SearchTypeResult/SearchSubjectResult.js +17 -17
- package/es/SearchTypeResult/SearchTypeHeader.js +40 -40
- package/es/SearchTypeResult/SearchTypeResult.js +17 -21
- package/es/SearchTypeResult/SearchViewType.js +16 -19
- package/es/SearchTypeResult/components/ItemContexts.js +39 -38
- package/es/SearchTypeResult/components/ItemResourceHeader.js +24 -30
- package/es/SearchTypeResult/components/ItemTopicHeader.js +14 -11
- package/es/SearchTypeResult/components/SubjectFilters.js +49 -72
- package/es/SectionHeading/SectionHeading.js +11 -11
- package/es/SnackBar/DefaultSnackbar.js +14 -13
- package/es/SnackBar/SnackbarProvider.js +60 -91
- package/es/Subject/SubjectBanner.js +9 -13
- package/es/Subject/SubjectHeader.js +14 -21
- package/es/Table/Table.js +37 -53
- package/es/TagSelector/Control.js +11 -15
- package/es/TagSelector/DropdownIndicator.js +24 -30
- package/es/TagSelector/Input.js +6 -11
- package/es/TagSelector/Menu.js +10 -17
- package/es/TagSelector/MenuList.js +11 -15
- package/es/TagSelector/Option.js +26 -24
- package/es/TagSelector/SelectContainer.js +10 -13
- package/es/TagSelector/TagSelector.js +65 -102
- package/es/TagSelector/ValueButton.js +21 -20
- package/es/TagSelector/ariaMessages.js +83 -81
- package/es/ToolboxPage/ToolboxInfo.js +11 -8
- package/es/Topic/Loader.js +96 -98
- package/es/Topic/Topic.js +50 -52
- package/es/TreeStructure/AddFolderButton.js +22 -21
- package/es/TreeStructure/ComboboxButton.js +27 -28
- package/es/TreeStructure/FolderItem.js +64 -70
- package/es/TreeStructure/FolderItems.js +33 -37
- package/es/TreeStructure/TreeStructure.js +52 -89
- package/es/TreeStructure/arrowNavigation.js +5 -7
- package/es/TreeStructure/helperFunctions.js +19 -24
- package/es/i18n/formatNestedMessages.js +8 -9
- package/es/i18n/i18n.js +3 -3
- package/es/locale/LocaleProvider.js +13 -8
- package/es/locale/messages-en.js +98 -33
- package/es/locale/messages-nb.js +98 -33
- package/es/locale/messages-nn.js +105 -40
- package/es/locale/messages-se.js +97 -32
- package/es/locale/messages-sma.js +102 -37
- package/es/model/ContentType.js +36 -33
- package/es/model/SubjectCategories.js +4 -4
- package/es/model/SubjectTypes.js +3 -3
- package/es/model/WordClass.js +1 -1
- package/es/model/index.js +8 -8
- package/es/types.js +1 -1
- package/es/utils/relativeUrl.js +11 -11
- package/es/utils/resourceTypeColor.js +4 -2
- package/lib/Article/Article.js +80 -85
- package/lib/Article/ArticleAccessMessage.js +15 -15
- package/lib/Article/ArticleByline.js +51 -66
- package/lib/Article/ArticleFootNotes.js +18 -19
- package/lib/Article/ArticleHeaderWrapper.js +20 -22
- package/lib/Article/ArticleNotions.js +20 -18
- package/lib/Article/index.js +9 -11
- package/lib/Aside/Aside.js +28 -32
- package/lib/Aside/index.js +1 -2
- package/lib/AudioPlayer/AudioPlayer.js +47 -61
- package/lib/AudioPlayer/Controls.js +81 -105
- package/lib/AudioPlayer/SpeechControl.js +12 -10
- package/lib/AudioPlayer/index.js +1 -2
- package/lib/BannerCard/BannerCard.js +22 -28
- package/lib/BannerCard/index.js +1 -1
- package/lib/BlogPost/BlogPost.js +19 -19
- package/lib/BlogPost/index.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +49 -63
- package/lib/Breadcrumb/BreadcrumbItem.js +39 -34
- package/lib/Breadcrumb/HeaderBreadcrumb.js +16 -14
- package/lib/Breadcrumb/HomeBreadcrumb.js +40 -29
- package/lib/Breadcrumb/index.js +3 -4
- package/lib/CampaignBlock/CampaignBlock.js +25 -26
- package/lib/CampaignBlock/index.js +1 -1
- package/lib/CompetenceGoalTab/CompetenceGoalItem.js +23 -23
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +30 -35
- package/lib/CompetenceGoalTab/CompetenceItem.js +56 -60
- package/lib/CompetenceGoalTab/CoreElementItem.js +12 -10
- package/lib/CompetenceGoalTab/SearchButton.js +9 -8
- package/lib/CompetenceGoalTab/index.js +1 -2
- package/lib/CompetenceGoalTab/styles.js +12 -17
- package/lib/ContactBlock/ContactBlock.js +55 -56
- package/lib/ContactBlock/index.js +1 -2
- package/lib/ContentLoader/index.js +28 -42
- package/lib/ContentPlaceholder/ContentPlaceholder.js +11 -12
- package/lib/ContentPlaceholder/index.js +1 -2
- package/lib/ContentTypeBadge/ContentTypeBadge.js +50 -63
- package/lib/ContentTypeBadge/index.js +8 -9
- package/lib/CopyParagraphButton/CopyParagraphButton.js +31 -41
- package/lib/CopyParagraphButton/index.js +2 -3
- package/lib/CreatedBy/CreatedBy.js +21 -21
- package/lib/CreatedBy/index.js +1 -2
- package/lib/DefinitionList/DefinitionDescription.js +13 -20
- package/lib/DefinitionList/DefinitionTerm.js +13 -20
- package/lib/DefinitionList/index.js +2 -2
- package/lib/Embed/AudioEmbed.js +28 -34
- package/lib/Embed/BrightcoveEmbed.js +70 -93
- package/lib/Embed/ConceptEmbed.js +91 -93
- package/lib/Embed/ConceptListEmbed.js +26 -20
- package/lib/Embed/ContentLinkEmbed.js +15 -11
- package/lib/Embed/EmbedErrorPlaceholder.js +10 -9
- package/lib/Embed/ExternalEmbed.js +33 -34
- package/lib/Embed/FootnoteEmbed.js +11 -9
- package/lib/Embed/H5pEmbed.js +16 -16
- package/lib/Embed/IframeEmbed.js +38 -35
- package/lib/Embed/ImageEmbed.js +91 -109
- package/lib/Embed/RelatedContentEmbed.js +24 -26
- package/lib/Embed/UnknownEmbed.js +9 -7
- package/lib/Embed/conceptComponents.js +56 -67
- package/lib/Embed/index.js +17 -18
- package/lib/ErrorMessage/ErrorMessage.js +15 -16
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +9 -7
- package/lib/ErrorMessage/index.js +2 -3
- package/lib/ExpandableBox/ExpandableBox.js +16 -20
- package/lib/ExpandableBox/index.js +2 -2
- package/lib/FactBox/FactBox.js +28 -43
- package/lib/FactBox/index.js +1 -2
- package/lib/Figure/Figure.js +25 -31
- package/lib/Figure/FigureOpenDialogButton.js +5 -3
- package/lib/Figure/index.js +2 -2
- package/lib/FileList/File.js +34 -30
- package/lib/FileList/FileList.js +17 -15
- package/lib/FileList/PdfFile.js +6 -5
- package/lib/FileList/index.js +3 -4
- package/lib/Filter/FilterButtons.js +72 -91
- package/lib/Filter/FilterCarousel.js +49 -72
- package/lib/Filter/FilterList.js +56 -77
- package/lib/Filter/FilterListPhone.js +143 -184
- package/lib/Filter/ToggleItem.js +34 -34
- package/lib/Filter/filterClasses.js +2 -3
- package/lib/Filter/index.js +5 -5
- package/lib/Footer/EditorName.js +6 -4
- package/lib/Footer/Footer.js +30 -30
- package/lib/Footer/FooterLinks.js +32 -34
- package/lib/Footer/FooterPrivacy.js +24 -25
- package/lib/Footer/FooterText.js +5 -3
- package/lib/Footer/index.js +3 -3
- package/lib/FramedContent/FramedContent.js +14 -21
- package/lib/FramedContent/index.js +1 -2
- package/lib/Frontpage/FrontpageAllSubjects.js +66 -78
- package/lib/FrontpageArticle/FrontpageArticle.js +23 -24
- package/lib/FrontpageArticle/index.js +5 -7
- package/lib/Gloss/Gloss.js +41 -44
- package/lib/Gloss/index.js +1 -1
- package/lib/Grid/Grid.js +31 -37
- package/lib/Grid/index.js +4 -5
- package/lib/Hero/Hero.js +46 -54
- package/lib/Hero/HeroContent.js +2 -3
- package/lib/Hero/index.js +9 -9
- package/lib/Image/Image.js +44 -59
- package/lib/Image/ImageLink.js +18 -25
- package/lib/Image/index.js +5 -7
- package/lib/KeyFigure/KeyFigure.js +20 -19
- package/lib/KeyFigure/index.js +1 -1
- package/lib/LanguageSelector/LanguageSelector.js +39 -41
- package/lib/LanguageSelector/index.js +1 -1
- package/lib/Layout/Content.js +5 -4
- package/lib/Layout/LayoutItem.js +11 -19
- package/lib/Layout/OneColumn.js +19 -26
- package/lib/Layout/PageContainer.js +22 -31
- package/lib/Layout/index.js +4 -5
- package/lib/LearningPaths/LearningPathContent.js +5 -3
- package/lib/LearningPaths/LearningPathInformation.js +17 -14
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +16 -14
- package/lib/LearningPaths/LearningPathMenu.js +70 -77
- package/lib/LearningPaths/LearningPathMenuAside.js +19 -19
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +13 -13
- package/lib/LearningPaths/LearningPathMenuContent.js +87 -52
- package/lib/LearningPaths/LearningPathMenuIntro.js +24 -28
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +22 -27
- package/lib/LearningPaths/LearningPathMobileHeader.js +7 -7
- package/lib/LearningPaths/LearningPathMobileStepInfo.js +10 -8
- package/lib/LearningPaths/LearningPathSticky.js +24 -21
- package/lib/LearningPaths/LearningPathWrapper.js +6 -4
- package/lib/LearningPaths/index.js +10 -10
- package/lib/LetterFilter/LetterFilter.js +18 -22
- package/lib/LetterFilter/alphabet.js +1 -2
- package/lib/LetterFilter/index.js +1 -2
- package/lib/LicenseByline/EmbedByline.js +38 -44
- package/lib/LicenseByline/LicenseDescription.js +7 -6
- package/lib/LicenseByline/LicenseLink.js +8 -8
- package/lib/LicenseByline/index.js +1 -1
- package/lib/LinkBlock/LinkBlock.js +18 -17
- package/lib/LinkBlock/LinkBlockSection.js +15 -23
- package/lib/LinkBlock/index.js +2 -2
- package/lib/List/OrderedList.js +20 -25
- package/lib/List/UnOrderedList.js +13 -20
- package/lib/List/index.js +2 -2
- package/lib/Logo/Logo.js +27 -31
- package/lib/Logo/SvgLogo.js +20 -23
- package/lib/Logo/index.js +1 -2
- package/lib/Masthead/Masthead.js +24 -31
- package/lib/Masthead/SkipToMainContent.js +10 -8
- package/lib/Masthead/index.js +4 -5
- package/lib/Masthead/utils.js +20 -30
- package/lib/MediaList/MediaList.js +91 -78
- package/lib/MediaList/index.js +6 -6
- package/lib/Messages/MessageBanner.js +21 -18
- package/lib/Messages/MessageBox.js +27 -28
- package/lib/Messages/index.js +2 -2
- package/lib/MyNdla/Resource/Folder.js +42 -38
- package/lib/MyNdla/Resource/FolderInput.js +26 -34
- package/lib/MyNdla/Resource/index.js +2 -2
- package/lib/MyNdla/index.js +2 -2
- package/lib/NDLAFilm/AboutNdlaFilm.js +11 -9
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +58 -68
- package/lib/NDLAFilm/FilmContentCard.js +35 -48
- package/lib/NDLAFilm/FilmContentCardTags.js +15 -18
- package/lib/NDLAFilm/FilmMovieList.js +16 -19
- package/lib/NDLAFilm/FilmMovieSearch.js +35 -38
- package/lib/NDLAFilm/FilmSlideshow.js +39 -59
- package/lib/NDLAFilm/MovieGrid.js +24 -28
- package/lib/NDLAFilm/VisualElement.js +18 -15
- package/lib/NDLAFilm/filmStyles.js +14 -14
- package/lib/NDLAFilm/index.js +6 -6
- package/lib/NDLAFilm/isLetter.js +3 -3
- package/lib/Navigation/NavigationBox.js +81 -96
- package/lib/Navigation/index.js +1 -1
- package/lib/NoContentBox/NoContentBox.js +7 -6
- package/lib/NoContentBox/index.js +1 -2
- package/lib/Notion/Notion.js +31 -34
- package/lib/Notion/NotionImage.js +13 -10
- package/lib/Notion/index.js +1 -1
- package/lib/Programme/Programme.js +42 -26
- package/lib/Programme/ProgrammeSubjects.js +20 -27
- package/lib/Programme/index.js +2 -3
- package/lib/ProgrammeCard/ProgrammeCard.js +11 -10
- package/lib/ProgrammeCard/index.js +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js +57 -75
- package/lib/RelatedArticleList/index.js +2 -3
- package/lib/Resource/BlockResource.js +41 -38
- package/lib/Resource/ListResource.js +50 -45
- package/lib/Resource/index.js +2 -2
- package/lib/Resource/resourceComponents.js +77 -88
- package/lib/Resource/storyComponents.js +28 -31
- package/lib/ResourceBox/ResourceBox.js +15 -14
- package/lib/ResourceBox/index.js +1 -1
- package/lib/ResourceGroup/ResourceGroup.js +15 -15
- package/lib/ResourceGroup/ResourceItem.js +65 -47
- package/lib/ResourceGroup/ResourceList.js +26 -34
- package/lib/ResourceGroup/index.js +1 -2
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +30 -27
- package/lib/ResourcesWrapper/ResourcesWrapper.js +13 -19
- package/lib/ResourcesWrapper/index.js +2 -3
- package/lib/Search/ActiveFilterContent.js +10 -12
- package/lib/Search/ActiveFilters.js +34 -29
- package/lib/Search/ContentTypeResult.js +50 -68
- package/lib/Search/ContentTypeResultStyles.js +20 -38
- package/lib/Search/IsPathToHighlight.js +2 -2
- package/lib/Search/LoadingWrapper.js +6 -5
- package/lib/Search/SearchField.js +51 -56
- package/lib/Search/SearchFieldForm.js +9 -9
- package/lib/Search/SearchResult.js +53 -59
- package/lib/Search/SearchResultSleeve.js +76 -97
- package/lib/Search/index.js +4 -4
- package/lib/SearchTypeResult/ActiveFilterContent.js +18 -19
- package/lib/SearchTypeResult/ActiveFilters.js +47 -44
- package/lib/SearchTypeResult/PopupFilter.js +40 -55
- package/lib/SearchTypeResult/ResultNavigation.js +23 -24
- package/lib/SearchTypeResult/SearchFieldHeader.js +35 -49
- package/lib/SearchTypeResult/SearchFilterContent.js +20 -18
- package/lib/SearchTypeResult/SearchHeader.js +54 -65
- package/lib/SearchTypeResult/SearchItem.js +37 -37
- package/lib/SearchTypeResult/SearchItemList.js +46 -48
- package/lib/SearchTypeResult/SearchItems.js +25 -27
- package/lib/SearchTypeResult/SearchNotionsResult.js +17 -15
- package/lib/SearchTypeResult/SearchSubjectItem.js +30 -22
- package/lib/SearchTypeResult/SearchSubjectResult.js +18 -19
- package/lib/SearchTypeResult/SearchTypeHeader.js +47 -48
- package/lib/SearchTypeResult/SearchTypeResult.js +26 -29
- package/lib/SearchTypeResult/SearchViewType.js +23 -27
- package/lib/SearchTypeResult/components/ItemContexts.js +46 -46
- package/lib/SearchTypeResult/components/ItemResourceHeader.js +31 -38
- package/lib/SearchTypeResult/components/ItemTopicHeader.js +21 -19
- package/lib/SearchTypeResult/components/SubjectFilters.js +56 -80
- package/lib/SearchTypeResult/index.js +6 -6
- package/lib/SectionHeading/SectionHeading.js +12 -13
- package/lib/SectionHeading/index.js +1 -2
- package/lib/SnackBar/DefaultSnackbar.js +15 -15
- package/lib/SnackBar/SnackbarProvider.js +67 -99
- package/lib/SnackBar/index.js +4 -4
- package/lib/Subject/SubjectBanner.js +10 -15
- package/lib/Subject/SubjectHeader.js +15 -23
- package/lib/Subject/index.js +2 -2
- package/lib/Table/Table.js +44 -62
- package/lib/Table/index.js +4 -6
- package/lib/TagSelector/Control.js +20 -23
- package/lib/TagSelector/DropdownIndicator.js +31 -38
- package/lib/TagSelector/Input.js +15 -19
- package/lib/TagSelector/Menu.js +12 -19
- package/lib/TagSelector/MenuList.js +20 -24
- package/lib/TagSelector/Option.js +35 -32
- package/lib/TagSelector/SelectContainer.js +19 -21
- package/lib/TagSelector/TagSelector.js +65 -103
- package/lib/TagSelector/ValueButton.js +30 -29
- package/lib/TagSelector/ariaMessages.js +83 -81
- package/lib/TagSelector/index.js +1 -1
- package/lib/ToolboxPage/ToolboxInfo.js +12 -10
- package/lib/ToolboxPage/index.js +1 -1
- package/lib/Topic/Loader.js +97 -100
- package/lib/Topic/Topic.js +57 -60
- package/lib/Topic/index.js +1 -2
- package/lib/TreeStructure/AddFolderButton.js +29 -29
- package/lib/TreeStructure/ComboboxButton.js +28 -30
- package/lib/TreeStructure/FolderItem.js +71 -78
- package/lib/TreeStructure/FolderItems.js +40 -45
- package/lib/TreeStructure/TreeStructure.js +59 -98
- package/lib/TreeStructure/arrowNavigation.js +5 -7
- package/lib/TreeStructure/helperFunctions.js +19 -24
- package/lib/TreeStructure/index.js +1 -1
- package/lib/i18n/formatNestedMessages.js +8 -9
- package/lib/i18n/i18n.js +3 -5
- package/lib/i18n/index.js +2 -2
- package/lib/index.js +175 -176
- package/lib/locale/LocaleProvider.js +14 -10
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +107 -40
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +107 -40
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +114 -47
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +106 -39
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +111 -44
- package/lib/model/ContentType.js +37 -53
- package/lib/model/SubjectCategories.js +4 -8
- package/lib/model/SubjectTypes.js +3 -6
- package/lib/model/WordClass.js +2 -3
- package/lib/model/index.js +8 -10
- package/lib/types.js +1 -1
- package/lib/utils/relativeUrl.js +11 -11
- package/lib/utils/resourceTypeColor.js +5 -4
- package/package.json +3 -3
- package/src/NDLAFilm/filmStyles.ts +9 -2
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +2 -1
- package/src/locale/messages-nn.ts +9 -8
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +6 -5
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var _subjectCategories, _subjectTypes, _contentTypeResultsSh, _contentTypeResultsSh2, _contentTypeResultsNo, _wordClass;
|
|
2
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
1
|
/**
|
|
9
2
|
* Copyright (c) 2018-present, NDLA.
|
|
10
3
|
*
|
|
@@ -15,13 +8,14 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
15
8
|
|
|
16
9
|
import { contributorTypes } from '@ndla/licenses';
|
|
17
10
|
import constants from '../model';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
export const {
|
|
12
|
+
contentTypes,
|
|
13
|
+
subjectCategories,
|
|
14
|
+
subjectTypes,
|
|
15
|
+
wordClass
|
|
16
|
+
} = constants;
|
|
17
|
+
const titleTemplate = ' - NDLA';
|
|
18
|
+
const messages = {
|
|
25
19
|
common: {
|
|
26
20
|
subject: 'Fag',
|
|
27
21
|
subject_plural: 'Fag'
|
|
@@ -67,7 +61,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
67
61
|
onChange: {
|
|
68
62
|
deselect: 'emneknagg {{label}}, fjernet.',
|
|
69
63
|
clear: 'Alle valgte emneknagger fjernet.',
|
|
70
|
-
initialFocus:
|
|
64
|
+
initialFocus: `Emneknagger {{labels}}, valgt.`,
|
|
71
65
|
selectedDisabled: 'Emneknagg {{label}} kan ikke velges. Velg et annet alternativ.',
|
|
72
66
|
selected: 'Emneknagg {{label}}, valgt.'
|
|
73
67
|
},
|
|
@@ -87,12 +81,12 @@ var messages = _objectSpread(_objectSpread({
|
|
|
87
81
|
showTags: 'Vis emneknagger'
|
|
88
82
|
},
|
|
89
83
|
htmlTitles: {
|
|
90
|
-
titleTemplate
|
|
91
|
-
welcomePage:
|
|
84
|
+
titleTemplate,
|
|
85
|
+
welcomePage: `Åvtesæjroe${titleTemplate}`,
|
|
92
86
|
topicPage: 'Teema',
|
|
93
|
-
subjectsPage:
|
|
94
|
-
searchPage:
|
|
95
|
-
notFound:
|
|
87
|
+
subjectsPage: `Veeljh faagem${titleTemplate}`,
|
|
88
|
+
searchPage: `Ohtsh${titleTemplate}`,
|
|
89
|
+
notFound: `Ij sæjroe gååvnesh${titleTemplate}`
|
|
96
90
|
},
|
|
97
91
|
newsLetter: {
|
|
98
92
|
heading: 'Saernieprievie',
|
|
@@ -116,8 +110,18 @@ var messages = _objectSpread(_objectSpread({
|
|
|
116
110
|
embed: 'Lissehth',
|
|
117
111
|
notSupported: 'Idtji gåaredh sisvegem lissiehtidh. Vaeltieh kopijem gaaltijekodeste vuelielistie juktie dam dov sæjrose lissiehtidh.'
|
|
118
112
|
},
|
|
119
|
-
subjectCategories:
|
|
120
|
-
|
|
113
|
+
subjectCategories: {
|
|
114
|
+
[subjectCategories.ACTIVE_SUBJECTS]: 'Aktijve',
|
|
115
|
+
[subjectCategories.ARCHIVE_SUBJECTS]: 'Eah vielie gååvnesh',
|
|
116
|
+
[subjectCategories.BETA_SUBJECTS]: 'Båetije',
|
|
117
|
+
[subjectCategories.OTHER]: 'Andre ressurser',
|
|
118
|
+
[subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamlinger'
|
|
119
|
+
},
|
|
120
|
+
subjectTypes: {
|
|
121
|
+
[subjectTypes.BETA_SUBJECT]: 'Betafag',
|
|
122
|
+
[subjectTypes.SUBJECT]: 'Faagem',
|
|
123
|
+
[subjectTypes.RESOURCE_COLLECTION]: 'Ressurssamling'
|
|
124
|
+
},
|
|
121
125
|
searchPage: {
|
|
122
126
|
noHits: 'Ij naan tjaalegh dov ohtseminie sjïehth: {{query}}',
|
|
123
127
|
noHitsShort: 'Ij naan gaavnedimmieh ohtsemasse: {{query}}',
|
|
@@ -365,9 +369,33 @@ var messages = _objectSpread(_objectSpread({
|
|
|
365
369
|
learningResourcesHeading: 'Lïeremevierhtieh',
|
|
366
370
|
back: 'Bååstede',
|
|
367
371
|
additionalFilterLabel: 'Lissievierhtieh',
|
|
368
|
-
contentTypeResultsShowMore:
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
contentTypeResultsShowMore: {
|
|
373
|
+
[contentTypes.SUBJECT_MATERIAL]: 'Vuesehth jienebh faage-aamhtesh',
|
|
374
|
+
[contentTypes.TASKS_AND_ACTIVITIES]: 'Vuesehth jienebh laavenjassh jïh darjomh',
|
|
375
|
+
[contentTypes.LEARNING_PATH]: 'Vuesehth jienebh lïeremebaalkah',
|
|
376
|
+
[contentTypes.ASSESSMENT_RESOURCES]: 'Vuesehth jienebh vuarjasjimmievierhtieh',
|
|
377
|
+
[contentTypes.SOURCE_MATERIAL]: 'Vuesehth jienebh gaaltijevierhtieh',
|
|
378
|
+
[contentTypes.EXTERNAL_LEARNING_RESOURCES]: 'Vuesehth jienebh byjngetje lïeremevierhtieh',
|
|
379
|
+
unGrouped: 'Vuesehth jienebh vierhtieh'
|
|
380
|
+
},
|
|
381
|
+
contentTypeResultsShowLess: {
|
|
382
|
+
[contentTypes.SUBJECT_MATERIAL]: 'Vuesehth vaenebh faage-aamhtesh',
|
|
383
|
+
[contentTypes.TASKS_AND_ACTIVITIES]: 'Vuesehth vaenebh laavenjassh jïh darjomh',
|
|
384
|
+
[contentTypes.LEARNING_PATH]: 'Vuesehth vaenebh lïeremebaalkah',
|
|
385
|
+
[contentTypes.ASSESSMENT_RESOURCES]: 'Vuesehth vaenebh vuarjasjimmievierhtieh',
|
|
386
|
+
[contentTypes.SOURCE_MATERIAL]: 'Vuesehth vaenebh gaaltijevierhtieh',
|
|
387
|
+
[contentTypes.EXTERNAL_LEARNING_RESOURCES]: 'Vuesehth vaenebh byjngetje lïeremevierhtieh',
|
|
388
|
+
unGrouped: 'Vuesehth vaenebh vierhtieh'
|
|
389
|
+
},
|
|
390
|
+
contentTypeResultsNoHit: {
|
|
391
|
+
[contentTypes.SUBJECT_MATERIAL]: 'Ij naan faage-aamhtesh',
|
|
392
|
+
[contentTypes.TASKS_AND_ACTIVITIES]: 'Ij naan laavenjassh',
|
|
393
|
+
[contentTypes.LEARNING_PATH]: 'Ij naan lïeremebaalkah',
|
|
394
|
+
[contentTypes.ASSESSMENT_RESOURCES]: 'Ij naan vuarjasjimmievierhtieh',
|
|
395
|
+
[contentTypes.SOURCE_MATERIAL]: 'Ij naan gaaltijevierhtieh',
|
|
396
|
+
[contentTypes.EXTERNAL_LEARNING_RESOURCES]: 'Ij naan byjngetje lïeremevierhtieh',
|
|
397
|
+
unGrouped: 'Ij naan vierhtieh'
|
|
398
|
+
}
|
|
371
399
|
}
|
|
372
400
|
},
|
|
373
401
|
logo: {
|
|
@@ -861,7 +889,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
861
889
|
previousArrow: 'Gå til førre steg'
|
|
862
890
|
},
|
|
863
891
|
dropdown: {
|
|
864
|
-
numberHits:
|
|
892
|
+
numberHits: `Datne {{hits}} gaavnedimmieh åadtjoejih`,
|
|
865
893
|
searching: 'Ohtseminie...',
|
|
866
894
|
create: 'Darjoeh orre',
|
|
867
895
|
isSelectedItem: 'Lissiehtamme',
|
|
@@ -947,7 +975,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
947
975
|
title: 'Tihtele',
|
|
948
976
|
cancel: 'Orrejh',
|
|
949
977
|
save: 'Vöörhkh',
|
|
950
|
-
photo: '
|
|
978
|
+
photo: 'Bilde',
|
|
951
979
|
email: 'E-post',
|
|
952
980
|
image: {
|
|
953
981
|
altText: 'Alt-tekst',
|
|
@@ -1029,8 +1057,8 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1029
1057
|
files: 'Filer',
|
|
1030
1058
|
fileTypesNotSupported: 'Filtypen(e) støttast ikkje: {{fileTypes}}',
|
|
1031
1059
|
download: 'Veedtjh fijlem: ',
|
|
1032
|
-
expandButton: 'Vuesehth stoerre versjovnem'
|
|
1033
|
-
|
|
1060
|
+
expandButton: 'Vuesehth stoerre versjovnem',
|
|
1061
|
+
...contributorTypes.nb,
|
|
1034
1062
|
filterButtons: {
|
|
1035
1063
|
removeAllFilters: 'Skubph filterem'
|
|
1036
1064
|
},
|
|
@@ -1129,10 +1157,11 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1129
1157
|
unShare: 'Når du avsluttar deling, sluttar lenka til den delte mappa og eventuelle undermapper å verke. Dersom du har delt lenka med nokon, kan dei ikkje lenger sjå innhaldet i mappa. Dette gjelder òg lenker til eventuelle undermapper.'
|
|
1130
1158
|
},
|
|
1131
1159
|
button: {
|
|
1132
|
-
share: '
|
|
1133
|
-
preview: '
|
|
1134
|
-
|
|
1135
|
-
|
|
1160
|
+
share: 'Juekieh maabpah',
|
|
1161
|
+
preview: 'Maahpa åvtelhbodti vuartasjidh',
|
|
1162
|
+
goTo: 'Vaedtsieh naemhtie juekedh mappine',
|
|
1163
|
+
unShare: 'Orrijh juekedh',
|
|
1164
|
+
shareLink: 'Lïenghkem kopijeradidh'
|
|
1136
1165
|
}
|
|
1137
1166
|
}
|
|
1138
1167
|
},
|
|
@@ -1404,9 +1433,9 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1404
1433
|
embed: {
|
|
1405
1434
|
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1406
1435
|
linkError: 'Klarte ikkje å vise lenke.',
|
|
1407
|
-
unsupported:
|
|
1436
|
+
unsupported: `Embed {{type}} er ikkje støtta.`,
|
|
1408
1437
|
goTo: 'Gå til {{type}}',
|
|
1409
|
-
embedError:
|
|
1438
|
+
embedError: `Orsak, ein feil oppstod ved lasting av {{type}}. Prøv å laste inn sida på nytt.`,
|
|
1410
1439
|
type: {
|
|
1411
1440
|
image: 'Bilde',
|
|
1412
1441
|
video: 'Video',
|
|
@@ -1426,9 +1455,45 @@ var messages = _objectSpread(_objectSpread({
|
|
|
1426
1455
|
pinyin: 'Pinyin'
|
|
1427
1456
|
}
|
|
1428
1457
|
},
|
|
1429
|
-
wordClass:
|
|
1458
|
+
wordClass: {
|
|
1459
|
+
[wordClass.wordClass.adjective]: 'Adjektiv',
|
|
1460
|
+
[wordClass.wordClass.adverb]: 'Adverb',
|
|
1461
|
+
[wordClass.wordClass.properNoun]: 'Egennavn',
|
|
1462
|
+
[wordClass.wordClass.auxiliary]: 'Hjelpeord',
|
|
1463
|
+
[wordClass.wordClass.complement]: 'Komplement',
|
|
1464
|
+
[wordClass.wordClass.conjunction]: 'Konjunksjon',
|
|
1465
|
+
[wordClass.wordClass.coverb]: 'Koverb',
|
|
1466
|
+
[wordClass.wordClass.determiner]: 'Bestemmerord',
|
|
1467
|
+
[wordClass.wordClass.interjection]: 'Interjeksjon',
|
|
1468
|
+
[wordClass.wordClass.quantifier]: 'Kvantor',
|
|
1469
|
+
[wordClass.wordClass.marker]: 'Markør',
|
|
1470
|
+
[wordClass.wordClass.modalVerb]: 'Modalverb',
|
|
1471
|
+
[wordClass.wordClass.measureWord]: 'Målord',
|
|
1472
|
+
[wordClass.wordClass.noun]: 'Substantiv',
|
|
1473
|
+
[wordClass.wordClass['noun-zh']]: 'Nomen',
|
|
1474
|
+
[wordClass.wordClass.nounPhrase]: 'Nominalfrase',
|
|
1475
|
+
[wordClass.wordClass.onomatopoeia]: 'Onomatopoetikon',
|
|
1476
|
+
[wordClass.wordClass.particle]: 'Partikkel',
|
|
1477
|
+
[wordClass.wordClass.demonstrative]: 'Pekeord',
|
|
1478
|
+
[wordClass.wordClass.personalPronoun]: 'Personlig Pronomen',
|
|
1479
|
+
[wordClass.wordClass.preposition]: 'Preposisjon',
|
|
1480
|
+
[wordClass.wordClass.pronoun]: 'Pronomen',
|
|
1481
|
+
[wordClass.wordClass.questionWord]: 'Spørreord',
|
|
1482
|
+
[wordClass.wordClass.locationWord]: 'Stedsord',
|
|
1483
|
+
[wordClass.wordClass.suffix]: 'Suffiks',
|
|
1484
|
+
[wordClass.wordClass.numeral]: 'Tallord',
|
|
1485
|
+
[wordClass.wordClass.timeWord]: 'Tidsord',
|
|
1486
|
+
[wordClass.wordClass.timeExpression]: 'Tidsuttrykk',
|
|
1487
|
+
[wordClass.wordClass.stativeVerb]: 'Tilstandsverb',
|
|
1488
|
+
[wordClass.wordClass.subordinatingConjunction]: 'Subjunksjon',
|
|
1489
|
+
[wordClass.wordClass.exclamationWord]: 'Utropsord',
|
|
1490
|
+
[wordClass.wordClass.expression]: 'Uttrykk',
|
|
1491
|
+
[wordClass.wordClass.verb]: 'Verb',
|
|
1492
|
+
[wordClass.wordClass.verbComplement]: 'Verb-Komplement',
|
|
1493
|
+
[wordClass.wordClass.verbObject]: 'Verb-Objekt'
|
|
1494
|
+
},
|
|
1430
1495
|
about: {
|
|
1431
1496
|
menuTitle: 'Om NDLA'
|
|
1432
1497
|
}
|
|
1433
|
-
}
|
|
1498
|
+
};
|
|
1434
1499
|
export default messages;
|
package/es/model/ContentType.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
var _contentTypeMapping;
|
|
2
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
1
|
/**
|
|
7
2
|
* Copyright (c) 2017-present, NDLA.
|
|
8
3
|
*
|
|
@@ -11,35 +6,43 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
11
6
|
*
|
|
12
7
|
*/
|
|
13
8
|
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
SUBJECT_MATERIAL
|
|
25
|
-
TASKS_AND_ACTIVITIES
|
|
26
|
-
ASSESSMENT_RESOURCES
|
|
27
|
-
SUBJECT
|
|
28
|
-
EXTERNAL_LEARNING_RESOURCES
|
|
29
|
-
SOURCE_MATERIAL
|
|
30
|
-
LEARNING_PATH
|
|
31
|
-
TOPIC
|
|
32
|
-
MULTIDISCIPLINARY_TOPIC
|
|
9
|
+
export const SUBJECT_MATERIAL = 'subject-material';
|
|
10
|
+
export const TASKS_AND_ACTIVITIES = 'tasks-and-activities';
|
|
11
|
+
export const ASSESSMENT_RESOURCES = 'assessment-resources';
|
|
12
|
+
export const SUBJECT = 'subject';
|
|
13
|
+
export const EXTERNAL_LEARNING_RESOURCES = 'external-learning-resources';
|
|
14
|
+
export const SOURCE_MATERIAL = 'source-material';
|
|
15
|
+
export const LEARNING_PATH = 'learning-path';
|
|
16
|
+
export const TOPIC = 'topic';
|
|
17
|
+
export const MULTIDISCIPLINARY_TOPIC = 'multidisciplinary-topic';
|
|
18
|
+
export const contentTypes = {
|
|
19
|
+
SUBJECT_MATERIAL,
|
|
20
|
+
TASKS_AND_ACTIVITIES,
|
|
21
|
+
ASSESSMENT_RESOURCES,
|
|
22
|
+
SUBJECT,
|
|
23
|
+
EXTERNAL_LEARNING_RESOURCES,
|
|
24
|
+
SOURCE_MATERIAL,
|
|
25
|
+
LEARNING_PATH,
|
|
26
|
+
TOPIC,
|
|
27
|
+
MULTIDISCIPLINARY_TOPIC
|
|
33
28
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
|
|
29
|
+
export const RESOURCE_TYPE_LEARNING_PATH = 'urn:resourcetype:learningPath';
|
|
30
|
+
export const RESOURCE_TYPE_SUBJECT_MATERIAL = 'urn:resourcetype:subjectMaterial';
|
|
31
|
+
export const RESOURCE_TYPE_TASKS_AND_ACTIVITIES = 'urn:resourcetype:tasksAndActivities';
|
|
32
|
+
export const RESOURCE_TYPE_ASSESSMENT_RESOURCES = 'urn:resourcetype:reviewResource';
|
|
33
|
+
export const RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = 'urn:resourcetype:externalResource';
|
|
34
|
+
export const RESOURCE_TYPE_SOURCE_MATERIAL = 'urn:resourcetype:SourceMaterial';
|
|
35
|
+
export const ListOfContentTypes = ['SUBJECT_MATERIAL', 'TASKS_AND_ACTIVITIES', 'ASSESSMENT_RESOURCES', 'SUBJECT', 'EXTERNAL_LEARNING_RESOURCES', 'SOURCE_MATERIAL', 'LEARNING_PATH', 'TOPIC', 'MULTIDISIPLINARY_TOPIC'];
|
|
36
|
+
export const contentTypeMapping = {
|
|
37
|
+
[RESOURCE_TYPE_LEARNING_PATH]: LEARNING_PATH,
|
|
38
|
+
[RESOURCE_TYPE_SUBJECT_MATERIAL]: SUBJECT_MATERIAL,
|
|
39
|
+
[RESOURCE_TYPE_TASKS_AND_ACTIVITIES]: TASKS_AND_ACTIVITIES,
|
|
40
|
+
[RESOURCE_TYPE_ASSESSMENT_RESOURCES]: ASSESSMENT_RESOURCES,
|
|
41
|
+
[RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES]: EXTERNAL_LEARNING_RESOURCES,
|
|
42
|
+
[RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,
|
|
43
|
+
default: SUBJECT_MATERIAL
|
|
44
|
+
};
|
|
45
|
+
export const resourceEmbedTypeMapping = {
|
|
43
46
|
image: 'image',
|
|
44
47
|
video: 'video',
|
|
45
48
|
concept: 'concept',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
9
|
+
export const ACTIVE_SUBJECTS = 'active';
|
|
10
|
+
export const ARCHIVE_SUBJECTS = 'archive';
|
|
11
|
+
export const BETA_SUBJECTS = 'beta';
|
|
12
|
+
export const OTHER = 'otherResources';
|
package/es/model/SubjectTypes.js
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
9
|
+
export const BETA_SUBJECT = 'betaSubject';
|
|
10
|
+
export const SUBJECT = 'subject';
|
|
11
|
+
export const RESOURCE_COLLECTION = 'resourceCollection';
|
package/es/model/WordClass.js
CHANGED
package/es/model/index.js
CHANGED
|
@@ -11,13 +11,13 @@ import * as subjectCategories from './SubjectCategories';
|
|
|
11
11
|
import * as subjectTypes from './SubjectTypes';
|
|
12
12
|
import * as wordClass from './WordClass';
|
|
13
13
|
import * as Transcriptions from './Transcriptions';
|
|
14
|
-
|
|
15
|
-
contentTypes
|
|
16
|
-
subjectCategories
|
|
17
|
-
subjectTypes
|
|
18
|
-
contentTypeMapping
|
|
19
|
-
resourceEmbedTypeMapping
|
|
20
|
-
wordClass
|
|
21
|
-
Transcriptions
|
|
14
|
+
const model = {
|
|
15
|
+
contentTypes,
|
|
16
|
+
subjectCategories,
|
|
17
|
+
subjectTypes,
|
|
18
|
+
contentTypeMapping,
|
|
19
|
+
resourceEmbedTypeMapping,
|
|
20
|
+
wordClass,
|
|
21
|
+
Transcriptions
|
|
22
22
|
};
|
|
23
23
|
export default model;
|
package/es/types.js
CHANGED
package/es/utils/relativeUrl.js
CHANGED
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { supportedTranslationLanguages } from '../i18n/i18n';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
10
|
+
const ENV_REGEX = /(staging|test)\.?/;
|
|
11
|
+
const LANGUAGE_REGEX = new RegExp(`^\\/((?:${supportedTranslationLanguages.join('|')})(?:$|\\/))`, '');
|
|
12
|
+
const NDLA_URL = /(.*\.)?ndla.no.*/;
|
|
13
|
+
const REPLACE_WWW = /^www\./;
|
|
14
|
+
export const getPossiblyRelativeUrl = (url, path) => {
|
|
15
15
|
if (!path) return url;
|
|
16
16
|
// If not on NDLA, or if url is not a NDLA url, return url as is
|
|
17
17
|
if (!NDLA_URL.test(url) || !NDLA_URL.test(path)) return url;
|
|
18
18
|
//Remove environment info
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const urlObj = new URL(url.replace(ENV_REGEX, ''));
|
|
20
|
+
const pathObj = new URL(path.replace(ENV_REGEX, ''));
|
|
21
21
|
// If the host is the same, return the relative path
|
|
22
22
|
if (urlObj.hostname.replace(REPLACE_WWW, '') === pathObj.hostname.replace(REPLACE_WWW, '')) {
|
|
23
23
|
// Replace the language part of the url with the language part of the path
|
|
24
24
|
// If the path language part does not exist, remove it.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (urlMatch
|
|
28
|
-
return urlObj.pathname.replace(urlMatch[1],
|
|
25
|
+
const urlMatch = urlObj.pathname.match(LANGUAGE_REGEX);
|
|
26
|
+
const pathMatch = pathObj.pathname.match(LANGUAGE_REGEX);
|
|
27
|
+
if (urlMatch?.[1] && urlMatch?.[1] !== pathMatch?.[1]) {
|
|
28
|
+
return urlObj.pathname.replace(urlMatch[1], pathMatch?.[1] || '');
|
|
29
29
|
}
|
|
30
30
|
return urlObj.pathname;
|
|
31
31
|
}
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
import { colors } from '@ndla/core';
|
|
10
10
|
import constants from '../model';
|
|
11
11
|
import { resourceEmbedTypeMapping } from '../model/ContentType';
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const {
|
|
13
|
+
contentTypes
|
|
14
|
+
} = constants;
|
|
15
|
+
export const resourceTypeColor = type => {
|
|
14
16
|
switch (type) {
|
|
15
17
|
case contentTypes.SUBJECT_MATERIAL:
|
|
16
18
|
return colors.subjectMaterial.light;
|