@micromag/screen-text 0.4.48 → 0.4.50
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 +74 -80
- package/package.json +11 -11
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormattedMessage, defineMessage } from 'react-intl';
|
|
2
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { ScreenElement } from '@micromag/core/components';
|
|
6
6
|
import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
7
7
|
import { isTextFilled, isHeaderFilled, isFooterFilled, getFooterProps } from '@micromag/core/utils';
|
|
@@ -12,6 +12,7 @@ import Header from '@micromag/element-header';
|
|
|
12
12
|
import Heading from '@micromag/element-heading';
|
|
13
13
|
import Layout, { Spacer } from '@micromag/element-layout';
|
|
14
14
|
import Text from '@micromag/element-text';
|
|
15
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
16
|
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
16
17
|
import _extends from '@babel/runtime/helpers/extends';
|
|
17
18
|
|
|
@@ -79,90 +80,83 @@ function TextScreen(_ref) {
|
|
|
79
80
|
openWebView: openWebView,
|
|
80
81
|
isPreview: isPreview
|
|
81
82
|
});
|
|
82
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/jsxs("div", {
|
|
83
84
|
className: classNames([styles.container, className, _defineProperty({}, styles.isPlaceholder, isPlaceholder)]),
|
|
84
|
-
"data-screen-ready": true
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
playing: backgroundPlaying,
|
|
155
|
-
muted: muted,
|
|
156
|
-
shouldLoad: mediaShouldLoad,
|
|
157
|
-
mediaRef: mediaRef,
|
|
158
|
-
withoutVideo: isPreview,
|
|
159
|
-
className: styles.background
|
|
160
|
-
}) : null);
|
|
85
|
+
"data-screen-ready": true,
|
|
86
|
+
children: [/*#__PURE__*/jsx(Container, {
|
|
87
|
+
width: width,
|
|
88
|
+
height: height,
|
|
89
|
+
className: styles.content,
|
|
90
|
+
children: /*#__PURE__*/jsxs(Layout, {
|
|
91
|
+
className: styles.layout,
|
|
92
|
+
fullscreen: true,
|
|
93
|
+
verticalAlign: verticalAlign,
|
|
94
|
+
style: !isPlaceholder ? {
|
|
95
|
+
padding: spacing,
|
|
96
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
|
|
97
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (hasFooter ? spacing / 2 : spacing)
|
|
98
|
+
} : null,
|
|
99
|
+
children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
|
|
100
|
+
style: {
|
|
101
|
+
paddingBottom: spacing
|
|
102
|
+
},
|
|
103
|
+
children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
|
|
104
|
+
}) : null, !isPlaceholder && hasFooter && isMiddleLayout ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-top") : null, !isPlaceholder && hasHeader && isBottomLayout ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-top") : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-top") : null, withTitle ? /*#__PURE__*/jsx(ScreenElement, {
|
|
105
|
+
placeholder: "title",
|
|
106
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
107
|
+
id: "2ZOPe+",
|
|
108
|
+
defaultMessage: [{
|
|
109
|
+
"type": 0,
|
|
110
|
+
"value": "Title"
|
|
111
|
+
}]
|
|
112
|
+
}),
|
|
113
|
+
emptyClassName: styles.emptyTitle,
|
|
114
|
+
isEmpty: !hasTitle,
|
|
115
|
+
children: hasTitle ? /*#__PURE__*/jsx(Heading, _objectSpread({
|
|
116
|
+
className: classNames([styles.title, _defineProperty({}, styles.withMargin, titleWithMargin)])
|
|
117
|
+
}, title)) : null
|
|
118
|
+
}, "title") : null, isSplitted && withTitle ? /*#__PURE__*/jsx(Spacer, {}, "spacer") : null, /*#__PURE__*/jsx(ScreenElement, {
|
|
119
|
+
placeholder: "text",
|
|
120
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
121
|
+
id: "z4CiV1",
|
|
122
|
+
defaultMessage: [{
|
|
123
|
+
"type": 0,
|
|
124
|
+
"value": "Text"
|
|
125
|
+
}]
|
|
126
|
+
}),
|
|
127
|
+
emptyClassName: styles.emptyText,
|
|
128
|
+
isEmpty: !hasText,
|
|
129
|
+
children: hasText ? /*#__PURE__*/jsx(Text, _objectSpread({
|
|
130
|
+
className: styles.text
|
|
131
|
+
}, text)) : null
|
|
132
|
+
}, "description"), !isPlaceholder && hasFooter && (isTopLayout || isMiddleLayout) ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-bottom") : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/jsx(Spacer, {}, "spacer-cta-bottom") : null, !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
133
|
+
className: styles.footer,
|
|
134
|
+
style: {
|
|
135
|
+
paddingTop: spacing,
|
|
136
|
+
paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
|
|
137
|
+
paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
|
|
138
|
+
},
|
|
139
|
+
children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
|
|
140
|
+
}) : null]
|
|
141
|
+
})
|
|
142
|
+
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
143
|
+
background: background,
|
|
144
|
+
width: width,
|
|
145
|
+
height: height,
|
|
146
|
+
resolution: resolution,
|
|
147
|
+
playing: backgroundPlaying,
|
|
148
|
+
muted: muted,
|
|
149
|
+
shouldLoad: mediaShouldLoad,
|
|
150
|
+
mediaRef: mediaRef,
|
|
151
|
+
withoutVideo: isPreview,
|
|
152
|
+
className: styles.background
|
|
153
|
+
}) : null]
|
|
154
|
+
});
|
|
161
155
|
}
|
|
162
156
|
|
|
163
157
|
function TextTitleScreen(_ref) {
|
|
164
158
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
165
|
-
return /*#__PURE__*/
|
|
159
|
+
return /*#__PURE__*/jsx(TextScreen, _objectSpread(_objectSpread({}, props), {}, {
|
|
166
160
|
withTitle: true
|
|
167
161
|
}));
|
|
168
162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-text",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-background": "^0.4.
|
|
66
|
-
"@micromag/element-container": "^0.4.
|
|
67
|
-
"@micromag/element-footer": "^0.4.
|
|
68
|
-
"@micromag/element-header": "^0.4.
|
|
69
|
-
"@micromag/element-heading": "^0.4.
|
|
70
|
-
"@micromag/element-layout": "^0.4.
|
|
71
|
-
"@micromag/element-text": "^0.4.
|
|
72
|
-
"@micromag/transforms": "^0.4.
|
|
64
|
+
"@micromag/core": "^0.4.50",
|
|
65
|
+
"@micromag/element-background": "^0.4.50",
|
|
66
|
+
"@micromag/element-container": "^0.4.50",
|
|
67
|
+
"@micromag/element-footer": "^0.4.50",
|
|
68
|
+
"@micromag/element-header": "^0.4.50",
|
|
69
|
+
"@micromag/element-heading": "^0.4.50",
|
|
70
|
+
"@micromag/element-layout": "^0.4.50",
|
|
71
|
+
"@micromag/element-text": "^0.4.50",
|
|
72
|
+
"@micromag/transforms": "^0.4.50",
|
|
73
73
|
"classnames": "^2.2.6",
|
|
74
74
|
"lodash": "^4.17.23",
|
|
75
75
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -79,6 +79,6 @@
|
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
83
83
|
"types": "es/index.d.ts"
|
|
84
84
|
}
|