@ndla/ui 30.7.1 → 30.8.1
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/Figure/Figure.js +5 -7
- package/es/MyNdla/Resource/Folder.js +14 -11
- package/es/Resource/resourceComponents.js +11 -11
- package/es/locale/messages-en.js +1 -0
- package/es/locale/messages-nb.js +1 -0
- package/es/locale/messages-nn.js +1 -0
- package/es/locale/messages-se.js +1 -0
- package/es/locale/messages-sma.js +1 -0
- package/lib/Figure/Figure.d.ts +5 -1
- package/lib/Figure/Figure.js +4 -6
- package/lib/MyNdla/Resource/Folder.js +14 -11
- package/lib/Resource/resourceComponents.js +11 -11
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +1 -0
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +1 -0
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +1 -0
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +1 -0
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +1 -0
- package/package.json +10 -10
- package/src/Figure/Figure.tsx +8 -6
- package/src/MyNdla/Resource/Folder.tsx +7 -4
- package/src/Resource/resourceComponents.tsx +1 -0
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +1 -0
- package/src/locale/messages-nn.ts +1 -0
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +1 -0
package/src/Figure/Figure.tsx
CHANGED
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
// N.B These
|
|
9
|
+
// N.B These components is used to render static markup serverside
|
|
10
10
|
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
11
11
|
|
|
12
12
|
import React, { ReactNode } from 'react';
|
|
13
13
|
import BEMHelper from 'react-bem-helper';
|
|
14
14
|
import { isFunction as isFunctionHelper, parseMarkdown } from '@ndla/util';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { Link as LinkIcon } from '@ndla/icons/common';
|
|
17
16
|
import { LicenseByline } from '@ndla/licenses';
|
|
18
17
|
import SafeLink from '@ndla/safelink';
|
|
@@ -36,9 +35,8 @@ export const FigureCaption = ({
|
|
|
36
35
|
hideFigcaption,
|
|
37
36
|
hasLinkedVideo,
|
|
38
37
|
hideIconsAndAuthors,
|
|
38
|
+
linkedVideoMessages,
|
|
39
39
|
}: FigureCaptionProps) => {
|
|
40
|
-
const { t } = useTranslation();
|
|
41
|
-
|
|
42
40
|
return (
|
|
43
41
|
<figcaption {...classes('caption', hideFigcaption && !isMobile ? 'hidden-caption' : undefined)}>
|
|
44
42
|
{caption ? <div {...classes('info')}>{parseMarkdown(caption)}</div> : null}
|
|
@@ -66,8 +64,8 @@ export const FigureCaption = ({
|
|
|
66
64
|
size="small"
|
|
67
65
|
type="button"
|
|
68
66
|
{...classes('toggleAlternativeVideo')}>
|
|
69
|
-
<span className="original">{
|
|
70
|
-
<span className="alternative hidden">{
|
|
67
|
+
<span className="original">{linkedVideoMessages?.alternative}</span>
|
|
68
|
+
<span className="alternative hidden">{linkedVideoMessages?.original}</span>
|
|
71
69
|
</Button>
|
|
72
70
|
)}
|
|
73
71
|
</div>
|
|
@@ -122,6 +120,10 @@ interface FigureCaptionProps {
|
|
|
122
120
|
hideFigcaption?: boolean;
|
|
123
121
|
hasLinkedVideo?: boolean;
|
|
124
122
|
hideIconsAndAuthors?: boolean;
|
|
123
|
+
linkedVideoMessages?: {
|
|
124
|
+
original: string;
|
|
125
|
+
alternative: string;
|
|
126
|
+
};
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
const Figure = ({ children, type = 'full', resizeIframe, ...rest }: Props) => {
|
|
@@ -99,15 +99,18 @@ const FolderTitle = styled.h2`
|
|
|
99
99
|
}
|
|
100
100
|
`;
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
interface MenuWrapperProps {
|
|
103
|
+
hasMenuButton: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const MenuWrapper = styled.div<MenuWrapperProps>`
|
|
103
107
|
overflow: hidden;
|
|
104
108
|
display: flex;
|
|
105
109
|
flex-direction: row;
|
|
106
110
|
align-items: center;
|
|
107
111
|
gap: ${spacing.xsmall};
|
|
108
112
|
justify-content: space-between;
|
|
109
|
-
margin: -${spacing.nsmall};
|
|
110
|
-
margin-left: 0;
|
|
113
|
+
margin: -${spacing.nsmall} -${(props) => (props.hasMenuButton ? spacing.nsmall : 0)} -${spacing.nsmall} 0;
|
|
111
114
|
`;
|
|
112
115
|
|
|
113
116
|
const CountContainer = styled.div`
|
|
@@ -185,7 +188,7 @@ const Folder = ({ id, link, title, subFolders, subResources, type = 'list', menu
|
|
|
185
188
|
<FolderTitle title={title}>{title}</FolderTitle>
|
|
186
189
|
</StyledLink>
|
|
187
190
|
</TitleWrapper>
|
|
188
|
-
<MenuWrapper>
|
|
191
|
+
<MenuWrapper hasMenuButton={!!menuItems?.length}>
|
|
189
192
|
<CountContainer>
|
|
190
193
|
<Count layoutType={type} type={'folder'} count={subFolders} />
|
|
191
194
|
<Count layoutType={type} type={'resource'} count={subResources} />
|
|
@@ -1093,6 +1093,7 @@ const messages = {
|
|
|
1093
1093
|
alreadyFavourited: 'Already in my favourites',
|
|
1094
1094
|
alreadyInFolder: 'Already in folder. You can still save new tags.',
|
|
1095
1095
|
noFolderSelected: 'Select or create a new folder to save the resource.',
|
|
1096
|
+
examLockInfo: 'Editing content on Min NDLA is deactivated for pupils during the exam period.',
|
|
1096
1097
|
help: 'Help',
|
|
1097
1098
|
more: 'More options',
|
|
1098
1099
|
listView: 'List view',
|
|
@@ -1091,6 +1091,7 @@ const messages = {
|
|
|
1091
1091
|
alreadyFavourited: 'Allerede lagt til i mine favoritter',
|
|
1092
1092
|
alreadyInFolder: 'Finnes allerede i mappen. Du kan fortsatt lagre nye emneknagger.',
|
|
1093
1093
|
noFolderSelected: 'Velg eller opprett ny mappe for å lagre ressursen',
|
|
1094
|
+
examLockInfo: 'Redigering av innhold på Min NDLA er deaktivert for elever i eksamensperioden.',
|
|
1094
1095
|
help: 'Hjelp',
|
|
1095
1096
|
more: 'Flere valg',
|
|
1096
1097
|
listView: 'Listevisning',
|
|
@@ -1092,6 +1092,7 @@ const messages = {
|
|
|
1092
1092
|
alreadyFavourited: 'Allereie lagt til i mine favorittar',
|
|
1093
1093
|
alreadyInFolder: 'Finst allereie i mappa. Du kan fortsatt lagre nye emneknaggar.',
|
|
1094
1094
|
noFolderSelected: 'Velg eller opprett ny mappe for å lagre ressursen',
|
|
1095
|
+
examLockInfo: 'Redigering av innhald på Min NDLA er deaktivert for elevar i eksamensperioden.',
|
|
1095
1096
|
help: 'Hjelp',
|
|
1096
1097
|
more: 'Fleire val',
|
|
1097
1098
|
listView: 'Listevisning',
|
|
@@ -1092,6 +1092,7 @@ const messages = {
|
|
|
1092
1092
|
alreadyFavourited: 'Lea juo biddjon oiddohin',
|
|
1093
1093
|
alreadyInFolder: 'Gávdno juo máhpas. Sáhtát ain vurket ođđa fáddágilkoriid.',
|
|
1094
1094
|
noFolderSelected: 'Vállje dahje ráhkat ođđa máhpa vai seasttát resurssa',
|
|
1095
|
+
examLockInfo: 'Mu NDLA redigeren ii leat doaimmas ohppiide eksámenáigodagas.',
|
|
1095
1096
|
help: 'Veahkki',
|
|
1096
1097
|
more: 'Eanet válljejumit',
|
|
1097
1098
|
listView: 'Oppalašlistu',
|
|
@@ -1093,6 +1093,7 @@ const messages = {
|
|
|
1093
1093
|
alreadyFavourited: 'Allerede lagt til i mine favoritter',
|
|
1094
1094
|
alreadyInFolder: 'Finnes allerede i mappen. Du kan fortsatt lagre nye emneknagger.',
|
|
1095
1095
|
noFolderSelected: 'Velg eller opprett ny mappe for å lagre ressursen',
|
|
1096
|
+
examLockInfo: 'Redigering av innhold på Min NDLA er deaktivert for elever i eksamensperioden.',
|
|
1096
1097
|
help: 'Hjelp',
|
|
1097
1098
|
more: 'Flere valg',
|
|
1098
1099
|
listView: 'Listevisning',
|