@ndla/ui 37.0.1 → 37.0.4
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/ArticleByline.js +7 -5
- package/es/AudioPlayer/SpeechControl.js +13 -13
- package/es/ContentTypeBadge/ContentTypeBadge.js +5 -5
- package/es/Embed/AudioEmbed.js +3 -2
- package/es/Embed/BrightcoveEmbed.js +5 -4
- package/es/Embed/ConceptEmbed.js +11 -10
- package/es/Embed/ImageEmbed.js +2 -1
- package/es/Embed/conceptComponents.js +9 -7
- package/es/List/OrderedList.js +2 -6
- package/es/List/UnOrderedList.js +1 -1
- package/es/NDLAFilm/FilmMovieSearch.js +10 -8
- package/es/Resource/BlockResource.js +9 -9
- package/es/Resource/ListResource.js +13 -9
- package/es/Resource/resourceComponents.js +12 -12
- package/es/Typography/Heading.js +17 -7
- package/es/index.js +2 -1
- package/es/locale/messages-en.js +10 -2
- package/es/locale/messages-nb.js +10 -2
- package/es/locale/messages-nn.js +10 -2
- package/es/locale/messages-se.js +10 -2
- package/es/locale/messages-sma.js +10 -2
- package/es/model/ContentType.js +1 -1
- package/es/model/index.js +3 -2
- package/es/utils/resourceTypeColor.js +6 -0
- package/lib/Article/ArticleByline.js +7 -5
- package/lib/AudioPlayer/SpeechControl.js +14 -14
- package/lib/ContentTypeBadge/ContentTypeBadge.js +5 -5
- package/lib/Embed/AudioEmbed.js +3 -2
- package/lib/Embed/BrightcoveEmbed.js +5 -4
- package/lib/Embed/ConceptEmbed.js +11 -10
- package/lib/Embed/ImageEmbed.js +2 -1
- package/lib/Embed/conceptComponents.js +9 -7
- package/lib/List/OrderedList.js +1 -5
- package/lib/List/UnOrderedList.js +1 -1
- package/lib/NDLAFilm/FilmMovieSearch.js +10 -8
- package/lib/Resource/BlockResource.js +8 -8
- package/lib/Resource/ListResource.js +12 -8
- package/lib/Resource/resourceComponents.js +11 -11
- package/lib/Typography/Heading.d.ts +4 -5
- package/lib/Typography/Heading.js +17 -8
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -0
- package/lib/locale/messages-en.d.ts +8 -0
- package/lib/locale/messages-en.js +10 -2
- package/lib/locale/messages-nb.d.ts +8 -0
- package/lib/locale/messages-nb.js +10 -2
- package/lib/locale/messages-nn.d.ts +8 -0
- package/lib/locale/messages-nn.js +10 -2
- package/lib/locale/messages-se.d.ts +8 -0
- package/lib/locale/messages-se.js +10 -2
- package/lib/locale/messages-sma.d.ts +8 -0
- package/lib/locale/messages-sma.js +10 -2
- package/lib/model/ContentType.d.ts +1 -1
- package/lib/model/ContentType.js +3 -3
- package/lib/model/index.d.ts +1 -0
- package/lib/model/index.js +2 -1
- package/lib/utils/resourceTypeColor.js +6 -0
- package/package.json +3 -3
- package/src/Article/ArticleByline.tsx +2 -2
- package/src/AudioPlayer/SpeechControl.tsx +9 -26
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +5 -5
- package/src/Embed/AudioEmbed.tsx +7 -2
- package/src/Embed/BrightcoveEmbed.tsx +2 -1
- package/src/Embed/ConceptEmbed.tsx +2 -1
- package/src/Embed/ImageEmbed.tsx +2 -1
- package/src/Embed/conceptComponents.tsx +2 -1
- package/src/List/OrderedList.tsx +15 -16
- package/src/List/UnOrderedList.tsx +9 -2
- package/src/NDLAFilm/FilmMovieSearch.tsx +24 -25
- package/src/Resource/BlockResource.tsx +6 -2
- package/src/Resource/ListResource.tsx +7 -8
- package/src/Resource/resourceComponents.tsx +4 -2
- package/src/Typography/Heading.tsx +8 -8
- package/src/index.ts +2 -0
- package/src/locale/messages-en.ts +8 -0
- package/src/locale/messages-nb.ts +8 -0
- package/src/locale/messages-nn.ts +8 -0
- package/src/locale/messages-se.ts +8 -0
- package/src/locale/messages-sma.ts +8 -0
- package/src/model/ContentType.ts +1 -1
- package/src/model/index.ts +2 -1
- package/src/utils/resourceTypeColor.tsx +6 -0
package/src/List/OrderedList.tsx
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import styled from '@emotion/styled';
|
|
10
|
-
import { fonts, spacing
|
|
10
|
+
import { fonts, spacing } from '@ndla/core';
|
|
11
11
|
import { forwardRef, HTMLAttributes } from 'react';
|
|
12
12
|
|
|
13
13
|
export const generateListResets = () => {
|
|
@@ -21,24 +21,25 @@ export const generateListResets = () => {
|
|
|
21
21
|
return styles;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const listSpacing = {
|
|
25
|
-
xlarge: `${spacingUnit * 2.5}px`,
|
|
26
|
-
xxlarge: `${spacingUnit * 3}px`,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
24
|
const StyledOl = styled.ol`
|
|
30
25
|
margin-top: 0;
|
|
31
|
-
margin-left:
|
|
26
|
+
margin-left: ${spacing.medium};
|
|
32
27
|
${fonts.sizes('18px', '29px')};
|
|
33
28
|
list-style-type: none;
|
|
29
|
+
padding-left: ${spacing.medium} !important;
|
|
34
30
|
|
|
35
31
|
// Child ordered lists
|
|
36
32
|
ol {
|
|
37
|
-
padding-left: ${spacing.
|
|
33
|
+
padding-left: ${spacing.medium};
|
|
34
|
+
margin-left: 0;
|
|
38
35
|
}
|
|
39
36
|
// List item
|
|
40
37
|
li {
|
|
41
38
|
margin-top: ${spacing.normal};
|
|
39
|
+
|
|
40
|
+
p {
|
|
41
|
+
margin-bottom: ${spacing.normal} !important;
|
|
42
|
+
}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
&[data-type='letters'] {
|
|
@@ -49,7 +50,7 @@ const StyledOl = styled.ol`
|
|
|
49
50
|
position: absolute;
|
|
50
51
|
transform: translateX(-100%);
|
|
51
52
|
content: counter(item, upper-alpha) '.';
|
|
52
|
-
padding-right:
|
|
53
|
+
padding-right: ${spacing.nsmall};
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
> ol[data-type='letters'] {
|
|
@@ -57,7 +58,6 @@ const StyledOl = styled.ol`
|
|
|
57
58
|
content: counter(item, lower-alpha) '.';
|
|
58
59
|
}
|
|
59
60
|
ol[data-type='letters'] {
|
|
60
|
-
padding-left: ${spacing.normal};
|
|
61
61
|
> li:before {
|
|
62
62
|
content: counter(item, lower-roman) '.';
|
|
63
63
|
}
|
|
@@ -73,20 +73,19 @@ const StyledOl = styled.ol`
|
|
|
73
73
|
&:before {
|
|
74
74
|
position: absolute;
|
|
75
75
|
transform: translateX(-100%);
|
|
76
|
-
padding-right: 0.25em;
|
|
77
76
|
content: counters(item, '.') '.';
|
|
77
|
+
padding-right: ${spacing.nsmall};
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
> ol:not([data-type='letters']) {
|
|
81
|
-
padding-left: ${spacing.medium};
|
|
82
81
|
> li {
|
|
82
|
+
padding-left: ${spacing.nsmall};
|
|
83
83
|
> ol:not([data-type='letters']) {
|
|
84
|
-
padding-left: ${spacing.large};
|
|
85
84
|
> li {
|
|
85
|
+
padding-left: ${spacing.medium};
|
|
86
86
|
> ol:not([data-type='letters']) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
padding-left: ${listSpacing.xxlarge};
|
|
87
|
+
> li {
|
|
88
|
+
padding-left: ${spacing.large};
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
}
|
|
@@ -12,6 +12,8 @@ import { forwardRef, HTMLAttributes } from 'react';
|
|
|
12
12
|
import { generateListResets } from './OrderedList';
|
|
13
13
|
|
|
14
14
|
const StyledUl = styled.ul`
|
|
15
|
+
padding-left: ${spacing.small} !important;
|
|
16
|
+
margin-left: ${spacing.medium} !important;
|
|
15
17
|
> li {
|
|
16
18
|
::marker {
|
|
17
19
|
color: ${colors.brand.secondary};
|
|
@@ -19,15 +21,20 @@ const StyledUl = styled.ul`
|
|
|
19
21
|
}
|
|
20
22
|
ul {
|
|
21
23
|
list-style-image: none;
|
|
22
|
-
padding-left: ${spacing.
|
|
24
|
+
padding-left: ${spacing.small};
|
|
25
|
+
|
|
26
|
+
margin-left: 0 !important;
|
|
23
27
|
}
|
|
24
28
|
margin-top: 0;
|
|
25
|
-
margin-left: 0;
|
|
26
29
|
${fonts.sizes('18px', '29px')};
|
|
27
30
|
|
|
28
31
|
// List item
|
|
29
32
|
li {
|
|
33
|
+
padding-left: ${spacing.nsmall};
|
|
30
34
|
margin-top: ${spacing.normal};
|
|
35
|
+
p {
|
|
36
|
+
margin-bottom: ${spacing.normal} !important;
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
// Child unordered lists
|
|
@@ -27,32 +27,31 @@ const TopicNavigation = styled.div`
|
|
|
27
27
|
align-items: flex-start;
|
|
28
28
|
padding: 0 ${spacing.normal};
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
width: 50%;
|
|
46
|
-
}
|
|
47
|
-
a {
|
|
48
|
-
color: #fff;
|
|
49
|
-
&:hover,
|
|
50
|
-
&:focus {
|
|
51
|
-
color: ${colors.brand.light};
|
|
52
|
-
}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
const StyledUl = styled.ul`
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
list-style-type: none;
|
|
36
|
+
list-style-image: none;
|
|
37
|
+
li {
|
|
38
|
+
flex: 1;
|
|
39
|
+
width: 100%;
|
|
40
|
+
a {
|
|
41
|
+
color: ${colors.white};
|
|
42
|
+
&:hover,
|
|
43
|
+
&:focus-within {
|
|
44
|
+
color: ${colors.brand.light};
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
47
|
}
|
|
48
|
+
${mq.range({ from: breakpoints.tablet })} {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-rows: auto auto auto auto;
|
|
51
|
+
grid-template-columns: 1fr;
|
|
52
|
+
grid-auto-flow: column;
|
|
53
|
+
column-gap: ${spacing.normal};
|
|
54
|
+
}
|
|
56
55
|
`;
|
|
57
56
|
|
|
58
57
|
interface Props {
|
|
@@ -81,7 +80,7 @@ const FilmMovieSearch = ({
|
|
|
81
80
|
{`${t('ndlaFilm.subjectsInMovies')}:`}
|
|
82
81
|
</StyledHeadingH2>
|
|
83
82
|
<nav className="u-12/12 u-8/12@tablet" aria-labelledby={skipToContentId}>
|
|
84
|
-
<
|
|
83
|
+
<StyledUl>
|
|
85
84
|
{topics.map((topic) => (
|
|
86
85
|
<li key={topic.id}>
|
|
87
86
|
<SafeLink to={topic.path} key={topic.id}>
|
|
@@ -89,7 +88,7 @@ const FilmMovieSearch = ({
|
|
|
89
88
|
</SafeLink>
|
|
90
89
|
</li>
|
|
91
90
|
))}
|
|
92
|
-
</
|
|
91
|
+
</StyledUl>
|
|
93
92
|
</nav>
|
|
94
93
|
</TopicNavigation>
|
|
95
94
|
<CategorySelect
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
StyledContentIconWrapper,
|
|
23
23
|
} from './resourceComponents';
|
|
24
24
|
import ContentLoader from '../ContentLoader';
|
|
25
|
-
import { contentTypeMapping } from '../model/ContentType';
|
|
25
|
+
import { contentTypeMapping, resourceEmbedTypeMapping } from '../model/ContentType';
|
|
26
26
|
import { SettingsMenu } from '../MyNdla';
|
|
27
27
|
|
|
28
28
|
const BlockElementWrapper = styled.div`
|
|
@@ -174,7 +174,11 @@ const BlockResource = ({
|
|
|
174
174
|
<BlockImage
|
|
175
175
|
image={resourceImage}
|
|
176
176
|
loading={isLoading}
|
|
177
|
-
contentType={
|
|
177
|
+
contentType={
|
|
178
|
+
contentTypeMapping[firstResourceType] ??
|
|
179
|
+
resourceEmbedTypeMapping[firstResourceType] ??
|
|
180
|
+
contentTypeMapping['default']
|
|
181
|
+
}
|
|
178
182
|
/>
|
|
179
183
|
</ImageWrapper>
|
|
180
184
|
<BlockInfoWrapper>
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from './resourceComponents';
|
|
23
23
|
import ContentLoader from '../ContentLoader';
|
|
24
24
|
import ContentTypeBadge from '../ContentTypeBadge';
|
|
25
|
-
import { contentTypeMapping,
|
|
25
|
+
import { contentTypeMapping, resourceEmbedTypeMapping } from '../model/ContentType';
|
|
26
26
|
import { SettingsMenu } from '../MyNdla';
|
|
27
27
|
|
|
28
28
|
const ListResourceWrapper = styled.div`
|
|
@@ -131,14 +131,15 @@ interface ListResourceImageProps {
|
|
|
131
131
|
loading?: boolean;
|
|
132
132
|
type: 'normal' | 'compact';
|
|
133
133
|
contentType: string;
|
|
134
|
+
background?: boolean;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
const ListResourceImage = ({ resourceImage, loading, type, contentType }: ListResourceImageProps) => {
|
|
137
|
+
const ListResourceImage = ({ resourceImage, loading, type, contentType, background }: ListResourceImageProps) => {
|
|
137
138
|
if (!loading) {
|
|
138
139
|
if (resourceImage.src === '') {
|
|
139
140
|
return (
|
|
140
141
|
<StyledContentIconWrapper contentType={contentType}>
|
|
141
|
-
<ContentTypeBadge type={contentType} size="x-small" />
|
|
142
|
+
<ContentTypeBadge type={contentType} background={background} size="x-small" />
|
|
142
143
|
</StyledContentIconWrapper>
|
|
143
144
|
);
|
|
144
145
|
} else {
|
|
@@ -221,6 +222,7 @@ const ListResource = ({
|
|
|
221
222
|
const showDescription = description !== undefined;
|
|
222
223
|
const imageType = showDescription ? 'normal' : 'compact';
|
|
223
224
|
const firstContentType = resourceTypes?.[0]?.id ?? '';
|
|
225
|
+
const embedResourceType = resourceEmbedTypeMapping[firstContentType];
|
|
224
226
|
|
|
225
227
|
return (
|
|
226
228
|
<ListResourceWrapper id={id}>
|
|
@@ -229,11 +231,8 @@ const ListResource = ({
|
|
|
229
231
|
resourceImage={resourceImage}
|
|
230
232
|
loading={isLoading}
|
|
231
233
|
type={imageType}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
resourceTypeMapping[firstContentType] ??
|
|
235
|
-
contentTypeMapping['default']
|
|
236
|
-
}
|
|
234
|
+
background={!!embedResourceType}
|
|
235
|
+
contentType={contentTypeMapping[firstContentType] ?? embedResourceType ?? contentTypeMapping['default']}
|
|
237
236
|
/>
|
|
238
237
|
</ImageWrapper>
|
|
239
238
|
<TopicAndTitleWrapper>
|
|
@@ -15,7 +15,7 @@ import SafeLink from '@ndla/safelink';
|
|
|
15
15
|
import { useNavigate } from 'react-router-dom';
|
|
16
16
|
import { HashTag } from '@ndla/icons/common';
|
|
17
17
|
import resourceTypeColor from '../utils/resourceTypeColor';
|
|
18
|
-
import {
|
|
18
|
+
import { resourceEmbedTypeMapping } from '../model/ContentType';
|
|
19
19
|
|
|
20
20
|
export interface ResourceImageProps {
|
|
21
21
|
alt: string;
|
|
@@ -198,7 +198,9 @@ export const ResourceTypeList = ({ resourceTypes }: ResourceTypeListProps) => {
|
|
|
198
198
|
<StyledResourceTypeList aria-label={t('navigation.topics')}>
|
|
199
199
|
{resourceTypes.map((resource, i) => (
|
|
200
200
|
<StyledResourceListElement key={resource.id}>
|
|
201
|
-
{
|
|
201
|
+
{resourceEmbedTypeMapping[resource.id]
|
|
202
|
+
? t(`embed.type.${resourceEmbedTypeMapping[resource.id]}`)
|
|
203
|
+
: resource.name}
|
|
202
204
|
{i !== resourceTypes.length - 1 && <StyledTopicDivider aria-hidden="true">•</StyledTopicDivider>}
|
|
203
205
|
</StyledResourceListElement>
|
|
204
206
|
))}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { breakpoints, fonts, mq, spacing } from '@ndla/core';
|
|
11
|
-
import {
|
|
11
|
+
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
12
12
|
import { HeadingLevel } from '../types';
|
|
13
13
|
|
|
14
14
|
const style = css`
|
|
@@ -63,8 +63,8 @@ const style = css`
|
|
|
63
63
|
|
|
64
64
|
type AllowedElements = HeadingLevel | 'p' | 'span';
|
|
65
65
|
|
|
66
|
-
interface Props<T extends AllowedElements>
|
|
67
|
-
element:
|
|
66
|
+
interface Props<T extends AllowedElements> {
|
|
67
|
+
element: T;
|
|
68
68
|
headingStyle: 'h1' | 'h2' | 'h3' | 'list-title' | 'default';
|
|
69
69
|
serif?: boolean;
|
|
70
70
|
/**
|
|
@@ -75,19 +75,19 @@ interface Props<T extends AllowedElements> extends HTMLAttributes<T> {
|
|
|
75
75
|
*/
|
|
76
76
|
margin?: 'xlarge' | 'large' | 'normal' | 'small' | 'none';
|
|
77
77
|
children: ReactNode;
|
|
78
|
-
className?: string;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
const Heading = <T extends AllowedElements>({
|
|
82
|
-
element
|
|
81
|
+
element,
|
|
83
82
|
children,
|
|
84
83
|
headingStyle,
|
|
85
84
|
margin = 'normal',
|
|
86
85
|
serif,
|
|
87
|
-
|
|
88
|
-
}: Props<T>) => {
|
|
86
|
+
...rest
|
|
87
|
+
}: Props<T> & ComponentProps<T>) => {
|
|
88
|
+
const Element = element as ElementType;
|
|
89
89
|
return (
|
|
90
|
-
<Element css={style} data-serif={serif} data-style={headingStyle} data-margin={margin}
|
|
90
|
+
<Element css={style} data-serif={serif} data-style={headingStyle} data-margin={margin} {...rest}>
|
|
91
91
|
{children}
|
|
92
92
|
</Element>
|
|
93
93
|
);
|
package/src/index.ts
CHANGED
|
@@ -277,3 +277,5 @@ export { KeyFigure } from './KeyFigure';
|
|
|
277
277
|
export { default as ContactBlock } from './ContactBlock';
|
|
278
278
|
export type { HeartButtonType } from './Embed';
|
|
279
279
|
export { CampaignBlock } from './CampaignBlock';
|
|
280
|
+
export { Heading } from './Typography';
|
|
281
|
+
export type { HeadingLevel } from './types';
|
|
@@ -478,6 +478,7 @@ const messages = {
|
|
|
478
478
|
onlyTeacher: 'This resource is accessible only to teachers who are logged in with Feide.',
|
|
479
479
|
},
|
|
480
480
|
possiblyOutdated: 'The article is outdated',
|
|
481
|
+
references: 'References',
|
|
481
482
|
},
|
|
482
483
|
competenceGoals: {
|
|
483
484
|
competenceGoal: 'competence-goal',
|
|
@@ -694,6 +695,12 @@ const messages = {
|
|
|
694
695
|
'assessment-resources': 'Assessment resource',
|
|
695
696
|
topic: 'Topic',
|
|
696
697
|
'multidisciplinary-topic': 'Multidisciplinary case',
|
|
698
|
+
image: 'Image',
|
|
699
|
+
concept: 'Concept',
|
|
700
|
+
audio: 'Audio',
|
|
701
|
+
podcast: 'Podcast',
|
|
702
|
+
h5p: 'H5P',
|
|
703
|
+
video: 'Video',
|
|
697
704
|
},
|
|
698
705
|
modal: {
|
|
699
706
|
closeModal: 'Close',
|
|
@@ -990,6 +997,7 @@ const messages = {
|
|
|
990
997
|
},
|
|
991
998
|
},
|
|
992
999
|
audio: {
|
|
1000
|
+
play: 'Play',
|
|
993
1001
|
download: 'Download audio',
|
|
994
1002
|
reuse: 'Use audio',
|
|
995
1003
|
error: {
|
|
@@ -477,6 +477,7 @@ const messages = {
|
|
|
477
477
|
onlyTeacher: 'Denne ressursen er bare tilgjengelig for lærere som er pålogget med Feide.',
|
|
478
478
|
},
|
|
479
479
|
possiblyOutdated: 'Artikkelen er foreldet.',
|
|
480
|
+
references: 'Referanser',
|
|
480
481
|
},
|
|
481
482
|
competenceGoals: {
|
|
482
483
|
competenceGoal: 'kompetansemål',
|
|
@@ -693,6 +694,12 @@ const messages = {
|
|
|
693
694
|
'assessment-resources': 'Vurderingsressurs',
|
|
694
695
|
topic: 'Emne',
|
|
695
696
|
'multidisciplinary-topic': 'Tverrfaglig case',
|
|
697
|
+
image: 'Bilde',
|
|
698
|
+
concept: 'Forklaring',
|
|
699
|
+
audio: 'Lyd',
|
|
700
|
+
podcast: 'Podkast',
|
|
701
|
+
h5p: 'H5P',
|
|
702
|
+
video: 'Video',
|
|
696
703
|
},
|
|
697
704
|
modal: {
|
|
698
705
|
closeModal: 'Lukk',
|
|
@@ -989,6 +996,7 @@ const messages = {
|
|
|
989
996
|
},
|
|
990
997
|
},
|
|
991
998
|
audio: {
|
|
999
|
+
play: 'Spill av',
|
|
992
1000
|
download: 'Last ned lydfil',
|
|
993
1001
|
reuse: 'Bruk lydfil',
|
|
994
1002
|
error: {
|
|
@@ -477,6 +477,7 @@ const messages = {
|
|
|
477
477
|
onlyTeacher: 'Denne ressursen er berre tilgjengeleg for lærarar som er pålogga med Feide.',
|
|
478
478
|
},
|
|
479
479
|
possiblyOutdated: 'Artikkelen er foreldet.',
|
|
480
|
+
references: 'Referanser',
|
|
480
481
|
},
|
|
481
482
|
competenceGoals: {
|
|
482
483
|
competenceGoal: 'kompetansemål',
|
|
@@ -693,6 +694,12 @@ const messages = {
|
|
|
693
694
|
'assessment-resources': 'Vurderingsressurs',
|
|
694
695
|
topic: 'Emne',
|
|
695
696
|
'multidisciplinary-topic': 'Tverrfagleg case',
|
|
697
|
+
image: 'Bilde',
|
|
698
|
+
concept: 'Forklaring',
|
|
699
|
+
audio: 'Lyd',
|
|
700
|
+
podcast: 'Podkast',
|
|
701
|
+
h5p: 'H5P',
|
|
702
|
+
video: 'Video',
|
|
696
703
|
},
|
|
697
704
|
modal: {
|
|
698
705
|
closeModal: 'Lukk',
|
|
@@ -989,6 +996,7 @@ const messages = {
|
|
|
989
996
|
},
|
|
990
997
|
},
|
|
991
998
|
audio: {
|
|
999
|
+
play: 'Spill av',
|
|
992
1000
|
download: 'Last ned lydfil',
|
|
993
1001
|
reuse: 'Bruk lydfil',
|
|
994
1002
|
error: {
|
|
@@ -478,6 +478,7 @@ const messages = {
|
|
|
478
478
|
onlyTeacher: 'Dát resursa lea dušše olamuttus oahpaheddjiide geat leat Feide bokte sisaloggejuvvon.',
|
|
479
479
|
},
|
|
480
480
|
possiblyOutdated: 'Artihkal lea boarásmuvvan.',
|
|
481
|
+
references: 'Referanser',
|
|
481
482
|
},
|
|
482
483
|
competenceGoals: {
|
|
483
484
|
competenceGoal: 'Gealbomihttomearri',
|
|
@@ -694,6 +695,12 @@ const messages = {
|
|
|
694
695
|
'assessment-resources': 'Árvoštallanresursa',
|
|
695
696
|
topic: 'Fáddá',
|
|
696
697
|
'multidisciplinary-topic': 'Fágaidrasttideaddji fáddá',
|
|
698
|
+
image: 'Bilde',
|
|
699
|
+
concept: 'Forklaring',
|
|
700
|
+
audio: 'Lyd',
|
|
701
|
+
podcast: 'Podkast',
|
|
702
|
+
h5p: 'H5P',
|
|
703
|
+
video: 'Video',
|
|
697
704
|
},
|
|
698
705
|
modal: {
|
|
699
706
|
closeModal: 'Govčča',
|
|
@@ -990,6 +997,7 @@ const messages = {
|
|
|
990
997
|
},
|
|
991
998
|
},
|
|
992
999
|
audio: {
|
|
1000
|
+
play: 'Spill av',
|
|
993
1001
|
download: 'Viečča jietnafiilla',
|
|
994
1002
|
reuse: 'Geavat jietnafiilla',
|
|
995
1003
|
error: {
|
|
@@ -478,6 +478,7 @@ const messages = {
|
|
|
478
478
|
onlyTeacher: 'Daate vierhtie ajve dïllesisnie lohkehtæjjide mah tjaangeme Feidine.',
|
|
479
479
|
},
|
|
480
480
|
possiblyOutdated: 'Artikkelen er foreldet.',
|
|
481
|
+
references: 'Referanser',
|
|
481
482
|
},
|
|
482
483
|
competenceGoals: {
|
|
483
484
|
competenceGoal: 'maahtoe-ulmie',
|
|
@@ -697,6 +698,12 @@ const messages = {
|
|
|
697
698
|
'assessment-resources': 'Vuarjasjimmievierhtie',
|
|
698
699
|
topic: 'Teema',
|
|
699
700
|
'multidisciplinary-topic': 'Tverrfaglig case',
|
|
701
|
+
image: 'Bilde',
|
|
702
|
+
concept: 'Forklaring',
|
|
703
|
+
audio: 'Lyd',
|
|
704
|
+
podcast: 'Podkast',
|
|
705
|
+
h5p: 'H5P',
|
|
706
|
+
video: 'Video',
|
|
700
707
|
},
|
|
701
708
|
modal: {
|
|
702
709
|
closeModal: 'Dahph',
|
|
@@ -993,6 +1000,7 @@ const messages = {
|
|
|
993
1000
|
},
|
|
994
1001
|
},
|
|
995
1002
|
audio: {
|
|
1003
|
+
play: 'Spill av',
|
|
996
1004
|
download: 'Veedtjh tjoeje-fijlem',
|
|
997
1005
|
reuse: 'Nuhtjh tjoeje-fijlem',
|
|
998
1006
|
error: {
|
package/src/model/ContentType.ts
CHANGED
|
@@ -57,7 +57,7 @@ export const contentTypeMapping: Record<string, string> = {
|
|
|
57
57
|
default: SUBJECT_MATERIAL,
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
export const
|
|
60
|
+
export const resourceEmbedTypeMapping: Record<string, string> = {
|
|
61
61
|
image: 'image',
|
|
62
62
|
video: 'video',
|
|
63
63
|
concept: 'concept',
|
package/src/model/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { contentTypes, contentTypeMapping } from './ContentType';
|
|
9
|
+
import { contentTypes, contentTypeMapping, resourceEmbedTypeMapping } from './ContentType';
|
|
10
10
|
import * as subjectCategories from './SubjectCategories';
|
|
11
11
|
import * as subjectTypes from './SubjectTypes';
|
|
12
12
|
|
|
@@ -15,6 +15,7 @@ const model = {
|
|
|
15
15
|
subjectCategories,
|
|
16
16
|
subjectTypes,
|
|
17
17
|
contentTypeMapping,
|
|
18
|
+
resourceEmbedTypeMapping,
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export default model;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { colors } from '@ndla/core';
|
|
10
10
|
import constants from '../model';
|
|
11
|
+
import { resourceEmbedTypeMapping } from '../model/ContentType';
|
|
11
12
|
const { contentTypes } = constants;
|
|
12
13
|
|
|
13
14
|
export const resourceTypeColor = (type: string) => {
|
|
@@ -30,6 +31,11 @@ export const resourceTypeColor = (type: string) => {
|
|
|
30
31
|
return colors.learningPath.light;
|
|
31
32
|
case contentTypes.MULTIDISCIPLINARY_TOPIC:
|
|
32
33
|
return colors.learningPath.background;
|
|
34
|
+
case resourceEmbedTypeMapping.image:
|
|
35
|
+
case resourceEmbedTypeMapping.video:
|
|
36
|
+
case resourceEmbedTypeMapping.concept:
|
|
37
|
+
case resourceEmbedTypeMapping.audio:
|
|
38
|
+
return colors.brand.greyLight;
|
|
33
39
|
default:
|
|
34
40
|
return '';
|
|
35
41
|
}
|