@micromag/screen-conversation 0.2.404 → 0.2.408
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 +15 -10
- package/lib/index.js +20 -15
- package/package.json +12 -12
package/es/index.js
CHANGED
|
@@ -2,21 +2,21 @@ import { FormattedMessage, defineMessage } from 'react-intl';
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { v1 } from 'uuid';
|
|
5
|
+
import { PropTypes } from '@micromag/core';
|
|
6
|
+
import { ScreenElement, Transitions } from '@micromag/core/components';
|
|
9
7
|
import { useScreenSize, useViewer, useScreenRenderContext } from '@micromag/core/contexts';
|
|
10
8
|
import { useTrackScreenEvent, useResizeObserver } from '@micromag/core/hooks';
|
|
11
|
-
import {
|
|
9
|
+
import { getStyleFromColor, isTextFilled } from '@micromag/core/utils';
|
|
12
10
|
import Background from '@micromag/element-background';
|
|
11
|
+
import CallToAction from '@micromag/element-call-to-action';
|
|
13
12
|
import Container from '@micromag/element-container';
|
|
13
|
+
import Heading from '@micromag/element-heading';
|
|
14
14
|
import Layout from '@micromag/element-layout';
|
|
15
15
|
import Scroll from '@micromag/element-scroll';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import PropTypes$1 from 'prop-types';
|
|
18
|
+
import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
19
|
+
import { v1 } from 'uuid';
|
|
20
20
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
21
21
|
import Text from '@micromag/element-text';
|
|
22
22
|
import Visual from '@micromag/element-visual';
|
|
@@ -183,6 +183,7 @@ var propTypes = {
|
|
|
183
183
|
background: PropTypes.backgroundElement,
|
|
184
184
|
callToAction: PropTypes.callToAction,
|
|
185
185
|
current: PropTypes$1.bool,
|
|
186
|
+
active: PropTypes$1.bool,
|
|
186
187
|
type: PropTypes$1.string,
|
|
187
188
|
conversation: PropTypes.conversation,
|
|
188
189
|
transitions: PropTypes.transitions,
|
|
@@ -196,6 +197,7 @@ var defaultProps = {
|
|
|
196
197
|
background: null,
|
|
197
198
|
callToAction: null,
|
|
198
199
|
current: true,
|
|
200
|
+
active: true,
|
|
199
201
|
type: null,
|
|
200
202
|
conversation: null,
|
|
201
203
|
transitions: null,
|
|
@@ -211,6 +213,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
211
213
|
background = _ref.background,
|
|
212
214
|
callToAction = _ref.callToAction,
|
|
213
215
|
current = _ref.current,
|
|
216
|
+
active = _ref.active,
|
|
214
217
|
type = _ref.type,
|
|
215
218
|
conversation = _ref.conversation,
|
|
216
219
|
transitions = _ref.transitions,
|
|
@@ -235,6 +238,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
235
238
|
isCapture = _useScreenRenderConte.isCapture;
|
|
236
239
|
|
|
237
240
|
var backgroundPlaying = current && (isView || isEdit);
|
|
241
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
238
242
|
var withAnimation = isView && !isStatic && timingMode === 'sequence';
|
|
239
243
|
|
|
240
244
|
var _ref2 = conversation || {},
|
|
@@ -355,7 +359,8 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
355
359
|
background: background,
|
|
356
360
|
width: width,
|
|
357
361
|
height: height,
|
|
358
|
-
playing: backgroundPlaying
|
|
362
|
+
playing: backgroundPlaying,
|
|
363
|
+
shouldLoad: backgroundShouldLoad
|
|
359
364
|
}) : null, /*#__PURE__*/React.createElement(Container, {
|
|
360
365
|
width: width,
|
|
361
366
|
height: height
|
package/lib/index.js
CHANGED
|
@@ -6,21 +6,21 @@ var reactIntl = require('react-intl');
|
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
8
8
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var classNames = require('classnames');
|
|
12
|
-
var uuid = require('uuid');
|
|
9
|
+
var core = require('@micromag/core');
|
|
10
|
+
var components = require('@micromag/core/components');
|
|
13
11
|
var contexts = require('@micromag/core/contexts');
|
|
14
12
|
var hooks = require('@micromag/core/hooks');
|
|
15
|
-
var
|
|
13
|
+
var utils = require('@micromag/core/utils');
|
|
16
14
|
var Background = require('@micromag/element-background');
|
|
15
|
+
var CallToAction = require('@micromag/element-call-to-action');
|
|
17
16
|
var Container = require('@micromag/element-container');
|
|
17
|
+
var Heading = require('@micromag/element-heading');
|
|
18
18
|
var Layout = require('@micromag/element-layout');
|
|
19
19
|
var Scroll = require('@micromag/element-scroll');
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
20
|
+
var classNames = require('classnames');
|
|
21
|
+
var PropTypes = require('prop-types');
|
|
22
|
+
var React = require('react');
|
|
23
|
+
var uuid = require('uuid');
|
|
24
24
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
25
25
|
var Text = require('@micromag/element-text');
|
|
26
26
|
var Visual = require('@micromag/element-visual');
|
|
@@ -30,15 +30,15 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
30
30
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
31
31
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
32
32
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
33
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
35
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
36
33
|
var Background__default = /*#__PURE__*/_interopDefaultLegacy(Background);
|
|
34
|
+
var CallToAction__default = /*#__PURE__*/_interopDefaultLegacy(CallToAction);
|
|
37
35
|
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
36
|
+
var Heading__default = /*#__PURE__*/_interopDefaultLegacy(Heading);
|
|
38
37
|
var Layout__default = /*#__PURE__*/_interopDefaultLegacy(Layout);
|
|
39
38
|
var Scroll__default = /*#__PURE__*/_interopDefaultLegacy(Scroll);
|
|
40
|
-
var
|
|
41
|
-
var
|
|
39
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
40
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
41
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
42
|
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
43
43
|
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
44
44
|
var Visual__default = /*#__PURE__*/_interopDefaultLegacy(Visual);
|
|
@@ -205,6 +205,7 @@ var propTypes = {
|
|
|
205
205
|
background: core.PropTypes.backgroundElement,
|
|
206
206
|
callToAction: core.PropTypes.callToAction,
|
|
207
207
|
current: PropTypes__default["default"].bool,
|
|
208
|
+
active: PropTypes__default["default"].bool,
|
|
208
209
|
type: PropTypes__default["default"].string,
|
|
209
210
|
conversation: core.PropTypes.conversation,
|
|
210
211
|
transitions: core.PropTypes.transitions,
|
|
@@ -218,6 +219,7 @@ var defaultProps = {
|
|
|
218
219
|
background: null,
|
|
219
220
|
callToAction: null,
|
|
220
221
|
current: true,
|
|
222
|
+
active: true,
|
|
221
223
|
type: null,
|
|
222
224
|
conversation: null,
|
|
223
225
|
transitions: null,
|
|
@@ -233,6 +235,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
233
235
|
background = _ref.background,
|
|
234
236
|
callToAction = _ref.callToAction,
|
|
235
237
|
current = _ref.current,
|
|
238
|
+
active = _ref.active,
|
|
236
239
|
type = _ref.type,
|
|
237
240
|
conversation = _ref.conversation,
|
|
238
241
|
transitions = _ref.transitions,
|
|
@@ -257,6 +260,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
257
260
|
isCapture = _useScreenRenderConte.isCapture;
|
|
258
261
|
|
|
259
262
|
var backgroundPlaying = current && (isView || isEdit);
|
|
263
|
+
var backgroundShouldLoad = current || active || !isView;
|
|
260
264
|
var withAnimation = isView && !isStatic && timingMode === 'sequence';
|
|
261
265
|
|
|
262
266
|
var _ref2 = conversation || {},
|
|
@@ -377,7 +381,8 @@ var ConversationScreen = function ConversationScreen(_ref) {
|
|
|
377
381
|
background: background,
|
|
378
382
|
width: width,
|
|
379
383
|
height: height,
|
|
380
|
-
playing: backgroundPlaying
|
|
384
|
+
playing: backgroundPlaying,
|
|
385
|
+
shouldLoad: backgroundShouldLoad
|
|
381
386
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
|
|
382
387
|
width: width,
|
|
383
388
|
height: height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-conversation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.408",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.2.
|
|
53
|
-
"@micromag/element-background": "^0.2.
|
|
54
|
-
"@micromag/element-call-to-action": "^0.2.
|
|
55
|
-
"@micromag/element-container": "^0.2.
|
|
56
|
-
"@micromag/element-heading": "^0.2.
|
|
57
|
-
"@micromag/element-layout": "^0.2.
|
|
58
|
-
"@micromag/element-scroll": "^0.2.
|
|
59
|
-
"@micromag/element-text": "^0.2.
|
|
60
|
-
"@micromag/element-visual": "^0.2.
|
|
61
|
-
"@micromag/transforms": "^0.2.
|
|
52
|
+
"@micromag/core": "^0.2.405",
|
|
53
|
+
"@micromag/element-background": "^0.2.407",
|
|
54
|
+
"@micromag/element-call-to-action": "^0.2.405",
|
|
55
|
+
"@micromag/element-container": "^0.2.405",
|
|
56
|
+
"@micromag/element-heading": "^0.2.405",
|
|
57
|
+
"@micromag/element-layout": "^0.2.405",
|
|
58
|
+
"@micromag/element-scroll": "^0.2.405",
|
|
59
|
+
"@micromag/element-text": "^0.2.405",
|
|
60
|
+
"@micromag/element-visual": "^0.2.407",
|
|
61
|
+
"@micromag/transforms": "^0.2.405",
|
|
62
62
|
"classnames": "^2.2.6",
|
|
63
63
|
"lodash": "^4.17.21",
|
|
64
64
|
"prop-types": "^15.7.2",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "4bc2ba99622adef74bd0da42cb52d1a575c1a544"
|
|
72
72
|
}
|