@micromag/screen-conversation 0.2.407 → 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.
Files changed (3) hide show
  1. package/es/index.js +12 -10
  2. package/lib/index.js +17 -15
  3. package/package.json +2 -2
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 React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
6
- import PropTypes$1 from 'prop-types';
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 { ScreenElement, Transitions } from '@micromag/core/components';
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 CallToAction from '@micromag/element-call-to-action';
17
- import { PropTypes } from '@micromag/core';
18
- import { getStyleFromColor, isTextFilled } from '@micromag/core/utils';
19
- import Heading from '@micromag/element-heading';
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';
@@ -213,6 +213,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
213
213
  background = _ref.background,
214
214
  callToAction = _ref.callToAction,
215
215
  current = _ref.current,
216
+ active = _ref.active,
216
217
  type = _ref.type,
217
218
  conversation = _ref.conversation,
218
219
  transitions = _ref.transitions,
@@ -237,6 +238,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
237
238
  isCapture = _useScreenRenderConte.isCapture;
238
239
 
239
240
  var backgroundPlaying = current && (isView || isEdit);
241
+ var backgroundShouldLoad = current || active || !isView;
240
242
  var withAnimation = isView && !isStatic && timingMode === 'sequence';
241
243
 
242
244
  var _ref2 = conversation || {},
@@ -358,7 +360,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
358
360
  width: width,
359
361
  height: height,
360
362
  playing: backgroundPlaying,
361
- shouldLoad: current || active
363
+ shouldLoad: backgroundShouldLoad
362
364
  }) : null, /*#__PURE__*/React.createElement(Container, {
363
365
  width: width,
364
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 React = require('react');
10
- var PropTypes = require('prop-types');
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 components = require('@micromag/core/components');
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 CallToAction = require('@micromag/element-call-to-action');
21
- var core = require('@micromag/core');
22
- var utils = require('@micromag/core/utils');
23
- var Heading = require('@micromag/element-heading');
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 CallToAction__default = /*#__PURE__*/_interopDefaultLegacy(CallToAction);
41
- var Heading__default = /*#__PURE__*/_interopDefaultLegacy(Heading);
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);
@@ -235,6 +235,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
235
235
  background = _ref.background,
236
236
  callToAction = _ref.callToAction,
237
237
  current = _ref.current,
238
+ active = _ref.active,
238
239
  type = _ref.type,
239
240
  conversation = _ref.conversation,
240
241
  transitions = _ref.transitions,
@@ -259,6 +260,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
259
260
  isCapture = _useScreenRenderConte.isCapture;
260
261
 
261
262
  var backgroundPlaying = current && (isView || isEdit);
263
+ var backgroundShouldLoad = current || active || !isView;
262
264
  var withAnimation = isView && !isStatic && timingMode === 'sequence';
263
265
 
264
266
  var _ref2 = conversation || {},
@@ -380,7 +382,7 @@ var ConversationScreen = function ConversationScreen(_ref) {
380
382
  width: width,
381
383
  height: height,
382
384
  playing: backgroundPlaying,
383
- shouldLoad: current || active
385
+ shouldLoad: backgroundShouldLoad
384
386
  }) : null, /*#__PURE__*/React__default["default"].createElement(Container__default["default"], {
385
387
  width: width,
386
388
  height: height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-conversation",
3
- "version": "0.2.407",
3
+ "version": "0.2.408",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "6e9f2acd39ad4982b571b91c406d30c59f4be473"
71
+ "gitHead": "4bc2ba99622adef74bd0da42cb52d1a575c1a544"
72
72
  }