@micromag/core 0.3.108 → 0.3.112
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/components.js +35 -12
- package/es/index.js +1 -1
- package/es/utils.js +31 -15
- package/lib/components.js +70 -29
- package/lib/index.js +1 -1
- package/lib/utils.js +31 -14
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -2,13 +2,13 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import PropTypes$1 from 'prop-types';
|
|
5
|
-
import React, { useCallback, useState, useEffect, useRef, useMemo } from 'react';
|
|
5
|
+
import React, { useCallback, useState, useEffect, useRef, useMemo, Suspense } from 'react';
|
|
6
6
|
import { Link as Link$1 } from 'react-router-dom';
|
|
7
7
|
import { PropTypes } from '@micromag/core';
|
|
8
8
|
import { FormattedMessage, defineMessages, FormattedDate, FormattedTime } from 'react-intl';
|
|
9
9
|
import { isMessage, getFieldFromPath, getComponentFromName, setFieldValue, validateFields, getDisplayName, pascalCase, convertStyleToString } from '@micromag/core/utils';
|
|
10
10
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
|
-
import { faAngleLeft
|
|
11
|
+
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
12
12
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
13
13
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
14
14
|
import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals, useUppy, withPanels, usePanels, ScreenSizeProvider, useScreenComponent, ScreenProvider, useScreenRenderContext, useScreenSize } from '@micromag/core/contexts';
|
|
@@ -16,16 +16,29 @@ import { useForm, useDocumentEvent, useIntersectionObserver, useResizeObserver }
|
|
|
16
16
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
17
17
|
import get from 'lodash/get';
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
|
-
import { DashboardModal } from '@uppy/react';
|
|
20
19
|
import isArray from 'lodash/isArray';
|
|
20
|
+
import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown';
|
|
21
|
+
import { faAngleUp } from '@fortawesome/free-solid-svg-icons/faAngleUp';
|
|
21
22
|
import dayjs from 'dayjs';
|
|
22
23
|
import throttle from 'lodash/throttle';
|
|
23
24
|
import isObject from 'lodash/isObject';
|
|
24
25
|
import { Helmet } from 'react-helmet';
|
|
25
26
|
import isString from 'lodash/isString';
|
|
26
27
|
import 'snake-case';
|
|
28
|
+
import { faAd } from '@fortawesome/free-solid-svg-icons/faAd';
|
|
29
|
+
import { faImage } from '@fortawesome/free-solid-svg-icons/faImage';
|
|
30
|
+
import { faMusic } from '@fortawesome/free-solid-svg-icons/faMusic';
|
|
27
31
|
import isNumber from 'lodash/isNumber';
|
|
32
|
+
import { faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons/faMapMarkerAlt';
|
|
33
|
+
import { faMapMarkedAlt } from '@fortawesome/free-solid-svg-icons/faMapMarkedAlt';
|
|
34
|
+
import { faVideo } from '@fortawesome/free-solid-svg-icons/faVideo';
|
|
35
|
+
import { faPlay } from '@fortawesome/free-solid-svg-icons/faPlay';
|
|
36
|
+
import { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';
|
|
28
37
|
import { getSizeWithinBounds } from '@folklore/size';
|
|
38
|
+
import { faCommentDots } from '@fortawesome/free-solid-svg-icons/faCommentDots';
|
|
39
|
+
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
40
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
41
|
+
import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
|
|
29
42
|
import { useSpring } from '@react-spring/core';
|
|
30
43
|
import { animated } from '@react-spring/web';
|
|
31
44
|
|
|
@@ -1745,6 +1758,14 @@ ModalDialog.propTypes = propTypes$q;
|
|
|
1745
1758
|
ModalDialog.defaultProps = defaultProps$q;
|
|
1746
1759
|
|
|
1747
1760
|
// import classNames from 'classnames';
|
|
1761
|
+
var DashboardModal = /*#__PURE__*/React.lazy(function () {
|
|
1762
|
+
return import('@uppy/react').then(function (_ref) {
|
|
1763
|
+
var Component = _ref.DashboardModal;
|
|
1764
|
+
return {
|
|
1765
|
+
"default": Component
|
|
1766
|
+
};
|
|
1767
|
+
});
|
|
1768
|
+
});
|
|
1748
1769
|
var propTypes$p = {
|
|
1749
1770
|
type: PropTypes$1.oneOfType([PropTypes.mediaTypes, PropTypes$1.array]),
|
|
1750
1771
|
opened: PropTypes$1.bool,
|
|
@@ -1760,12 +1781,12 @@ var defaultProps$p = {
|
|
|
1760
1781
|
onRequestClose: null
|
|
1761
1782
|
};
|
|
1762
1783
|
|
|
1763
|
-
var UploadModal = function UploadModal(
|
|
1764
|
-
var type =
|
|
1765
|
-
opened =
|
|
1766
|
-
sources =
|
|
1767
|
-
onUploaded =
|
|
1768
|
-
onRequestClose =
|
|
1784
|
+
var UploadModal = function UploadModal(_ref2) {
|
|
1785
|
+
var type = _ref2.type,
|
|
1786
|
+
opened = _ref2.opened,
|
|
1787
|
+
sources = _ref2.sources,
|
|
1788
|
+
onUploaded = _ref2.onUploaded,
|
|
1789
|
+
onRequestClose = _ref2.onRequestClose;
|
|
1769
1790
|
var onUppyComplete = useCallback(function (response) {
|
|
1770
1791
|
if (onUploaded !== null) {
|
|
1771
1792
|
onUploaded(response);
|
|
@@ -1792,13 +1813,15 @@ var UploadModal = function UploadModal(_ref) {
|
|
|
1792
1813
|
uppy.reset();
|
|
1793
1814
|
}
|
|
1794
1815
|
}, [uppy, opened]);
|
|
1795
|
-
return uppy !== null ? /*#__PURE__*/React.createElement(
|
|
1816
|
+
return uppy !== null ? /*#__PURE__*/React.createElement(Suspense, {
|
|
1817
|
+
fallback: /*#__PURE__*/React.createElement("div", null)
|
|
1818
|
+
}, /*#__PURE__*/React.createElement(DashboardModal, {
|
|
1796
1819
|
uppy: uppy,
|
|
1797
1820
|
open: opened,
|
|
1798
1821
|
closeAfterFinish: true,
|
|
1799
1822
|
onRequestClose: onRequestClose,
|
|
1800
1823
|
plugins: sources
|
|
1801
|
-
}) : null;
|
|
1824
|
+
})) : null;
|
|
1802
1825
|
};
|
|
1803
1826
|
|
|
1804
1827
|
UploadModal.propTypes = propTypes$p;
|
|
@@ -2628,7 +2651,7 @@ PropTypes$1.shape({
|
|
|
2628
2651
|
loop: PropTypes$1.bool,
|
|
2629
2652
|
closedCaptions: closedCaptionsMedia,
|
|
2630
2653
|
withSeekBar: PropTypes$1.bool,
|
|
2631
|
-
|
|
2654
|
+
withControls: PropTypes$1.bool
|
|
2632
2655
|
});
|
|
2633
2656
|
var visualElement = PropTypes$1.shape({
|
|
2634
2657
|
media: imageMedia
|
package/es/index.js
CHANGED
|
@@ -287,7 +287,7 @@ var videoElement = PropTypes$1.shape({
|
|
|
287
287
|
loop: PropTypes$1.bool,
|
|
288
288
|
closedCaptions: closedCaptionsMedia,
|
|
289
289
|
withSeekBar: PropTypes$1.bool,
|
|
290
|
-
|
|
290
|
+
withControls: PropTypes$1.bool
|
|
291
291
|
});
|
|
292
292
|
var visualElement = PropTypes$1.shape({
|
|
293
293
|
media: imageMedia
|
package/es/utils.js
CHANGED
|
@@ -404,6 +404,15 @@ var getScreenExtraField = function getScreenExtraField(intl) {
|
|
|
404
404
|
};
|
|
405
405
|
};
|
|
406
406
|
|
|
407
|
+
function getShadowCoords(angle, distance) {
|
|
408
|
+
var x = (Math.cos(angle) * distance).toFixed(3);
|
|
409
|
+
var y = (Math.sin(angle) * distance).toFixed(3);
|
|
410
|
+
return {
|
|
411
|
+
x: x,
|
|
412
|
+
y: y
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
407
416
|
var getStyleFromColor = function getStyleFromColor() {
|
|
408
417
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
409
418
|
var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'backgroundColor';
|
|
@@ -436,17 +445,24 @@ var getStyleFromShadow = function getStyleFromShadow(value) {
|
|
|
436
445
|
}
|
|
437
446
|
|
|
438
447
|
var _ref = value || {},
|
|
439
|
-
_ref$
|
|
440
|
-
|
|
441
|
-
_ref$
|
|
442
|
-
|
|
448
|
+
_ref$shadowAngle = _ref.shadowAngle,
|
|
449
|
+
shadowAngle = _ref$shadowAngle === void 0 ? null : _ref$shadowAngle,
|
|
450
|
+
_ref$shadowDistance = _ref.shadowDistance,
|
|
451
|
+
shadowDistance = _ref$shadowDistance === void 0 ? null : _ref$shadowDistance,
|
|
443
452
|
_ref$shadowBlur = _ref.shadowBlur,
|
|
444
|
-
shadowBlur = _ref$shadowBlur === void 0 ?
|
|
453
|
+
shadowBlur = _ref$shadowBlur === void 0 ? null : _ref$shadowBlur,
|
|
445
454
|
_ref$shadowColor = _ref.shadowColor,
|
|
446
|
-
shadowColor = _ref$shadowColor === void 0 ?
|
|
455
|
+
shadowColor = _ref$shadowColor === void 0 ? null : _ref$shadowColor;
|
|
456
|
+
|
|
457
|
+
if (!shadowAngle) return null;
|
|
458
|
+
var blur = shadowBlur || '0';
|
|
459
|
+
var color = getColorAsString(shadowColor) || '#000000';
|
|
460
|
+
|
|
461
|
+
var _getShadowCoords = getShadowCoords(shadowAngle, shadowDistance),
|
|
462
|
+
x = _getShadowCoords.x,
|
|
463
|
+
y = _getShadowCoords.y;
|
|
447
464
|
|
|
448
|
-
var
|
|
449
|
-
var boxShadow = "".concat(shadowHorizontalOffset, "px ").concat(shadowVerticalOffset, "px ").concat(shadowBlur, "px 0 ").concat(color);
|
|
465
|
+
var boxShadow = "".concat(x, "px ").concat(y, "px ").concat(blur, "px 0 ").concat(color);
|
|
450
466
|
return {
|
|
451
467
|
boxShadow: boxShadow
|
|
452
468
|
};
|
|
@@ -477,10 +493,10 @@ var getStyleFromBox = function getStyleFromBox(value) {
|
|
|
477
493
|
borderStyle = _value$borderStyle === void 0 ? null : _value$borderStyle,
|
|
478
494
|
_value$borderColor = value.borderColor,
|
|
479
495
|
borderColor = _value$borderColor === void 0 ? null : _value$borderColor,
|
|
480
|
-
_value$
|
|
481
|
-
|
|
482
|
-
_value$
|
|
483
|
-
|
|
496
|
+
_value$shadowAngle = value.shadowAngle,
|
|
497
|
+
shadowAngle = _value$shadowAngle === void 0 ? null : _value$shadowAngle,
|
|
498
|
+
_value$shadowDistance = value.shadowDistance,
|
|
499
|
+
shadowDistance = _value$shadowDistance === void 0 ? null : _value$shadowDistance,
|
|
484
500
|
_value$shadowBlur = value.shadowBlur,
|
|
485
501
|
shadowBlur = _value$shadowBlur === void 0 ? null : _value$shadowBlur,
|
|
486
502
|
_value$shadowColor = value.shadowColor,
|
|
@@ -491,8 +507,8 @@ var getStyleFromBox = function getStyleFromBox(value) {
|
|
|
491
507
|
color: borderColor
|
|
492
508
|
};
|
|
493
509
|
var shadow = {
|
|
494
|
-
|
|
495
|
-
|
|
510
|
+
shadowAngle: shadowAngle,
|
|
511
|
+
shadowDistance: shadowDistance,
|
|
496
512
|
shadowBlur: shadowBlur,
|
|
497
513
|
shadowColor: shadowColor
|
|
498
514
|
};
|
|
@@ -836,4 +852,4 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
836
852
|
return tinycolor(color).spin(30).toString();
|
|
837
853
|
};
|
|
838
854
|
|
|
839
|
-
export { convertStyleToString, createNullableOnChange, createUseEvent, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, schemaId, setValue as setFieldValue, slug, unique, validateFields };
|
|
855
|
+
export { convertStyleToString, createNullableOnChange, createUseEvent, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getShadowCoords, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, schemaId, setValue as setFieldValue, slug, unique, validateFields };
|
package/lib/components.js
CHANGED
|
@@ -12,7 +12,7 @@ var core = require('@micromag/core');
|
|
|
12
12
|
var reactIntl = require('react-intl');
|
|
13
13
|
var utils = require('@micromag/core/utils');
|
|
14
14
|
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
15
|
-
var
|
|
15
|
+
var faAngleLeft = require('@fortawesome/free-solid-svg-icons/faAngleLeft');
|
|
16
16
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
17
17
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
18
18
|
var contexts = require('@micromag/core/contexts');
|
|
@@ -20,21 +20,52 @@ var hooks = require('@micromag/core/hooks');
|
|
|
20
20
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
21
21
|
var get = require('lodash/get');
|
|
22
22
|
var ReactDOM = require('react-dom');
|
|
23
|
-
var react = require('@uppy/react');
|
|
24
23
|
var isArray = require('lodash/isArray');
|
|
24
|
+
var faAngleDown = require('@fortawesome/free-solid-svg-icons/faAngleDown');
|
|
25
|
+
var faAngleUp = require('@fortawesome/free-solid-svg-icons/faAngleUp');
|
|
25
26
|
var dayjs = require('dayjs');
|
|
26
27
|
var throttle = require('lodash/throttle');
|
|
27
28
|
var isObject = require('lodash/isObject');
|
|
28
29
|
var reactHelmet = require('react-helmet');
|
|
29
30
|
var isString = require('lodash/isString');
|
|
30
31
|
require('snake-case');
|
|
32
|
+
var faAd = require('@fortawesome/free-solid-svg-icons/faAd');
|
|
33
|
+
var faImage = require('@fortawesome/free-solid-svg-icons/faImage');
|
|
34
|
+
var faMusic = require('@fortawesome/free-solid-svg-icons/faMusic');
|
|
31
35
|
var isNumber = require('lodash/isNumber');
|
|
36
|
+
var faMapMarkerAlt = require('@fortawesome/free-solid-svg-icons/faMapMarkerAlt');
|
|
37
|
+
var faMapMarkedAlt = require('@fortawesome/free-solid-svg-icons/faMapMarkedAlt');
|
|
38
|
+
var faVideo = require('@fortawesome/free-solid-svg-icons/faVideo');
|
|
39
|
+
var faPlay = require('@fortawesome/free-solid-svg-icons/faPlay');
|
|
40
|
+
var faRedo = require('@fortawesome/free-solid-svg-icons/faRedo');
|
|
32
41
|
var size = require('@folklore/size');
|
|
42
|
+
var faCommentDots = require('@fortawesome/free-solid-svg-icons/faCommentDots');
|
|
43
|
+
var faCheck = require('@fortawesome/free-solid-svg-icons/faCheck');
|
|
44
|
+
var faTimes = require('@fortawesome/free-solid-svg-icons/faTimes');
|
|
45
|
+
var faPercent = require('@fortawesome/free-solid-svg-icons/faPercent');
|
|
33
46
|
var core$1 = require('@react-spring/core');
|
|
34
47
|
var web = require('@react-spring/web');
|
|
35
48
|
|
|
36
49
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
37
50
|
|
|
51
|
+
function _interopNamespace(e) {
|
|
52
|
+
if (e && e.__esModule) return e;
|
|
53
|
+
var n = Object.create(null);
|
|
54
|
+
if (e) {
|
|
55
|
+
Object.keys(e).forEach(function (k) {
|
|
56
|
+
if (k !== 'default') {
|
|
57
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
58
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return e[k]; }
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
n["default"] = e;
|
|
66
|
+
return Object.freeze(n);
|
|
67
|
+
}
|
|
68
|
+
|
|
38
69
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
39
70
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
40
71
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
@@ -313,7 +344,7 @@ var BackButton = function BackButton(_ref) {
|
|
|
313
344
|
className: classNames__default["default"](['px-2', _defineProperty__default["default"]({}, className, className)]),
|
|
314
345
|
size: "sm",
|
|
315
346
|
icon: /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
316
|
-
icon:
|
|
347
|
+
icon: faAngleLeft.faAngleLeft,
|
|
317
348
|
size: "lg"
|
|
318
349
|
})
|
|
319
350
|
}, props));
|
|
@@ -1768,6 +1799,14 @@ ModalDialog.propTypes = propTypes$q;
|
|
|
1768
1799
|
ModalDialog.defaultProps = defaultProps$q;
|
|
1769
1800
|
|
|
1770
1801
|
// import classNames from 'classnames';
|
|
1802
|
+
var DashboardModal = /*#__PURE__*/React__default["default"].lazy(function () {
|
|
1803
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@uppy/react')); }).then(function (_ref) {
|
|
1804
|
+
var Component = _ref.DashboardModal;
|
|
1805
|
+
return {
|
|
1806
|
+
"default": Component
|
|
1807
|
+
};
|
|
1808
|
+
});
|
|
1809
|
+
});
|
|
1771
1810
|
var propTypes$p = {
|
|
1772
1811
|
type: PropTypes__default["default"].oneOfType([core.PropTypes.mediaTypes, PropTypes__default["default"].array]),
|
|
1773
1812
|
opened: PropTypes__default["default"].bool,
|
|
@@ -1783,12 +1822,12 @@ var defaultProps$p = {
|
|
|
1783
1822
|
onRequestClose: null
|
|
1784
1823
|
};
|
|
1785
1824
|
|
|
1786
|
-
var UploadModal = function UploadModal(
|
|
1787
|
-
var type =
|
|
1788
|
-
opened =
|
|
1789
|
-
sources =
|
|
1790
|
-
onUploaded =
|
|
1791
|
-
onRequestClose =
|
|
1825
|
+
var UploadModal = function UploadModal(_ref2) {
|
|
1826
|
+
var type = _ref2.type,
|
|
1827
|
+
opened = _ref2.opened,
|
|
1828
|
+
sources = _ref2.sources,
|
|
1829
|
+
onUploaded = _ref2.onUploaded,
|
|
1830
|
+
onRequestClose = _ref2.onRequestClose;
|
|
1792
1831
|
var onUppyComplete = React.useCallback(function (response) {
|
|
1793
1832
|
if (onUploaded !== null) {
|
|
1794
1833
|
onUploaded(response);
|
|
@@ -1815,13 +1854,15 @@ var UploadModal = function UploadModal(_ref) {
|
|
|
1815
1854
|
uppy.reset();
|
|
1816
1855
|
}
|
|
1817
1856
|
}, [uppy, opened]);
|
|
1818
|
-
return uppy !== null ? /*#__PURE__*/React__default["default"].createElement(
|
|
1857
|
+
return uppy !== null ? /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
|
|
1858
|
+
fallback: /*#__PURE__*/React__default["default"].createElement("div", null)
|
|
1859
|
+
}, /*#__PURE__*/React__default["default"].createElement(DashboardModal, {
|
|
1819
1860
|
uppy: uppy,
|
|
1820
1861
|
open: opened,
|
|
1821
1862
|
closeAfterFinish: true,
|
|
1822
1863
|
onRequestClose: onRequestClose,
|
|
1823
1864
|
plugins: sources
|
|
1824
|
-
}) : null;
|
|
1865
|
+
})) : null;
|
|
1825
1866
|
};
|
|
1826
1867
|
|
|
1827
1868
|
UploadModal.propTypes = propTypes$p;
|
|
@@ -1988,7 +2029,7 @@ var CollapsablePanel = function CollapsablePanel(_ref) {
|
|
|
1988
2029
|
withoutStyle: true,
|
|
1989
2030
|
className: classNames__default["default"]([styles$h.button, _defineProperty__default["default"]({}, buttonClassName, buttonClassName !== null)]),
|
|
1990
2031
|
icon: /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1991
|
-
icon: opened ?
|
|
2032
|
+
icon: opened ? faAngleUp.faAngleUp : faAngleDown.faAngleDown,
|
|
1992
2033
|
className: styles$h.icon
|
|
1993
2034
|
}),
|
|
1994
2035
|
iconPosition: "right",
|
|
@@ -2651,7 +2692,7 @@ PropTypes__default["default"].shape({
|
|
|
2651
2692
|
loop: PropTypes__default["default"].bool,
|
|
2652
2693
|
closedCaptions: closedCaptionsMedia,
|
|
2653
2694
|
withSeekBar: PropTypes__default["default"].bool,
|
|
2654
|
-
|
|
2695
|
+
withControls: PropTypes__default["default"].bool
|
|
2655
2696
|
});
|
|
2656
2697
|
var visualElement = PropTypes__default["default"].shape({
|
|
2657
2698
|
media: imageMedia
|
|
@@ -3168,7 +3209,7 @@ var AdFrame = function AdFrame(_ref) {
|
|
|
3168
3209
|
height: height,
|
|
3169
3210
|
className: className
|
|
3170
3211
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3171
|
-
icon:
|
|
3212
|
+
icon: faAd.faAd,
|
|
3172
3213
|
className: styles$c.icon
|
|
3173
3214
|
}));
|
|
3174
3215
|
};
|
|
@@ -3183,7 +3224,7 @@ var AdImage = function AdImage(_ref) {
|
|
|
3183
3224
|
height: height,
|
|
3184
3225
|
className: className
|
|
3185
3226
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3186
|
-
icon:
|
|
3227
|
+
icon: faImage.faImage,
|
|
3187
3228
|
className: styles$c.icon
|
|
3188
3229
|
}));
|
|
3189
3230
|
};
|
|
@@ -3200,7 +3241,7 @@ var Audio = function Audio(_ref) {
|
|
|
3200
3241
|
height: height,
|
|
3201
3242
|
className: className
|
|
3202
3243
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3203
|
-
icon:
|
|
3244
|
+
icon: faMusic.faMusic,
|
|
3204
3245
|
className: styles$c.icon
|
|
3205
3246
|
}));
|
|
3206
3247
|
};
|
|
@@ -3280,7 +3321,7 @@ var Image = function Image(_ref) {
|
|
|
3280
3321
|
height: height,
|
|
3281
3322
|
className: className
|
|
3282
3323
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3283
|
-
icon:
|
|
3324
|
+
icon: faImage.faImage,
|
|
3284
3325
|
className: styles$c.icon
|
|
3285
3326
|
}));
|
|
3286
3327
|
};
|
|
@@ -3302,16 +3343,16 @@ var Map = function Map(props) {
|
|
|
3302
3343
|
height: "100%",
|
|
3303
3344
|
className: classNames__default["default"]([styles$a.container, _defineProperty__default["default"]({}, props.className, props.className !== null)])
|
|
3304
3345
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3305
|
-
icon: props.withImages ?
|
|
3346
|
+
icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
|
|
3306
3347
|
className: styles$a.icon
|
|
3307
3348
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3308
|
-
icon: props.withImages ?
|
|
3349
|
+
icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
|
|
3309
3350
|
className: styles$a.icon
|
|
3310
3351
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3311
|
-
icon: props.withImages ?
|
|
3352
|
+
icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
|
|
3312
3353
|
className: styles$a.icon
|
|
3313
3354
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3314
|
-
icon: props.withImages ?
|
|
3355
|
+
icon: props.withImages ? faImage.faImage : faMapMarkerAlt.faMapMarkerAlt,
|
|
3315
3356
|
className: styles$a.icon
|
|
3316
3357
|
}));
|
|
3317
3358
|
};
|
|
@@ -3323,7 +3364,7 @@ var MapPath = function MapPath(props) {
|
|
|
3323
3364
|
height: "70%",
|
|
3324
3365
|
className: classNames__default["default"]([props.className, styles$c.mapPath])
|
|
3325
3366
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3326
|
-
icon:
|
|
3367
|
+
icon: faMapMarkedAlt.faMapMarkedAlt,
|
|
3327
3368
|
size: "lg",
|
|
3328
3369
|
className: styles$c.icon
|
|
3329
3370
|
}));
|
|
@@ -3400,7 +3441,7 @@ var Video = function Video(_ref) {
|
|
|
3400
3441
|
height: height,
|
|
3401
3442
|
className: className
|
|
3402
3443
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3403
|
-
icon:
|
|
3444
|
+
icon: faVideo.faVideo,
|
|
3404
3445
|
className: styles$c.icon
|
|
3405
3446
|
}));
|
|
3406
3447
|
};
|
|
@@ -3417,7 +3458,7 @@ var Video360 = function Video360(_ref) {
|
|
|
3417
3458
|
className: classNames__default["default"]([styles$9.container, _defineProperty__default["default"]({}, className, className !== null)]),
|
|
3418
3459
|
boxClassName: styles$9.box
|
|
3419
3460
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3420
|
-
icon:
|
|
3461
|
+
icon: faVideo.faVideo,
|
|
3421
3462
|
className: styles$9.icon
|
|
3422
3463
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3423
3464
|
className: styles$9.label
|
|
@@ -3434,10 +3475,10 @@ var VideoLoop = function VideoLoop(_ref) {
|
|
|
3434
3475
|
height: height,
|
|
3435
3476
|
className: className
|
|
3436
3477
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3437
|
-
icon:
|
|
3478
|
+
icon: faPlay.faPlay,
|
|
3438
3479
|
className: styles$c.icon
|
|
3439
3480
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3440
|
-
icon:
|
|
3481
|
+
icon: faRedo.faRedo,
|
|
3441
3482
|
className: styles$c.icon
|
|
3442
3483
|
}));
|
|
3443
3484
|
};
|
|
@@ -3761,7 +3802,7 @@ var Conversation = function Conversation() {
|
|
|
3761
3802
|
className: classNames__default["default"]([styles$4.message, styles$4["placeholderMessage".concat(idx)]])
|
|
3762
3803
|
});
|
|
3763
3804
|
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3764
|
-
icon:
|
|
3805
|
+
icon: faCommentDots.faCommentDots,
|
|
3765
3806
|
className: styles$4.icon
|
|
3766
3807
|
}));
|
|
3767
3808
|
};
|
|
@@ -3799,7 +3840,7 @@ var Answer$1 = function Answer(_ref) {
|
|
|
3799
3840
|
className: styles$3.answer
|
|
3800
3841
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3801
3842
|
className: styles$3.answerIcon,
|
|
3802
|
-
icon: good ?
|
|
3843
|
+
icon: good ? faCheck.faCheck : faTimes.faTimes
|
|
3803
3844
|
})), /*#__PURE__*/React__default["default"].createElement(PlaceholderBlock, {
|
|
3804
3845
|
outline: true,
|
|
3805
3846
|
width: width,
|
|
@@ -3833,7 +3874,7 @@ var Answer = function Answer(_ref) {
|
|
|
3833
3874
|
className: styles$2.percent
|
|
3834
3875
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3835
3876
|
className: styles$2.percentIcon,
|
|
3836
|
-
icon:
|
|
3877
|
+
icon: faPercent.faPercent
|
|
3837
3878
|
})));
|
|
3838
3879
|
};
|
|
3839
3880
|
|
package/lib/index.js
CHANGED
|
@@ -314,7 +314,7 @@ var videoElement = PropTypes__default["default"].shape({
|
|
|
314
314
|
loop: PropTypes__default["default"].bool,
|
|
315
315
|
closedCaptions: closedCaptionsMedia,
|
|
316
316
|
withSeekBar: PropTypes__default["default"].bool,
|
|
317
|
-
|
|
317
|
+
withControls: PropTypes__default["default"].bool
|
|
318
318
|
});
|
|
319
319
|
var visualElement = PropTypes__default["default"].shape({
|
|
320
320
|
media: imageMedia
|
package/lib/utils.js
CHANGED
|
@@ -421,6 +421,15 @@ var getScreenExtraField = function getScreenExtraField(intl) {
|
|
|
421
421
|
};
|
|
422
422
|
};
|
|
423
423
|
|
|
424
|
+
function getShadowCoords(angle, distance) {
|
|
425
|
+
var x = (Math.cos(angle) * distance).toFixed(3);
|
|
426
|
+
var y = (Math.sin(angle) * distance).toFixed(3);
|
|
427
|
+
return {
|
|
428
|
+
x: x,
|
|
429
|
+
y: y
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
424
433
|
var getStyleFromColor = function getStyleFromColor() {
|
|
425
434
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
426
435
|
var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'backgroundColor';
|
|
@@ -453,17 +462,24 @@ var getStyleFromShadow = function getStyleFromShadow(value) {
|
|
|
453
462
|
}
|
|
454
463
|
|
|
455
464
|
var _ref = value || {},
|
|
456
|
-
_ref$
|
|
457
|
-
|
|
458
|
-
_ref$
|
|
459
|
-
|
|
465
|
+
_ref$shadowAngle = _ref.shadowAngle,
|
|
466
|
+
shadowAngle = _ref$shadowAngle === void 0 ? null : _ref$shadowAngle,
|
|
467
|
+
_ref$shadowDistance = _ref.shadowDistance,
|
|
468
|
+
shadowDistance = _ref$shadowDistance === void 0 ? null : _ref$shadowDistance,
|
|
460
469
|
_ref$shadowBlur = _ref.shadowBlur,
|
|
461
|
-
shadowBlur = _ref$shadowBlur === void 0 ?
|
|
470
|
+
shadowBlur = _ref$shadowBlur === void 0 ? null : _ref$shadowBlur,
|
|
462
471
|
_ref$shadowColor = _ref.shadowColor,
|
|
463
|
-
shadowColor = _ref$shadowColor === void 0 ?
|
|
472
|
+
shadowColor = _ref$shadowColor === void 0 ? null : _ref$shadowColor;
|
|
473
|
+
|
|
474
|
+
if (!shadowAngle) return null;
|
|
475
|
+
var blur = shadowBlur || '0';
|
|
476
|
+
var color = getColorAsString(shadowColor) || '#000000';
|
|
477
|
+
|
|
478
|
+
var _getShadowCoords = getShadowCoords(shadowAngle, shadowDistance),
|
|
479
|
+
x = _getShadowCoords.x,
|
|
480
|
+
y = _getShadowCoords.y;
|
|
464
481
|
|
|
465
|
-
var
|
|
466
|
-
var boxShadow = "".concat(shadowHorizontalOffset, "px ").concat(shadowVerticalOffset, "px ").concat(shadowBlur, "px 0 ").concat(color);
|
|
482
|
+
var boxShadow = "".concat(x, "px ").concat(y, "px ").concat(blur, "px 0 ").concat(color);
|
|
467
483
|
return {
|
|
468
484
|
boxShadow: boxShadow
|
|
469
485
|
};
|
|
@@ -494,10 +510,10 @@ var getStyleFromBox = function getStyleFromBox(value) {
|
|
|
494
510
|
borderStyle = _value$borderStyle === void 0 ? null : _value$borderStyle,
|
|
495
511
|
_value$borderColor = value.borderColor,
|
|
496
512
|
borderColor = _value$borderColor === void 0 ? null : _value$borderColor,
|
|
497
|
-
_value$
|
|
498
|
-
|
|
499
|
-
_value$
|
|
500
|
-
|
|
513
|
+
_value$shadowAngle = value.shadowAngle,
|
|
514
|
+
shadowAngle = _value$shadowAngle === void 0 ? null : _value$shadowAngle,
|
|
515
|
+
_value$shadowDistance = value.shadowDistance,
|
|
516
|
+
shadowDistance = _value$shadowDistance === void 0 ? null : _value$shadowDistance,
|
|
501
517
|
_value$shadowBlur = value.shadowBlur,
|
|
502
518
|
shadowBlur = _value$shadowBlur === void 0 ? null : _value$shadowBlur,
|
|
503
519
|
_value$shadowColor = value.shadowColor,
|
|
@@ -508,8 +524,8 @@ var getStyleFromBox = function getStyleFromBox(value) {
|
|
|
508
524
|
color: borderColor
|
|
509
525
|
};
|
|
510
526
|
var shadow = {
|
|
511
|
-
|
|
512
|
-
|
|
527
|
+
shadowAngle: shadowAngle,
|
|
528
|
+
shadowDistance: shadowDistance,
|
|
513
529
|
shadowBlur: shadowBlur,
|
|
514
530
|
shadowColor: shadowColor
|
|
515
531
|
};
|
|
@@ -881,6 +897,7 @@ exports.getMediaFilesAsArray = getMediaFilesAsArray;
|
|
|
881
897
|
exports.getOptimalImageUrl = getOptimalImageUrl;
|
|
882
898
|
exports.getScreenExtraField = getScreenExtraField;
|
|
883
899
|
exports.getSecondsFromTime = getSecondsFromTime;
|
|
900
|
+
exports.getShadowCoords = getShadowCoords;
|
|
884
901
|
exports.getStyleFromBorder = getStyleFromBorder;
|
|
885
902
|
exports.getStyleFromBox = getStyleFromBox;
|
|
886
903
|
exports.getStyleFromColor = getStyleFromColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.112",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "f85362071b76115397f9a77537ac6e66b91f59f3"
|
|
136
136
|
}
|