@micromag/screen-quote 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.
Files changed (2) hide show
  1. package/es/index.js +72 -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 { isHeaderFilled, isFooterFilled, getFooterProps, isTextFilled } from '@micromag/core/utils';
@@ -12,11 +12,10 @@ import Header from '@micromag/element-header';
12
12
  import Layout, { Spacer } from '@micromag/element-layout';
13
13
  import Quote from '@micromag/element-quote';
14
14
  import Text from '@micromag/element-text';
15
+ import { jsxs, jsx } from 'react/jsx-runtime';
15
16
 
16
17
  var styles = {"container":"micromag-screen-quote-container","background":"micromag-screen-quote-background","content":"micromag-screen-quote-content","emptyQuote":"micromag-screen-quote-emptyQuote","emptyAuthor":"micromag-screen-quote-emptyAuthor","quote":"micromag-screen-quote-quote","withMargin":"micromag-screen-quote-withMargin","isPlaceholder":"micromag-screen-quote-isPlaceholder","layout":"micromag-screen-quote-layout"};
17
18
 
18
- // NOTE: this might be better with a scroll
19
-
20
19
  function QuoteScreen(_ref) {
21
20
  var _ref$layout = _ref.layout,
22
21
  layout = _ref$layout === void 0 ? 'top' : _ref$layout,
@@ -77,84 +76,77 @@ function QuoteScreen(_ref) {
77
76
  var quoteWithMargin = hasQuote && hasAuthor && !isSplitted;
78
77
  var backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
79
78
  var mediaShouldLoad = current || preload;
80
- return /*#__PURE__*/React.createElement("div", {
79
+ return /*#__PURE__*/jsxs("div", {
81
80
  className: classNames([styles.container, className, _defineProperty({}, styles.isPlaceholder, isPlaceholder)]),
82
- "data-screen-ready": true
83
- }, /*#__PURE__*/React.createElement(Container, {
84
- width: width,
85
- height: height,
86
- className: styles.content
87
- }, /*#__PURE__*/React.createElement(Layout, {
88
- className: styles.layout,
89
- fullscreen: true,
90
- verticalAlign: verticalAlign,
91
- style: !isPlaceholder ? {
92
- padding: spacing,
93
- paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
94
- paddingBottom: (!isPreview ? viewerBottomHeight : 0) + (hasFooter ? spacing / 2 : spacing)
95
- } : null
96
- }, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
97
- style: {
98
- paddingBottom: spacing
99
- }
100
- }, /*#__PURE__*/React.createElement(Header, header)) : null, !isPlaceholder && hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
101
- key: "spacer-cta-top"
102
- }) : null, !isPlaceholder && hasHeader && isBottomLayout ? /*#__PURE__*/React.createElement(Spacer, {
103
- key: "spacer-cta-top"
104
- }) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
105
- key: "spacer-cta-top"
106
- }) : null, /*#__PURE__*/React.createElement(ScreenElement, {
107
- key: "quote",
108
- placeholder: "quote",
109
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
110
- id: "CrzYgw",
111
- defaultMessage: [{
112
- "type": 0,
113
- "value": "Quote"
114
- }]
115
- }),
116
- emptyClassName: styles.emptyQuote,
117
- isEmpty: !hasQuote
118
- }, hasQuote ? /*#__PURE__*/React.createElement(Quote, Object.assign({
119
- className: classNames([styles.quote, _defineProperty({}, styles.withMargin, quoteWithMargin)])
120
- }, quote)) : null), isSplitted ? /*#__PURE__*/React.createElement(Spacer, {
121
- key: "spacer"
122
- }) : null, /*#__PURE__*/React.createElement(ScreenElement, {
123
- key: "author",
124
- placeholder: "subtitle",
125
- emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
126
- id: "xYqGzM",
127
- defaultMessage: [{
128
- "type": 0,
129
- "value": "Author"
130
- }]
131
- }),
132
- emptyClassName: styles.emptyAuthor,
133
- isEmpty: !hasAuthor
134
- }, hasAuthor ? /*#__PURE__*/React.createElement(Text, Object.assign({
135
- className: styles.author
136
- }, author)) : null), !isPlaceholder && hasFooter && (isTopLayout || isMiddleLayout) ? /*#__PURE__*/React.createElement(Spacer, {
137
- key: "spacer-cta-bottom"
138
- }) : null, !isPlaceholder && hasHeader && !hasFooter && isMiddleLayout ? /*#__PURE__*/React.createElement(Spacer, {
139
- key: "spacer-cta-bottom"
140
- }) : null, !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
141
- style: {
142
- paddingTop: spacing,
143
- paddingLeft: Math.max(viewerBottomSidesWidth - spacing, 0),
144
- paddingRight: Math.max(viewerBottomSidesWidth - spacing, 0)
145
- }
146
- }, /*#__PURE__*/React.createElement(Footer, footerProps)) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
147
- background: background,
148
- width: width,
149
- height: height,
150
- resolution: resolution,
151
- playing: backgroundPlaying,
152
- muted: muted,
153
- shouldLoad: mediaShouldLoad,
154
- mediaRef: mediaRef,
155
- withoutVideo: isPreview,
156
- className: styles.background
157
- }) : null);
81
+ "data-screen-ready": true,
82
+ children: [/*#__PURE__*/jsx(Container, {
83
+ width: width,
84
+ height: height,
85
+ className: styles.content,
86
+ children: /*#__PURE__*/jsxs(Layout, {
87
+ className: styles.layout,
88
+ fullscreen: true,
89
+ verticalAlign: verticalAlign,
90
+ style: !isPlaceholder ? {
91
+ padding: spacing,
92
+ paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
93
+ paddingBottom: (!isPreview ? viewerBottomHeight : 0) + (hasFooter ? spacing / 2 : spacing)
94
+ } : null,
95
+ children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
96
+ style: {
97
+ paddingBottom: spacing
98
+ },
99
+ children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
100
+ }) : 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, /*#__PURE__*/jsx(ScreenElement, {
101
+ placeholder: "quote",
102
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
103
+ id: "CrzYgw",
104
+ defaultMessage: [{
105
+ "type": 0,
106
+ "value": "Quote"
107
+ }]
108
+ }),
109
+ emptyClassName: styles.emptyQuote,
110
+ isEmpty: !hasQuote,
111
+ children: hasQuote ? /*#__PURE__*/jsx(Quote, _objectSpread({
112
+ className: classNames([styles.quote, _defineProperty({}, styles.withMargin, quoteWithMargin)])
113
+ }, quote)) : null
114
+ }, "quote"), isSplitted ? /*#__PURE__*/jsx(Spacer, {}, "spacer") : null, /*#__PURE__*/jsx(ScreenElement, {
115
+ placeholder: "subtitle",
116
+ emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
117
+ id: "xYqGzM",
118
+ defaultMessage: [{
119
+ "type": 0,
120
+ "value": "Author"
121
+ }]
122
+ }),
123
+ emptyClassName: styles.emptyAuthor,
124
+ isEmpty: !hasAuthor,
125
+ children: hasAuthor ? /*#__PURE__*/jsx(Text, _objectSpread({
126
+ className: styles.author
127
+ }, author)) : null
128
+ }, "author"), !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", {
129
+ style: {
130
+ paddingTop: spacing,
131
+ paddingLeft: Math.max(viewerBottomSidesWidth - spacing, 0),
132
+ paddingRight: Math.max(viewerBottomSidesWidth - spacing, 0)
133
+ },
134
+ children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
135
+ }) : null]
136
+ })
137
+ }), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
138
+ background: background,
139
+ width: width,
140
+ height: height,
141
+ resolution: resolution,
142
+ playing: backgroundPlaying,
143
+ muted: muted,
144
+ shouldLoad: mediaShouldLoad,
145
+ mediaRef: mediaRef,
146
+ withoutVideo: isPreview,
147
+ className: styles.background
148
+ }) : null]
149
+ });
158
150
  }
159
151
 
160
152
  // import * as transforms from './transforms/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-quote",
3
- "version": "0.4.48",
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.48",
65
- "@micromag/element-background": "^0.4.48",
66
- "@micromag/element-container": "^0.4.48",
67
- "@micromag/element-footer": "^0.4.48",
68
- "@micromag/element-header": "^0.4.48",
69
- "@micromag/element-layout": "^0.4.48",
70
- "@micromag/element-quote": "^0.4.48",
71
- "@micromag/element-text": "^0.4.48",
72
- "@micromag/transforms": "^0.4.48",
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-layout": "^0.4.50",
70
+ "@micromag/element-quote": "^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": "d6772865be1ee3f2d19288ebfbf4b9b6860f4cd7",
82
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
83
83
  "types": "es/index.d.ts"
84
84
  }