@kids-reporter/draft-renderer 0.4.23 → 0.4.25
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/lib/block-render-maps/annotation.js +2 -2
- package/lib/block-render-maps/article-content.js +6 -6
- package/lib/block-render-maps/info-box.js +2 -2
- package/lib/block-renderer-fn.js +5 -0
- package/lib/block-renderers/blockquote.js +1 -1
- package/lib/block-renderers/divider.js +29 -0
- package/lib/block-renderers/embedded-code-block.js +1 -1
- package/lib/block-renderers/image-block.js +1 -1
- package/lib/block-renderers/index.js +2 -0
- package/lib/block-renderers/multimedia.js +1 -1
- package/package.json +1 -1
|
@@ -19,14 +19,14 @@ const ListForAnnotation = (0, _styledComponents.default)(_articleContent.List)`
|
|
|
19
19
|
li {
|
|
20
20
|
font-size: ${({
|
|
21
21
|
theme
|
|
22
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
22
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '20px' : '16px'};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
const ParagraphForAnnotation = (0, _styledComponents.default)(_articleContent.Paragraph)`
|
|
26
26
|
/* overwrite css */
|
|
27
27
|
font-size: ${({
|
|
28
28
|
theme
|
|
29
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
29
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '20px' : '16px'};
|
|
30
30
|
font-weight: 400;
|
|
31
31
|
margin-bottom: 20px;
|
|
32
32
|
color: #494949;
|
|
@@ -15,7 +15,7 @@ const Paragraph = _styledComponents.default.div`
|
|
|
15
15
|
max-width: 700px;
|
|
16
16
|
font-size: ${({
|
|
17
17
|
theme
|
|
18
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
18
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '22px' : '18px'};
|
|
19
19
|
font-weight: 400;
|
|
20
20
|
color: #3a4f66;
|
|
21
21
|
letter-spacing: 0.9px;
|
|
@@ -50,25 +50,25 @@ const Heading = _styledComponents.default.div`
|
|
|
50
50
|
h2 {
|
|
51
51
|
font-size: ${({
|
|
52
52
|
theme
|
|
53
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
53
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '39px' : '35px'};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
h3 {
|
|
57
57
|
font-size: ${({
|
|
58
58
|
theme
|
|
59
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
59
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '34px' : '30px'};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
h4 {
|
|
63
63
|
font-size: ${({
|
|
64
64
|
theme
|
|
65
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
65
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '29px' : '25px'};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
h5 {
|
|
69
69
|
font-size: ${({
|
|
70
70
|
theme
|
|
71
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
71
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '24px' : '20px'};
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
${_mediaQuery.mediaQuery.smallOnly} {
|
|
@@ -83,7 +83,7 @@ const List = _styledComponents.default.ol`
|
|
|
83
83
|
margin: 0 auto 27px auto;
|
|
84
84
|
font-size: ${({
|
|
85
85
|
theme
|
|
86
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
86
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '22px' : '18px'};
|
|
87
87
|
line-height: 2;
|
|
88
88
|
letter-spacing: 0.9px;
|
|
89
89
|
color: #3a4f66;
|
|
@@ -28,7 +28,7 @@ const ListForInfoBox = (0, _styledComponents.default)(_articleContent.List)`
|
|
|
28
28
|
li {
|
|
29
29
|
font-size: ${({
|
|
30
30
|
theme
|
|
31
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
31
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '20px' : '16px'};
|
|
32
32
|
line-height: 1.5;
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
@@ -36,7 +36,7 @@ const ParagraphForInfoBox = (0, _styledComponents.default)(_articleContent.Parag
|
|
|
36
36
|
/* overwrite css */
|
|
37
37
|
font-size: ${({
|
|
38
38
|
theme
|
|
39
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
39
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '20px' : '16px'};
|
|
40
40
|
font-weight: 400;
|
|
41
41
|
margin-bottom: 20px;
|
|
42
42
|
line-height: 1.5;
|
package/lib/block-renderer-fn.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.atomicBlockRenderer = atomicBlockRenderer;
|
|
|
7
7
|
var _blockRenderers = require("./block-renderers");
|
|
8
8
|
const {
|
|
9
9
|
BlockquoteInArticleBody,
|
|
10
|
+
Divider,
|
|
10
11
|
EmbeddedCodeInArticleBody,
|
|
11
12
|
ImageInArticleBody,
|
|
12
13
|
InfoBoxInArticleBody,
|
|
@@ -24,6 +25,10 @@ const AtomicBlock = props => {
|
|
|
24
25
|
data: entityData
|
|
25
26
|
});
|
|
26
27
|
}
|
|
28
|
+
case 'DIVIDER':
|
|
29
|
+
{
|
|
30
|
+
return Divider();
|
|
31
|
+
}
|
|
27
32
|
case 'IMAGE':
|
|
28
33
|
{
|
|
29
34
|
return ImageInArticleBody({
|
|
@@ -39,7 +39,7 @@ const QuoteText = _styledComponents.default.p`
|
|
|
39
39
|
word-break: break-word;
|
|
40
40
|
font-size: ${({
|
|
41
41
|
theme
|
|
42
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
42
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '22px' : '18px'};
|
|
43
43
|
font-weight: 500;
|
|
44
44
|
letter-spacing: 0.9px;
|
|
45
45
|
line-height: 2;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Divider = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _index = require("../utils/index");
|
|
10
|
+
var _mediaQuery = require("../utils/media-query");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
const Hr = _styledComponents.default.hr`
|
|
13
|
+
border-top: 3px solid ${({
|
|
14
|
+
theme
|
|
15
|
+
}) => (0, _index.getColorHex)(theme === null || theme === void 0 ? void 0 : theme.themeColor)};
|
|
16
|
+
width: 385px;
|
|
17
|
+
height: 3px;
|
|
18
|
+
margin: 40px auto 60px auto;
|
|
19
|
+
|
|
20
|
+
${_mediaQuery.mediaQuery.smallOnly} {
|
|
21
|
+
width: 55%;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const Divider = () => {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(Hr, null);
|
|
26
|
+
};
|
|
27
|
+
exports.Divider = Divider;
|
|
28
|
+
var _default = Divider;
|
|
29
|
+
exports.default = _default;
|
|
@@ -27,7 +27,7 @@ exports.Block = Block;
|
|
|
27
27
|
const Caption = _styledComponents.default.div`
|
|
28
28
|
font-size: ${({
|
|
29
29
|
theme
|
|
30
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
30
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '18px' : '14px'};
|
|
31
31
|
line-height: 1.43;
|
|
32
32
|
letter-spacing: 0.4px;
|
|
33
33
|
color: #808080;
|
|
@@ -18,7 +18,7 @@ const FigureCaption = _styledComponents.default.figcaption`
|
|
|
18
18
|
max-width: 100%;
|
|
19
19
|
font-size: ${({
|
|
20
20
|
theme
|
|
21
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
21
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '18px' : '14px'};
|
|
22
22
|
margin-left: auto;
|
|
23
23
|
margin-right: auto;
|
|
24
24
|
margin-top: 0.5em;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.blockRenderers = void 0;
|
|
7
7
|
var _blockquote = require("./blockquote");
|
|
8
|
+
var _divider = require("./divider");
|
|
8
9
|
var _embeddedCodeBlock = require("./embedded-code-block");
|
|
9
10
|
var _imageBlock = require("./image-block");
|
|
10
11
|
var _infoBoxBlock = require("./info-box-block");
|
|
@@ -12,6 +13,7 @@ var _slideshowBlock = require("./slideshow-block");
|
|
|
12
13
|
var _newsReading = require("./news-reading");
|
|
13
14
|
const blockRenderers = {
|
|
14
15
|
BlockquoteInArticleBody: _blockquote.BlockquoteInArticleBody,
|
|
16
|
+
Divider: _divider.Divider,
|
|
15
17
|
EmbeddedCodeBlock: _embeddedCodeBlock.EmbeddedCodeBlock,
|
|
16
18
|
EmbeddedCodeInArticleBody: _embeddedCodeBlock.EmbeddedCodeInArticleBody,
|
|
17
19
|
ImageBlock: _imageBlock.ImageBlock,
|
|
@@ -69,7 +69,7 @@ const Caption = _styledComponents.default.figcaption`
|
|
|
69
69
|
font-weight: normal;
|
|
70
70
|
font-size: ${({
|
|
71
71
|
theme
|
|
72
|
-
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === '
|
|
72
|
+
}) => (theme === null || theme === void 0 ? void 0 : theme.fontSizeLevel) === 'large' ? '18px' : '14px'};
|
|
73
73
|
margin-bottom: 30px;
|
|
74
74
|
|
|
75
75
|
/* border-bottom of caption */
|