@ndla/ui 56.0.190-alpha.0 → 56.0.192-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/dist/panda.buildinfo.json +4 -0
- package/dist/styles.css +16 -0
- package/es/AnchorHeading/AnchorHeading.mjs.map +1 -1
- package/es/Article/Article.mjs.map +1 -1
- package/es/Article/ArticleByline.mjs.map +1 -1
- package/es/Article/ArticleFootNotes.mjs.map +1 -1
- package/es/Article/BadgesContainer.mjs.map +1 -1
- package/es/AudioPlayer/AudioElement.mjs.map +1 -1
- package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
- package/es/AudioPlayer/AudioProgress.mjs +4 -1
- package/es/AudioPlayer/AudioProgress.mjs.map +1 -1
- package/es/AudioPlayer/CompactAudioPlayer.mjs.map +1 -1
- package/es/AudioPlayer/Controls.mjs.map +1 -1
- package/es/AudioPlayer/PlayButton.mjs.map +1 -1
- package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
- package/es/AudioPlayer/VolumeSlider.mjs.map +1 -1
- package/es/AudioPlayer/audioUtils.mjs.map +1 -1
- package/es/AudioPlayer/useAudioControls.mjs.map +1 -1
- package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs.map +1 -1
- package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
- package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
- package/es/CodeBlock/CodeBlock.mjs.map +1 -1
- package/es/CodeBlock/codeLanguageOptions.mjs.map +1 -1
- package/es/Concept/Concept.mjs.map +1 -1
- package/es/ContactBlock/ContactBlock.mjs.map +1 -1
- package/es/Embed/AudioEmbed.mjs.map +1 -1
- package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
- package/es/Embed/CodeEmbed.mjs.map +1 -1
- package/es/Embed/ConceptEmbed.mjs.map +1 -1
- package/es/Embed/ConceptInlineTriggerButton.mjs.map +1 -1
- package/es/Embed/ContentLinkEmbed.mjs.map +1 -1
- package/es/Embed/CopyrightEmbed.mjs.map +1 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs.map +1 -1
- package/es/Embed/EmbedWrapper.mjs.map +1 -1
- package/es/Embed/ExternalEmbed.mjs.map +1 -1
- package/es/Embed/FootnoteEmbed.mjs.map +1 -1
- package/es/Embed/GlossEmbed.mjs.map +1 -1
- package/es/Embed/H5pEmbed.mjs.map +1 -1
- package/es/Embed/IframeEmbed.mjs.map +1 -1
- package/es/Embed/ImageEmbed.mjs.map +1 -1
- package/es/Embed/InlineTriggerButton.mjs.map +1 -1
- package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
- package/es/Embed/UnknownEmbed.mjs.map +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs.map +1 -1
- package/es/FactBox/FactBox.mjs +1 -0
- package/es/FactBox/FactBox.mjs.map +1 -1
- package/es/FileList/File.mjs.map +1 -1
- package/es/FileList/FileList.mjs.map +1 -1
- package/es/FileList/PdfFile.mjs.map +1 -1
- package/es/Gloss/Gloss.mjs.map +1 -1
- package/es/Gloss/GlossExample.mjs.map +1 -1
- package/es/Grid/Grid.mjs.map +1 -1
- package/es/KeyFigure/KeyFigure.mjs.map +1 -1
- package/es/LicenseByline/EmbedByline.mjs.map +1 -1
- package/es/LicenseByline/LicenseLink.mjs.map +1 -1
- package/es/LinkBlock/LinkBlock.mjs.map +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
- package/es/Pitch/Pitch.mjs.map +1 -1
- package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
- package/es/ResourceBox/ResourceBox.mjs.map +1 -1
- package/es/TagSelector/TagSelector.mjs.map +1 -1
- package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
- package/es/i18n/useComponentTranslations.mjs.map +1 -1
- package/es/model/ContentType.mjs.map +1 -1
- package/es/model/SubjectCategories.mjs.map +1 -1
- package/es/model/SubjectTypes.mjs.map +1 -1
- package/es/model/WordClass.mjs.map +1 -1
- package/es/model/index.mjs.map +1 -1
- package/es/utils/licenseAttributes.mjs.map +1 -1
- package/es/utils/relativeUrl.mjs.map +1 -1
- package/lib/AnchorHeading/AnchorHeading.js.map +1 -1
- package/lib/Article/Article.js.map +1 -1
- package/lib/Article/ArticleByline.js.map +1 -1
- package/lib/Article/ArticleFootNotes.js.map +1 -1
- package/lib/Article/BadgesContainer.js.map +1 -1
- package/lib/AudioPlayer/AudioElement.js.map +1 -1
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
- package/lib/AudioPlayer/AudioProgress.js +4 -1
- package/lib/AudioPlayer/AudioProgress.js.map +1 -1
- package/lib/AudioPlayer/CompactAudioPlayer.js.map +1 -1
- package/lib/AudioPlayer/Controls.js.map +1 -1
- package/lib/AudioPlayer/PlayButton.js.map +1 -1
- package/lib/AudioPlayer/SpeechControl.js.map +1 -1
- package/lib/AudioPlayer/VolumeSlider.js.map +1 -1
- package/lib/AudioPlayer/audioUtils.js.map +1 -1
- package/lib/AudioPlayer/useAudioControls.js.map +1 -1
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
- package/lib/CodeBlock/CodeBlock.js.map +1 -1
- package/lib/CodeBlock/codeLanguageOptions.js.map +1 -1
- package/lib/Concept/Concept.js.map +1 -1
- package/lib/ContactBlock/ContactBlock.js.map +1 -1
- package/lib/Embed/AudioEmbed.js.map +1 -1
- package/lib/Embed/BrightcoveEmbed.js.map +1 -1
- package/lib/Embed/CodeEmbed.js.map +1 -1
- package/lib/Embed/ConceptEmbed.js.map +1 -1
- package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -1
- package/lib/Embed/ContentLinkEmbed.js.map +1 -1
- package/lib/Embed/CopyrightEmbed.js.map +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
- package/lib/Embed/EmbedWrapper.js.map +1 -1
- package/lib/Embed/ExternalEmbed.js.map +1 -1
- package/lib/Embed/FootnoteEmbed.js.map +1 -1
- package/lib/Embed/GlossEmbed.js.map +1 -1
- package/lib/Embed/H5pEmbed.js.map +1 -1
- package/lib/Embed/IframeEmbed.js.map +1 -1
- package/lib/Embed/ImageEmbed.js.map +1 -1
- package/lib/Embed/InlineTriggerButton.js.map +1 -1
- package/lib/Embed/RelatedContentEmbed.js.map +1 -1
- package/lib/Embed/UnknownEmbed.js.map +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -1
- package/lib/FactBox/FactBox.js +1 -0
- package/lib/FactBox/FactBox.js.map +1 -1
- package/lib/FileList/File.js.map +1 -1
- package/lib/FileList/FileList.js.map +1 -1
- package/lib/FileList/PdfFile.js.map +1 -1
- package/lib/Gloss/Gloss.js.map +1 -1
- package/lib/Gloss/GlossExample.js.map +1 -1
- package/lib/Grid/Grid.js.map +1 -1
- package/lib/KeyFigure/KeyFigure.js.map +1 -1
- package/lib/LicenseByline/EmbedByline.js.map +1 -1
- package/lib/LicenseByline/LicenseLink.js.map +1 -1
- package/lib/LinkBlock/LinkBlock.js.map +1 -1
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
- package/lib/Pitch/Pitch.js.map +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
- package/lib/ResourceBox/ResourceBox.js.map +1 -1
- package/lib/TagSelector/TagSelector.js.map +1 -1
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
- package/lib/i18n/useComponentTranslations.js.map +1 -1
- package/lib/model/ContentType.js.map +1 -1
- package/lib/model/SubjectCategories.js.map +1 -1
- package/lib/model/SubjectTypes.js.map +1 -1
- package/lib/model/WordClass.js.map +1 -1
- package/lib/model/index.js.map +1 -1
- package/lib/utils/licenseAttributes.js.map +1 -1
- package/lib/utils/relativeUrl.js.map +1 -1
- package/package.json +5 -5
- package/src/AudioPlayer/AudioProgress.tsx +3 -0
- package/src/AudioPlayer/SpeechControl.tsx +1 -1
- package/src/Embed/UuDisclaimerEmbed.tsx +1 -0
- package/src/FactBox/FactBox.tsx +1 -0
|
@@ -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":";;;;;;;;;;AAUA,MAAa,qBAAqB,SAA6B,MAA0B,QAA4B;
|
|
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;CAWnH,QAAA,GAAA,eAAA,2BAAA,GAAA,eAAA,0BAV6C,UAAU,UAAU,IAAI,IAEb,EAAE,MAAM,IAC5D;EACE,YAAY;EACZ,aAAa;EACb,OAAO,OAAO,KAAA;CAChB,IACA,CAAC;AAGP"}
|
|
@@ -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":";;;;;;;;AAQA,MAAM,gCAAgC;CAAC;CAAM;CAAM;CAAM;
|
|
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;AAAI;AAE7D,MAAM,YAAY;AAClB,MAAM,iBAAiB,IAAI,OAAO,WAAW,8BAA8B,KAAK,GAAG,EAAE,cAAc,EAAE;AAErG,MAAM,WAAW;AACjB,MAAM,cAAc;AAEpB,MAAa,0BAA0B,KAAa,SAAkB;CACpE,IAAI,CAAC,MAAM,OAAO;CAElB,IAAI,IAAI,WAAW,SAAS,GAAG,OAAO;CAEtC,IAAI,CAAC,SAAS,KAAK,GAAG,KAAK,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO;CAExD,MAAM,SAAS,IAAI,IAAI,IAAI,QAAQ,WAAW,EAAE,CAAC;CACjD,MAAM,UAAU,IAAI,IAAI,KAAK,QAAQ,WAAW,EAAE,CAAC;CAEnD,IAAI,OAAO,SAAS,QAAQ,aAAa,EAAE,MAAM,QAAQ,SAAS,QAAQ,aAAa,EAAE,GAAG;EAG1F,MAAM,SAAS,OAAO;EAEtB,MAAM,WAAW,OAAO,SAAS,MAAM,cAAc;EACrD,MAAM,YAAY,QAAQ,SAAS,MAAM,cAAc;EACvD,IAAI,WAAW,MAAM,WAAW,OAAO,YAAY,IACjD,OAAO,GAAG,OAAO,SAAS,QAAQ,SAAS,IAAI,YAAY,MAAM,EAAE,IAAI;EAGzE,OAAO,GAAG,OAAO,WAAW;CAC9B;CACA,OAAO;AACT"}
|
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.192-alpha.0",
|
|
5
5
|
"description": "UI component library for NDLA",
|
|
6
6
|
"license": "GPL-3.0",
|
|
7
7
|
"exports": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@ark-ui/react": "^5.34.1",
|
|
40
40
|
"@ndla/core": "^6.0.7-alpha.0",
|
|
41
41
|
"@ndla/icons": "^8.0.89-alpha.0",
|
|
42
|
-
"@ndla/licenses": "^10.0.
|
|
42
|
+
"@ndla/licenses": "^10.0.12-alpha.0",
|
|
43
43
|
"@ndla/locales": "^0.0.3",
|
|
44
|
-
"@ndla/primitives": "^1.0.
|
|
45
|
-
"@ndla/safelink": "^7.0.
|
|
44
|
+
"@ndla/primitives": "^1.0.130-alpha.0",
|
|
45
|
+
"@ndla/safelink": "^7.0.133-alpha.0",
|
|
46
46
|
"@ndla/styled-system": "^0.0.49",
|
|
47
47
|
"@ndla/util": "^5.0.21-alpha.0",
|
|
48
48
|
"html-react-parser": "^6.0.0"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "609d5d044ece059de95a3142847ad9ab8737f468"
|
|
67
67
|
}
|
|
@@ -20,7 +20,7 @@ export const SpeechControl = ({ src, title }: Props) => {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<div data-embed-type="speech">
|
|
23
|
-
{/* oxlint-disable-next-line jsx-a11y/media-has-caption */}
|
|
23
|
+
{/* oxlint-disable-next-line jsx-a11y/media-has-caption oxlint-disable-next-line jsx-a11y/control-has-associated-label */}
|
|
24
24
|
<audio ref={audioRef} src={src} title={title} preload="metadata" />
|
|
25
25
|
<PlayButton variant="tertiary" onClick={togglePlay}>
|
|
26
26
|
<VolumeUpFill />
|
|
@@ -65,6 +65,7 @@ export const UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }: Pr
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
|
+
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role
|
|
68
69
|
<DisclaimerWrapper role="region" data-embed-type="uu-disclaimer">
|
|
69
70
|
<PopoverRoot>
|
|
70
71
|
<PopoverTrigger asChild>
|