@ndla/ui 3.2.2 → 3.2.6
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 +4 -4
- package/es/Article/ArticleNotions.js +5 -5
- package/es/Article/ArticleSideBar.js +42 -14
- package/es/Figure/Figure.js +5 -1
- package/es/Figure/FigureLicense.js +1 -1
- package/es/Filter/FilterButtons.js +9 -9
- package/es/Footer/FooterPrivacy.js +2 -2
- package/es/Image/Image.js +1 -1
- package/es/Image/ImageLink.js +1 -1
- package/es/ResourcesWrapper/ResourcesTitle.js +0 -4
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +12 -25
- package/es/ResourcesWrapper/ResourcesWrapper.js +2 -11
- package/es/Table/Table.js +0 -9
- package/es/Topic/Topic.js +21 -22
- package/es/User/AuthModal.js +8 -8
- package/es/index-javascript.js +0 -2
- package/es/index.js +2 -0
- package/es/locale/messages-en.js +2 -2
- package/es/locale/messages-nb.js +2 -2
- package/es/locale/messages-nn.js +2 -2
- package/lib/Article/ArticleByline.js +4 -4
- package/lib/Article/ArticleNotions.js +5 -5
- package/lib/Article/ArticleSideBar.d.ts +2 -1
- package/lib/Article/ArticleSideBar.js +43 -14
- package/lib/Figure/Figure.d.ts +6 -7
- package/lib/Figure/Figure.js +5 -1
- package/lib/Figure/FigureLicense.js +1 -1
- package/lib/Filter/FilterButtons.js +9 -9
- package/lib/Footer/FooterPrivacy.js +2 -2
- package/lib/Hero/Hero.d.ts +2 -1
- package/lib/Hero/index.d.ts +1 -0
- package/lib/Image/Image.d.ts +10 -1
- package/lib/Image/Image.js +1 -1
- package/lib/Image/ImageLink.d.ts +1 -1
- package/lib/Image/ImageLink.js +1 -1
- package/lib/Image/index.d.ts +1 -0
- package/lib/Masthead/MastheadSearchModal.d.ts +1 -1
- package/lib/MessageBox/MessageBox.d.ts +1 -1
- package/lib/ResourcesWrapper/ResourcesTitle.d.ts +13 -0
- package/lib/ResourcesWrapper/ResourcesTitle.js +0 -5
- package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +13 -0
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +11 -26
- package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +18 -0
- package/lib/ResourcesWrapper/ResourcesWrapper.js +2 -12
- package/lib/ResourcesWrapper/index.d.ts +11 -0
- package/lib/Table/Table.d.ts +14 -0
- package/lib/Table/Table.js +0 -10
- package/lib/Table/index.d.ts +9 -0
- package/lib/Topic/Topic.d.ts +1 -1
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/TranslationBox.d.ts +1 -1
- package/lib/User/AuthModal.d.ts +2 -2
- package/lib/User/AuthModal.js +8 -8
- package/lib/index-javascript.js +3 -31
- package/lib/index.d.ts +2 -0
- package/lib/index.js +32 -0
- package/lib/locale/messages-en.js +2 -2
- package/lib/locale/messages-nb.js +2 -2
- package/lib/locale/messages-nn.js +2 -2
- package/lib/types.d.ts +0 -10
- package/package.json +5 -5
- package/src/Article/ArticleByline.tsx +1 -1
- package/src/Article/ArticleNotions.tsx +1 -1
- package/src/Article/ArticleSideBar.tsx +31 -3
- package/src/Figure/Figure.tsx +10 -7
- package/src/Figure/FigureLicense.tsx +1 -1
- package/src/Filter/FilterButtons.tsx +1 -1
- package/src/Footer/FooterPrivacy.tsx +1 -1
- package/src/Hero/Hero.tsx +14 -12
- package/src/Hero/index.ts +2 -0
- package/src/Image/Image.tsx +11 -1
- package/src/Image/ImageLink.tsx +1 -1
- package/src/Image/index.ts +1 -0
- package/src/ResourcesWrapper/{ResourcesTitle.jsx → ResourcesTitle.tsx} +5 -7
- package/src/ResourcesWrapper/{ResourcesTopicTitle.jsx → ResourcesTopicTitle.tsx} +23 -22
- package/src/ResourcesWrapper/{ResourcesWrapper.jsx → ResourcesWrapper.tsx} +9 -14
- package/src/ResourcesWrapper/{index.js → index.ts} +0 -0
- package/src/Table/{Table.jsx → Table.tsx} +14 -12
- package/src/Table/{index.js → index.ts} +0 -0
- package/src/Topic/Topic.tsx +1 -3
- package/src/Translation/TranslationBox.tsx +1 -1
- package/src/User/AuthModal.tsx +3 -3
- package/src/index-javascript.js +0 -2
- package/src/index.ts +4 -0
- package/src/locale/messages-en.ts +2 -2
- package/src/locale/messages-nb.ts +2 -2
- package/src/locale/messages-nn.ts +2 -2
- package/src/types.ts +0 -12
package/src/Figure/Figure.tsx
CHANGED
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
import React, { ReactNode } from 'react';
|
|
13
13
|
import BEMHelper from 'react-bem-helper';
|
|
14
|
-
import { isFunction, parseMarkdown } from '@ndla/util';
|
|
14
|
+
import { isFunction as isFunctionHelper, parseMarkdown } from '@ndla/util';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { Link as LinkIcon } from '@ndla/icons/common';
|
|
17
17
|
import { LicenseByline } from '@ndla/licenses';
|
|
18
18
|
import SafeLink from '@ndla/safelink';
|
|
19
19
|
//@ts-ignore
|
|
20
20
|
import Button from '@ndla/button';
|
|
21
|
-
import { License } from '../types';
|
|
22
21
|
|
|
23
22
|
const classes = new BEMHelper({
|
|
24
23
|
name: 'figure',
|
|
@@ -91,7 +90,7 @@ export const FigureCaption = ({
|
|
|
91
90
|
);
|
|
92
91
|
};
|
|
93
92
|
|
|
94
|
-
export interface FigureLicense
|
|
93
|
+
export interface FigureLicense {
|
|
95
94
|
short: string;
|
|
96
95
|
title: string;
|
|
97
96
|
userFriendlyTitle: string;
|
|
@@ -103,7 +102,7 @@ export interface FigureLicense extends License {
|
|
|
103
102
|
|
|
104
103
|
interface FigureCaptionProps {
|
|
105
104
|
figureId: string;
|
|
106
|
-
id
|
|
105
|
+
id?: string;
|
|
107
106
|
caption?: string;
|
|
108
107
|
reuseLabel: string;
|
|
109
108
|
licenseRights: string[];
|
|
@@ -129,10 +128,14 @@ const Figure = ({ children, type = 'full', resizeIframe, ...rest }: Props) => {
|
|
|
129
128
|
);
|
|
130
129
|
};
|
|
131
130
|
|
|
131
|
+
const isFunction = (children: Function | ReactNode): children is Function => {
|
|
132
|
+
return isFunctionHelper(children);
|
|
133
|
+
};
|
|
134
|
+
|
|
132
135
|
interface Props {
|
|
133
|
-
id
|
|
134
|
-
children: (params: { typeClass: string }) => ReactNode
|
|
135
|
-
type
|
|
136
|
+
id?: string;
|
|
137
|
+
children: ReactNode | ((params: { typeClass: string }) => ReactNode);
|
|
138
|
+
type?: 'full' | 'full-column' | 'left' | 'small-left' | 'right' | 'small-right' | 'xsmall-right' | 'xsmall-left';
|
|
136
139
|
resizeIframe?: boolean;
|
|
137
140
|
noFigcaption?: boolean;
|
|
138
141
|
}
|
|
@@ -67,7 +67,7 @@ interface Props {
|
|
|
67
67
|
|
|
68
68
|
export const FigureLicenseByline = ({ messages, license, locale }: Props) => (
|
|
69
69
|
<>
|
|
70
|
-
<LicenseDescription key="byline" highlightCC locale={locale} messages={messages} licenseRights={license.rights}
|
|
70
|
+
<LicenseDescription key="byline" highlightCC locale={locale} messages={messages} licenseRights={license.rights} />
|
|
71
71
|
<a key="link" {...classLicenses('link')} target="_blank" rel="noopener noreferrer" href={license.url}>
|
|
72
72
|
{license.linkText}
|
|
73
73
|
</a>
|
|
@@ -143,7 +143,7 @@ export const FilterButtons = ({ heading, items, onFilterToggle, onRemoveAllFilte
|
|
|
143
143
|
</Button>
|
|
144
144
|
</StyledButtonElementWrapper>
|
|
145
145
|
}>
|
|
146
|
-
{(onClose: void) => (
|
|
146
|
+
{(onClose: () => void) => (
|
|
147
147
|
<>
|
|
148
148
|
<ModalHeader modifier={['left-align']}>
|
|
149
149
|
<h1>{heading}</h1>
|
|
@@ -71,7 +71,7 @@ const StyledFooterText = styled.div`
|
|
|
71
71
|
const FooterPrivacy: React.FunctionComponent<FooterPrivacyProps> = ({ lang, label }) => (
|
|
72
72
|
<StyledFooterText>
|
|
73
73
|
<Modal activateButton={<StyledPrivacyButton type="button">{label}</StyledPrivacyButton>} size="fullscreen">
|
|
74
|
-
{(onClose: void) => (
|
|
74
|
+
{(onClose: () => void) => (
|
|
75
75
|
<OneColumn cssModifier="medium">
|
|
76
76
|
<ModalHeader>
|
|
77
77
|
<ModalCloseButton onClick={onClose} title="Lukk" />
|
package/src/Hero/Hero.tsx
CHANGED
|
@@ -16,20 +16,22 @@ const classes = new BEMHelper({
|
|
|
16
16
|
prefix: 'c-',
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
export type HeroContentType =
|
|
20
|
+
| 'subject-material'
|
|
21
|
+
| 'tasks-and-activities'
|
|
22
|
+
| 'assessment-resources'
|
|
23
|
+
| 'subject'
|
|
24
|
+
| 'external-learning-resources'
|
|
25
|
+
| 'source-material'
|
|
26
|
+
| 'learning-path'
|
|
27
|
+
| 'topic'
|
|
28
|
+
| 'beta'
|
|
29
|
+
| 'ndla-film'
|
|
30
|
+
| 'ndla-film has-image';
|
|
31
|
+
|
|
19
32
|
interface HeroProps {
|
|
20
33
|
children?: ReactNode;
|
|
21
|
-
contentType
|
|
22
|
-
| 'subject-material'
|
|
23
|
-
| 'tasks-and-activities'
|
|
24
|
-
| 'assessment-resources'
|
|
25
|
-
| 'subject'
|
|
26
|
-
| 'external-learning-resources'
|
|
27
|
-
| 'source-material'
|
|
28
|
-
| 'learning-path'
|
|
29
|
-
| 'topic'
|
|
30
|
-
| 'beta'
|
|
31
|
-
| 'ndla-film'
|
|
32
|
-
| 'ndla-film has-image';
|
|
34
|
+
contentType?: HeroContentType;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export const Hero = ({ children, contentType }: HeroProps) => (
|
package/src/Hero/index.ts
CHANGED
package/src/Image/Image.tsx
CHANGED
|
@@ -10,7 +10,17 @@ import React, { ReactNode } from 'react';
|
|
|
10
10
|
import defined from 'defined';
|
|
11
11
|
import styled from '@emotion/styled';
|
|
12
12
|
import LazyLoadImage from './LazyLoadImage';
|
|
13
|
-
|
|
13
|
+
export interface ImageCrop {
|
|
14
|
+
startX: number;
|
|
15
|
+
startY: number;
|
|
16
|
+
endX: number;
|
|
17
|
+
endY: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ImageFocalPoint {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}
|
|
14
24
|
|
|
15
25
|
export const makeSrcQueryString = (width: number | undefined, crop?: ImageCrop, focalPoint?: ImageFocalPoint) => {
|
|
16
26
|
const widthParams = width && `width=${width}`;
|
package/src/Image/ImageLink.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import React, { ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { makeSrcQueryString } from './Image';
|
|
12
|
-
import { ImageCrop, ImageFocalPoint } from '
|
|
12
|
+
import { ImageCrop, ImageFocalPoint } from '.';
|
|
13
13
|
|
|
14
14
|
const StyledLink = styled.a`
|
|
15
15
|
box-shadow: inset 0 0;
|
package/src/Image/index.ts
CHANGED
|
@@ -6,20 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
11
10
|
import { classes } from './ResourcesWrapper';
|
|
12
11
|
import { SubjectBadge } from '../ContentTypeBadge';
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
interface Props {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
const ResourceTitle = ({ children }: Props) => (
|
|
15
17
|
<div {...classes('title-wrapper')}>
|
|
16
18
|
<SubjectBadge size="large" background />
|
|
17
19
|
<h1 {...classes('title')}>{children}</h1>
|
|
18
20
|
</div>
|
|
19
21
|
);
|
|
20
22
|
|
|
21
|
-
ResourceTitle.propTypes = {
|
|
22
|
-
children: PropTypes.node.isRequired,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
23
|
export default ResourceTitle;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { Fragment, ReactNode } from 'react';
|
|
3
2
|
import { css } from '@emotion/core';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
5
4
|
import { spacing } from '@ndla/core';
|
|
6
5
|
import { HelpCircleDual } from '@ndla/icons/common';
|
|
6
|
+
//@ts-ignore
|
|
7
7
|
import Modal, { ModalBody, ModalHeader, ModalCloseButton } from '@ndla/modal';
|
|
8
8
|
import Tooltip from '@ndla/tooltip';
|
|
9
9
|
import { Switch } from '@ndla/switch';
|
|
@@ -11,7 +11,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
11
11
|
|
|
12
12
|
import { classes } from './ResourcesWrapper';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface HelpIconProps {
|
|
15
|
+
invertedStyle: boolean;
|
|
16
|
+
}
|
|
17
|
+
const HelpIcon = ({ invertedStyle }: HelpIconProps) => (
|
|
15
18
|
<div {...classes('topic-title-icon', { invertedStyle })}>
|
|
16
19
|
<HelpCircleDual className={`c-icon--22 u-margin-left-tiny ${classes('icon').className}`} />
|
|
17
20
|
</div>
|
|
@@ -37,14 +40,25 @@ const TooltipButton = styled.button`
|
|
|
37
40
|
cursor: pointer;
|
|
38
41
|
`;
|
|
39
42
|
|
|
43
|
+
interface Props {
|
|
44
|
+
title?: string;
|
|
45
|
+
toggleAdditionalResources: () => void;
|
|
46
|
+
hasAdditionalResources: boolean;
|
|
47
|
+
showAdditionalResources: boolean;
|
|
48
|
+
invertedStyle?: boolean;
|
|
49
|
+
messages: {
|
|
50
|
+
label: string;
|
|
51
|
+
additionalFilterLabel: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
40
54
|
const ResourcesTopicTitle = ({
|
|
41
55
|
title,
|
|
42
56
|
hasAdditionalResources,
|
|
43
57
|
toggleAdditionalResources,
|
|
44
58
|
showAdditionalResources,
|
|
45
59
|
messages,
|
|
46
|
-
invertedStyle,
|
|
47
|
-
}) => {
|
|
60
|
+
invertedStyle = false,
|
|
61
|
+
}: Props) => {
|
|
48
62
|
const { t } = useTranslation();
|
|
49
63
|
// Fix for heading while title not required when ready.
|
|
50
64
|
let heading;
|
|
@@ -70,7 +84,7 @@ const ResourcesTopicTitle = ({
|
|
|
70
84
|
/>
|
|
71
85
|
<Modal
|
|
72
86
|
narrow
|
|
73
|
-
wrapperFunctionForButton={(activateButton) => (
|
|
87
|
+
wrapperFunctionForButton={(activateButton: ReactNode) => (
|
|
74
88
|
<TooltipWrapper>
|
|
75
89
|
<Tooltip tooltip={t('resource.dialogTooltip')}>{activateButton}</Tooltip>
|
|
76
90
|
</TooltipWrapper>
|
|
@@ -80,8 +94,8 @@ const ResourcesTopicTitle = ({
|
|
|
80
94
|
<HelpIcon invertedStyle={invertedStyle} />
|
|
81
95
|
</TooltipButton>
|
|
82
96
|
}>
|
|
83
|
-
{(onClose) => (
|
|
84
|
-
|
|
97
|
+
{(onClose: () => void) => (
|
|
98
|
+
<>
|
|
85
99
|
<ModalHeader>
|
|
86
100
|
<ModalCloseButton title={t('modal.closeModal')} onClick={onClose} />
|
|
87
101
|
</ModalHeader>
|
|
@@ -91,7 +105,7 @@ const ResourcesTopicTitle = ({
|
|
|
91
105
|
<p>{t('resource.dialogText1')}</p>
|
|
92
106
|
<p>{t('resource.dialogText2')}</p>
|
|
93
107
|
</ModalBody>
|
|
94
|
-
|
|
108
|
+
</>
|
|
95
109
|
)}
|
|
96
110
|
</Modal>
|
|
97
111
|
</div>
|
|
@@ -100,17 +114,4 @@ const ResourcesTopicTitle = ({
|
|
|
100
114
|
);
|
|
101
115
|
};
|
|
102
116
|
|
|
103
|
-
/* eslint-disable no-console */
|
|
104
|
-
ResourcesTopicTitle.propTypes = {
|
|
105
|
-
title: PropTypes.string, // Should be required
|
|
106
|
-
toggleAdditionalResources: PropTypes.func.isRequired,
|
|
107
|
-
hasAdditionalResources: PropTypes.bool.isRequired,
|
|
108
|
-
showAdditionalResources: PropTypes.bool.isRequired,
|
|
109
|
-
invertedStyle: PropTypes.bool,
|
|
110
|
-
messages: PropTypes.shape({
|
|
111
|
-
label: PropTypes.string.isRequired,
|
|
112
|
-
additionalFilterLabel: PropTypes.string.isRequired,
|
|
113
|
-
}).isRequired,
|
|
114
|
-
};
|
|
115
|
-
|
|
116
117
|
export default ResourcesTopicTitle;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
11
10
|
import BEMHelper from 'react-bem-helper';
|
|
12
11
|
|
|
13
12
|
export const classes = new BEMHelper({
|
|
@@ -15,22 +14,18 @@ export const classes = new BEMHelper({
|
|
|
15
14
|
prefix: 'c-',
|
|
16
15
|
});
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
interface Props {
|
|
18
|
+
header?: ReactNode;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
subjectPage?: boolean;
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const ResourcesWrapper = ({ children, header, subjectPage = false, id }: Props) => (
|
|
19
25
|
<section {...classes('', { subjectPage })} id={id}>
|
|
20
26
|
{header}
|
|
21
27
|
<div {...classes('content')}>{children}</div>
|
|
22
28
|
</section>
|
|
23
29
|
);
|
|
24
30
|
|
|
25
|
-
ResourcesWrapper.propTypes = {
|
|
26
|
-
header: PropTypes.node,
|
|
27
|
-
children: PropTypes.node.isRequired,
|
|
28
|
-
subjectPage: PropTypes.bool,
|
|
29
|
-
id: PropTypes.string,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
ResourcesWrapper.defaultProps = {
|
|
33
|
-
subjectPage: false,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
31
|
export default ResourcesWrapper;
|
|
File without changes
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
9
|
+
import React, { ReactNode } from 'react';
|
|
11
10
|
import BEMHelper from 'react-bem-helper';
|
|
12
11
|
import { ZoomOutMap } from '@ndla/icons/common';
|
|
13
12
|
|
|
@@ -16,7 +15,19 @@ import Dialog from '../Dialog';
|
|
|
16
15
|
|
|
17
16
|
const classes = BEMHelper('c-table');
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
interface Props {
|
|
19
|
+
id?: string;
|
|
20
|
+
messages: {
|
|
21
|
+
dialogCloseButton: string;
|
|
22
|
+
expandButtonLabel: string;
|
|
23
|
+
};
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
dangerouslySetInnerHTML?: {
|
|
26
|
+
__html: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Table = ({ children, messages, id, ...rest }: Props) => {
|
|
20
31
|
const tableId = id || uuid();
|
|
21
32
|
const dialogId = `dialog-${tableId}`;
|
|
22
33
|
|
|
@@ -55,13 +66,4 @@ const Table = ({ children, messages, id, ...rest }) => {
|
|
|
55
66
|
);
|
|
56
67
|
};
|
|
57
68
|
|
|
58
|
-
Table.propTypes = {
|
|
59
|
-
id: PropTypes.string,
|
|
60
|
-
messages: PropTypes.shape({
|
|
61
|
-
dialogCloseButton: PropTypes.string.isRequired,
|
|
62
|
-
expandButtonLabel: PropTypes.string.isRequired,
|
|
63
|
-
}).isRequired,
|
|
64
|
-
children: PropTypes.node,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
69
|
export default Table;
|
|
File without changes
|
package/src/Topic/Topic.tsx
CHANGED
|
@@ -22,9 +22,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
22
22
|
import Loader from './Loader';
|
|
23
23
|
import { ItemProps } from '../Navigation/NavigationBox';
|
|
24
24
|
import { NavigationBox } from '../Navigation';
|
|
25
|
-
|
|
26
|
-
import { makeSrcQueryString } from '../Image';
|
|
27
|
-
import { ImageCrop, ImageFocalPoint } from '../types';
|
|
25
|
+
import { makeSrcQueryString, ImageCrop, ImageFocalPoint } from '../Image';
|
|
28
26
|
|
|
29
27
|
type InvertItProps = {
|
|
30
28
|
invertedStyle?: boolean;
|
package/src/User/AuthModal.tsx
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React, { ReactNode } from 'react';
|
|
9
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
10
10
|
import styled from '@emotion/styled';
|
|
11
11
|
import { useTranslation } from 'react-i18next';
|
|
12
12
|
// @ts-ignore
|
|
@@ -70,7 +70,7 @@ export type AuthModalProps = {
|
|
|
70
70
|
authorizedCollectedInfo?: string[];
|
|
71
71
|
onAuthenticateClick: () => void;
|
|
72
72
|
position?: 'top' | 'bottom';
|
|
73
|
-
activateButton?:
|
|
73
|
+
activateButton?: ReactElement;
|
|
74
74
|
children?: ReactNode;
|
|
75
75
|
isOpen?: boolean;
|
|
76
76
|
onClose?: () => void;
|
|
@@ -97,7 +97,7 @@ const AuthModal = ({
|
|
|
97
97
|
isOpen={isOpen}
|
|
98
98
|
onClose={onClose}
|
|
99
99
|
controllable={!activateButton}>
|
|
100
|
-
{(onClose: void) => (
|
|
100
|
+
{(onClose: () => void) => (
|
|
101
101
|
<StyledModalBody>
|
|
102
102
|
<StyledModalHeader>
|
|
103
103
|
<StyledHeading aria-label="Feide">
|
package/src/index-javascript.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export { default as Table } from './Table';
|
|
10
9
|
export { FilterList, FilterListPhone, FilterButtons } from './Filter';
|
|
11
10
|
|
|
12
11
|
export {
|
|
@@ -44,7 +43,6 @@ export {
|
|
|
44
43
|
CompetenceGoalsDialog,
|
|
45
44
|
} from './CompetenceGoals';
|
|
46
45
|
|
|
47
|
-
export { default as ResourcesWrapper, ResourcesTitle, ResourcesTopicTitle } from './ResourcesWrapper';
|
|
48
46
|
export {
|
|
49
47
|
MediaList,
|
|
50
48
|
MediaListItem,
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,10 @@ export {
|
|
|
24
24
|
default as Article,
|
|
25
25
|
} from './Article';
|
|
26
26
|
|
|
27
|
+
export { default as Table } from './Table';
|
|
28
|
+
|
|
29
|
+
export { default as ResourcesWrapper, ResourcesTitle, ResourcesTopicTitle } from './ResourcesWrapper';
|
|
30
|
+
|
|
27
31
|
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
28
32
|
|
|
29
33
|
export { default as NoContentBox } from './NoContentBox';
|
|
@@ -707,8 +707,8 @@ const messages = {
|
|
|
707
707
|
licenseAuthor: 'Scanpix.no',
|
|
708
708
|
},
|
|
709
709
|
blog2: {
|
|
710
|
-
text: '
|
|
711
|
-
externalLink: 'https://blogg.ndla.no/
|
|
710
|
+
text: 'Aktiviser elevane med digitale verktøy',
|
|
711
|
+
externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
|
|
712
712
|
linkText: 'Fagblogg',
|
|
713
713
|
license: 'CC-BY-NC-SA-4.0',
|
|
714
714
|
licenseAuthor: 'Scanpix.no',
|
|
@@ -706,8 +706,8 @@ const messages = {
|
|
|
706
706
|
licenseAuthor: 'Scanpix.no',
|
|
707
707
|
},
|
|
708
708
|
blog2: {
|
|
709
|
-
text: '
|
|
710
|
-
externalLink: 'https://blogg.ndla.no/
|
|
709
|
+
text: 'Aktiviser elevene med digitale verktøy',
|
|
710
|
+
externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
|
|
711
711
|
linkText: 'Fagblogg',
|
|
712
712
|
license: 'CC-BY-NC-SA-4.0',
|
|
713
713
|
licenseAuthor: 'Scanpix.no',
|
|
@@ -707,8 +707,8 @@ const messages = {
|
|
|
707
707
|
licenseAuthor: 'Scanpix.no',
|
|
708
708
|
},
|
|
709
709
|
blog2: {
|
|
710
|
-
text: '
|
|
711
|
-
externalLink: 'https://blogg.ndla.no/
|
|
710
|
+
text: 'Aktiviser elevane med digitale verktøy',
|
|
711
|
+
externalLink: 'https://blogg.ndla.no/2021/09/aktiviser-elevane-med-digitale-verktoy/',
|
|
712
712
|
linkText: 'Fagblogg',
|
|
713
713
|
license: 'CC-BY-NC-SA-4.0',
|
|
714
714
|
licenseAuthor: 'Scanpix.no',
|
package/src/types.ts
CHANGED
|
@@ -45,18 +45,6 @@ export interface License {
|
|
|
45
45
|
license: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export interface ImageCrop {
|
|
49
|
-
startX: number;
|
|
50
|
-
startY: number;
|
|
51
|
-
endX: number;
|
|
52
|
-
endY: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ImageFocalPoint {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
48
|
export interface Copyright {
|
|
61
49
|
license: License;
|
|
62
50
|
creators: Array<Contributor>;
|