@micromag/screen-article 0.3.426 → 0.3.430
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/assets/css/styles.css +1 -1
- package/es/index.js +1 -2
- package/lib/index.js +45 -67
- package/package.json +23 -15
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-screen-article-container .micromag-screen-article-background{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySurtitle,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-article-container{position:relative}.micromag-screen-article-container .micromag-screen-article-background{z-index:0}.micromag-screen-article-container .micromag-screen-article-content{z-index:1}.micromag-screen-article-container .micromag-screen-article-layout{position:relative}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{margin:10px auto;padding:12px 0 10px;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySurtitle{-ms-flex-negative:0;flex-shrink:0;padding:4px 0;width:50%}.micromag-screen-article-container .micromag-screen-article-main.micromag-screen-article-hasText{margin-bottom:30px}.micromag-screen-article-container .micromag-screen-article-visualContainer{height:auto;left:0;position:absolute;top:0;width:100%;z-index:-1}.micromag-screen-article-container .micromag-screen-article-surtitle{font-size:12px;width:100%}.micromag-screen-article-container .micromag-screen-article-date{font-size:12px;text-align:right;width:100%}.micromag-screen-article-container .micromag-screen-article-title{margin:10px 0}.micromag-screen-article-container .micromag-screen-article-text blockquote,.micromag-screen-article-container .micromag-screen-article-text h2,.micromag-screen-article-container .micromag-screen-article-text h3,.micromag-screen-article-container .micromag-screen-article-text img,.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text p,.micromag-screen-article-container .micromag-screen-article-text ul{margin-bottom:1rem}.micromag-screen-article-container .micromag-screen-article-text blockquote:last-child,.micromag-screen-article-container .micromag-screen-article-text h2:last-child,.micromag-screen-article-container .micromag-screen-article-text h3:last-child,.micromag-screen-article-container .micromag-screen-article-text img:last-child,.micromag-screen-article-container .micromag-screen-article-text ol:last-child,.micromag-screen-article-container .micromag-screen-article-text p:last-child,.micromag-screen-article-container .micromag-screen-article-text ul:last-child{margin-bottom:0}.micromag-screen-article-container .micromag-screen-article-text h2{font-size:2em}.micromag-screen-article-container .micromag-screen-article-text h3{font-size:1.5em}.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text ul{list-style-position:inside}.micromag-screen-article-container .micromag-screen-article-text blockquote{border-left:1px solid;padding-left:.5em}.micromag-screen-article-container .micromag-screen-article-topContent{-ms-flex-pack:justify;display:-ms-flexbox;display:flex;justify-content:space-between}.micromag-screen-article-container .micromag-screen-article-footer{-webkit-transition:opacity .2s ease-out
|
|
1
|
+
.micromag-screen-article-container .micromag-screen-article-background{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySurtitle,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-article-container{position:relative}.micromag-screen-article-container .micromag-screen-article-background{z-index:0}.micromag-screen-article-container .micromag-screen-article-content{z-index:1}.micromag-screen-article-container .micromag-screen-article-layout{position:relative}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{margin:10px auto;padding:12px 0 10px;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySurtitle{-ms-flex-negative:0;flex-shrink:0;padding:4px 0;width:50%}.micromag-screen-article-container .micromag-screen-article-main.micromag-screen-article-hasText{margin-bottom:30px}.micromag-screen-article-container .micromag-screen-article-visualContainer{height:auto;left:0;position:absolute;top:0;width:100%;z-index:-1}.micromag-screen-article-container .micromag-screen-article-surtitle{font-size:12px;width:100%}.micromag-screen-article-container .micromag-screen-article-date{font-size:12px;text-align:right;width:100%}.micromag-screen-article-container .micromag-screen-article-title{margin:10px 0}.micromag-screen-article-container .micromag-screen-article-text blockquote,.micromag-screen-article-container .micromag-screen-article-text h2,.micromag-screen-article-container .micromag-screen-article-text h3,.micromag-screen-article-container .micromag-screen-article-text img,.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text p,.micromag-screen-article-container .micromag-screen-article-text ul{margin-bottom:1rem}.micromag-screen-article-container .micromag-screen-article-text blockquote:last-child,.micromag-screen-article-container .micromag-screen-article-text h2:last-child,.micromag-screen-article-container .micromag-screen-article-text h3:last-child,.micromag-screen-article-container .micromag-screen-article-text img:last-child,.micromag-screen-article-container .micromag-screen-article-text ol:last-child,.micromag-screen-article-container .micromag-screen-article-text p:last-child,.micromag-screen-article-container .micromag-screen-article-text ul:last-child{margin-bottom:0}.micromag-screen-article-container .micromag-screen-article-text h2{font-size:2em}.micromag-screen-article-container .micromag-screen-article-text h3{font-size:1.5em}.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text ul{list-style-position:inside}.micromag-screen-article-container .micromag-screen-article-text blockquote{border-left:1px solid;padding-left:.5em}.micromag-screen-article-container .micromag-screen-article-topContent{-webkit-box-pack:justify;-ms-flex-pack:justify;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}.micromag-screen-article-container .micromag-screen-article-footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.micromag-screen-article-container .micromag-screen-article-footer a{padding:0}.micromag-screen-article-container .micromag-screen-article-footer.micromag-screen-article-disabled{opacity:0;pointer-events:none}.micromag-screen-article-container.micromag-screen-article-isPlaceholder .micromag-screen-article-layout{padding:10px}
|
package/es/index.js
CHANGED
|
@@ -62,7 +62,6 @@ var defaultProps = {
|
|
|
62
62
|
className: null
|
|
63
63
|
};
|
|
64
64
|
var ArticleScreen = function ArticleScreen(_ref) {
|
|
65
|
-
var _ref6;
|
|
66
65
|
var image = _ref.image,
|
|
67
66
|
title = _ref.title,
|
|
68
67
|
surtitle = _ref.surtitle,
|
|
@@ -266,7 +265,7 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
266
265
|
setScrolledBottom(false);
|
|
267
266
|
}, [setScrolledBottom]);
|
|
268
267
|
return /*#__PURE__*/React.createElement("div", {
|
|
269
|
-
className: classNames([styles.container, (
|
|
268
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder)]),
|
|
270
269
|
"data-screen-ready": ready
|
|
271
270
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
272
271
|
width: width,
|
package/lib/index.js
CHANGED
|
@@ -28,31 +28,10 @@ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
|
28
28
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
29
29
|
var appleNews = require('@micromag/transforms/apple-news');
|
|
30
30
|
|
|
31
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
32
|
-
|
|
33
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
34
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
35
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
36
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
37
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
38
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
|
-
var Author__default = /*#__PURE__*/_interopDefaultLegacy(Author);
|
|
40
|
-
var Background__default = /*#__PURE__*/_interopDefaultLegacy(Background);
|
|
41
|
-
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
42
|
-
var Footer__default = /*#__PURE__*/_interopDefaultLegacy(Footer);
|
|
43
|
-
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
44
|
-
var Heading__default = /*#__PURE__*/_interopDefaultLegacy(Heading);
|
|
45
|
-
var Layout__default = /*#__PURE__*/_interopDefaultLegacy(Layout);
|
|
46
|
-
var Scroll__default = /*#__PURE__*/_interopDefaultLegacy(Scroll);
|
|
47
|
-
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
48
|
-
var Visual__default = /*#__PURE__*/_interopDefaultLegacy(Visual);
|
|
49
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
50
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
51
|
-
|
|
52
31
|
var styles = {"container":"micromag-screen-article-container","background":"micromag-screen-article-background","emptySurtitle":"micromag-screen-article-emptySurtitle","emptyDate":"micromag-screen-article-emptyDate","emptyTitle":"micromag-screen-article-emptyTitle","emptyAuthor":"micromag-screen-article-emptyAuthor","emptyText":"micromag-screen-article-emptyText","content":"micromag-screen-article-content","layout":"micromag-screen-article-layout","main":"micromag-screen-article-main","hasText":"micromag-screen-article-hasText","visualContainer":"micromag-screen-article-visualContainer","surtitle":"micromag-screen-article-surtitle","date":"micromag-screen-article-date","title":"micromag-screen-article-title","text":"micromag-screen-article-text","topContent":"micromag-screen-article-topContent","footer":"micromag-screen-article-footer","disabled":"micromag-screen-article-disabled","isPlaceholder":"micromag-screen-article-isPlaceholder"};
|
|
53
32
|
|
|
54
33
|
var propTypes = {
|
|
55
|
-
layout:
|
|
34
|
+
layout: PropTypes.oneOf(['normal']),
|
|
56
35
|
image: core.PropTypes.visual,
|
|
57
36
|
title: core.PropTypes.title,
|
|
58
37
|
surtitle: core.PropTypes.text,
|
|
@@ -60,14 +39,14 @@ var propTypes = {
|
|
|
60
39
|
author: core.PropTypes.author,
|
|
61
40
|
// author: MicromagPropTypes.text,
|
|
62
41
|
text: core.PropTypes.text,
|
|
63
|
-
spacing:
|
|
42
|
+
spacing: PropTypes.number,
|
|
64
43
|
background: core.PropTypes.backgroundElement,
|
|
65
44
|
header: core.PropTypes.header,
|
|
66
45
|
footer: core.PropTypes.footer,
|
|
67
|
-
current:
|
|
68
|
-
active:
|
|
69
|
-
type:
|
|
70
|
-
className:
|
|
46
|
+
current: PropTypes.bool,
|
|
47
|
+
active: PropTypes.bool,
|
|
48
|
+
type: PropTypes.string,
|
|
49
|
+
className: PropTypes.string
|
|
71
50
|
};
|
|
72
51
|
var defaultProps = {
|
|
73
52
|
layout: 'normal',
|
|
@@ -87,7 +66,6 @@ var defaultProps = {
|
|
|
87
66
|
className: null
|
|
88
67
|
};
|
|
89
68
|
var ArticleScreen = function ArticleScreen(_ref) {
|
|
90
|
-
var _ref6;
|
|
91
69
|
var image = _ref.image,
|
|
92
70
|
title = _ref.title,
|
|
93
71
|
surtitle = _ref.surtitle,
|
|
@@ -169,15 +147,15 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
169
147
|
}, [image]);
|
|
170
148
|
var partialDate = hasDate ? date.body || null : null;
|
|
171
149
|
var finalDate = React.useMemo(function () {
|
|
172
|
-
return partialDate !== null ? "<p>".concat(intl.formatDate(
|
|
150
|
+
return partialDate !== null ? "<p>".concat(intl.formatDate(dayjs(partialDate).toDate(), {
|
|
173
151
|
year: 'numeric',
|
|
174
152
|
month: 'long',
|
|
175
153
|
day: '2-digit'
|
|
176
154
|
}), "</p>") : null;
|
|
177
155
|
}, [partialDate]);
|
|
178
|
-
var imageElement = /*#__PURE__*/
|
|
156
|
+
var imageElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
179
157
|
placeholder: "image",
|
|
180
|
-
emptyLabel: /*#__PURE__*/
|
|
158
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
181
159
|
id: "ebsPd4",
|
|
182
160
|
defaultMessage: [{
|
|
183
161
|
"type": 0,
|
|
@@ -186,10 +164,10 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
186
164
|
}),
|
|
187
165
|
emptyClassName: styles.emptyText,
|
|
188
166
|
isEmpty: !hasImage
|
|
189
|
-
}, /*#__PURE__*/
|
|
167
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
190
168
|
ref: imageCntRef,
|
|
191
169
|
className: styles.visualContainer
|
|
192
|
-
}, hasImage ? /*#__PURE__*/
|
|
170
|
+
}, hasImage ? /*#__PURE__*/React.createElement(Visual, {
|
|
193
171
|
media: image
|
|
194
172
|
// width={width - spacing * 2} // in layout flow
|
|
195
173
|
,
|
|
@@ -198,10 +176,10 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
198
176
|
resolution: resolution,
|
|
199
177
|
className: styles.visual
|
|
200
178
|
}) : null));
|
|
201
|
-
var titleElement = /*#__PURE__*/
|
|
179
|
+
var titleElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
202
180
|
key: "title",
|
|
203
181
|
placeholder: "title",
|
|
204
|
-
emptyLabel: /*#__PURE__*/
|
|
182
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
205
183
|
id: "2ZOPe+",
|
|
206
184
|
defaultMessage: [{
|
|
207
185
|
"type": 0,
|
|
@@ -210,13 +188,13 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
210
188
|
}),
|
|
211
189
|
emptyClassName: styles.emptyTitle,
|
|
212
190
|
isEmpty: !hasTitle
|
|
213
|
-
}, hasTitle ? /*#__PURE__*/
|
|
191
|
+
}, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
214
192
|
className: styles.title
|
|
215
193
|
}, title)) : null);
|
|
216
|
-
var surtitleElement = /*#__PURE__*/
|
|
194
|
+
var surtitleElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
217
195
|
key: "surtitle",
|
|
218
196
|
placeholder: "line",
|
|
219
|
-
emptyLabel: /*#__PURE__*/
|
|
197
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
220
198
|
id: "vdWMTA",
|
|
221
199
|
defaultMessage: [{
|
|
222
200
|
"type": 0,
|
|
@@ -225,13 +203,13 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
225
203
|
}),
|
|
226
204
|
emptyClassName: styles.emptySurtitle,
|
|
227
205
|
isEmpty: !hasSurtitle
|
|
228
|
-
}, hasSurtitle ? /*#__PURE__*/
|
|
206
|
+
}, hasSurtitle ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
229
207
|
className: styles.surtitle
|
|
230
208
|
}, surtitle)) : null);
|
|
231
|
-
var dateElement = /*#__PURE__*/
|
|
209
|
+
var dateElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
232
210
|
key: "date",
|
|
233
211
|
placeholder: "line",
|
|
234
|
-
emptyLabel: /*#__PURE__*/
|
|
212
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
235
213
|
id: "/MsgWe",
|
|
236
214
|
defaultMessage: [{
|
|
237
215
|
"type": 0,
|
|
@@ -240,15 +218,15 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
240
218
|
}),
|
|
241
219
|
emptyClassName: styles.emptyDate,
|
|
242
220
|
isEmpty: !hasDate
|
|
243
|
-
}, hasDate ? /*#__PURE__*/
|
|
221
|
+
}, hasDate ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
244
222
|
className: styles.date
|
|
245
223
|
}, date, {
|
|
246
224
|
body: finalDate
|
|
247
225
|
})) : null);
|
|
248
|
-
var authorElement = /*#__PURE__*/
|
|
226
|
+
var authorElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
249
227
|
key: "author",
|
|
250
228
|
placeholder: "line",
|
|
251
|
-
emptyLabel: /*#__PURE__*/
|
|
229
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
252
230
|
id: "xYqGzM",
|
|
253
231
|
defaultMessage: [{
|
|
254
232
|
"type": 0,
|
|
@@ -257,14 +235,14 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
257
235
|
}),
|
|
258
236
|
emptyClassName: styles.emptyAuthor,
|
|
259
237
|
isEmpty: !hasAuthor && !hasSimpleAuthor
|
|
260
|
-
}, hasSimpleAuthor ? /*#__PURE__*/
|
|
238
|
+
}, hasSimpleAuthor ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
261
239
|
className: styles.author
|
|
262
|
-
}, author)) : null, hasAuthor ? /*#__PURE__*/
|
|
240
|
+
}, author)) : null, hasAuthor ? /*#__PURE__*/React.createElement(Author, {
|
|
263
241
|
author: author
|
|
264
242
|
}) : null);
|
|
265
|
-
var contentElement = /*#__PURE__*/
|
|
243
|
+
var contentElement = /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
266
244
|
placeholder: "text",
|
|
267
|
-
emptyLabel: /*#__PURE__*/
|
|
245
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
268
246
|
id: "z4CiV1",
|
|
269
247
|
defaultMessage: [{
|
|
270
248
|
"type": 0,
|
|
@@ -273,11 +251,11 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
273
251
|
}),
|
|
274
252
|
emptyClassName: styles.emptyText,
|
|
275
253
|
isEmpty: !hasText
|
|
276
|
-
}, hasText ? /*#__PURE__*/
|
|
254
|
+
}, hasText ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
277
255
|
className: styles.text
|
|
278
256
|
}, text)) : null);
|
|
279
257
|
var _useState = React.useState(false),
|
|
280
|
-
_useState2 =
|
|
258
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
281
259
|
scrolledBottom = _useState2[0],
|
|
282
260
|
setScrolledBottom = _useState2[1];
|
|
283
261
|
var onScrolledBottom = React.useCallback(function (_ref5) {
|
|
@@ -290,42 +268,42 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
290
268
|
var onScrolledNotBottom = React.useCallback(function () {
|
|
291
269
|
setScrolledBottom(false);
|
|
292
270
|
}, [setScrolledBottom]);
|
|
293
|
-
return /*#__PURE__*/
|
|
294
|
-
className:
|
|
271
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder)]),
|
|
295
273
|
"data-screen-ready": ready
|
|
296
|
-
}, /*#__PURE__*/
|
|
274
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
297
275
|
width: width,
|
|
298
276
|
height: height,
|
|
299
277
|
className: styles.content
|
|
300
|
-
}, /*#__PURE__*/
|
|
278
|
+
}, /*#__PURE__*/React.createElement(Scroll, {
|
|
301
279
|
disabled: scrollingDisabled,
|
|
302
280
|
onScrolledBottom: onScrolledBottom,
|
|
303
281
|
onScrolledNotBottom: onScrolledNotBottom
|
|
304
|
-
}, /*#__PURE__*/
|
|
282
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
305
283
|
className: styles.layout,
|
|
306
284
|
style: !isPlaceholder ? {
|
|
307
285
|
padding: spacing,
|
|
308
286
|
paddingTop: hasHeader ? spacing / 2 + (!isPreview ? viewerTopHeight : 0) : spacing / 2 + imageHeight,
|
|
309
287
|
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + spacing / 2
|
|
310
288
|
} : null
|
|
311
|
-
}, !isPlaceholder && hasHeader ? /*#__PURE__*/
|
|
289
|
+
}, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
312
290
|
key: "header",
|
|
313
291
|
style: {
|
|
314
292
|
height: hasImage && imageHeight > 0 ? 0 : 'auto',
|
|
315
293
|
paddingBottom: imageHeight > 0 ? imageHeight - viewerTopHeight : spacing
|
|
316
294
|
}
|
|
317
|
-
}, /*#__PURE__*/
|
|
318
|
-
className:
|
|
319
|
-
}, imageElement, /*#__PURE__*/
|
|
295
|
+
}, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement("div", {
|
|
296
|
+
className: classNames([styles.main, _defineProperty({}, styles.hasText, hasText)])
|
|
297
|
+
}, imageElement, /*#__PURE__*/React.createElement("div", {
|
|
320
298
|
className: styles.topContent
|
|
321
|
-
}, surtitleElement, dateElement), titleElement, authorElement), contentElement, !isPlaceholder && hasFooter ? /*#__PURE__*/
|
|
322
|
-
className:
|
|
299
|
+
}, surtitleElement, dateElement), titleElement, authorElement), contentElement, !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
300
|
+
className: classNames([styles.footer, _defineProperty({}, styles.disabled, !scrolledBottom)]),
|
|
323
301
|
style: {
|
|
324
302
|
paddingLeft: Math.max(viewerBottomSidesWidth - spacing, 0),
|
|
325
303
|
paddingRight: Math.max(viewerBottomSidesWidth - spacing, 0),
|
|
326
304
|
paddingTop: spacing
|
|
327
305
|
}
|
|
328
|
-
}, /*#__PURE__*/
|
|
306
|
+
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null))), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
329
307
|
background: background,
|
|
330
308
|
width: width,
|
|
331
309
|
height: height,
|
|
@@ -340,16 +318,16 @@ var ArticleScreen = function ArticleScreen(_ref) {
|
|
|
340
318
|
};
|
|
341
319
|
ArticleScreen.propTypes = propTypes;
|
|
342
320
|
ArticleScreen.defaultProps = defaultProps;
|
|
343
|
-
var ArticleScreen$1 = /*#__PURE__*/
|
|
321
|
+
var ArticleScreen$1 = /*#__PURE__*/React.memo(ArticleScreen);
|
|
344
322
|
|
|
345
323
|
var transform = function transform(newStory, _ref) {
|
|
346
324
|
var body = _ref.body;
|
|
347
325
|
var bodyComponent = body;
|
|
348
|
-
var _Container = appleNews.Container(null,
|
|
326
|
+
var _Container = appleNews.Container(null, _toConsumableArray(bodyComponent ? [bodyComponent] : [])),
|
|
349
327
|
containerStory = _Container.story,
|
|
350
328
|
containerComponent = _Container.component;
|
|
351
|
-
return
|
|
352
|
-
components: [].concat(
|
|
329
|
+
return _objectSpread(_objectSpread({}, containerStory), {}, {
|
|
330
|
+
components: [].concat(_toConsumableArray(newStory.components || []), _toConsumableArray(containerComponent ? [containerComponent] : []))
|
|
353
331
|
});
|
|
354
332
|
};
|
|
355
333
|
|
|
@@ -507,4 +485,4 @@ var definition = [{
|
|
|
507
485
|
}];
|
|
508
486
|
|
|
509
487
|
exports.ArticleScreen = ArticleScreen$1;
|
|
510
|
-
exports
|
|
488
|
+
exports.default = definition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-article",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.430",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -28,6 +28,14 @@
|
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "es/index.js",
|
|
31
|
+
"style": "assets/css/styles.css",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"require": "./lib/index.js",
|
|
35
|
+
"import": "./es/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./assets/css/*.css": "./assets/css/*.css"
|
|
38
|
+
},
|
|
31
39
|
"files": [
|
|
32
40
|
"lib",
|
|
33
41
|
"es",
|
|
@@ -46,19 +54,19 @@
|
|
|
46
54
|
},
|
|
47
55
|
"dependencies": {
|
|
48
56
|
"@babel/runtime": "^7.13.10",
|
|
49
|
-
"@micromag/core": "^0.3.
|
|
50
|
-
"@micromag/element-author": "^0.3.
|
|
51
|
-
"@micromag/element-background": "^0.3.
|
|
52
|
-
"@micromag/element-container": "^0.3.
|
|
53
|
-
"@micromag/element-footer": "^0.3.
|
|
54
|
-
"@micromag/element-header": "^0.3.
|
|
55
|
-
"@micromag/element-heading": "^0.3.
|
|
56
|
-
"@micromag/element-layout": "^0.3.
|
|
57
|
-
"@micromag/element-scroll": "^0.3.
|
|
58
|
-
"@micromag/element-stack": "^0.3.
|
|
59
|
-
"@micromag/element-text": "^0.3.
|
|
60
|
-
"@micromag/element-visual": "^0.3.
|
|
61
|
-
"@micromag/transforms": "^0.3.
|
|
57
|
+
"@micromag/core": "^0.3.430",
|
|
58
|
+
"@micromag/element-author": "^0.3.430",
|
|
59
|
+
"@micromag/element-background": "^0.3.430",
|
|
60
|
+
"@micromag/element-container": "^0.3.430",
|
|
61
|
+
"@micromag/element-footer": "^0.3.430",
|
|
62
|
+
"@micromag/element-header": "^0.3.430",
|
|
63
|
+
"@micromag/element-heading": "^0.3.430",
|
|
64
|
+
"@micromag/element-layout": "^0.3.430",
|
|
65
|
+
"@micromag/element-scroll": "^0.3.430",
|
|
66
|
+
"@micromag/element-stack": "^0.3.430",
|
|
67
|
+
"@micromag/element-text": "^0.3.430",
|
|
68
|
+
"@micromag/element-visual": "^0.3.430",
|
|
69
|
+
"@micromag/transforms": "^0.3.430",
|
|
62
70
|
"classnames": "^2.2.6",
|
|
63
71
|
"dayjs": "^1.11.10",
|
|
64
72
|
"lodash": "^4.17.21",
|
|
@@ -70,5 +78,5 @@
|
|
|
70
78
|
"access": "public",
|
|
71
79
|
"registry": "https://registry.npmjs.org/"
|
|
72
80
|
},
|
|
73
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "da790d76dba9d8e308d9f9c4e51d93a4a0e012a9"
|
|
74
82
|
}
|