@ndla/ui 34.6.1 → 34.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Article/Article.js +11 -6
- package/es/Aside/Aside.js +5 -2
- package/es/CopyParagraphButton/CopyParagraphButtonV2.js +85 -0
- package/es/CopyParagraphButton/index.js +2 -1
- package/es/Embed/AudioEmbed.js +254 -0
- package/es/Embed/BrightcoveEmbed.js +250 -0
- package/es/Embed/ConceptEmbed.js +358 -0
- package/es/Embed/ConceptListEmbed.js +71 -0
- package/es/Embed/ContentLinkEmbed.js +42 -0
- package/es/Embed/ExternalEmbed.js +91 -0
- package/es/Embed/FootnoteEmbed.js +32 -0
- package/es/Embed/H5pEmbed.js +87 -0
- package/es/Embed/IframeEmbed.js +83 -0
- package/es/Embed/ImageEmbed.js +322 -0
- package/es/Embed/RelatedContentEmbed.js +58 -0
- package/es/Embed/UnknownEmbed.js +27 -0
- package/es/Embed/conceptComponents.js +282 -0
- package/es/Embed/index.js +21 -0
- package/es/FactBox/FactBoxV2.js +90 -0
- package/es/FactBox/index.js +1 -0
- package/es/Figure/Figure.js +8 -5
- package/es/Figure/FigureLicenseDialogContent.js +72 -0
- package/es/FileList/FileListV2.js +47 -0
- package/es/FileList/FileV2.js +34 -0
- package/es/FileList/PdfFile.js +25 -0
- package/es/FileList/index.js +3 -0
- package/es/Notion/Notion.js +5 -5
- package/es/Notion/NotionVisualElement.js +2 -2
- package/es/RelatedArticleList/RelatedArticleV2.js +101 -0
- package/es/RelatedArticleList/index.js +2 -1
- package/es/Table/Table.js +95 -8
- package/es/all.css +1 -1
- package/es/index.js +5 -4
- package/es/locale/messages-en.js +11 -1
- package/es/locale/messages-nb.js +11 -1
- package/es/locale/messages-nn.js +11 -1
- package/es/locale/messages-se.js +11 -1
- package/es/locale/messages-sma.js +11 -1
- package/lib/Article/Article.d.ts +2 -1
- package/lib/Article/Article.js +11 -6
- package/lib/Aside/Aside.d.ts +2 -1
- package/lib/Aside/Aside.js +5 -2
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.d.ts +14 -0
- package/lib/CopyParagraphButton/CopyParagraphButtonV2.js +84 -0
- package/lib/CopyParagraphButton/index.d.ts +2 -1
- package/lib/CopyParagraphButton/index.js +7 -0
- package/lib/Embed/AudioEmbed.d.ts +20 -0
- package/lib/Embed/AudioEmbed.js +252 -0
- package/lib/Embed/BrightcoveEmbed.d.ts +16 -0
- package/lib/Embed/BrightcoveEmbed.js +250 -0
- package/lib/Embed/ConceptEmbed.d.ts +19 -0
- package/lib/Embed/ConceptEmbed.js +358 -0
- package/lib/Embed/ConceptListEmbed.d.ts +13 -0
- package/lib/Embed/ConceptListEmbed.js +70 -0
- package/lib/Embed/ContentLinkEmbed.d.ts +14 -0
- package/lib/Embed/ContentLinkEmbed.js +50 -0
- package/lib/Embed/ExternalEmbed.d.ts +14 -0
- package/lib/Embed/ExternalEmbed.js +90 -0
- package/lib/Embed/FootnoteEmbed.d.ts +13 -0
- package/lib/Embed/FootnoteEmbed.js +39 -0
- package/lib/Embed/H5pEmbed.d.ts +14 -0
- package/lib/Embed/H5pEmbed.js +86 -0
- package/lib/Embed/IframeEmbed.d.ts +14 -0
- package/lib/Embed/IframeEmbed.js +91 -0
- package/lib/Embed/ImageEmbed.d.ts +37 -0
- package/lib/Embed/ImageEmbed.js +326 -0
- package/lib/Embed/RelatedContentEmbed.d.ts +16 -0
- package/lib/Embed/RelatedContentEmbed.js +64 -0
- package/lib/Embed/UnknownEmbed.d.ts +13 -0
- package/lib/Embed/UnknownEmbed.js +35 -0
- package/lib/Embed/conceptComponents.d.ts +32 -0
- package/lib/Embed/conceptComponents.js +280 -0
- package/lib/Embed/index.d.ts +20 -0
- package/lib/Embed/index.js +97 -0
- package/lib/FactBox/FactBoxV2.d.ts +13 -0
- package/lib/FactBox/FactBoxV2.js +92 -0
- package/lib/FactBox/index.d.ts +1 -0
- package/lib/FactBox/index.js +7 -0
- package/lib/Figure/Figure.d.ts +5 -2
- package/lib/Figure/Figure.js +8 -5
- package/lib/Figure/FigureLicenseDialogContent.d.ts +22 -0
- package/lib/Figure/FigureLicenseDialogContent.js +71 -0
- package/lib/FileList/FileListV2.d.ts +13 -0
- package/lib/FileList/FileListV2.js +46 -0
- package/lib/FileList/FileV2.d.ts +16 -0
- package/lib/FileList/FileV2.js +42 -0
- package/lib/FileList/PdfFile.d.ts +13 -0
- package/lib/FileList/PdfFile.js +31 -0
- package/lib/FileList/index.d.ts +3 -0
- package/lib/FileList/index.js +21 -0
- package/lib/Notion/Notion.js +5 -5
- package/lib/Notion/NotionVisualElement.d.ts +1 -1
- package/lib/Notion/NotionVisualElement.js +2 -2
- package/lib/RelatedArticleList/RelatedArticleV2.d.ts +25 -0
- package/lib/RelatedArticleList/RelatedArticleV2.js +101 -0
- package/lib/RelatedArticleList/index.d.ts +2 -1
- package/lib/RelatedArticleList/index.js +7 -0
- package/lib/Table/Table.js +98 -8
- package/lib/all.css +1 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.js +117 -2
- package/lib/locale/messages-en.d.ts +10 -0
- package/lib/locale/messages-en.js +11 -1
- package/lib/locale/messages-nb.d.ts +10 -0
- package/lib/locale/messages-nb.js +11 -1
- package/lib/locale/messages-nn.d.ts +10 -0
- package/lib/locale/messages-nn.js +11 -1
- package/lib/locale/messages-se.d.ts +10 -0
- package/lib/locale/messages-se.js +11 -1
- package/lib/locale/messages-sma.d.ts +10 -0
- package/lib/locale/messages-sma.js +11 -1
- package/lib/types.d.ts +1 -1
- package/package.json +16 -12
- package/src/Article/Article.tsx +8 -3
- package/src/Aside/Aside.tsx +9 -1
- package/src/Aside/component.aside.scss +3 -0
- package/src/CopyParagraphButton/CopyParagraphButtonV2.tsx +84 -0
- package/src/CopyParagraphButton/index.tsx +2 -1
- package/src/Embed/AudioEmbed.tsx +249 -0
- package/src/Embed/BrightcoveEmbed.tsx +203 -0
- package/src/Embed/ConceptEmbed.tsx +408 -0
- package/src/Embed/ConceptListEmbed.tsx +64 -0
- package/src/Embed/ContentLinkEmbed.tsx +41 -0
- package/src/Embed/ExternalEmbed.tsx +80 -0
- package/src/Embed/FootnoteEmbed.tsx +30 -0
- package/src/Embed/H5pEmbed.tsx +74 -0
- package/src/Embed/IframeEmbed.tsx +84 -0
- package/src/Embed/ImageEmbed.tsx +314 -0
- package/src/Embed/RelatedContentEmbed.tsx +62 -0
- package/src/Embed/UnknownEmbed.tsx +27 -0
- package/src/Embed/conceptComponents.tsx +393 -0
- package/src/Embed/index.ts +21 -0
- package/src/FactBox/FactBoxV2.tsx +56 -0
- package/src/FactBox/index.ts +2 -0
- package/src/Figure/Figure.tsx +28 -15
- package/src/Figure/FigureLicenseDialogContent.tsx +80 -0
- package/src/Figure/component.figure.scss +0 -1
- package/src/FileList/FileListV2.tsx +58 -0
- package/src/FileList/FileV2.tsx +35 -0
- package/src/FileList/PdfFile.tsx +25 -0
- package/src/FileList/index.ts +3 -0
- package/src/Notion/Notion.tsx +0 -1
- package/src/Notion/NotionVisualElement.tsx +1 -1
- package/src/RelatedArticleList/RelatedArticleV2.tsx +84 -0
- package/src/RelatedArticleList/index.ts +2 -1
- package/src/Table/Table.tsx +77 -4
- package/src/index.ts +19 -4
- package/src/locale/messages-en.ts +10 -0
- package/src/locale/messages-nb.ts +10 -0
- package/src/locale/messages-nn.ts +10 -0
- package/src/locale/messages-se.ts +10 -1
- package/src/locale/messages-sma.ts +10 -0
- package/src/types.ts +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import styled from '@emotion/styled';
|
|
10
|
+
import { colors, fonts, spacing } from '@ndla/core';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const FileListSection = styled.section`
|
|
19
|
+
margin: ${spacing.large} 0;
|
|
20
|
+
padding: ${spacing.small} 0 ${spacing.normal} ${spacing.normal};
|
|
21
|
+
border-left: 2px solid ${colors.brand.greyLightest};
|
|
22
|
+
font-family: ${fonts.sans};
|
|
23
|
+
|
|
24
|
+
.c-icon {
|
|
25
|
+
margin-top: 3px;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
margin-right: ${spacing.small};
|
|
28
|
+
height: 18px;
|
|
29
|
+
width: 18px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const FileListHeading = styled.h3`
|
|
34
|
+
${fonts.sizes('16px', '18px')};
|
|
35
|
+
letter-spacing: 0.05em;
|
|
36
|
+
margin: 0 0 ${spacing.xsmall} 0;
|
|
37
|
+
padding-bottom: ${spacing.xsmall};
|
|
38
|
+
border-bottom: 2px solid ${colors.brand.greyLight};
|
|
39
|
+
font-weight: ${fonts.weight.bold};
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const FilesList = styled.ul`
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const FileListV2 = ({ children }: Props) => {
|
|
49
|
+
const { t } = useTranslation();
|
|
50
|
+
return (
|
|
51
|
+
<FileListSection>
|
|
52
|
+
<FileListHeading>{t('files')}</FileListHeading>
|
|
53
|
+
<FilesList>{children}</FilesList>
|
|
54
|
+
</FileListSection>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default FileListV2;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import File from './File';
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
url: string;
|
|
16
|
+
fileExists: boolean;
|
|
17
|
+
fileType: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const FileV2 = ({ title, url, id, fileExists, fileType }: Props) => {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
const tooltip = `${t('download')} ${url.split('/').pop()}`;
|
|
23
|
+
return (
|
|
24
|
+
<File
|
|
25
|
+
id={id}
|
|
26
|
+
file={{
|
|
27
|
+
title,
|
|
28
|
+
fileExists,
|
|
29
|
+
formats: [{ url, fileType, tooltip }],
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default FileV2;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Figure } from '../Figure';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
title: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const PdfFile = ({ title, url }: Props) => {
|
|
17
|
+
return (
|
|
18
|
+
<Figure>
|
|
19
|
+
<h2>{title}</h2>
|
|
20
|
+
<iframe title={title} height="1050" src={url} />
|
|
21
|
+
</Figure>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default PdfFile;
|
package/src/FileList/index.ts
CHANGED
package/src/Notion/Notion.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const StyledIframe = styled.iframe<{ type: string }>`
|
|
|
21
21
|
|
|
22
22
|
export type NotionVisualElementType = {
|
|
23
23
|
element?: ReactNode;
|
|
24
|
-
type?: 'video' | 'image' | 'h5p';
|
|
24
|
+
type?: 'video' | 'image' | 'h5p' | 'iframe';
|
|
25
25
|
resource?: string;
|
|
26
26
|
title?: string;
|
|
27
27
|
url?: string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Children, useMemo, useState } from 'react';
|
|
10
|
+
import BEMHelper from 'react-bem-helper';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
import { ButtonV2 } from '@ndla/button';
|
|
13
|
+
import SafeLink from '@ndla/safelink';
|
|
14
|
+
import SectionHeading from '../SectionHeading';
|
|
15
|
+
import { HeadingLevel } from '../types';
|
|
16
|
+
import ContentTypeBadge from '../ContentTypeBadge';
|
|
17
|
+
import { contentTypes } from '../model/ContentType';
|
|
18
|
+
|
|
19
|
+
const classes = new BEMHelper({
|
|
20
|
+
name: 'related-articles',
|
|
21
|
+
prefix: 'c-',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
interface RelatedArticleProps {
|
|
25
|
+
title: string;
|
|
26
|
+
introduction: string;
|
|
27
|
+
to: string;
|
|
28
|
+
linkInfo?: string;
|
|
29
|
+
target?: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const RelatedArticleV2 = ({
|
|
34
|
+
title,
|
|
35
|
+
introduction,
|
|
36
|
+
to,
|
|
37
|
+
linkInfo = '',
|
|
38
|
+
target = '',
|
|
39
|
+
type = contentTypes.SUBJECT_MATERIAL,
|
|
40
|
+
}: RelatedArticleProps) => {
|
|
41
|
+
return (
|
|
42
|
+
<article {...classes('item', type)}>
|
|
43
|
+
<h3 {...classes('title')}>
|
|
44
|
+
<ContentTypeBadge type={type} background size="small" />
|
|
45
|
+
<span {...classes('link-wrapper')}>
|
|
46
|
+
<SafeLink to={to} {...classes('link')} target={target} rel={linkInfo ? 'noopener noreferrer' : undefined}>
|
|
47
|
+
{title}
|
|
48
|
+
</SafeLink>
|
|
49
|
+
</span>
|
|
50
|
+
</h3>
|
|
51
|
+
<p {...classes('description')} dangerouslySetInnerHTML={{ __html: introduction }} />
|
|
52
|
+
{linkInfo && <p {...classes('link-info')}>{linkInfo}</p>}
|
|
53
|
+
</article>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
interface Props {
|
|
58
|
+
children?: JSX.Element[];
|
|
59
|
+
articleCount?: number;
|
|
60
|
+
headingLevel?: HeadingLevel;
|
|
61
|
+
}
|
|
62
|
+
export const RelatedArticleListV2 = ({ children = [], articleCount, headingLevel = 'h3' }: Props) => {
|
|
63
|
+
const [expanded, setExpanded] = useState(false);
|
|
64
|
+
const { t } = useTranslation();
|
|
65
|
+
const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);
|
|
66
|
+
const childrenToShow = useMemo(
|
|
67
|
+
() => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),
|
|
68
|
+
[childCount, children, expanded],
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<section {...classes('')}>
|
|
73
|
+
<SectionHeading headingLevel={headingLevel} className={classes('component-title').className}>
|
|
74
|
+
{t('related.title')}
|
|
75
|
+
</SectionHeading>
|
|
76
|
+
<div {...classes('articles')}>{childrenToShow}</div>
|
|
77
|
+
{childCount > 2 ? (
|
|
78
|
+
<ButtonV2 onClick={() => setExpanded((p) => !p)} variant="outline">
|
|
79
|
+
{t(`related.show${expanded ? 'Less' : 'More'}`)}
|
|
80
|
+
</ButtonV2>
|
|
81
|
+
) : null}
|
|
82
|
+
</section>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import RelatedArticleList, { RelatedArticle } from './RelatedArticleList';
|
|
10
|
+
import { RelatedArticleListV2 } from './RelatedArticleV2';
|
|
10
11
|
|
|
11
|
-
export { RelatedArticle };
|
|
12
|
+
export { RelatedArticle, RelatedArticleListV2 };
|
|
12
13
|
|
|
13
14
|
export default RelatedArticleList;
|
package/src/Table/Table.tsx
CHANGED
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import styled from '@emotion/styled';
|
|
10
|
+
import { colors, spacing } from '@ndla/core';
|
|
11
|
+
import throttle from 'lodash/throttle';
|
|
12
|
+
import React, { ReactNode, UIEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
13
|
import BEMHelper from 'react-bem-helper';
|
|
11
14
|
|
|
15
|
+
type ScrollPosition = 'start' | 'end' | 'center';
|
|
16
|
+
|
|
12
17
|
const classes = BEMHelper('c-table');
|
|
13
18
|
|
|
19
|
+
const MARGIN = 5;
|
|
20
|
+
|
|
14
21
|
interface Props {
|
|
15
22
|
id?: string;
|
|
16
23
|
children?: ReactNode;
|
|
@@ -19,15 +26,81 @@ interface Props {
|
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
28
|
|
|
29
|
+
interface StyledProps {
|
|
30
|
+
show: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const ScrollBorder = styled.div<StyledProps>`
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
height: calc(100% - ${spacing.mediumlarge});
|
|
37
|
+
width: 3px;
|
|
38
|
+
background: ${colors.background.dark};
|
|
39
|
+
display: ${({ show }) => (show ? 'block' : 'none')};
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const RightScrollBorder = styled(ScrollBorder)`
|
|
43
|
+
right: 0;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const LeftScrollBorder = styled(ScrollBorder)`
|
|
47
|
+
left: 0;
|
|
48
|
+
`;
|
|
49
|
+
|
|
22
50
|
const Table = ({ children, id, ...rest }: Props) => {
|
|
51
|
+
const [scrollPosition, setScrollPosition] = useState<ScrollPosition | undefined>(undefined);
|
|
52
|
+
const tableRef = useRef<HTMLTableElement>(null);
|
|
53
|
+
|
|
54
|
+
const checkScrollPosition = useCallback((el: HTMLTableElement) => {
|
|
55
|
+
const { scrollLeft, offsetWidth, scrollWidth, clientWidth } = el;
|
|
56
|
+
const hasScrollbar = scrollWidth > clientWidth;
|
|
57
|
+
|
|
58
|
+
if (!hasScrollbar) {
|
|
59
|
+
setScrollPosition(undefined);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const isStart = scrollLeft <= MARGIN;
|
|
64
|
+
const isEnd = offsetWidth + scrollLeft >= scrollWidth - MARGIN;
|
|
65
|
+
|
|
66
|
+
if (isStart) {
|
|
67
|
+
setScrollPosition('start');
|
|
68
|
+
} else if (isEnd) {
|
|
69
|
+
setScrollPosition('end');
|
|
70
|
+
} else {
|
|
71
|
+
setScrollPosition('center');
|
|
72
|
+
}
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
75
|
+
const onScroll = useMemo(
|
|
76
|
+
() =>
|
|
77
|
+
throttle((event: UIEvent<HTMLTableElement>) => {
|
|
78
|
+
const el = event.target as HTMLTableElement | undefined;
|
|
79
|
+
if (el) {
|
|
80
|
+
checkScrollPosition(el);
|
|
81
|
+
}
|
|
82
|
+
}, 100),
|
|
83
|
+
[checkScrollPosition],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const el = tableRef.current;
|
|
88
|
+
if (el) {
|
|
89
|
+
checkScrollPosition(el);
|
|
90
|
+
}
|
|
91
|
+
}, [checkScrollPosition]);
|
|
92
|
+
|
|
23
93
|
return (
|
|
24
94
|
<div {...classes('wrapper')}>
|
|
25
95
|
<div {...classes('content')}>
|
|
26
|
-
<
|
|
27
|
-
<table id={id} {...classes({ extra: ['o-table'] })} {...rest}>
|
|
96
|
+
<LeftScrollBorder show={scrollPosition === 'end' || scrollPosition === 'center'} {...classes('left-shadow')} />
|
|
97
|
+
<table ref={tableRef} id={id} onScroll={onScroll} {...classes({ extra: ['o-table'] })} {...rest}>
|
|
28
98
|
{children}
|
|
29
99
|
</table>
|
|
30
|
-
<
|
|
100
|
+
<RightScrollBorder
|
|
101
|
+
show={scrollPosition === 'start' || scrollPosition === 'center'}
|
|
102
|
+
{...classes('right-shadow')}
|
|
103
|
+
/>
|
|
31
104
|
</div>
|
|
32
105
|
</div>
|
|
33
106
|
);
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
// Move components to this file when they are migrated to typescript
|
|
11
11
|
|
|
12
12
|
export { default as SectionHeading } from './SectionHeading';
|
|
13
|
+
export {
|
|
14
|
+
ConceptNotionV2,
|
|
15
|
+
ImageEmbed,
|
|
16
|
+
AudioEmbed,
|
|
17
|
+
H5pEmbed,
|
|
18
|
+
ExternalEmbed,
|
|
19
|
+
IframeEmbed,
|
|
20
|
+
FootnoteEmbed,
|
|
21
|
+
BrightcoveEmbed,
|
|
22
|
+
ContentLinkEmbed,
|
|
23
|
+
RelatedContentEmbed,
|
|
24
|
+
ConceptEmbed,
|
|
25
|
+
ConceptListEmbed,
|
|
26
|
+
UnknownEmbed,
|
|
27
|
+
} from './Embed';
|
|
13
28
|
|
|
14
29
|
export {
|
|
15
30
|
ArticleByline,
|
|
@@ -39,11 +54,11 @@ export { default as Portrait } from './Portrait';
|
|
|
39
54
|
|
|
40
55
|
export { default as ContentLoader } from './ContentLoader';
|
|
41
56
|
|
|
42
|
-
export { default as RelatedArticleList, RelatedArticle } from './RelatedArticleList';
|
|
57
|
+
export { default as RelatedArticleList, RelatedArticle, RelatedArticleListV2 } from './RelatedArticleList';
|
|
43
58
|
|
|
44
59
|
export { ErrorResourceAccessDenied, default as ErrorMessage } from './ErrorMessage';
|
|
45
60
|
|
|
46
|
-
export { default as FileList, File } from './FileList';
|
|
61
|
+
export { default as FileList, File, FileListV2, FileV2, PdfFile } from './FileList';
|
|
47
62
|
|
|
48
63
|
export { BlogPost, BlogPostWrapper } from './BlogPosts';
|
|
49
64
|
|
|
@@ -64,7 +79,7 @@ export {
|
|
|
64
79
|
FrontpageProgramMenu,
|
|
65
80
|
} from './Frontpage';
|
|
66
81
|
|
|
67
|
-
export { default as FactBox } from './FactBox';
|
|
82
|
+
export { default as FactBox, FactBoxV2 } from './FactBox';
|
|
68
83
|
|
|
69
84
|
export { default as Image, ImageLink, makeSrcQueryString } from './Image';
|
|
70
85
|
export type { ImageCrop, ImageFocalPoint } from './Image';
|
|
@@ -232,7 +247,7 @@ export {
|
|
|
232
247
|
|
|
233
248
|
export { default as ContentCard } from './ContentCard';
|
|
234
249
|
|
|
235
|
-
export { default as CopyParagraphButton } from './CopyParagraphButton';
|
|
250
|
+
export { default as CopyParagraphButton, CopyParagraphButtonV2 } from './CopyParagraphButton';
|
|
236
251
|
|
|
237
252
|
export { default as ContentPlaceholder } from './ContentPlaceholder';
|
|
238
253
|
|
|
@@ -631,6 +631,7 @@ const messages = {
|
|
|
631
631
|
rightsholder: 'Rightsholder',
|
|
632
632
|
source: 'Source',
|
|
633
633
|
published: 'Published',
|
|
634
|
+
info: 'License information',
|
|
634
635
|
},
|
|
635
636
|
errorMessage: {
|
|
636
637
|
title: 'Oops, something went wrong',
|
|
@@ -765,6 +766,7 @@ const messages = {
|
|
|
765
766
|
hits: '{{count}} hits',
|
|
766
767
|
},
|
|
767
768
|
notions: {
|
|
769
|
+
tags: 'List and filters',
|
|
768
770
|
usedIn: 'Used in',
|
|
769
771
|
closeNotion: 'Close',
|
|
770
772
|
},
|
|
@@ -1139,6 +1141,9 @@ const messages = {
|
|
|
1139
1141
|
listView: 'List view',
|
|
1140
1142
|
detailView: 'Detailed listview',
|
|
1141
1143
|
shortView: 'Card view',
|
|
1144
|
+
sharedFolder: {
|
|
1145
|
+
info: 'This folder contains learning resources and tasks from NDLA, curated by a teacher.',
|
|
1146
|
+
},
|
|
1142
1147
|
myPage: {
|
|
1143
1148
|
noRecents: "You haven't added any resources yet. This is how you get started:",
|
|
1144
1149
|
imageAlt:
|
|
@@ -1230,6 +1235,11 @@ const messages = {
|
|
|
1230
1235
|
programme: {
|
|
1231
1236
|
grades: 'Grades',
|
|
1232
1237
|
},
|
|
1238
|
+
embed: {
|
|
1239
|
+
conceptListError: 'Failed to show concept list',
|
|
1240
|
+
linkError: 'Failed to show link.',
|
|
1241
|
+
unsupported: `Embed {{type}} not supported.`,
|
|
1242
|
+
},
|
|
1233
1243
|
};
|
|
1234
1244
|
|
|
1235
1245
|
export default messages;
|
|
@@ -630,6 +630,7 @@ const messages = {
|
|
|
630
630
|
published: 'Publiseringsdato',
|
|
631
631
|
rightsholder: 'Rettighetshaver',
|
|
632
632
|
source: 'Kilde',
|
|
633
|
+
info: 'Lisensinformasjon',
|
|
633
634
|
},
|
|
634
635
|
errorMessage: {
|
|
635
636
|
title: 'Ops, noe gikk galt',
|
|
@@ -764,6 +765,7 @@ const messages = {
|
|
|
764
765
|
hits: '{{count}} treff',
|
|
765
766
|
},
|
|
766
767
|
notions: {
|
|
768
|
+
tags: 'Liste og filter',
|
|
767
769
|
usedIn: 'Brukes i',
|
|
768
770
|
closeNotion: 'Lukk',
|
|
769
771
|
},
|
|
@@ -1137,6 +1139,9 @@ const messages = {
|
|
|
1137
1139
|
listView: 'Listevisning',
|
|
1138
1140
|
detailView: 'Detaljert listevisning',
|
|
1139
1141
|
shortView: 'Kort visning',
|
|
1142
|
+
sharedFolder: {
|
|
1143
|
+
info: 'Denne mappen inneholder fagstoff og oppgaver fra NDLA, samlet av en lærer. ',
|
|
1144
|
+
},
|
|
1140
1145
|
myPage: {
|
|
1141
1146
|
noRecents: 'Du har ikke lagt til noen ressurser ennå. Slik kommer du i gang:',
|
|
1142
1147
|
imageAlt:
|
|
@@ -1227,6 +1232,11 @@ const messages = {
|
|
|
1227
1232
|
programme: {
|
|
1228
1233
|
grades: 'Trinn',
|
|
1229
1234
|
},
|
|
1235
|
+
embed: {
|
|
1236
|
+
conceptListError: 'Klarte ikke å vise forklaringsliste',
|
|
1237
|
+
linkError: 'Klarte ikke å vise lenke.',
|
|
1238
|
+
unsupported: `Embed {{type}} er ikke støttet.`,
|
|
1239
|
+
},
|
|
1230
1240
|
};
|
|
1231
1241
|
|
|
1232
1242
|
export default messages;
|
|
@@ -630,6 +630,7 @@ const messages = {
|
|
|
630
630
|
rightsholder: 'Rettshavar',
|
|
631
631
|
source: 'Kjelde',
|
|
632
632
|
published: 'Publiseringsdato',
|
|
633
|
+
info: 'Lisensinformasjon',
|
|
633
634
|
},
|
|
634
635
|
errorMessage: {
|
|
635
636
|
title: 'Ops, noko gjekk gale',
|
|
@@ -764,6 +765,7 @@ const messages = {
|
|
|
764
765
|
hits: '{{count}} treff',
|
|
765
766
|
},
|
|
766
767
|
notions: {
|
|
768
|
+
tags: 'Liste og filter',
|
|
767
769
|
usedIn: 'Brukast i',
|
|
768
770
|
closeNotion: 'Lukk',
|
|
769
771
|
},
|
|
@@ -1137,6 +1139,9 @@ const messages = {
|
|
|
1137
1139
|
listView: 'Listevisning',
|
|
1138
1140
|
detailView: 'Detaljert listevisning',
|
|
1139
1141
|
shortView: 'Kortvisning',
|
|
1142
|
+
sharedFolder: {
|
|
1143
|
+
info: 'Denne mappa inneheld fagstoff og innhald frå NDLA, samla av ein lærar. ',
|
|
1144
|
+
},
|
|
1140
1145
|
myPage: {
|
|
1141
1146
|
noRecents: 'Du har ikkje lagt til nokon ressurar enno. Slik kjem du i gang:',
|
|
1142
1147
|
imageAlt:
|
|
@@ -1227,6 +1232,11 @@ const messages = {
|
|
|
1227
1232
|
programme: {
|
|
1228
1233
|
grades: 'Trinn',
|
|
1229
1234
|
},
|
|
1235
|
+
embed: {
|
|
1236
|
+
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1237
|
+
linkError: 'Klarte ikkje å vise lenke.',
|
|
1238
|
+
unsupported: `Embed {{type}} er ikkje støtta.`,
|
|
1239
|
+
},
|
|
1230
1240
|
};
|
|
1231
1241
|
|
|
1232
1242
|
export default messages;
|
|
@@ -631,6 +631,7 @@ const messages = {
|
|
|
631
631
|
published: 'Almmuhanbeaivi',
|
|
632
632
|
rightsholder: 'Vuoigatvuođaguoddi',
|
|
633
633
|
source: 'Gáldu',
|
|
634
|
+
info: 'Lisensinformasjon',
|
|
634
635
|
},
|
|
635
636
|
errorMessage: {
|
|
636
637
|
title: 'Ops, juoga manai boastut',
|
|
@@ -765,6 +766,7 @@ const messages = {
|
|
|
765
766
|
hits: '{{count}} deaivama',
|
|
766
767
|
},
|
|
767
768
|
notions: {
|
|
769
|
+
tags: 'Liste og filter',
|
|
768
770
|
usedIn: 'Adnojuvvo dás',
|
|
769
771
|
closeNotion: 'Govčča',
|
|
770
772
|
},
|
|
@@ -1138,7 +1140,9 @@ const messages = {
|
|
|
1138
1140
|
listView: 'Oppalašlistu',
|
|
1139
1141
|
detailView: 'Bienalaš oppalašlistu',
|
|
1140
1142
|
shortView: 'Oanehis listu',
|
|
1141
|
-
|
|
1143
|
+
sharedFolder: {
|
|
1144
|
+
info: 'Denne mappen inneholder fagstoff og oppgaver fra NDLA, samlet av en lærer. ',
|
|
1145
|
+
},
|
|
1142
1146
|
myPage: {
|
|
1143
1147
|
noRecents: 'Don it leat lasihan makkárge resurssa vel. Ná boađát johtui:',
|
|
1144
1148
|
imageAlt:
|
|
@@ -1229,6 +1233,11 @@ const messages = {
|
|
|
1229
1233
|
programme: {
|
|
1230
1234
|
grades: 'Trinn',
|
|
1231
1235
|
},
|
|
1236
|
+
embed: {
|
|
1237
|
+
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1238
|
+
linkError: 'Klarte ikkje å vise lenke.',
|
|
1239
|
+
unsupported: `Embed {{type}} er ikkje støtta.`,
|
|
1240
|
+
},
|
|
1232
1241
|
};
|
|
1233
1242
|
|
|
1234
1243
|
export default messages;
|
|
@@ -634,6 +634,7 @@ const messages = {
|
|
|
634
634
|
published: 'Publiseringsdato',
|
|
635
635
|
rightsholder: 'Rettighetshaver',
|
|
636
636
|
source: 'Gaaltije',
|
|
637
|
+
info: 'Lisensinformasjon',
|
|
637
638
|
},
|
|
638
639
|
errorMessage: {
|
|
639
640
|
title: 'Ovva, mij akt båajhtede sjïdtit',
|
|
@@ -768,6 +769,7 @@ const messages = {
|
|
|
768
769
|
hits: '{{count}} gaavnedimmieh',
|
|
769
770
|
},
|
|
770
771
|
notions: {
|
|
772
|
+
tags: 'Liste og filter',
|
|
771
773
|
usedIn: 'Brukes i',
|
|
772
774
|
closeNotion: 'Dahph',
|
|
773
775
|
},
|
|
@@ -1142,6 +1144,9 @@ const messages = {
|
|
|
1142
1144
|
listView: 'Listevisning',
|
|
1143
1145
|
detailView: 'Detaljert listevisning',
|
|
1144
1146
|
shortView: 'Kort visning',
|
|
1147
|
+
sharedFolder: {
|
|
1148
|
+
info: 'Denne mappen inneholder fagstoff og oppgaver fra NDLA, samlet av en lærer. ',
|
|
1149
|
+
},
|
|
1145
1150
|
myPage: {
|
|
1146
1151
|
noRecents: 'Du har ikkje lagt til nokon ressurar enno. Slik kjem du i gang:',
|
|
1147
1152
|
imageAlt:
|
|
@@ -1232,6 +1237,11 @@ const messages = {
|
|
|
1232
1237
|
programme: {
|
|
1233
1238
|
grades: 'Trinn',
|
|
1234
1239
|
},
|
|
1240
|
+
embed: {
|
|
1241
|
+
conceptListError: 'Klarte ikkje å vise forklaringsliste',
|
|
1242
|
+
linkError: 'Klarte ikkje å vise lenke.',
|
|
1243
|
+
unsupported: `Embed {{type}} er ikkje støtta.`,
|
|
1244
|
+
},
|
|
1235
1245
|
};
|
|
1236
1246
|
|
|
1237
1247
|
export default messages;
|