@micromag/screen-text 0.3.423 → 0.3.429
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/index.js +1 -2
- package/lib/index.js +33 -52
- package/package.json +19 -11
package/es/index.js
CHANGED
|
@@ -49,7 +49,6 @@ var defaultProps = {
|
|
|
49
49
|
className: null
|
|
50
50
|
};
|
|
51
51
|
var TextScreen = function TextScreen(_ref) {
|
|
52
|
-
var _ref2;
|
|
53
52
|
var layout = _ref.layout,
|
|
54
53
|
text = _ref.text,
|
|
55
54
|
title = _ref.title,
|
|
@@ -98,7 +97,7 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
98
97
|
isPreview: isPreview
|
|
99
98
|
});
|
|
100
99
|
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: classNames([styles.container, (
|
|
100
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder)]),
|
|
102
101
|
"data-screen-ready": true
|
|
103
102
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
104
103
|
width: width,
|
package/lib/index.js
CHANGED
|
@@ -24,38 +24,20 @@ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
|
24
24
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
25
25
|
var appleNews = require('@micromag/transforms/apple-news');
|
|
26
26
|
|
|
27
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
|
-
|
|
29
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
30
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
31
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
32
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
33
|
-
var Background__default = /*#__PURE__*/_interopDefaultLegacy(Background);
|
|
34
|
-
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
35
|
-
var Footer__default = /*#__PURE__*/_interopDefaultLegacy(Footer);
|
|
36
|
-
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
37
|
-
var Heading__default = /*#__PURE__*/_interopDefaultLegacy(Heading);
|
|
38
|
-
var Layout__default = /*#__PURE__*/_interopDefaultLegacy(Layout);
|
|
39
|
-
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
40
|
-
var _objectDestructuringEmpty__default = /*#__PURE__*/_interopDefaultLegacy(_objectDestructuringEmpty);
|
|
41
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
42
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
43
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
44
|
-
|
|
45
27
|
var styles = {"container":"micromag-screen-text-container","background":"micromag-screen-text-background","disabled":"micromag-screen-text-disabled","hidden":"micromag-screen-text-hidden","placeholder":"micromag-screen-text-placeholder","content":"micromag-screen-text-content","emptyTitle":"micromag-screen-text-emptyTitle","emptyText":"micromag-screen-text-emptyText","title":"micromag-screen-text-title","withMargin":"micromag-screen-text-withMargin","isPlaceholder":"micromag-screen-text-isPlaceholder","layout":"micromag-screen-text-layout"};
|
|
46
28
|
|
|
47
29
|
var propTypes = {
|
|
48
|
-
layout:
|
|
30
|
+
layout: PropTypes.oneOf(['top', 'middle', 'bottom', 'split']),
|
|
49
31
|
text: core.PropTypes.textElement,
|
|
50
32
|
title: core.PropTypes.headingElement,
|
|
51
|
-
withTitle:
|
|
52
|
-
spacing:
|
|
33
|
+
withTitle: PropTypes.bool,
|
|
34
|
+
spacing: PropTypes.number,
|
|
53
35
|
header: core.PropTypes.header,
|
|
54
36
|
footer: core.PropTypes.footer,
|
|
55
37
|
background: core.PropTypes.backgroundElement,
|
|
56
|
-
current:
|
|
57
|
-
active:
|
|
58
|
-
className:
|
|
38
|
+
current: PropTypes.bool,
|
|
39
|
+
active: PropTypes.bool,
|
|
40
|
+
className: PropTypes.string
|
|
59
41
|
};
|
|
60
42
|
var defaultProps = {
|
|
61
43
|
layout: 'top',
|
|
@@ -71,7 +53,6 @@ var defaultProps = {
|
|
|
71
53
|
className: null
|
|
72
54
|
};
|
|
73
55
|
var TextScreen = function TextScreen(_ref) {
|
|
74
|
-
var _ref2;
|
|
75
56
|
var layout = _ref.layout,
|
|
76
57
|
text = _ref.text,
|
|
77
58
|
title = _ref.title,
|
|
@@ -119,14 +100,14 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
119
100
|
openWebView: openWebView,
|
|
120
101
|
isPreview: isPreview
|
|
121
102
|
});
|
|
122
|
-
return /*#__PURE__*/
|
|
123
|
-
className:
|
|
103
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder)]),
|
|
124
105
|
"data-screen-ready": true
|
|
125
|
-
}, /*#__PURE__*/
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
126
107
|
width: width,
|
|
127
108
|
height: height,
|
|
128
109
|
className: styles.content
|
|
129
|
-
}, /*#__PURE__*/
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
130
111
|
className: styles.layout,
|
|
131
112
|
fullscreen: true,
|
|
132
113
|
verticalAlign: verticalAlign,
|
|
@@ -135,20 +116,20 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
135
116
|
paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
|
|
136
117
|
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (hasFooter ? spacing / 2 : spacing)
|
|
137
118
|
} : null
|
|
138
|
-
}, !isPlaceholder && hasHeader ? /*#__PURE__*/
|
|
119
|
+
}, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
139
120
|
style: {
|
|
140
121
|
paddingBottom: spacing
|
|
141
122
|
}
|
|
142
|
-
}, /*#__PURE__*/
|
|
123
|
+
}, /*#__PURE__*/React.createElement(Header, header)) : null, !isPlaceholder && hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
143
124
|
key: "spacer-cta-top"
|
|
144
|
-
}) : null, !isPlaceholder && hasHeader && isBottomLayout ? /*#__PURE__*/
|
|
125
|
+
}) : null, !isPlaceholder && hasHeader && isBottomLayout ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
145
126
|
key: "spacer-cta-top"
|
|
146
|
-
}) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/
|
|
127
|
+
}) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
147
128
|
key: "spacer-cta-top"
|
|
148
|
-
}) : null, withTitle ? /*#__PURE__*/
|
|
129
|
+
}) : null, withTitle ? /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
149
130
|
key: "title",
|
|
150
131
|
placeholder: "title",
|
|
151
|
-
emptyLabel: /*#__PURE__*/
|
|
132
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
152
133
|
id: "2ZOPe+",
|
|
153
134
|
defaultMessage: [{
|
|
154
135
|
"type": 0,
|
|
@@ -157,14 +138,14 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
157
138
|
}),
|
|
158
139
|
emptyClassName: styles.emptyTitle,
|
|
159
140
|
isEmpty: !hasTitle
|
|
160
|
-
}, hasTitle ? /*#__PURE__*/
|
|
161
|
-
className:
|
|
162
|
-
}, title)) : null) : null, isSplitted && withTitle ? /*#__PURE__*/
|
|
141
|
+
}, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
142
|
+
className: classNames([styles.title, _defineProperty({}, styles.withMargin, titleWithMargin)])
|
|
143
|
+
}, title)) : null) : null, isSplitted && withTitle ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
163
144
|
key: "spacer"
|
|
164
|
-
}) : null, /*#__PURE__*/
|
|
145
|
+
}) : null, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
165
146
|
key: "description",
|
|
166
147
|
placeholder: "text",
|
|
167
|
-
emptyLabel: /*#__PURE__*/
|
|
148
|
+
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
168
149
|
id: "z4CiV1",
|
|
169
150
|
defaultMessage: [{
|
|
170
151
|
"type": 0,
|
|
@@ -173,20 +154,20 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
173
154
|
}),
|
|
174
155
|
emptyClassName: styles.emptyText,
|
|
175
156
|
isEmpty: !hasText
|
|
176
|
-
}, hasText ? /*#__PURE__*/
|
|
157
|
+
}, hasText ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
177
158
|
className: styles.text
|
|
178
|
-
}, text)) : null), !isPlaceholder && hasFooter && (isTopLayout || isMiddleLayout) ? /*#__PURE__*/
|
|
159
|
+
}, text)) : null), !isPlaceholder && hasFooter && (isTopLayout || isMiddleLayout) ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
179
160
|
key: "spacer-cta-bottom"
|
|
180
|
-
}) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/
|
|
161
|
+
}) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Layout.Spacer, {
|
|
181
162
|
key: "spacer-cta-bottom"
|
|
182
|
-
}) : null, !isPlaceholder && hasFooter ? /*#__PURE__*/
|
|
163
|
+
}) : null, !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
183
164
|
className: styles.footer,
|
|
184
165
|
style: {
|
|
185
166
|
paddingTop: spacing,
|
|
186
167
|
paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
|
|
187
168
|
paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
|
|
188
169
|
}
|
|
189
|
-
}, /*#__PURE__*/
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
190
171
|
background: background,
|
|
191
172
|
width: width,
|
|
192
173
|
height: height,
|
|
@@ -201,11 +182,11 @@ var TextScreen = function TextScreen(_ref) {
|
|
|
201
182
|
};
|
|
202
183
|
TextScreen.propTypes = propTypes;
|
|
203
184
|
TextScreen.defaultProps = defaultProps;
|
|
204
|
-
var TextScreen$1 = /*#__PURE__*/
|
|
185
|
+
var TextScreen$1 = /*#__PURE__*/React.memo(TextScreen);
|
|
205
186
|
|
|
206
187
|
var TextTitleScreen = function TextTitleScreen(_ref) {
|
|
207
|
-
var props =
|
|
208
|
-
return /*#__PURE__*/
|
|
188
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
189
|
+
return /*#__PURE__*/React.createElement(TextScreen$1, Object.assign({}, props, {
|
|
209
190
|
withTitle: true
|
|
210
191
|
}));
|
|
211
192
|
};
|
|
@@ -219,11 +200,11 @@ var transform = function transform(newStory, _ref) {
|
|
|
219
200
|
var _Text = appleNews.Text(titleStory, text),
|
|
220
201
|
textStory = _Text.story,
|
|
221
202
|
textComponent = _Text.component;
|
|
222
|
-
var _Container = appleNews.Container(textStory, [].concat(
|
|
203
|
+
var _Container = appleNews.Container(textStory, [].concat(_toConsumableArray(titleComponent ? [titleComponent] : []), _toConsumableArray(textComponent ? [textComponent] : []))),
|
|
223
204
|
containerStory = _Container.story,
|
|
224
205
|
containerComponent = _Container.component;
|
|
225
|
-
return
|
|
226
|
-
components: [].concat(
|
|
206
|
+
return _objectSpread(_objectSpread({}, containerStory), {}, {
|
|
207
|
+
components: [].concat(_toConsumableArray(newStory.components || []), _toConsumableArray(containerComponent ? [containerComponent] : []))
|
|
227
208
|
});
|
|
228
209
|
};
|
|
229
210
|
|
|
@@ -439,4 +420,4 @@ var definition = [{
|
|
|
439
420
|
}];
|
|
440
421
|
|
|
441
422
|
exports.TextScreen = TextScreen$1;
|
|
442
|
-
exports
|
|
423
|
+
exports.default = definition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-text",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.429",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,14 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"main": "lib/index.js",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"style": "assets/css/styles.css",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"require": "./lib/index.js",
|
|
39
|
+
"import": "./es/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./assets/css/*.css": "./assets/css/*.css"
|
|
42
|
+
},
|
|
35
43
|
"files": [
|
|
36
44
|
"lib",
|
|
37
45
|
"es",
|
|
@@ -50,15 +58,15 @@
|
|
|
50
58
|
},
|
|
51
59
|
"dependencies": {
|
|
52
60
|
"@babel/runtime": "^7.13.10",
|
|
53
|
-
"@micromag/core": "^0.3.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-container": "^0.3.
|
|
56
|
-
"@micromag/element-footer": "^0.3.
|
|
57
|
-
"@micromag/element-header": "^0.3.
|
|
58
|
-
"@micromag/element-heading": "^0.3.
|
|
59
|
-
"@micromag/element-layout": "^0.3.
|
|
60
|
-
"@micromag/element-text": "^0.3.
|
|
61
|
-
"@micromag/transforms": "^0.3.
|
|
61
|
+
"@micromag/core": "^0.3.429",
|
|
62
|
+
"@micromag/element-background": "^0.3.429",
|
|
63
|
+
"@micromag/element-container": "^0.3.429",
|
|
64
|
+
"@micromag/element-footer": "^0.3.429",
|
|
65
|
+
"@micromag/element-header": "^0.3.429",
|
|
66
|
+
"@micromag/element-heading": "^0.3.429",
|
|
67
|
+
"@micromag/element-layout": "^0.3.429",
|
|
68
|
+
"@micromag/element-text": "^0.3.429",
|
|
69
|
+
"@micromag/transforms": "^0.3.429",
|
|
62
70
|
"classnames": "^2.2.6",
|
|
63
71
|
"lodash": "^4.17.21",
|
|
64
72
|
"prop-types": "^15.7.2",
|
|
@@ -69,5 +77,5 @@
|
|
|
69
77
|
"access": "public",
|
|
70
78
|
"registry": "https://registry.npmjs.org/"
|
|
71
79
|
},
|
|
72
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
|
|
73
81
|
}
|