@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
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
|
|
6
5
|
//#region src/LinkBlock/LinkBlockSection.tsx
|
|
7
6
|
/**
|
|
8
7
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -24,7 +23,7 @@ const LinkBlockSection = ({ children, ...rest }) => {
|
|
|
24
23
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledList, { children: react.Children.map(children, (child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: child })) })
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
27
|
exports.LinkBlockSection = LinkBlockSection;
|
|
28
|
+
|
|
30
29
|
//# sourceMappingURL=LinkBlockSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkBlockSection.js","names":["Children"],"sources":["../../src/LinkBlock/LinkBlockSection.tsx"],"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\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { Children, type HTMLAttributes, type ReactNode } from \"react\";\n\ninterface Props extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n}\n\nconst StyledList = styled(\"ul\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n listStyle: \"none\",\n },\n});\n\nexport const LinkBlockSection = ({ children, ...rest }: Props) => {\n return (\n <nav {...rest} data-embed-type=\"link-block-list\">\n <StyledList>\n {Children.map(children, (child) => (\n <li>{child}</li>\n ))}\n </StyledList>\n </nav>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkBlockSection.js","names":["Children"],"sources":["../../src/LinkBlock/LinkBlockSection.tsx"],"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\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { Children, type HTMLAttributes, type ReactNode } from \"react\";\n\ninterface Props extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n}\n\nconst StyledList = styled(\"ul\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xsmall\",\n listStyle: \"none\",\n },\n});\n\nexport const LinkBlockSection = ({ children, ...rest }: Props) => {\n return (\n <nav {...rest} data-embed-type=\"link-block-list\">\n <StyledList>\n {Children.map(children, (child) => (\n <li>{child}</li>\n ))}\n </StyledList>\n </nav>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,cAAA,GAAA,wBAAA,QAAoB,MAAM,EAC9B,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,WAAW;CACZ,EACF,CAAC;AAEF,MAAa,oBAAoB,EAAE,UAAU,GAAG,WAAkB;AAChE,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,GAAI;EAAM,mBAAgB;YAC7B,iBAAA,GAAA,kBAAA,KAAC,YAAD,EAAA,UACGA,MAAAA,SAAS,IAAI,WAAW,UACvB,iBAAA,GAAA,kBAAA,KAAC,MAAD,EAAA,UAAK,OAAW,CAAA,CAChB,EACS,CAAA;EACT,CAAA"}
|
package/lib/Pitch/Pitch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_runtime = require(
|
|
2
|
-
const require_relativeUrl = require(
|
|
1
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_relativeUrl = require("../utils/relativeUrl.js");
|
|
3
3
|
let _ndla_primitives = require("@ndla/primitives");
|
|
4
4
|
let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
|
|
5
5
|
let html_react_parser = require("html-react-parser");
|
|
@@ -7,7 +7,6 @@ html_react_parser = require_runtime.__toESM(html_react_parser);
|
|
|
7
7
|
let _ndla_safelink = require("@ndla/safelink");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let _ndla_styled_system_patterns = require("@ndla/styled-system/patterns");
|
|
10
|
-
|
|
11
10
|
//#region src/Pitch/Pitch.tsx
|
|
12
11
|
/**
|
|
13
12
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -66,7 +65,7 @@ const Pitch = ({ title, url, metaImage, path, description }) => {
|
|
|
66
65
|
] })
|
|
67
66
|
});
|
|
68
67
|
};
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
69
|
exports.Pitch = Pitch;
|
|
70
|
+
|
|
72
71
|
//# sourceMappingURL=Pitch.js.map
|
package/lib/Pitch/Pitch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pitch.js","names":["CardHeading","Text","CardRoot","CardImage","getPossiblyRelativeUrl","SafeLink","linkOverlay"],"sources":["../../src/Pitch/Pitch.tsx"],"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 { CardHeading, CardImage, CardRoot, Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport parse from \"html-react-parser\";\nimport { getPossiblyRelativeUrl } from \"../utils/relativeUrl\";\n\nexport interface Props {\n title: string;\n url: string;\n description?: string;\n metaImage: {\n url: string;\n alt: string;\n };\n path?: string;\n}\n\nconst StyledCardHeading = styled(CardHeading, {\n base: {\n paddingBlockStart: \"medium\",\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n paddingBlockEnd: \"medium\",\n },\n});\n\nconst StyledCardRoot = styled(CardRoot, {\n base: {\n outline: \"0px\",\n boxShadow: \"none\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"small\",\n },\n});\n\nconst StyledCardImage = styled(CardImage, {\n base: {\n aspectRatio: \"16/9\",\n height: \"unset\",\n },\n});\n\nexport const Pitch = ({ title, url, metaImage, path, description }: Props) => {\n const href = getPossiblyRelativeUrl(url, path);\n\n return (\n <StyledCardRoot nonInteractive data-embed-type=\"pitch\" asChild consumeCss>\n <div>\n <StyledCardHeading textStyle=\"heading.small\" asChild consumeCss>\n <SafeLink to={href} unstyled css={linkOverlay.raw()}>\n {parse(title)}\n </SafeLink>\n </StyledCardHeading>\n {!!description && (\n <StyledText textStyle=\"body.xlarge\" asChild consumeCss>\n <div>{parse(description)}</div>\n </StyledText>\n )}\n <StyledCardImage\n variant=\"rounded\"\n src={metaImage.url}\n alt={metaImage.alt}\n sizes=\"480px\"\n fallbackWidth={300}\n width={550}\n height={310}\n />\n </div>\n </StyledCardRoot>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pitch.js","names":["CardHeading","Text","CardRoot","CardImage","getPossiblyRelativeUrl","SafeLink","linkOverlay"],"sources":["../../src/Pitch/Pitch.tsx"],"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 { CardHeading, CardImage, CardRoot, Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport parse from \"html-react-parser\";\nimport { getPossiblyRelativeUrl } from \"../utils/relativeUrl\";\n\nexport interface Props {\n title: string;\n url: string;\n description?: string;\n metaImage: {\n url: string;\n alt: string;\n };\n path?: string;\n}\n\nconst StyledCardHeading = styled(CardHeading, {\n base: {\n paddingBlockStart: \"medium\",\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n paddingBlockEnd: \"medium\",\n },\n});\n\nconst StyledCardRoot = styled(CardRoot, {\n base: {\n outline: \"0px\",\n boxShadow: \"none\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"small\",\n },\n});\n\nconst StyledCardImage = styled(CardImage, {\n base: {\n aspectRatio: \"16/9\",\n height: \"unset\",\n },\n});\n\nexport const Pitch = ({ title, url, metaImage, path, description }: Props) => {\n const href = getPossiblyRelativeUrl(url, path);\n\n return (\n <StyledCardRoot nonInteractive data-embed-type=\"pitch\" asChild consumeCss>\n <div>\n <StyledCardHeading textStyle=\"heading.small\" asChild consumeCss>\n <SafeLink to={href} unstyled css={linkOverlay.raw()}>\n {parse(title)}\n </SafeLink>\n </StyledCardHeading>\n {!!description && (\n <StyledText textStyle=\"body.xlarge\" asChild consumeCss>\n <div>{parse(description)}</div>\n </StyledText>\n )}\n <StyledCardImage\n variant=\"rounded\"\n src={metaImage.url}\n alt={metaImage.alt}\n sizes=\"480px\"\n fallbackWidth={300}\n width={550}\n height={310}\n />\n </div>\n </StyledCardRoot>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,qBAAA,GAAA,wBAAA,QAA2BA,iBAAAA,aAAa,EAC5C,MAAM,EACJ,mBAAmB,UACpB,EACF,CAAC;AAEF,MAAM,cAAA,GAAA,wBAAA,QAAoBC,iBAAAA,MAAM,EAC9B,MAAM,EACJ,iBAAiB,UAClB,EACF,CAAC;AAEF,MAAM,kBAAA,GAAA,wBAAA,QAAwBC,iBAAAA,UAAU,EACtC,MAAM;CACJ,SAAS;CACT,WAAW;CACX,SAAS;CACT,eAAe;CACf,KAAK;CACN,EACF,CAAC;AAEF,MAAM,mBAAA,GAAA,wBAAA,QAAyBC,iBAAAA,WAAW,EACxC,MAAM;CACJ,aAAa;CACb,QAAQ;CACT,EACF,CAAC;AAEF,MAAa,SAAS,EAAE,OAAO,KAAK,WAAW,MAAM,kBAAyB;CAC5E,MAAM,OAAOC,oBAAAA,uBAAuB,KAAK,KAAK;AAE9C,QACE,iBAAA,GAAA,kBAAA,KAAC,gBAAD;EAAgB,gBAAA;EAAe,mBAAgB;EAAQ,SAAA;EAAQ,YAAA;YAC7D,iBAAA,GAAA,kBAAA,MAAC,OAAD,EAAA,UAAA;GACE,iBAAA,GAAA,kBAAA,KAAC,mBAAD;IAAmB,WAAU;IAAgB,SAAA;IAAQ,YAAA;cACnD,iBAAA,GAAA,kBAAA,KAACC,eAAAA,UAAD;KAAU,IAAI;KAAM,UAAA;KAAS,KAAKC,6BAAAA,YAAY,KAAK;8CAC1C,MAAM;KACJ,CAAA;IACO,CAAA;GACnB,CAAC,CAAC,eACD,iBAAA,GAAA,kBAAA,KAAC,YAAD;IAAY,WAAU;IAAc,SAAA;IAAQ,YAAA;cAC1C,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,WAAA,GAAA,kBAAA,SAAY,YAAY,EAAO,CAAA;IACpB,CAAA;GAEf,iBAAA,GAAA,kBAAA,KAAC,iBAAD;IACE,SAAQ;IACR,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAM;IACN,eAAe;IACf,OAAO;IACP,QAAQ;IACR,CAAA;GACE,EAAA,CAAA;EACS,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_primitives = require("@ndla/primitives");
|
|
3
3
|
let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
|
|
4
4
|
let react = require("react");
|
|
@@ -7,7 +7,6 @@ let _ndla_icons = require("@ndla/icons");
|
|
|
7
7
|
let _ndla_safelink = require("@ndla/safelink");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let _ndla_styled_system_patterns = require("@ndla/styled-system/patterns");
|
|
10
|
-
|
|
11
10
|
//#region src/RelatedArticleList/RelatedArticleList.tsx
|
|
12
11
|
/**
|
|
13
12
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -96,8 +95,8 @@ const RelatedArticleList = ({ children = [], articleCount, headingLevel: Heading
|
|
|
96
95
|
]
|
|
97
96
|
});
|
|
98
97
|
};
|
|
99
|
-
|
|
100
98
|
//#endregion
|
|
101
99
|
exports.RelatedArticle = RelatedArticle;
|
|
102
100
|
exports.RelatedArticleList = RelatedArticleList;
|
|
101
|
+
|
|
103
102
|
//# sourceMappingURL=RelatedArticleList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedArticleList.js","names":["CardRoot","CardContent","CardHeading","linkOverlay","SafeLink","ExternalLinkLine","Text","Button","Children","Heading"],"sources":["../../src/RelatedArticleList/RelatedArticleList.tsx"],"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\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction?: string;\n to: string;\n linkInfo?: string;\n target?: string;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({ title, introduction, to, linkInfo = \"\", target = \"\" }: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n <CardHeading asChild consumeCss css={linkOverlay.raw()}>\n <SafeLink to={to} target={target} rel={linkInfo ? \"noopener noreferrer\" : undefined}>\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </CardHeading>\n {!!introduction && <Text dangerouslySetInnerHTML={{ __html: introduction }} />}\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show${expanded ? \"Less\" : \"More\"}`)}\n </StyledButton>\n ) : null}\n </StyledSection>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RelatedArticleList.js","names":["CardRoot","CardContent","CardHeading","linkOverlay","SafeLink","ExternalLinkLine","Text","Button","Children","Heading"],"sources":["../../src/RelatedArticleList/RelatedArticleList.tsx"],"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\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction?: string;\n to: string;\n linkInfo?: string;\n target?: string;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({ title, introduction, to, linkInfo = \"\", target = \"\" }: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n <CardHeading asChild consumeCss css={linkOverlay.raw()}>\n <SafeLink to={to} target={target} rel={linkInfo ? \"noopener noreferrer\" : undefined}>\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </CardHeading>\n {!!introduction && <Text dangerouslySetInnerHTML={{ __html: introduction }} />}\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show${expanded ? \"Less\" : \"More\"}`)}\n </StyledButton>\n ) : null}\n </StyledSection>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAA,GAAA,wBAAA,QAAoB,QAAQ,EAChC,MAAM;CACJ,SAAS;CACT,YAAY;CACZ,KAAK;CACN,EACF,CAAC;AAEF,MAAa,kBAAkB,EAAE,OAAO,cAAc,IAAI,WAAW,IAAI,SAAS,SAA8B;AAC9G,QACE,iBAAA,GAAA,kBAAA,KAACA,iBAAAA,UAAD;EAAU,mBAAgB;YACxB,iBAAA,GAAA,kBAAA,MAACC,iBAAAA,aAAD,EAAA,UAAA;GACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,aAAD;IAAa,SAAA;IAAQ,YAAA;IAAW,KAAKC,6BAAAA,YAAY,KAAK;cACpD,iBAAA,GAAA,kBAAA,KAACC,eAAAA,UAAD;KAAc;KAAY;KAAQ,KAAK,WAAW,wBAAwB,KAAA;eACxE,iBAAA,GAAA,kBAAA,MAAC,YAAD,EAAA,UAAA,CACG,OACA,WAAW,YAAY,iBAAA,GAAA,kBAAA,KAACC,YAAAA,kBAAD,EAAoB,CAAA,CACjC,EAAA,CA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;EAAe,GAAI;EAAM,mBAAgB;YAAzC;GACE,iBAAA,GAAA,kBAAA,MAAC,gBAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,SAAD;IAAS,SAAA;IAAQ,YAAA;IAAW,WAAU;IAAc,YAAW;cAC7D,iBAAA,GAAA,kBAAA,KAAC,gBAAD,EAAA,UAAiB,EAAE,gBAAgB,EAAkB,CAAA;IAC7C,CAAA,EACT,eACc,EAAA,CAAA;GACjB,iBAAA,GAAA,kBAAA,KAAC,iBAAD,EAAA,UAAkB,gBAAiC,CAAA;GAClD,aAAa,IACZ,iBAAA,GAAA,kBAAA,KAAC,cAAD;IAAc,SAAQ;IAAY,eAAe,aAAa,MAAM,CAAC,EAAE;cACpE,EAAE,eAAe,WAAW,SAAS,SAAS;IAClC,CAAA,GACb;GACU"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_primitives = require("@ndla/primitives");
|
|
3
3
|
let _ndla_styled_system_jsx = require("@ndla/styled-system/jsx");
|
|
4
4
|
let _ndla_icons = require("@ndla/icons");
|
|
5
5
|
let _ndla_safelink = require("@ndla/safelink");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let _ndla_core = require("@ndla/core");
|
|
8
|
-
|
|
9
8
|
//#region src/ResourceBox/ResourceBox.tsx
|
|
10
9
|
/**
|
|
11
10
|
* Copyright (c) 2022-present, NDLA.
|
|
@@ -75,7 +74,7 @@ const ResourceBox = ({ image, title, caption, url, buttonText }) => {
|
|
|
75
74
|
})
|
|
76
75
|
] })] });
|
|
77
76
|
};
|
|
78
|
-
|
|
79
77
|
//#endregion
|
|
80
78
|
exports.ResourceBox = ResourceBox;
|
|
79
|
+
|
|
81
80
|
//# sourceMappingURL=ResourceBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceBox.js","names":["Image","Text","breakpoints","Heading","SafeLinkButton","ShareBoxLine"],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"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\nimport { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourceBox.js","names":["Image","Text","breakpoints","Heading","SafeLinkButton","ShareBoxLine"],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"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\nimport { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,aAAA,GAAA,wBAAA,QAAmB,OAAO,EAC9B,MAAM;CACJ,SAAS;CACT,SAAS;CACT,cAAc;CACd,QAAQ;CACR,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,gBAAgB,EACd,SAAS,UACV;CACD,YAAY;EACV,eAAe;EACf,KAAK;EACL,SAAS;EACV;CACF,EACF,CAAC;AAEF,MAAM,kBAAA,GAAA,wBAAA,QAAwB,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,MAAM;CACN,YAAY,EACV,SAAS,UACV;CACF,EACF,CAAC;AAEF,MAAM,eAAA,GAAA,wBAAA,QAAqBA,iBAAAA,OAAO,EAChC,MAAM;CACJ,WAAW;CACX,cAAc;CACd,OAAO;CACP,aAAa;CACb,YAAY;EACV,OAAO;EACP,cAAc;EACf;CACF,EACF,CAAC;AAEF,MAAM,cAAA,GAAA,wBAAA,QAAoBC,iBAAAA,MAAM,EAC9B,MAAM,EACJ,MAAM,KACP,EACF,CAAC;AAeF,MAAa,eAAe,EAAE,OAAO,OAAO,SAAS,KAAK,iBAAwB;AAChF,QACE,iBAAA,GAAA,kBAAA,MAAC,WAAD,EAAA,UAAA,CACG,QACC,iBAAA,GAAA,kBAAA,KAAC,aAAD;EACE,KAAK,MAAM;EACX,KAAK,MAAM;EACX,OAAO,eAAeC,WAAAA,YAAY,QAAQ,uBAAuBA,WAAAA,YAAY,OAAO;EACpF,SAAQ;EACR,CAAA,GACA,MACJ,iBAAA,GAAA,kBAAA,MAAC,gBAAD,EAAA,UAAA;EACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,SAAD;GAAS,WAAU;GAAc,YAAW;GAAO,SAAA;GAAQ,YAAA;aACzD,iBAAA,GAAA,kBAAA,KAAC,MAAD,EAAA,UAAK,OAAW,CAAA;GACR,CAAA;EACV,iBAAA,GAAA,kBAAA,KAAC,YAAD;GAAY,WAAU;aAAe;GAAqB,CAAA;EAC1D,iBAAA,GAAA,kBAAA,MAACC,eAAAA,gBAAD;GAAgB,IAAI;GAAK,QAAO;GAAS,SAAQ;aAAjD,CACG,YACD,iBAAA,GAAA,kBAAA,KAACC,YAAAA,cAAD,EAAgB,CAAA,CACD;;EACF,EAAA,CAAA,CACP,EAAA,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_primitives = require("@ndla/primitives");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let _ndla_icons = require("@ndla/icons");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let _ndla_util = require("@ndla/util");
|
|
7
7
|
let _ark_ui_react = require("@ark-ui/react");
|
|
8
|
-
|
|
9
8
|
//#region src/TagSelector/TagSelector.tsx
|
|
10
9
|
/**
|
|
11
10
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -102,7 +101,6 @@ const TagSelectorInput = (0, react.forwardRef)(({ children, ...props }, ref) =>
|
|
|
102
101
|
})
|
|
103
102
|
})] });
|
|
104
103
|
});
|
|
105
|
-
|
|
106
104
|
//#endregion
|
|
107
105
|
exports.TagSelectorClearTrigger = TagSelectorClearTrigger;
|
|
108
106
|
exports.TagSelectorControl = TagSelectorControl;
|
|
@@ -112,4 +110,5 @@ exports.TagSelectorItemInput = TagSelectorItemInput;
|
|
|
112
110
|
exports.TagSelectorLabel = TagSelectorLabel;
|
|
113
111
|
exports.TagSelectorRoot = TagSelectorRoot;
|
|
114
112
|
exports.TagSelectorTrigger = TagSelectorTrigger;
|
|
113
|
+
|
|
115
114
|
//# sourceMappingURL=TagSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagSelector.js","names":["ComboboxRoot","TagsInputRoot","ComboboxLabel","TagsInputItemInput","ComboboxTrigger","ComboboxControl","TagsInputControl","ComboboxClearTrigger","ComboboxInput","TagsInputInput","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","CloseLine"],"sources":["../../src/TagSelector/TagSelector.tsx"],"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 { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\nimport { forwardRef, useEffect, useId, useRef } from \"react\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TagSelector.js","names":["ComboboxRoot","TagsInputRoot","ComboboxLabel","TagsInputItemInput","ComboboxTrigger","ComboboxControl","TagsInputControl","ComboboxClearTrigger","ComboboxInput","TagsInputInput","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","CloseLine"],"sources":["../../src/TagSelector/TagSelector.tsx"],"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 { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\nimport { forwardRef, useEffect, useId, useRef } from \"react\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAa,mBAA6C,EACxD,mBAAmB,MACnB,WAAW,MACX,oBAAoB,SACpB,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AAA,CAAA;EAEL"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let _ndla_primitives = require("@ndla/primitives");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
|
|
6
5
|
//#region src/ZendeskButton/ZendeskButton.tsx
|
|
7
6
|
/**
|
|
8
7
|
* Copyright (c) 2024-present, NDLA.
|
|
@@ -43,7 +42,7 @@ const ZendeskButton = (0, react.forwardRef)(({ locale, variant = "secondary", wi
|
|
|
43
42
|
children
|
|
44
43
|
});
|
|
45
44
|
});
|
|
46
|
-
|
|
47
45
|
//#endregion
|
|
48
46
|
exports.ZendeskButton = ZendeskButton;
|
|
47
|
+
|
|
49
48
|
//# sourceMappingURL=ZendeskButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.tsx"],"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 { Button, type ButtonProps } from \"@ndla/primitives\";\nimport { forwardRef, useState } from \"react\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.tsx"],"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 { Button, type ButtonProps } from \"@ndla/primitives\";\nimport { forwardRef, useState } from \"react\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAa,iBAAA,GAAA,MAAA,aACV,EAAE,QAAQ,UAAU,aAAa,WAAW,UAAU,GAAG,QAAQ,QAAQ;CACxE,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,UAAuB,MAAM;CAC7C,MAAM,oBAAoB;AACxB,MAAI,UAAU,CAAC,OAAO,IAAI;AACxB,cAAW,KAAK;GAEhB,MAAM,SAAS,SAAS,cAAc,SAAS;AAC/C,UAAO,KAAK;AACZ,UAAO,OAAO;AACd,UAAO,QAAQ;AACf,UAAO,eAAe;AACpB,QAAI,OAAO,IAAI;AACb,YAAO,GAAG,aAAa,aAAa,OAAO;AAC3C,YAAO,GAAG,gBAAgB,eAAe;AACvC,iBAAW,MAAM;OACjB;AACF,YAAO,GAAG,aAAa,OAAO;;;AAGlC,UAAO,MAAM,kDAAkD;AAC/D,YAAS,KAAK,YAAY,OAAO;aACxB,QAAQ,GACjB,QAAO,GAAG,aAAa,OAAO;;AAIlC,QACE,iBAAA,GAAA,kBAAA,KAACA,iBAAAA,QAAD;EAAQ,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;EACM,CAAA;EAGd"}
|
|
@@ -7,28 +7,20 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __exportAll = (all, no_symbols) => {
|
|
9
9
|
let target = {};
|
|
10
|
-
for (var name in all) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (!no_symbols) {
|
|
17
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
-
}
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
15
|
return target;
|
|
20
16
|
};
|
|
21
17
|
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
32
24
|
}
|
|
33
25
|
return to;
|
|
34
26
|
};
|
|
@@ -36,8 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
28
|
value: mod,
|
|
37
29
|
enumerable: true
|
|
38
30
|
}) : target, mod));
|
|
39
|
-
|
|
40
31
|
//#endregion
|
|
41
|
-
|
|
42
32
|
exports.__exportAll = __exportAll;
|
|
43
|
-
exports.__toESM = __toESM;
|
|
33
|
+
exports.__toESM = __toESM;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let react_i18next = require("react-i18next");
|
|
4
|
-
|
|
5
4
|
//#region src/i18n/useComponentTranslations.ts
|
|
6
5
|
const useTagsInputTranslations = (translations) => {
|
|
7
6
|
const { t } = (0, react_i18next.useTranslation)("translation", { keyPrefix: "component.tagsInput" });
|
|
@@ -150,7 +149,6 @@ const useDatePickerTranslations = (translations) => {
|
|
|
150
149
|
...translations
|
|
151
150
|
}), [t, translations]);
|
|
152
151
|
};
|
|
153
|
-
|
|
154
152
|
//#endregion
|
|
155
153
|
exports.useAudioSearchTranslations = useAudioSearchTranslations;
|
|
156
154
|
exports.useComboboxTranslations = useComboboxTranslations;
|
|
@@ -160,4 +158,5 @@ exports.usePaginationTranslations = usePaginationTranslations;
|
|
|
160
158
|
exports.useTagSelectorTranslations = useTagSelectorTranslations;
|
|
161
159
|
exports.useTagsInputTranslations = useTagsInputTranslations;
|
|
162
160
|
exports.useVideoSearchTranslations = useVideoSearchTranslations;
|
|
161
|
+
|
|
163
162
|
//# sourceMappingURL=useComponentTranslations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentTranslations.js","names":[],"sources":["../../src/i18n/useComponentTranslations.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 type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyy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[],"sources":["../../src/i18n/useComponentTranslations.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 type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyyy\" };\n },\n ...translations,\n }),\n [t, translations],\n );\n};\n"],"mappings":";;;;AAkBA,MAAa,4BACX,iBACuC;CACvC,MAAM,EAAE,OAAA,GAAA,cAAA,gBAAqB,eAAe,EAAE,WAAW,uBAAuB,CAAC;AAEjF,SAAA,GAAA,MAAA,gBACS;EACL,mBAAmB,EAAE,oBAAoB;EACzC,wBAAwB,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;EACnE,WAAW,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC;EACzC,aAAa,QAAQ,EAAE,cAAc,EAAE,QAAQ,IAAI,QAAQ,CAAC;EAC5D,YAAY,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC;EAC3C,aAAa,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;EAC7C,aAAa,QAAQ,EAA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G;EACJ,GACD,CAAC,GAAG,aAAa,CAClB;;AAGH,MAAa,6BACX,iBACqD;CACrD,MAAM,EAAE,OAAA,GAAA,cAAA,gBAAqB,eAAe,EAAE,WAAW,wBAAwB,CAAC;AAElF,SAAA,GAAA,MAAA,gBACS;EACL,UAAU,UAAU;AAClB,OAAI,MAAM,YACR,QAAO,EAAE,uBAAuB,EAAE,MAAM,MAAM,eAAe,CAAC;YACrD,MAAM,SACf,QAAO,EAAE,oBAAoB,EAAE,MAAM,MAAM,eAAe,CAAC;OACtD,QAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,eAAe,CAAC;;EAElE,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,aAAa,EAAE,cAAc;EAC7B,YAAY,EAAE,aAAa;EAC3B,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,gBAAgB,UAAU;AACxB,OAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,EAAE,uBAAuB;IAAE,OAAO,MAAM;IAAI,KAAK,MAAM;IAAI,CAAC;OAC9D,QAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;;EAE1D,cAAc,EAAE,eAAe;EAC/B,UAAU,SAAS,EAAE,WAAW,OAAO,UAAU,SAAS;EAC1D,SAAS,EAAE,UAAU;EACrB,cAAc,YAAY;AACxB,UAAO;IAAE,KAAK;IAAM,OAAO;IAAM,MAAM;IAAQ;;EAEjD,GAAG;EACJ,GACD,CAAC,GAAG,aAAa,CAClB"}
|
package/lib/index.js
CHANGED
|
@@ -1,62 +1,61 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
|
|
3
|
-
const require_LicenseLink = require(
|
|
4
|
-
const require_EmbedByline = require(
|
|
5
|
-
const require_licenseAttributes = require(
|
|
6
|
-
const require_BrightcoveEmbed = require(
|
|
7
|
-
const require_ResourceBox = require(
|
|
8
|
-
const require_ExternalEmbed = require(
|
|
9
|
-
const require_H5pEmbed = require(
|
|
10
|
-
const require_IframeEmbed = require(
|
|
11
|
-
const require_ImageEmbed = require(
|
|
12
|
-
const require_Concept = require(
|
|
13
|
-
const require_InlineTriggerButton = require(
|
|
14
|
-
const require_AudioPlayer = require(
|
|
15
|
-
const require_AudioEmbed = require(
|
|
16
|
-
const require_FootnoteEmbed = require(
|
|
17
|
-
const require_ContentLinkEmbed = require(
|
|
18
|
-
const require_RelatedArticleList = require(
|
|
19
|
-
const require_RelatedContentEmbed = require(
|
|
20
|
-
const require_ConceptInlineTriggerButton = require(
|
|
21
|
-
const require_GlossExample = require(
|
|
22
|
-
const require_Gloss = require(
|
|
23
|
-
const require_ConceptEmbed = require(
|
|
24
|
-
const require_UnknownEmbed = require(
|
|
25
|
-
const require_UuDisclaimerEmbed = require(
|
|
26
|
-
const require_CopyrightEmbed = require(
|
|
27
|
-
const require_CodeBlock = require(
|
|
28
|
-
const require_codeLanguageOptions = require(
|
|
29
|
-
const require_CodeEmbed = require(
|
|
30
|
-
const require_EmbedWrapper = require(
|
|
31
|
-
const require_BadgesContainer = require(
|
|
32
|
-
const require_Article = require(
|
|
33
|
-
const require_ArticleFootNotes = require(
|
|
34
|
-
const require_ArticleByline = require(
|
|
35
|
-
const require_relativeUrl = require(
|
|
36
|
-
const require_FileList = require(
|
|
37
|
-
const require_File = require(
|
|
38
|
-
const require_PdfFile = require(
|
|
39
|
-
const require_FactBox = require(
|
|
40
|
-
const require_ContentType = require(
|
|
41
|
-
const require_SubjectCategories = require(
|
|
42
|
-
const require_SubjectTypes = require(
|
|
43
|
-
const require_WordClass = require(
|
|
44
|
-
const require_index = require(
|
|
45
|
-
const require_Breadcrumb = require(
|
|
46
|
-
const require_HomeBreadcrumb = require(
|
|
47
|
-
const require_TagSelector = require(
|
|
48
|
-
const require_useComponentTranslations = require(
|
|
49
|
-
const require_AnchorHeading = require(
|
|
50
|
-
const require_Pitch = require(
|
|
51
|
-
const require_KeyFigure = require(
|
|
52
|
-
const require_ContactBlock = require(
|
|
53
|
-
const require_CampaignBlock = require(
|
|
54
|
-
const require_Grid = require(
|
|
55
|
-
const require_LinkBlock = require(
|
|
56
|
-
const require_LinkBlockSection = require(
|
|
57
|
-
const require_ZendeskButton = require(
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_LicenseLink = require("./LicenseByline/LicenseLink.js");
|
|
4
|
+
const require_EmbedByline = require("./LicenseByline/EmbedByline.js");
|
|
5
|
+
const require_licenseAttributes = require("./utils/licenseAttributes.js");
|
|
6
|
+
const require_BrightcoveEmbed = require("./Embed/BrightcoveEmbed.js");
|
|
7
|
+
const require_ResourceBox = require("./ResourceBox/ResourceBox.js");
|
|
8
|
+
const require_ExternalEmbed = require("./Embed/ExternalEmbed.js");
|
|
9
|
+
const require_H5pEmbed = require("./Embed/H5pEmbed.js");
|
|
10
|
+
const require_IframeEmbed = require("./Embed/IframeEmbed.js");
|
|
11
|
+
const require_ImageEmbed = require("./Embed/ImageEmbed.js");
|
|
12
|
+
const require_Concept = require("./Concept/Concept.js");
|
|
13
|
+
const require_InlineTriggerButton = require("./Embed/InlineTriggerButton.js");
|
|
14
|
+
const require_AudioPlayer = require("./AudioPlayer/AudioPlayer.js");
|
|
15
|
+
const require_AudioEmbed = require("./Embed/AudioEmbed.js");
|
|
16
|
+
const require_FootnoteEmbed = require("./Embed/FootnoteEmbed.js");
|
|
17
|
+
const require_ContentLinkEmbed = require("./Embed/ContentLinkEmbed.js");
|
|
18
|
+
const require_RelatedArticleList = require("./RelatedArticleList/RelatedArticleList.js");
|
|
19
|
+
const require_RelatedContentEmbed = require("./Embed/RelatedContentEmbed.js");
|
|
20
|
+
const require_ConceptInlineTriggerButton = require("./Embed/ConceptInlineTriggerButton.js");
|
|
21
|
+
const require_GlossExample = require("./Gloss/GlossExample.js");
|
|
22
|
+
const require_Gloss = require("./Gloss/Gloss.js");
|
|
23
|
+
const require_ConceptEmbed = require("./Embed/ConceptEmbed.js");
|
|
24
|
+
const require_UnknownEmbed = require("./Embed/UnknownEmbed.js");
|
|
25
|
+
const require_UuDisclaimerEmbed = require("./Embed/UuDisclaimerEmbed.js");
|
|
26
|
+
const require_CopyrightEmbed = require("./Embed/CopyrightEmbed.js");
|
|
27
|
+
const require_CodeBlock = require("./CodeBlock/CodeBlock.js");
|
|
28
|
+
const require_codeLanguageOptions = require("./CodeBlock/codeLanguageOptions.js");
|
|
29
|
+
const require_CodeEmbed = require("./Embed/CodeEmbed.js");
|
|
30
|
+
const require_EmbedWrapper = require("./Embed/EmbedWrapper.js");
|
|
31
|
+
const require_BadgesContainer = require("./Article/BadgesContainer.js");
|
|
32
|
+
const require_Article = require("./Article/Article.js");
|
|
33
|
+
const require_ArticleFootNotes = require("./Article/ArticleFootNotes.js");
|
|
34
|
+
const require_ArticleByline = require("./Article/ArticleByline.js");
|
|
35
|
+
const require_relativeUrl = require("./utils/relativeUrl.js");
|
|
36
|
+
const require_FileList = require("./FileList/FileList.js");
|
|
37
|
+
const require_File = require("./FileList/File.js");
|
|
38
|
+
const require_PdfFile = require("./FileList/PdfFile.js");
|
|
39
|
+
const require_FactBox = require("./FactBox/FactBox.js");
|
|
40
|
+
const require_ContentType = require("./model/ContentType.js");
|
|
41
|
+
const require_SubjectCategories = require("./model/SubjectCategories.js");
|
|
42
|
+
const require_SubjectTypes = require("./model/SubjectTypes.js");
|
|
43
|
+
const require_WordClass = require("./model/WordClass.js");
|
|
44
|
+
const require_index = require("./model/index.js");
|
|
45
|
+
const require_Breadcrumb = require("./Breadcrumb/Breadcrumb.js");
|
|
46
|
+
const require_HomeBreadcrumb = require("./Breadcrumb/HomeBreadcrumb.js");
|
|
47
|
+
const require_TagSelector = require("./TagSelector/TagSelector.js");
|
|
48
|
+
const require_useComponentTranslations = require("./i18n/useComponentTranslations.js");
|
|
49
|
+
const require_AnchorHeading = require("./AnchorHeading/AnchorHeading.js");
|
|
50
|
+
const require_Pitch = require("./Pitch/Pitch.js");
|
|
51
|
+
const require_KeyFigure = require("./KeyFigure/KeyFigure.js");
|
|
52
|
+
const require_ContactBlock = require("./ContactBlock/ContactBlock.js");
|
|
53
|
+
const require_CampaignBlock = require("./CampaignBlock/CampaignBlock.js");
|
|
54
|
+
const require_Grid = require("./Grid/Grid.js");
|
|
55
|
+
const require_LinkBlock = require("./LinkBlock/LinkBlock.js");
|
|
56
|
+
const require_LinkBlockSection = require("./LinkBlock/LinkBlockSection.js");
|
|
57
|
+
const require_ZendeskButton = require("./ZendeskButton/ZendeskButton.js");
|
|
58
58
|
let _ndla_locales = require("@ndla/locales");
|
|
59
|
-
|
|
60
59
|
exports.AnchorHeading = require_AnchorHeading.AnchorHeading;
|
|
61
60
|
exports.ArticleByline = require_ArticleByline.ArticleByline;
|
|
62
61
|
exports.ArticleBylineAccordionItem = require_ArticleByline.ArticleBylineAccordionItem;
|
|
@@ -132,29 +131,29 @@ exports.getCrop = require_ImageEmbed.getCrop;
|
|
|
132
131
|
exports.getFocalPoint = require_ImageEmbed.getFocalPoint;
|
|
133
132
|
exports.getPossiblyRelativeUrl = require_relativeUrl.getPossiblyRelativeUrl;
|
|
134
133
|
exports.licenseAttributes = require_licenseAttributes.licenseAttributes;
|
|
135
|
-
Object.defineProperty(exports,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
Object.defineProperty(exports, "messagesEN", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return _ndla_locales.messagesEN;
|
|
138
|
+
}
|
|
140
139
|
});
|
|
141
|
-
Object.defineProperty(exports,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
Object.defineProperty(exports, "messagesNB", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: function() {
|
|
143
|
+
return _ndla_locales.messagesNB;
|
|
144
|
+
}
|
|
146
145
|
});
|
|
147
|
-
Object.defineProperty(exports,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
Object.defineProperty(exports, "messagesNN", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function() {
|
|
149
|
+
return _ndla_locales.messagesNN;
|
|
150
|
+
}
|
|
152
151
|
});
|
|
153
|
-
Object.defineProperty(exports,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
Object.defineProperty(exports, "messagesSE", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function() {
|
|
155
|
+
return _ndla_locales.messagesSE;
|
|
156
|
+
}
|
|
158
157
|
});
|
|
159
158
|
exports.resourceEmbedTypeMapping = require_ContentType.resourceEmbedTypeMapping;
|
|
160
159
|
exports.subjectCategories = require_SubjectCategories.subjectCategories;
|
|
@@ -167,4 +166,4 @@ exports.usePaginationTranslations = require_useComponentTranslations.usePaginati
|
|
|
167
166
|
exports.useTagSelectorTranslations = require_useComponentTranslations.useTagSelectorTranslations;
|
|
168
167
|
exports.useTagsInputTranslations = require_useComponentTranslations.useTagsInputTranslations;
|
|
169
168
|
exports.useVideoSearchTranslations = require_useComponentTranslations.useVideoSearchTranslations;
|
|
170
|
-
exports.wordClass = require_WordClass.wordClass;
|
|
169
|
+
exports.wordClass = require_WordClass.wordClass;
|