@ndla/ui 56.0.181-alpha.0 → 56.0.182-alpha.0
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/AnchorHeading/AnchorHeading.mjs +1 -2
- package/es/AnchorHeading/AnchorHeading.mjs.map +1 -1
- package/es/Article/Article.mjs +1 -2
- package/es/Article/Article.mjs.map +1 -1
- package/es/Article/ArticleByline.mjs +1 -2
- package/es/Article/ArticleByline.mjs.map +1 -1
- package/es/Article/ArticleFootNotes.mjs +1 -2
- package/es/Article/ArticleFootNotes.mjs.map +1 -1
- package/es/Article/BadgesContainer.mjs +1 -2
- package/es/Article/BadgesContainer.mjs.map +1 -1
- package/es/AudioPlayer/AudioPlayer.mjs +1 -2
- package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
- package/es/AudioPlayer/Controls.mjs +1 -2
- package/es/AudioPlayer/Controls.mjs.map +1 -1
- package/es/AudioPlayer/SpeechControl.mjs +1 -2
- package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
- package/es/Breadcrumb/Breadcrumb.mjs +1 -2
- package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs +1 -2
- package/es/Breadcrumb/BreadcrumbItem.mjs.map +1 -1
- package/es/Breadcrumb/HomeBreadcrumb.mjs +1 -2
- package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
- package/es/CampaignBlock/CampaignBlock.mjs +1 -2
- package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
- package/es/CodeBlock/CodeBlock.mjs +1 -2
- package/es/CodeBlock/CodeBlock.mjs.map +1 -1
- package/es/CodeBlock/codeLanguageOptions.mjs +1 -1
- package/es/Concept/Concept.mjs +1 -2
- package/es/Concept/Concept.mjs.map +1 -1
- package/es/ContactBlock/ContactBlock.mjs +1 -2
- package/es/ContactBlock/ContactBlock.mjs.map +1 -1
- package/es/Embed/AudioEmbed.mjs +1 -2
- package/es/Embed/AudioEmbed.mjs.map +1 -1
- package/es/Embed/BrightcoveEmbed.mjs +1 -2
- package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
- package/es/Embed/CodeEmbed.mjs +1 -2
- package/es/Embed/CodeEmbed.mjs.map +1 -1
- package/es/Embed/ConceptEmbed.mjs +1 -2
- package/es/Embed/ConceptEmbed.mjs.map +1 -1
- package/es/Embed/ConceptInlineTriggerButton.mjs +1 -2
- package/es/Embed/ConceptInlineTriggerButton.mjs.map +1 -1
- package/es/Embed/ContentLinkEmbed.mjs +1 -2
- package/es/Embed/ContentLinkEmbed.mjs.map +1 -1
- package/es/Embed/CopyrightEmbed.mjs +1 -2
- package/es/Embed/CopyrightEmbed.mjs.map +1 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs +1 -2
- package/es/Embed/EmbedErrorPlaceholder.mjs.map +1 -1
- package/es/Embed/EmbedWrapper.mjs +1 -2
- package/es/Embed/EmbedWrapper.mjs.map +1 -1
- package/es/Embed/ExternalEmbed.mjs +1 -2
- package/es/Embed/ExternalEmbed.mjs.map +1 -1
- package/es/Embed/FootnoteEmbed.mjs +1 -2
- package/es/Embed/FootnoteEmbed.mjs.map +1 -1
- package/es/Embed/GlossEmbed.mjs +1 -2
- package/es/Embed/GlossEmbed.mjs.map +1 -1
- package/es/Embed/H5pEmbed.mjs +1 -2
- package/es/Embed/H5pEmbed.mjs.map +1 -1
- package/es/Embed/IframeEmbed.mjs +1 -2
- package/es/Embed/IframeEmbed.mjs.map +1 -1
- package/es/Embed/ImageEmbed.mjs +1 -2
- package/es/Embed/ImageEmbed.mjs.map +1 -1
- package/es/Embed/InlineTriggerButton.mjs +1 -2
- package/es/Embed/InlineTriggerButton.mjs.map +1 -1
- package/es/Embed/RelatedContentEmbed.mjs +1 -2
- package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
- package/es/Embed/UnknownEmbed.mjs +1 -2
- package/es/Embed/UnknownEmbed.mjs.map +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs +1 -2
- package/es/Embed/UuDisclaimerEmbed.mjs.map +1 -1
- package/es/FactBox/FactBox.mjs +1 -2
- package/es/FactBox/FactBox.mjs.map +1 -1
- package/es/FileList/File.mjs +1 -2
- package/es/FileList/File.mjs.map +1 -1
- package/es/FileList/FileList.mjs +1 -2
- package/es/FileList/FileList.mjs.map +1 -1
- package/es/FileList/PdfFile.mjs +1 -2
- package/es/FileList/PdfFile.mjs.map +1 -1
- package/es/Gloss/Gloss.mjs +1 -2
- package/es/Gloss/Gloss.mjs.map +1 -1
- package/es/Gloss/GlossExample.mjs +1 -2
- package/es/Gloss/GlossExample.mjs.map +1 -1
- package/es/Grid/Grid.mjs +1 -2
- package/es/Grid/Grid.mjs.map +1 -1
- package/es/KeyFigure/KeyFigure.mjs +1 -2
- package/es/KeyFigure/KeyFigure.mjs.map +1 -1
- package/es/LicenseByline/EmbedByline.mjs +1 -2
- package/es/LicenseByline/EmbedByline.mjs.map +1 -1
- package/es/LicenseByline/LicenseLink.mjs +1 -2
- package/es/LicenseByline/LicenseLink.mjs.map +1 -1
- package/es/LinkBlock/LinkBlock.mjs +1 -2
- package/es/LinkBlock/LinkBlock.mjs.map +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs +1 -2
- package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
- package/es/Pitch/Pitch.mjs +1 -2
- package/es/Pitch/Pitch.mjs.map +1 -1
- package/es/RelatedArticleList/RelatedArticleList.mjs +1 -2
- package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
- package/es/ResourceBox/ResourceBox.mjs +1 -2
- package/es/ResourceBox/ResourceBox.mjs.map +1 -1
- package/es/TagSelector/TagSelector.mjs +1 -2
- package/es/TagSelector/TagSelector.mjs.map +1 -1
- package/es/ZendeskButton/ZendeskButton.mjs +1 -2
- package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
- package/es/_virtual/_rolldown/runtime.mjs +6 -11
- package/es/i18n/useComponentTranslations.mjs +1 -2
- package/es/i18n/useComponentTranslations.mjs.map +1 -1
- package/es/index.mjs +1 -2
- package/es/model/ContentType.mjs +1 -1
- package/es/model/SubjectCategories.mjs +1 -2
- package/es/model/SubjectCategories.mjs.map +1 -1
- package/es/model/SubjectTypes.mjs +1 -2
- package/es/model/SubjectTypes.mjs.map +1 -1
- package/es/model/WordClass.mjs +1 -2
- package/es/model/WordClass.mjs.map +1 -1
- package/es/model/index.mjs +1 -2
- package/es/model/index.mjs.map +1 -1
- package/es/utils/licenseAttributes.mjs +1 -2
- package/es/utils/licenseAttributes.mjs.map +1 -1
- package/es/utils/relativeUrl.mjs +1 -1
- package/lib/AnchorHeading/AnchorHeading.js +2 -3
- package/lib/AnchorHeading/AnchorHeading.js.map +1 -1
- package/lib/Article/Article.js +3 -4
- package/lib/Article/Article.js.map +1 -1
- package/lib/Article/ArticleByline.js +3 -4
- package/lib/Article/ArticleByline.js.map +1 -1
- package/lib/Article/ArticleFootNotes.js +2 -3
- package/lib/Article/ArticleFootNotes.js.map +1 -1
- package/lib/Article/BadgesContainer.js +3 -5
- package/lib/Article/BadgesContainer.js.map +1 -1
- package/lib/AudioPlayer/AudioPlayer.js +4 -5
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
- package/lib/AudioPlayer/Controls.js +2 -3
- package/lib/AudioPlayer/Controls.js.map +1 -1
- package/lib/AudioPlayer/SpeechControl.js +2 -3
- package/lib/AudioPlayer/SpeechControl.js.map +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +4 -5
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js +3 -4
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js +3 -4
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
- package/lib/CampaignBlock/CampaignBlock.js +4 -5
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
- package/lib/CodeBlock/CodeBlock.js +2 -3
- package/lib/CodeBlock/CodeBlock.js.map +1 -1
- package/lib/CodeBlock/codeLanguageOptions.js +1 -2
- package/lib/CodeBlock/codeLanguageOptions.js.map +1 -1
- package/lib/Concept/Concept.js +9 -10
- package/lib/Concept/Concept.js.map +1 -1
- package/lib/ContactBlock/ContactBlock.js +3 -4
- package/lib/ContactBlock/ContactBlock.js.map +1 -1
- package/lib/Embed/AudioEmbed.js +6 -7
- package/lib/Embed/AudioEmbed.js.map +1 -1
- package/lib/Embed/BrightcoveEmbed.js +5 -6
- package/lib/Embed/BrightcoveEmbed.js.map +1 -1
- package/lib/Embed/CodeEmbed.js +5 -6
- package/lib/Embed/CodeEmbed.js.map +1 -1
- package/lib/Embed/ConceptEmbed.js +6 -7
- package/lib/Embed/ConceptEmbed.js.map +1 -1
- package/lib/Embed/ConceptInlineTriggerButton.js +4 -6
- package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -1
- package/lib/Embed/ContentLinkEmbed.js +2 -3
- package/lib/Embed/ContentLinkEmbed.js.map +1 -1
- package/lib/Embed/CopyrightEmbed.js +3 -4
- package/lib/Embed/CopyrightEmbed.js.map +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.js +4 -5
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
- package/lib/Embed/EmbedWrapper.js +2 -3
- package/lib/Embed/EmbedWrapper.js.map +1 -1
- package/lib/Embed/ExternalEmbed.js +4 -5
- package/lib/Embed/ExternalEmbed.js.map +1 -1
- package/lib/Embed/FootnoteEmbed.js +2 -3
- package/lib/Embed/FootnoteEmbed.js.map +1 -1
- package/lib/Embed/GlossEmbed.js +5 -6
- package/lib/Embed/GlossEmbed.js.map +1 -1
- package/lib/Embed/H5pEmbed.js +3 -4
- package/lib/Embed/H5pEmbed.js.map +1 -1
- package/lib/Embed/IframeEmbed.js +4 -5
- package/lib/Embed/IframeEmbed.js.map +1 -1
- package/lib/Embed/ImageEmbed.js +5 -6
- package/lib/Embed/ImageEmbed.js.map +1 -1
- package/lib/Embed/InlineTriggerButton.js +2 -3
- package/lib/Embed/InlineTriggerButton.js.map +1 -1
- package/lib/Embed/RelatedContentEmbed.js +3 -4
- package/lib/Embed/RelatedContentEmbed.js.map +1 -1
- package/lib/Embed/UnknownEmbed.js +2 -3
- package/lib/Embed/UnknownEmbed.js.map +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js +3 -4
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -1
- package/lib/FactBox/FactBox.js +2 -3
- package/lib/FactBox/FactBox.js.map +1 -1
- package/lib/FileList/File.js +3 -4
- package/lib/FileList/File.js.map +1 -1
- package/lib/FileList/FileList.js +3 -4
- package/lib/FileList/FileList.js.map +1 -1
- package/lib/FileList/PdfFile.js +2 -3
- package/lib/FileList/PdfFile.js.map +1 -1
- package/lib/Gloss/Gloss.js +4 -5
- package/lib/Gloss/Gloss.js.map +1 -1
- package/lib/Gloss/GlossExample.js +2 -3
- package/lib/Gloss/GlossExample.js.map +1 -1
- package/lib/Grid/Grid.js +3 -4
- package/lib/Grid/Grid.js.map +1 -1
- package/lib/KeyFigure/KeyFigure.js +2 -3
- package/lib/KeyFigure/KeyFigure.js.map +1 -1
- package/lib/LicenseByline/EmbedByline.js +3 -4
- package/lib/LicenseByline/EmbedByline.js.map +1 -1
- package/lib/LicenseByline/LicenseLink.js +2 -3
- package/lib/LicenseByline/LicenseLink.js.map +1 -1
- package/lib/LinkBlock/LinkBlock.js +3 -4
- package/lib/LinkBlock/LinkBlock.js.map +1 -1
- package/lib/LinkBlock/LinkBlockSection.js +2 -3
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
- package/lib/Pitch/Pitch.js +3 -4
- package/lib/Pitch/Pitch.js.map +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -3
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
- package/lib/ResourceBox/ResourceBox.js +2 -3
- package/lib/ResourceBox/ResourceBox.js.map +1 -1
- package/lib/TagSelector/TagSelector.js +2 -3
- package/lib/TagSelector/TagSelector.js.map +1 -1
- package/lib/ZendeskButton/ZendeskButton.js +2 -3
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
- package/lib/_virtual/_rolldown/runtime.js +12 -22
- package/lib/i18n/useComponentTranslations.js +2 -3
- package/lib/i18n/useComponentTranslations.js.map +1 -1
- package/lib/index.js +78 -79
- package/lib/model/ContentType.js +1 -2
- package/lib/model/ContentType.js.map +1 -1
- package/lib/model/SubjectCategories.js +7 -9
- package/lib/model/SubjectCategories.js.map +1 -1
- package/lib/model/SubjectTypes.js +7 -9
- package/lib/model/SubjectTypes.js.map +1 -1
- package/lib/model/WordClass.js +7 -9
- package/lib/model/WordClass.js.map +1 -1
- package/lib/model/index.js +5 -6
- package/lib/model/index.js.map +1 -1
- package/lib/utils/licenseAttributes.js +2 -3
- package/lib/utils/licenseAttributes.js.map +1 -1
- package/lib/utils/relativeUrl.js +1 -2
- package/lib/utils/relativeUrl.js.map +1 -1
- package/package.json +5 -5
- package/src/AudioPlayer/Controls.tsx +1 -1
- package/src/AudioPlayer/SpeechControl.tsx +1 -1
- package/src/Embed/InlineTriggerButton.tsx +1 -0
- package/src/Grid/Grid.stories.tsx +3 -3
package/lib/model/ContentType.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/model/ContentType.ts
|
|
3
2
|
/**
|
|
4
3
|
* Copyright (c) 2017-present, NDLA.
|
|
@@ -69,9 +68,9 @@ const resourceEmbedTypeMapping = {
|
|
|
69
68
|
podcast: "podcast",
|
|
70
69
|
gloss: "gloss"
|
|
71
70
|
};
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
exports.contentTypeMapping = contentTypeMapping;
|
|
75
73
|
exports.contentTypes = contentTypes;
|
|
76
74
|
exports.resourceEmbedTypeMapping = resourceEmbedTypeMapping;
|
|
75
|
+
|
|
77
76
|
//# sourceMappingURL=ContentType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentType.js","names":[],"sources":["../../src/model/ContentType.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const SUBJECT_MATERIAL = \"subject-material\";\nexport const TASKS_AND_ACTIVITIES = \"tasks-and-activities\";\nexport const ASSESSMENT_RESOURCES = \"assessment-resources\";\nexport const SUBJECT = \"subject\";\nexport const SOURCE_MATERIAL = \"source-material\";\nexport const LEARNING_PATH = \"learning-path\";\nexport const TOPIC = \"topic\";\nexport const MULTIDISCIPLINARY = \"multidisciplinary\";\nexport const CONCEPT = \"concept\";\nexport const EXTERNAL = \"external\";\nexport const MISSING = \"missing\";\nexport const IMAGE = \"image\";\nexport const VIDEO = \"video\";\nexport const AUDIO = \"audio\";\nexport const PODCAST = \"podcast\";\nexport const GLOSS = \"gloss\";\nexport const PROGRAMME = \"programme\";\nexport const PODCAST_SERIES = \"podcast-series\";\nexport const FRONTPAGE_ARTICLE = \"frontpage-article\";\nexport const GAME = \"game\";\nexport const CASE = \"case\";\n\nexport const contentTypes = {\n SUBJECT_MATERIAL,\n TASKS_AND_ACTIVITIES,\n ASSESSMENT_RESOURCES,\n SUBJECT,\n SOURCE_MATERIAL,\n LEARNING_PATH,\n TOPIC,\n MULTIDISCIPLINARY,\n CONCEPT,\n EXTERNAL,\n MISSING,\n PROGRAMME,\n PODCAST_SERIES,\n GAME,\n CASE,\n};\n\nexport const RESOURCE_TYPE_LEARNING_PATH = \"urn:resourcetype:learningPath\";\nexport const RESOURCE_TYPE_SUBJECT_MATERIAL = \"urn:resourcetype:subjectMaterial\";\nexport const RESOURCE_TYPE_TASKS_AND_ACTIVITIES = \"urn:resourcetype:tasksAndActivities\";\nexport const RESOURCE_TYPE_ASSESSMENT_RESOURCES = \"urn:resourcetype:reviewResource\";\nexport const RESOURCE_TYPE_SOURCE_MATERIAL = \"urn:resourcetype:SourceMaterial\";\nexport const RESOURCE_TYPE_CONCEPT = \"urn:resourcetype:concept\";\nexport const RESOURCE_TYPE_GAME = \"urn:resourcetype:game\";\n\nexport const contentTypeMapping: Record<string, string> = {\n [RESOURCE_TYPE_LEARNING_PATH]: LEARNING_PATH,\n [RESOURCE_TYPE_SUBJECT_MATERIAL]: SUBJECT_MATERIAL,\n [RESOURCE_TYPE_TASKS_AND_ACTIVITIES]: TASKS_AND_ACTIVITIES,\n [RESOURCE_TYPE_ASSESSMENT_RESOURCES]: ASSESSMENT_RESOURCES,\n [RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,\n [RESOURCE_TYPE_CONCEPT]: CONCEPT,\n [RESOURCE_TYPE_GAME]: GAME,\n [MULTIDISCIPLINARY]: MULTIDISCIPLINARY,\n [CASE]: CASE,\n [TOPIC]: TOPIC,\n [FRONTPAGE_ARTICLE]: FRONTPAGE_ARTICLE,\n default: SUBJECT_MATERIAL,\n};\n\nexport const resourceEmbedTypeMapping: Record<string, string> = {\n image: \"image\",\n video: \"video\",\n concept: \"concept\",\n audio: \"audio\",\n podcast: \"podcast\",\n gloss: \"gloss\",\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentType.js","names":[],"sources":["../../src/model/ContentType.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const SUBJECT_MATERIAL = \"subject-material\";\nexport const TASKS_AND_ACTIVITIES = \"tasks-and-activities\";\nexport const ASSESSMENT_RESOURCES = \"assessment-resources\";\nexport const SUBJECT = \"subject\";\nexport const SOURCE_MATERIAL = \"source-material\";\nexport const LEARNING_PATH = \"learning-path\";\nexport const TOPIC = \"topic\";\nexport const MULTIDISCIPLINARY = \"multidisciplinary\";\nexport const CONCEPT = \"concept\";\nexport const EXTERNAL = \"external\";\nexport const MISSING = \"missing\";\nexport const IMAGE = \"image\";\nexport const VIDEO = \"video\";\nexport const AUDIO = \"audio\";\nexport const PODCAST = \"podcast\";\nexport const GLOSS = \"gloss\";\nexport const PROGRAMME = \"programme\";\nexport const PODCAST_SERIES = \"podcast-series\";\nexport const FRONTPAGE_ARTICLE = \"frontpage-article\";\nexport const GAME = \"game\";\nexport const CASE = \"case\";\n\nexport const contentTypes = {\n SUBJECT_MATERIAL,\n TASKS_AND_ACTIVITIES,\n ASSESSMENT_RESOURCES,\n SUBJECT,\n SOURCE_MATERIAL,\n LEARNING_PATH,\n TOPIC,\n MULTIDISCIPLINARY,\n CONCEPT,\n EXTERNAL,\n MISSING,\n PROGRAMME,\n PODCAST_SERIES,\n GAME,\n CASE,\n};\n\nexport const RESOURCE_TYPE_LEARNING_PATH = \"urn:resourcetype:learningPath\";\nexport const RESOURCE_TYPE_SUBJECT_MATERIAL = \"urn:resourcetype:subjectMaterial\";\nexport const RESOURCE_TYPE_TASKS_AND_ACTIVITIES = \"urn:resourcetype:tasksAndActivities\";\nexport const RESOURCE_TYPE_ASSESSMENT_RESOURCES = \"urn:resourcetype:reviewResource\";\nexport const RESOURCE_TYPE_SOURCE_MATERIAL = \"urn:resourcetype:SourceMaterial\";\nexport const RESOURCE_TYPE_CONCEPT = \"urn:resourcetype:concept\";\nexport const RESOURCE_TYPE_GAME = \"urn:resourcetype:game\";\n\nexport const contentTypeMapping: Record<string, string> = {\n [RESOURCE_TYPE_LEARNING_PATH]: LEARNING_PATH,\n [RESOURCE_TYPE_SUBJECT_MATERIAL]: SUBJECT_MATERIAL,\n [RESOURCE_TYPE_TASKS_AND_ACTIVITIES]: TASKS_AND_ACTIVITIES,\n [RESOURCE_TYPE_ASSESSMENT_RESOURCES]: ASSESSMENT_RESOURCES,\n [RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,\n [RESOURCE_TYPE_CONCEPT]: CONCEPT,\n [RESOURCE_TYPE_GAME]: GAME,\n [MULTIDISCIPLINARY]: MULTIDISCIPLINARY,\n [CASE]: CASE,\n [TOPIC]: TOPIC,\n [FRONTPAGE_ARTICLE]: FRONTPAGE_ARTICLE,\n default: SUBJECT_MATERIAL,\n};\n\nexport const resourceEmbedTypeMapping: Record<string, string> = {\n image: \"image\",\n video: \"video\",\n concept: \"concept\",\n audio: \"audio\",\n podcast: \"podcast\",\n gloss: \"gloss\",\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,mBAAmB;AAChC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,UAAU;AACvB,MAAa,kBAAkB;AAC/B,MAAa,gBAAgB;AAC7B,MAAa,QAAQ;AACrB,MAAa,oBAAoB;AACjC,MAAa,UAAU;AACvB,MAAa,WAAW;AACxB,MAAa,UAAU;AAMvB,MAAa,YAAY;AACzB,MAAa,iBAAiB;AAC9B,MAAa,oBAAoB;AACjC,MAAa,OAAO;AACpB,MAAa,OAAO;AAEpB,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,8BAA8B;AAC3C,MAAa,iCAAiC;AAC9C,MAAa,qCAAqC;AAClD,MAAa,qCAAqC;AAClD,MAAa,gCAAgC;AAC7C,MAAa,wBAAwB;AACrC,MAAa,qBAAqB;AAElC,MAAa,qBAA6C;EACvD,8BAA8B;EAC9B,iCAAiC;EACjC,qCAAqC;EACrC,qCAAqC;EACrC,gCAAgC;EAChC,wBAAwB;EACxB,qBAAqB;EACrB,oBAAoB;EACpB,OAAO;EACP,QAAQ;EACR,oBAAoB;CACrB,SAAS;CACV;AAED,MAAa,2BAAmD;CAC9D,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,SAAS;CACT,OAAO;CACR"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
2
|
-
|
|
3
1
|
//#region src/model/SubjectCategories.ts
|
|
4
|
-
var SubjectCategories_exports = /* @__PURE__ */
|
|
2
|
+
var SubjectCategories_exports = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__exportAll({
|
|
5
3
|
ACTIVE_SUBJECTS: () => ACTIVE_SUBJECTS,
|
|
6
4
|
ARCHIVE_SUBJECTS: () => ARCHIVE_SUBJECTS,
|
|
7
5
|
BETA_SUBJECTS: () => BETA_SUBJECTS,
|
|
@@ -25,13 +23,13 @@ const subjectCategories = {
|
|
|
25
23
|
BETA_SUBJECTS,
|
|
26
24
|
OTHER
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
//#endregion
|
|
30
|
-
Object.defineProperty(exports,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
Object.defineProperty(exports, "SubjectCategories_exports", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return SubjectCategories_exports;
|
|
31
|
+
}
|
|
35
32
|
});
|
|
36
33
|
exports.subjectCategories = subjectCategories;
|
|
34
|
+
|
|
37
35
|
//# sourceMappingURL=SubjectCategories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectCategories.js","names":[],"sources":["../../src/model/SubjectCategories.ts"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const ACTIVE_SUBJECTS = \"active\";\nexport const ARCHIVE_SUBJECTS = \"archive\";\nexport const BETA_SUBJECTS = \"beta\";\nexport const OTHER = \"otherResources\";\n\nexport const subjectCategories = {\n ACTIVE_SUBJECTS,\n ARCHIVE_SUBJECTS,\n BETA_SUBJECTS,\n OTHER,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubjectCategories.js","names":[],"sources":["../../src/model/SubjectCategories.ts"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const ACTIVE_SUBJECTS = \"active\";\nexport const ARCHIVE_SUBJECTS = \"archive\";\nexport const BETA_SUBJECTS = \"beta\";\nexport const OTHER = \"otherResources\";\n\nexport const subjectCategories = {\n ACTIVE_SUBJECTS,\n ARCHIVE_SUBJECTS,\n BETA_SUBJECTS,\n OTHER,\n};\n"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;AAChC,MAAa,gBAAgB;AAC7B,MAAa,QAAQ;AAErB,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACD"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
2
|
-
|
|
3
1
|
//#region src/model/SubjectTypes.ts
|
|
4
|
-
var SubjectTypes_exports = /* @__PURE__ */
|
|
2
|
+
var SubjectTypes_exports = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__exportAll({
|
|
5
3
|
ARCHIVE_SUBJECT: () => ARCHIVE_SUBJECT,
|
|
6
4
|
BETA_SUBJECT: () => BETA_SUBJECT,
|
|
7
5
|
RESOURCE_COLLECTION: () => RESOURCE_COLLECTION,
|
|
@@ -25,13 +23,13 @@ const subjectTypes = {
|
|
|
25
23
|
RESOURCE_COLLECTION,
|
|
26
24
|
ARCHIVE_SUBJECT
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
//#endregion
|
|
30
|
-
Object.defineProperty(exports,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
Object.defineProperty(exports, "SubjectTypes_exports", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return SubjectTypes_exports;
|
|
31
|
+
}
|
|
35
32
|
});
|
|
36
33
|
exports.subjectTypes = subjectTypes;
|
|
34
|
+
|
|
37
35
|
//# sourceMappingURL=SubjectTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectTypes.js","names":[],"sources":["../../src/model/SubjectTypes.ts"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const BETA_SUBJECT = \"betaSubject\";\nexport const SUBJECT = \"subject\";\nexport const RESOURCE_COLLECTION = \"resourceCollection\";\nexport const ARCHIVE_SUBJECT = \"archiveSubject\";\n\nexport const subjectTypes = {\n BETA_SUBJECT,\n SUBJECT,\n RESOURCE_COLLECTION,\n ARCHIVE_SUBJECT,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubjectTypes.js","names":[],"sources":["../../src/model/SubjectTypes.ts"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const BETA_SUBJECT = \"betaSubject\";\nexport const SUBJECT = \"subject\";\nexport const RESOURCE_COLLECTION = \"resourceCollection\";\nexport const ARCHIVE_SUBJECT = \"archiveSubject\";\n\nexport const subjectTypes = {\n BETA_SUBJECT,\n SUBJECT,\n RESOURCE_COLLECTION,\n ARCHIVE_SUBJECT,\n};\n"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAa,eAAe;AAC5B,MAAa,UAAU;AACvB,MAAa,sBAAsB;AACnC,MAAa,kBAAkB;AAE/B,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACD"}
|
package/lib/model/WordClass.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
2
|
-
|
|
3
1
|
//#region src/model/WordClass.ts
|
|
4
|
-
var WordClass_exports = /* @__PURE__ */
|
|
2
|
+
var WordClass_exports = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__exportAll({ wordClass: () => wordClass });
|
|
5
3
|
/**
|
|
6
4
|
* Copyright (c) 2023-present, NDLA.
|
|
7
5
|
*
|
|
@@ -46,13 +44,13 @@ const wordClass = {
|
|
|
46
44
|
verbComplement: "verb-complement",
|
|
47
45
|
verbObject: "verb-object"
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
//#endregion
|
|
51
|
-
Object.defineProperty(exports,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
Object.defineProperty(exports, "WordClass_exports", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function() {
|
|
51
|
+
return WordClass_exports;
|
|
52
|
+
}
|
|
56
53
|
});
|
|
57
54
|
exports.wordClass = wordClass;
|
|
55
|
+
|
|
58
56
|
//# sourceMappingURL=WordClass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WordClass.js","names":[],"sources":["../../src/model/WordClass.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const wordClass = {\n adjective: \"adjective\",\n adverb: \"adverb\",\n properNoun: \"proper-noun\",\n auxiliary: \"auxiliary\",\n complement: \"complement\",\n conjunction: \"conjunction\",\n coverb: \"coverb\",\n determiner: \"determiner\",\n interjection: \"interjection\",\n quantifier: \"quantifier\",\n marker: \"marker\",\n modalVerb: \"modal-verb\",\n measureWord: \"measure-word\",\n noun: \"noun\",\n \"noun-zh\": \"noun-zh\",\n nounPhrase: \"noun-phrase\",\n onomatopoeia: \"onomatopoeia\",\n particle: \"particle\",\n demonstrative: \"demonstrative\",\n personalPronoun: \"personal-pronoun\",\n preposition: \"preposition\",\n pronoun: \"pronoun\",\n questionWord: \"question-word\",\n locationWord: \"location-word\",\n suffix: \"suffix\",\n numeral: \"numeral\",\n timeWord: \"time word\",\n timeExpression: \"time-expression\",\n stativeVerb: \"stative-verb\",\n subordinatingConjunction: \"subordinating-conjunction\",\n exclamationWord: \"exclamation-word\",\n expression: \"expression\",\n verb: \"verb\",\n verbComplement: \"verb-complement\",\n verbObject: \"verb-object\",\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"WordClass.js","names":[],"sources":["../../src/model/WordClass.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport const wordClass = {\n adjective: \"adjective\",\n adverb: \"adverb\",\n properNoun: \"proper-noun\",\n auxiliary: \"auxiliary\",\n complement: \"complement\",\n conjunction: \"conjunction\",\n coverb: \"coverb\",\n determiner: \"determiner\",\n interjection: \"interjection\",\n quantifier: \"quantifier\",\n marker: \"marker\",\n modalVerb: \"modal-verb\",\n measureWord: \"measure-word\",\n noun: \"noun\",\n \"noun-zh\": \"noun-zh\",\n nounPhrase: \"noun-phrase\",\n onomatopoeia: \"onomatopoeia\",\n particle: \"particle\",\n demonstrative: \"demonstrative\",\n personalPronoun: \"personal-pronoun\",\n preposition: \"preposition\",\n pronoun: \"pronoun\",\n questionWord: \"question-word\",\n locationWord: \"location-word\",\n suffix: \"suffix\",\n numeral: \"numeral\",\n timeWord: \"time word\",\n timeExpression: \"time-expression\",\n stativeVerb: \"stative-verb\",\n subordinatingConjunction: \"subordinating-conjunction\",\n exclamationWord: \"exclamation-word\",\n expression: \"expression\",\n verb: \"verb\",\n verbComplement: \"verb-complement\",\n verbObject: \"verb-object\",\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,YAAY;CACvB,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,aAAa;CACb,QAAQ;CACR,YAAY;CACZ,cAAc;CACd,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,aAAa;CACb,MAAM;CACN,WAAW;CACX,YAAY;CACZ,cAAc;CACd,UAAU;CACV,eAAe;CACf,iBAAiB;CACjB,aAAa;CACb,SAAS;CACT,cAAc;CACd,cAAc;CACd,QAAQ;CACR,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,aAAa;CACb,0BAA0B;CAC1B,iBAAiB;CACjB,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,YAAY;CACb"}
|
package/lib/model/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const require_ContentType = require(
|
|
2
|
-
const require_SubjectCategories = require(
|
|
3
|
-
const require_SubjectTypes = require(
|
|
4
|
-
const require_WordClass = require(
|
|
5
|
-
|
|
1
|
+
const require_ContentType = require("./ContentType.js");
|
|
2
|
+
const require_SubjectCategories = require("./SubjectCategories.js");
|
|
3
|
+
const require_SubjectTypes = require("./SubjectTypes.js");
|
|
4
|
+
const require_WordClass = require("./WordClass.js");
|
|
6
5
|
//#region src/model/index.ts
|
|
7
6
|
/**
|
|
8
7
|
* Copyright (c) 2017-present, NDLA.
|
|
@@ -19,7 +18,7 @@ const constants = {
|
|
|
19
18
|
resourceEmbedTypeMapping: require_ContentType.resourceEmbedTypeMapping,
|
|
20
19
|
wordClass: require_WordClass.WordClass_exports
|
|
21
20
|
};
|
|
22
|
-
|
|
23
21
|
//#endregion
|
|
24
22
|
exports.constants = constants;
|
|
23
|
+
|
|
25
24
|
//# sourceMappingURL=index.js.map
|
package/lib/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/model/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { contentTypes, contentTypeMapping, resourceEmbedTypeMapping } from \"./ContentType\";\nimport * as subjectCategories from \"./SubjectCategories\";\nimport * as subjectTypes from \"./SubjectTypes\";\nimport * as wordClass from \"./WordClass\";\n\nexport const constants = {\n contentTypes,\n subjectCategories,\n subjectTypes,\n contentTypeMapping,\n resourceEmbedTypeMapping,\n wordClass,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/model/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { contentTypes, contentTypeMapping, resourceEmbedTypeMapping } from \"./ContentType\";\nimport * as subjectCategories from \"./SubjectCategories\";\nimport * as subjectTypes from \"./SubjectTypes\";\nimport * as wordClass from \"./WordClass\";\n\nexport const constants = {\n contentTypes,\n subjectCategories,\n subjectTypes,\n contentTypeMapping,\n resourceEmbedTypeMapping,\n wordClass,\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,YAAY;CACvB,cAAA,oBAAA;CACA,mBAAA,0BAAA;CACA,cAAA,qBAAA;CACA,oBAAA,oBAAA;CACA,0BAAA,oBAAA;CACA,WAAA,kBAAA;CACD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_licenses = require("@ndla/licenses");
|
|
3
|
-
|
|
4
3
|
//#region src/utils/licenseAttributes.ts
|
|
5
4
|
/**
|
|
6
5
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -16,7 +15,7 @@ const licenseAttributes = (license, lang, url) => {
|
|
|
16
15
|
about: url ?? void 0
|
|
17
16
|
} : {};
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
//#endregion
|
|
21
19
|
exports.licenseAttributes = licenseAttributes;
|
|
20
|
+
|
|
22
21
|
//# sourceMappingURL=licenseAttributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licenseAttributes.js","names":[],"sources":["../../src/utils/licenseAttributes.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { getLicenseByAbbreviation, isCreativeCommonsLicense } from \"@ndla/licenses\";\n\nexport const licenseAttributes = (license: string | undefined, lang: string | undefined, url: string | undefined) => {\n const licenseAbbr = getLicenseByAbbreviation(license ? license : \"\", lang);\n\n const licenseProps = isCreativeCommonsLicense(licenseAbbr.rights)\n ? {\n \"xmlns:cc\": \"https://creativecommons.org/ns#\",\n \"xmlns:dct\": \"http://purl.org/dc/terms/\",\n about: url ?? undefined,\n }\n : {};\n\n return licenseProps;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"licenseAttributes.js","names":[],"sources":["../../src/utils/licenseAttributes.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { getLicenseByAbbreviation, isCreativeCommonsLicense } from \"@ndla/licenses\";\n\nexport const licenseAttributes = (license: string | undefined, lang: string | undefined, url: string | undefined) => {\n const licenseAbbr = getLicenseByAbbreviation(license ? license : \"\", lang);\n\n const licenseProps = isCreativeCommonsLicense(licenseAbbr.rights)\n ? {\n \"xmlns:cc\": \"https://creativecommons.org/ns#\",\n \"xmlns:dct\": \"http://purl.org/dc/terms/\",\n about: url ?? undefined,\n }\n : {};\n\n return licenseProps;\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,qBAAqB,SAA6B,MAA0B,QAA4B;AAWnH,SAAA,GAAA,eAAA,2BAAA,GAAA,eAAA,0BAV6C,UAAU,UAAU,IAAI,KAAK,CAEhB,OAAO,GAC7D;EACE,YAAY;EACZ,aAAa;EACb,OAAO,OAAO,KAAA;EACf,GACD,EAAE"}
|
package/lib/utils/relativeUrl.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/utils/relativeUrl.ts
|
|
3
2
|
/**
|
|
4
3
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -32,7 +31,7 @@ const getPossiblyRelativeUrl = (url, path) => {
|
|
|
32
31
|
}
|
|
33
32
|
return url;
|
|
34
33
|
};
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
35
|
exports.getPossiblyRelativeUrl = getPossiblyRelativeUrl;
|
|
36
|
+
|
|
38
37
|
//# sourceMappingURL=relativeUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relativeUrl.js","names":[],"sources":["../../src/utils/relativeUrl.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst supportedTranslationLanguages = [\"nb\", \"nn\", \"en\", \"se\"] as const;\n\nconst ENV_REGEX = /(staging|test)\\.?/;\nconst LANGUAGE_REGEX = new RegExp(`^\\\\/((?:${supportedTranslationLanguages.join(\"|\")})(?:$|\\\\/))`, \"\");\n\nconst NDLA_URL = /(.*\\.)?ndla.no.*/;\nconst REPLACE_WWW = /^www\\./;\n\nexport const getPossiblyRelativeUrl = (url: string, path?: string) => {\n if (!path) return url;\n // If url is a mailto link, return url as is.\n if (url.startsWith(\"mailto:\")) return url;\n // If not on NDLA, or if url is not a NDLA url, return url as is\n if (!NDLA_URL.test(url) || !NDLA_URL.test(path)) return url;\n //Remove environment info\n const urlObj = new URL(url.replace(ENV_REGEX, \"\"));\n const pathObj = new URL(path.replace(ENV_REGEX, \"\"));\n // If the host is the same, return the relative path\n if (urlObj.hostname.replace(REPLACE_WWW, \"\") === pathObj.hostname.replace(REPLACE_WWW, \"\")) {\n // Replace the language part of the url with the language part of the path\n // Keep the search params if they exist\n const search = urlObj.search;\n // If the path language part does not exist, remove it.\n const urlMatch = urlObj.pathname.match(LANGUAGE_REGEX);\n const pathMatch = pathObj.pathname.match(LANGUAGE_REGEX);\n if (urlMatch?.[1] && urlMatch?.[1] !== pathMatch?.[1]) {\n return `${urlObj.pathname.replace(urlMatch[1], pathMatch?.[1] || \"\")}${search}`;\n }\n\n return `${urlObj.pathname}${search}`;\n }\n return url;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"relativeUrl.js","names":[],"sources":["../../src/utils/relativeUrl.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst supportedTranslationLanguages = [\"nb\", \"nn\", \"en\", \"se\"] as const;\n\nconst ENV_REGEX = /(staging|test)\\.?/;\nconst LANGUAGE_REGEX = new RegExp(`^\\\\/((?:${supportedTranslationLanguages.join(\"|\")})(?:$|\\\\/))`, \"\");\n\nconst NDLA_URL = /(.*\\.)?ndla.no.*/;\nconst REPLACE_WWW = /^www\\./;\n\nexport const getPossiblyRelativeUrl = (url: string, path?: string) => {\n if (!path) return url;\n // If url is a mailto link, return url as is.\n if (url.startsWith(\"mailto:\")) return url;\n // If not on NDLA, or if url is not a NDLA url, return url as is\n if (!NDLA_URL.test(url) || !NDLA_URL.test(path)) return url;\n //Remove environment info\n const urlObj = new URL(url.replace(ENV_REGEX, \"\"));\n const pathObj = new URL(path.replace(ENV_REGEX, \"\"));\n // If the host is the same, return the relative path\n if (urlObj.hostname.replace(REPLACE_WWW, \"\") === pathObj.hostname.replace(REPLACE_WWW, \"\")) {\n // Replace the language part of the url with the language part of the path\n // Keep the search params if they exist\n const search = urlObj.search;\n // If the path language part does not exist, remove it.\n const urlMatch = urlObj.pathname.match(LANGUAGE_REGEX);\n const pathMatch = pathObj.pathname.match(LANGUAGE_REGEX);\n if (urlMatch?.[1] && urlMatch?.[1] !== pathMatch?.[1]) {\n return `${urlObj.pathname.replace(urlMatch[1], pathMatch?.[1] || \"\")}${search}`;\n }\n\n return `${urlObj.pathname}${search}`;\n }\n return url;\n};\n"],"mappings":";;;;;;;;AAQA,MAAM,gCAAgC;CAAC;CAAM;CAAM;CAAM;CAAK;AAE9D,MAAM,YAAY;AAClB,MAAM,iBAAiB,IAAI,OAAO,WAAW,8BAA8B,KAAK,IAAI,CAAC,cAAc,GAAG;AAEtG,MAAM,WAAW;AACjB,MAAM,cAAc;AAEpB,MAAa,0BAA0B,KAAa,SAAkB;AACpE,KAAI,CAAC,KAAM,QAAO;AAElB,KAAI,IAAI,WAAW,UAAU,CAAE,QAAO;AAEtC,KAAI,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,CAAE,QAAO;CAExD,MAAM,SAAS,IAAI,IAAI,IAAI,QAAQ,WAAW,GAAG,CAAC;CAClD,MAAM,UAAU,IAAI,IAAI,KAAK,QAAQ,WAAW,GAAG,CAAC;AAEpD,KAAI,OAAO,SAAS,QAAQ,aAAa,GAAG,KAAK,QAAQ,SAAS,QAAQ,aAAa,GAAG,EAAE;EAG1F,MAAM,SAAS,OAAO;EAEtB,MAAM,WAAW,OAAO,SAAS,MAAM,eAAe;EACtD,MAAM,YAAY,QAAQ,SAAS,MAAM,eAAe;AACxD,MAAI,WAAW,MAAM,WAAW,OAAO,YAAY,GACjD,QAAO,GAAG,OAAO,SAAS,QAAQ,SAAS,IAAI,YAAY,MAAM,GAAG,GAAG;AAGzE,SAAO,GAAG,OAAO,WAAW;;AAE9B,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "56.0.
|
|
4
|
+
"version": "56.0.182-alpha.0",
|
|
5
5
|
"description": "UI component library for NDLA",
|
|
6
6
|
"license": "GPL-3.0",
|
|
7
7
|
"exports": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@ndla/icons": "^8.0.86-alpha.0",
|
|
42
42
|
"@ndla/licenses": "^10.0.11-alpha.0",
|
|
43
43
|
"@ndla/locales": "^0.0.2",
|
|
44
|
-
"@ndla/primitives": "^1.0.
|
|
45
|
-
"@ndla/safelink": "^7.0.
|
|
44
|
+
"@ndla/primitives": "^1.0.125-alpha.0",
|
|
45
|
+
"@ndla/safelink": "^7.0.128-alpha.0",
|
|
46
46
|
"@ndla/styled-system": "^0.0.47",
|
|
47
|
-
"@ndla/util": "^5.0.
|
|
47
|
+
"@ndla/util": "^5.0.19-alpha.0",
|
|
48
48
|
"html-react-parser": "^5.2.8"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ea88390746e8683cbc04e3b3f5786dcf1e31d9f2"
|
|
67
67
|
}
|
|
@@ -239,7 +239,7 @@ export const Controls = ({ src, title }: Props) => {
|
|
|
239
239
|
return (
|
|
240
240
|
<div>
|
|
241
241
|
{/* TODO: We should tie this up to the textual description somehow */}
|
|
242
|
-
{/*
|
|
242
|
+
{/* oxlint-disable-next-line jsx-a11y/media-has-caption */}
|
|
243
243
|
<audio ref={audioRef} src={src} title={title} preload="metadata" />
|
|
244
244
|
<ControlsWrapper>
|
|
245
245
|
<Back15SecButton
|
|
@@ -33,7 +33,7 @@ export const SpeechControl = ({ src, title, type = "audio" }: Props) => {
|
|
|
33
33
|
};
|
|
34
34
|
return (
|
|
35
35
|
<div data-embed-type="speech">
|
|
36
|
-
{/*
|
|
36
|
+
{/* oxlint-disable-next-line jsx-a11y/media-has-caption */}
|
|
37
37
|
<audio ref={audioRef} src={src} title={title} preload="metadata" />
|
|
38
38
|
<IconButton variant="tertiary" aria-label={t(`${type}.play`)} title={t(`${type}.play`)} onClick={togglePlay}>
|
|
39
39
|
<VolumeUpFill />
|
|
@@ -28,6 +28,7 @@ export const InlineTriggerButton = forwardRef<HTMLSpanElement, ComponentPropsWit
|
|
|
28
28
|
ref={composeRefs(spanRef, ref)}
|
|
29
29
|
onKeyUp={onKeyboardEvent}
|
|
30
30
|
onClick={onClick}
|
|
31
|
+
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role
|
|
31
32
|
role="button"
|
|
32
33
|
tabIndex={0}
|
|
33
34
|
{...props}
|
|
@@ -62,11 +62,11 @@ export const GridPitchStory: StoryFn<typeof Grid> = ({ ...args }) => {
|
|
|
62
62
|
const items = new Array(columns).fill(
|
|
63
63
|
<GridItem data-type="grid-cell">
|
|
64
64
|
<PitchStory
|
|
65
|
-
//
|
|
65
|
+
// oxlint-disable-next-line typescript/no-non-null-asserted-optional-chain
|
|
66
66
|
metaImage={PitchStory.args?.metaImage!}
|
|
67
|
-
//
|
|
67
|
+
// oxlint-disable-next-line typescript/no-non-null-asserted-optional-chain
|
|
68
68
|
title={PitchStory.args?.title!}
|
|
69
|
-
//
|
|
69
|
+
// oxlint-disable-next-line typescript/no-non-null-asserted-optional-chain
|
|
70
70
|
url={PitchStory.args?.url!}
|
|
71
71
|
description={PitchStory.args?.description}
|
|
72
72
|
/>
|