@micromag/screen-text 0.4.49 → 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.
Files changed (2) hide show
  1. package/es/index.js +74 -80
  2. 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__*/React.createElement("div", {
83
+ return /*#__PURE__*/jsxs("div", {
83
84
  className: classNames([styles.container, className, _defineProperty({}, styles.isPlaceholder, isPlaceholder)]),
84
- "data-screen-ready": true
85
- }, /*#__PURE__*/React.createElement(Container, {
86
- width: width,
87
- height: height,
88
- className: styles.content
89
- }, /*#__PURE__*/React.createElement(Layout, {
90
- className: styles.layout,
91
- fullscreen: true,
92
- verticalAlign: verticalAlign,
93
- style: !isPlaceholder ? {
94
- padding: spacing,
95
- paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
96
- paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (hasFooter ? spacing / 2 : spacing)
97
- } : null
98
- }, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
99
- style: {
100
- paddingBottom: spacing
101
- }
102
- }, /*#__PURE__*/React.createElement(Header, header)) : null, !isPlaceholder && hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
103
- key: "spacer-cta-top"
104
- }) : null, !isPlaceholder && hasHeader && isBottomLayout ? /*#__PURE__*/React.createElement(Spacer, {
105
- key: "spacer-cta-top"
106
- }) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
107
- key: "spacer-cta-top"
108
- }) : null, withTitle ? /*#__PURE__*/React.createElement(ScreenElement, {
109
- key: "title",
110
- placeholder: "title",
111
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
112
- id: "2ZOPe+",
113
- defaultMessage: [{
114
- "type": 0,
115
- "value": "Title"
116
- }]
117
- }),
118
- emptyClassName: styles.emptyTitle,
119
- isEmpty: !hasTitle
120
- }, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
121
- className: classNames([styles.title, _defineProperty({}, styles.withMargin, titleWithMargin)])
122
- }, title)) : null) : null, isSplitted && withTitle ? /*#__PURE__*/React.createElement(Spacer, {
123
- key: "spacer"
124
- }) : null, /*#__PURE__*/React.createElement(ScreenElement, {
125
- key: "description",
126
- placeholder: "text",
127
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
128
- id: "z4CiV1",
129
- defaultMessage: [{
130
- "type": 0,
131
- "value": "Text"
132
- }]
133
- }),
134
- emptyClassName: styles.emptyText,
135
- isEmpty: !hasText
136
- }, hasText ? /*#__PURE__*/React.createElement(Text, Object.assign({
137
- className: styles.text
138
- }, text)) : null), !isPlaceholder && hasFooter && (isTopLayout || isMiddleLayout) ? /*#__PURE__*/React.createElement(Spacer, {
139
- key: "spacer-cta-bottom"
140
- }) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
141
- key: "spacer-cta-bottom"
142
- }) : null, !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
143
- className: styles.footer,
144
- style: {
145
- paddingTop: spacing,
146
- paddingLeft: Math.max(0, viewerBottomSidesWidth - spacing),
147
- paddingRight: Math.max(0, viewerBottomSidesWidth - spacing)
148
- }
149
- }, /*#__PURE__*/React.createElement(Footer, footerProps)) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
150
- background: background,
151
- width: width,
152
- height: height,
153
- resolution: resolution,
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__*/React.createElement(TextScreen, Object.assign({}, props, {
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.49",
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.49",
65
- "@micromag/element-background": "^0.4.49",
66
- "@micromag/element-container": "^0.4.49",
67
- "@micromag/element-footer": "^0.4.49",
68
- "@micromag/element-header": "^0.4.49",
69
- "@micromag/element-heading": "^0.4.49",
70
- "@micromag/element-layout": "^0.4.49",
71
- "@micromag/element-text": "^0.4.49",
72
- "@micromag/transforms": "^0.4.49",
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": "0a225ff29387217cccb0fcc5a731e23c74bd202e",
82
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
83
83
  "types": "es/index.d.ts"
84
84
  }