@micromag/core 0.3.781 → 0.3.789

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 CHANGED
@@ -1,31 +1,31 @@
1
+ import PropTypes from 'prop-types';
2
+ import React, { useCallback, useState, useEffect, useRef, useMemo } from 'react';
1
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import classNames from 'classnames';
4
- import PropTypes from 'prop-types';
5
- import React, { useCallback, useState, useEffect, useRef, useMemo } from 'react';
6
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
+ import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
6
8
  import { Link as Link$1 } from 'wouter';
7
9
  import { PropTypes as PropTypes$1 } from '@micromag/core';
8
10
  import { FormattedMessage, defineMessages, FormattedDate, FormattedTime } from 'react-intl';
9
11
  import { isMessage, getFieldFromPath, getComponentFromName, setFieldValue, validateFields, getDisplayName, pascalCase, convertStyleToString } from '@micromag/core/utils';
10
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
11
- import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
12
12
  import { faClose } from '@fortawesome/free-solid-svg-icons/faClose';
13
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
14
13
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
15
- import { useForm, useDocumentEvent, useIntersectionObserver, useDimensionObserver, useDevicePixelRatio } from '@micromag/core/hooks';
16
- import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals, withPanels, usePanels, ScreenSizeProvider, useScreenComponent, ScreenProvider, useScreenRenderContext, useScreenSize } from '@micromag/core/contexts';
17
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
18
- import get from 'lodash/get';
19
- import queryString from 'query-string';
20
- import { createPortal } from 'react-dom';
21
14
  import { faAngleDown } from '@fortawesome/free-solid-svg-icons/faAngleDown';
22
15
  import { faAngleUp } from '@fortawesome/free-solid-svg-icons/faAngleUp';
23
16
  import dayjs from 'dayjs';
24
17
  import throttle from 'lodash/throttle';
18
+ import { useForm, useDocumentEvent, useIntersectionObserver, useDimensionObserver, useDevicePixelRatio } from '@micromag/core/hooks';
19
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
20
+ import get from 'lodash/get';
21
+ import { useFieldsManager, useFieldComponent, FieldContextProvider, withModals, useModals, withPanels, usePanels, ScreenSizeProvider, useScreenComponent, ScreenProvider, useScreenRenderContext, useScreenSize } from '@micromag/core/contexts';
22
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
25
23
  import isObject from 'lodash/isObject';
26
24
  import { Helmet } from 'react-helmet';
27
25
  import isString from 'lodash/isString';
28
26
  import isArray from 'lodash/isArray';
27
+ import { createPortal } from 'react-dom';
28
+ import queryString from 'query-string';
29
29
  import { faAd } from '@fortawesome/free-solid-svg-icons/faAd';
30
30
  import { faImage } from '@fortawesome/free-solid-svg-icons/faImage';
31
31
  import { faMusic } from '@fortawesome/free-solid-svg-icons/faMusic';
@@ -35,12 +35,12 @@ import { faMapMarkedAlt } from '@fortawesome/free-solid-svg-icons/faMapMarkedAlt
35
35
  import { faVideo } from '@fortawesome/free-solid-svg-icons/faVideo';
36
36
  import { faPlay } from '@fortawesome/free-solid-svg-icons/faPlay';
37
37
  import { faRedo } from '@fortawesome/free-solid-svg-icons/faRedo';
38
- import { getSizeWithinBounds } from '@folklore/size';
39
38
  import { faCommentDots } from '@fortawesome/free-solid-svg-icons/faCommentDots';
40
39
  import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
41
40
  import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
42
41
  import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
43
42
  import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
43
+ import { getSizeWithinBounds } from '@folklore/size';
44
44
  import { useSpring } from '@react-spring/core';
45
45
  import { config, animated } from '@react-spring/web';
46
46
 
@@ -2435,24 +2435,56 @@ var FontFaces = function FontFaces(_ref4) {
2435
2435
  return fontFontFaces;
2436
2436
  }
2437
2437
  var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
2438
- return [].concat(_toConsumableArray(fontFontFaces), [urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null], _toConsumableArray((variants || []).map(function (_ref6) {
2438
+ var fontKey = name.toLowerCase();
2439
+ return _objectSpread(_objectSpread({}, fontFontFaces), {}, _defineProperty({}, fontKey, urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null), variants.reduce(function (variantFontFaces, _ref6) {
2439
2440
  var weight = _ref6.weight,
2440
2441
  style = _ref6.style,
2441
2442
  _ref6$media = _ref6.media,
2442
2443
  variantMedia = _ref6$media === void 0 ? null : _ref6$media;
2443
2444
  if (variantMedia == null) {
2444
- return null;
2445
+ return variantFontFaces;
2445
2446
  }
2446
2447
  var variantUrls = getUrlsFromMedia(variantMedia, formats);
2447
- return variantUrls !== null && variantUrls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n ").concat(weight !== null ? "font-weight: ".concat(weight, ";") : '', "\n ").concat(style !== null ? "font-style: ".concat(style, ";") : '', "\n src: ").concat(variantUrls.join(','), ";\n }\n ") : null;
2448
- })));
2449
- }, []).filter(function (it) {
2450
- return it !== null;
2451
- });
2452
- return fontFaces.length > 0 ? /*#__PURE__*/React.createElement("style", {
2448
+ var variantKey = "".concat(fontKey, "-").concat(weight !== null ? weight : 'normal', "-").concat(style !== null ? style : 'normal');
2449
+ return _objectSpread(_objectSpread({}, variantFontFaces), {}, _defineProperty({}, variantKey, variantUrls !== null && variantUrls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n ").concat(weight !== null ? "font-weight: ".concat(weight, ";") : '', "\n ").concat(style !== null ? "font-style: ".concat(style, ";") : '', "\n src: ").concat(variantUrls.join(','), ";\n }\n ") : null));
2450
+ }, {}));
2451
+
2452
+ // return [
2453
+ // ...fontFontFaces,
2454
+ // urls !== null && urls.length > 0
2455
+ // ? `
2456
+ // @font-face {
2457
+ // font-family: "${name}";
2458
+ // src: ${urls.join(',')};
2459
+ // }
2460
+ // `
2461
+ // : null,
2462
+ // ...(variants || []).map(({ weight, style, media: variantMedia = null }) => {
2463
+ // if (variantMedia == null) {
2464
+ // return null;
2465
+ // }
2466
+ // const variantUrls = getUrlsFromMedia(variantMedia, formats);
2467
+ // return variantUrls !== null && variantUrls.length > 0
2468
+ // ? `
2469
+ // @font-face {
2470
+ // font-family: "${name}";
2471
+ // ${weight !== null ? `font-weight: ${weight};` : ''}
2472
+ // ${style !== null ? `font-style: ${style};` : ''}
2473
+ // src: ${variantUrls.join(',')};
2474
+ // }
2475
+ // `
2476
+ // : null;
2477
+ // }),
2478
+ // ];
2479
+ }, {});
2480
+ return Object.keys(fontFaces).length > 0 ? /*#__PURE__*/React.createElement("style", {
2453
2481
  type: "text/css",
2454
2482
  dangerouslySetInnerHTML: {
2455
- __html: fontFaces.join('\n')
2483
+ __html: Object.keys(fontFaces).map(function (it) {
2484
+ return fontFaces[it];
2485
+ }).filter(function (it) {
2486
+ return it !== null;
2487
+ }).join('\n')
2456
2488
  }
2457
2489
  }) : null;
2458
2490
  };
@@ -3743,7 +3775,7 @@ var defaultProps$9 = {
3743
3775
  className: null,
3744
3776
  mediaRef: null
3745
3777
  };
3746
- var Screen = function Screen(_ref) {
3778
+ var Screen$1 = function Screen(_ref) {
3747
3779
  var screen = _ref.screen,
3748
3780
  renderContext = _ref.renderContext,
3749
3781
  screenState = _ref.screenState,
@@ -3777,9 +3809,9 @@ var Screen = function Screen(_ref) {
3777
3809
  className: className
3778
3810
  }, component));
3779
3811
  };
3780
- Screen.propTypes = propTypes$9;
3781
- Screen.defaultProps = defaultProps$9;
3782
- var Screen$1 = /*#__PURE__*/React.memo(Screen);
3812
+ Screen$1.propTypes = propTypes$9;
3813
+ Screen$1.defaultProps = defaultProps$9;
3814
+ var Screen = /*#__PURE__*/React.memo(Screen$1);
3783
3815
 
3784
3816
  var styles$7 = {"screen":"micromag-core-screens-screen-placeholder-screen"};
3785
3817
 
@@ -3810,7 +3842,7 @@ var ScreenPlaceholder = function ScreenPlaceholder(_ref) {
3810
3842
  withSize = _ref.withSize,
3811
3843
  className = _ref.className,
3812
3844
  props = _objectWithoutProperties(_ref, _excluded$1);
3813
- var screenElement = /*#__PURE__*/React.createElement(Screen$1, Object.assign({
3845
+ var screenElement = /*#__PURE__*/React.createElement(Screen, Object.assign({
3814
3846
  screen: screen,
3815
3847
  renderContext: "placeholder",
3816
3848
  screenState: screenState,
@@ -3863,7 +3895,7 @@ var ScreenPreview = function ScreenPreview(_ref) {
3863
3895
  fit = _ref.fit,
3864
3896
  hidden = _ref.hidden,
3865
3897
  props = _objectWithoutProperties(_ref, _excluded);
3866
- var screenElement = /*#__PURE__*/React.createElement(Screen$1, Object.assign({
3898
+ var screenElement = /*#__PURE__*/React.createElement(Screen, Object.assign({
3867
3899
  screen: screen,
3868
3900
  renderContext: "preview",
3869
3901
  screenState: screenState,
@@ -4094,7 +4126,7 @@ var Screens = function Screens(_ref) {
4094
4126
  className: classNames([styles$1.container, _defineProperty({}, className, className)])
4095
4127
  }, screens.map(function (screen) {
4096
4128
  var id = screen.id;
4097
- return /*#__PURE__*/React.createElement(Screen$1, {
4129
+ return /*#__PURE__*/React.createElement(Screen, {
4098
4130
  key: "screen-".concat(id),
4099
4131
  screen: screen,
4100
4132
  className: classNames([styles$1.screen, _defineProperty({}, styles$1.visible, screenId === id)])
@@ -4428,4 +4460,4 @@ var LinkStyle = function LinkStyle(_ref) {
4428
4460
  LinkStyle.propTypes = propTypes;
4429
4461
  LinkStyle.defaultProps = defaultProps;
4430
4462
 
4431
- export { ArrowIcon, BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, ClearButton, Close, CloseIcon, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, FullscreenIcon, HighlightStyle, Label, Link, LinkIcon, LinkStyle, Media, _Menu as Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, MuteIcon, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, PauseIcon, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, PlayIcon, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UnmuteIcon };
4463
+ export { ArrowIcon, BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, ClearButton, Close, CloseIcon, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, FullscreenIcon, HighlightStyle, Label, Link, LinkIcon, LinkStyle, Media, _Menu as Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, MuteIcon, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, PauseIcon, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, PlayIcon, Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UnmuteIcon };
package/es/contexts.js CHANGED
@@ -15,10 +15,10 @@ import { loadGoogleApi, loadGoogleMaps } from '@folklore/services';
15
15
  import { getDisplayName, getScreenExtraField } from '@micromag/core/utils';
16
16
  import { useUrlGenerator } from '@folklore/routes';
17
17
  export { RoutesContext, RoutesProvider, useRoutes, useUrlGenerator } from '@folklore/routes';
18
- import { useLocation } from 'wouter';
19
- import { TrackingContext, TrackingContainer } from '@folklore/tracking';
18
+ import { TrackingContainer, TrackingContext } from '@folklore/tracking';
20
19
  export { TrackingContext } from '@folklore/tracking';
21
20
  import EventEmitter from 'wolfy87-eventemitter';
21
+ import { useLocation } from 'wouter';
22
22
 
23
23
  var MODALS_NAMESPACE = 'modals';
24
24
  var FIELDS_NAMESPACE = 'fields';
package/es/hooks.js CHANGED
@@ -13,13 +13,13 @@ import screenfull from 'screenfull';
13
13
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
14
14
  import isArray from 'lodash/isArray';
15
15
  import isObject from 'lodash/isObject';
16
+ import raf from 'raf';
16
17
  import createDebug from 'debug';
17
18
  import isString from 'lodash/isString';
18
- import raf from 'raf';
19
19
  import { useScreensManager, useFieldsManager, useTracking, useScreen } from '@micromag/core/contexts';
20
+ import { match } from 'css-mediaquery';
20
21
  import { useIntl } from 'react-intl';
21
22
  import dayjs from 'dayjs';
22
- import { match } from 'css-mediaquery';
23
23
  import clamp from 'lodash/clamp';
24
24
 
25
25
  function useActivityDetector() {
package/es/index.js CHANGED
@@ -12,11 +12,11 @@ import _inherits from '@babel/runtime/helpers/inherits';
12
12
  import EventEmitter from 'wolfy87-eventemitter';
13
13
  import { snakeCase, pascalCase } from 'change-case';
14
14
  import uniqBy from 'lodash/uniqBy';
15
- import _typeof from '@babel/runtime/helpers/typeof';
16
15
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
16
+ import uniq from 'lodash/uniq';
17
+ import _typeof from '@babel/runtime/helpers/typeof';
17
18
  import isString from 'lodash/isString';
18
19
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
19
- import uniq from 'lodash/uniq';
20
20
  import isEmpty from 'lodash/isEmpty';
21
21
  import { Tracking as Tracking$1 } from '@folklore/tracking';
22
22
  import PropTypes$1 from 'prop-types';
package/es/utils.js CHANGED
@@ -11,8 +11,8 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
11
11
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
12
12
  import isArray from 'lodash/isArray';
13
13
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
14
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
15
14
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
15
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
16
16
  import slugify from 'slugify';
17
17
 
18
18
  function addNonBreakingSpaces(text) {
package/lib/components.js CHANGED
@@ -1,33 +1,33 @@
1
1
  'use strict';
2
2
 
3
+ var PropTypes = require('prop-types');
4
+ var React = require('react');
3
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
6
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
7
  var classNames = require('classnames');
6
- var PropTypes = require('prop-types');
7
- var React = require('react');
8
+ var reactFontawesome = require('@fortawesome/react-fontawesome');
9
+ var faAngleLeft = require('@fortawesome/free-solid-svg-icons/faAngleLeft');
8
10
  var wouter = require('wouter');
9
11
  var core = require('@micromag/core');
10
12
  var reactIntl = require('react-intl');
11
13
  var utils = require('@micromag/core/utils');
12
- var reactFontawesome = require('@fortawesome/react-fontawesome');
13
- var faAngleLeft = require('@fortawesome/free-solid-svg-icons/faAngleLeft');
14
14
  var faClose = require('@fortawesome/free-solid-svg-icons/faClose');
15
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
16
15
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
17
- var hooks = require('@micromag/core/hooks');
18
- var contexts = require('@micromag/core/contexts');
19
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
20
- var get = require('lodash/get');
21
- var queryString = require('query-string');
22
- var reactDom = require('react-dom');
23
16
  var faAngleDown = require('@fortawesome/free-solid-svg-icons/faAngleDown');
24
17
  var faAngleUp = require('@fortawesome/free-solid-svg-icons/faAngleUp');
25
18
  var dayjs = require('dayjs');
26
19
  var throttle = require('lodash/throttle');
20
+ var hooks = require('@micromag/core/hooks');
21
+ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
22
+ var get = require('lodash/get');
23
+ var contexts = require('@micromag/core/contexts');
24
+ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
27
25
  var isObject = require('lodash/isObject');
28
26
  var reactHelmet = require('react-helmet');
29
27
  var isString = require('lodash/isString');
30
28
  var isArray = require('lodash/isArray');
29
+ var reactDom = require('react-dom');
30
+ var queryString = require('query-string');
31
31
  var faAd = require('@fortawesome/free-solid-svg-icons/faAd');
32
32
  var faImage = require('@fortawesome/free-solid-svg-icons/faImage');
33
33
  var faMusic = require('@fortawesome/free-solid-svg-icons/faMusic');
@@ -37,12 +37,12 @@ var faMapMarkedAlt = require('@fortawesome/free-solid-svg-icons/faMapMarkedAlt')
37
37
  var faVideo = require('@fortawesome/free-solid-svg-icons/faVideo');
38
38
  var faPlay = require('@fortawesome/free-solid-svg-icons/faPlay');
39
39
  var faRedo = require('@fortawesome/free-solid-svg-icons/faRedo');
40
- var size = require('@folklore/size');
41
40
  var faCommentDots = require('@fortawesome/free-solid-svg-icons/faCommentDots');
42
41
  var faCheck = require('@fortawesome/free-solid-svg-icons/faCheck');
43
42
  var faTimes = require('@fortawesome/free-solid-svg-icons/faTimes');
44
43
  var faCircle = require('@fortawesome/free-solid-svg-icons/faCircle');
45
44
  var faPercent = require('@fortawesome/free-solid-svg-icons/faPercent');
45
+ var size = require('@folklore/size');
46
46
  var core$1 = require('@react-spring/core');
47
47
  var web = require('@react-spring/web');
48
48
 
@@ -2437,24 +2437,56 @@ var FontFaces = function FontFaces(_ref4) {
2437
2437
  return fontFontFaces;
2438
2438
  }
2439
2439
  var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
2440
- return [].concat(_toConsumableArray(fontFontFaces), [urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null], _toConsumableArray((variants || []).map(function (_ref6) {
2440
+ var fontKey = name.toLowerCase();
2441
+ return _objectSpread(_objectSpread({}, fontFontFaces), {}, _defineProperty({}, fontKey, urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null), variants.reduce(function (variantFontFaces, _ref6) {
2441
2442
  var weight = _ref6.weight,
2442
2443
  style = _ref6.style,
2443
2444
  _ref6$media = _ref6.media,
2444
2445
  variantMedia = _ref6$media === void 0 ? null : _ref6$media;
2445
2446
  if (variantMedia == null) {
2446
- return null;
2447
+ return variantFontFaces;
2447
2448
  }
2448
2449
  var variantUrls = getUrlsFromMedia(variantMedia, formats);
2449
- return variantUrls !== null && variantUrls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n ").concat(weight !== null ? "font-weight: ".concat(weight, ";") : '', "\n ").concat(style !== null ? "font-style: ".concat(style, ";") : '', "\n src: ").concat(variantUrls.join(','), ";\n }\n ") : null;
2450
- })));
2451
- }, []).filter(function (it) {
2452
- return it !== null;
2453
- });
2454
- return fontFaces.length > 0 ? /*#__PURE__*/React.createElement("style", {
2450
+ var variantKey = "".concat(fontKey, "-").concat(weight !== null ? weight : 'normal', "-").concat(style !== null ? style : 'normal');
2451
+ return _objectSpread(_objectSpread({}, variantFontFaces), {}, _defineProperty({}, variantKey, variantUrls !== null && variantUrls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n ").concat(weight !== null ? "font-weight: ".concat(weight, ";") : '', "\n ").concat(style !== null ? "font-style: ".concat(style, ";") : '', "\n src: ").concat(variantUrls.join(','), ";\n }\n ") : null));
2452
+ }, {}));
2453
+
2454
+ // return [
2455
+ // ...fontFontFaces,
2456
+ // urls !== null && urls.length > 0
2457
+ // ? `
2458
+ // @font-face {
2459
+ // font-family: "${name}";
2460
+ // src: ${urls.join(',')};
2461
+ // }
2462
+ // `
2463
+ // : null,
2464
+ // ...(variants || []).map(({ weight, style, media: variantMedia = null }) => {
2465
+ // if (variantMedia == null) {
2466
+ // return null;
2467
+ // }
2468
+ // const variantUrls = getUrlsFromMedia(variantMedia, formats);
2469
+ // return variantUrls !== null && variantUrls.length > 0
2470
+ // ? `
2471
+ // @font-face {
2472
+ // font-family: "${name}";
2473
+ // ${weight !== null ? `font-weight: ${weight};` : ''}
2474
+ // ${style !== null ? `font-style: ${style};` : ''}
2475
+ // src: ${variantUrls.join(',')};
2476
+ // }
2477
+ // `
2478
+ // : null;
2479
+ // }),
2480
+ // ];
2481
+ }, {});
2482
+ return Object.keys(fontFaces).length > 0 ? /*#__PURE__*/React.createElement("style", {
2455
2483
  type: "text/css",
2456
2484
  dangerouslySetInnerHTML: {
2457
- __html: fontFaces.join('\n')
2485
+ __html: Object.keys(fontFaces).map(function (it) {
2486
+ return fontFaces[it];
2487
+ }).filter(function (it) {
2488
+ return it !== null;
2489
+ }).join('\n')
2458
2490
  }
2459
2491
  }) : null;
2460
2492
  };
package/lib/contexts.js CHANGED
@@ -16,9 +16,9 @@ var isObject = require('lodash/isObject');
16
16
  var services = require('@folklore/services');
17
17
  var utils = require('@micromag/core/utils');
18
18
  var routes = require('@folklore/routes');
19
- var wouter = require('wouter');
20
19
  var tracking = require('@folklore/tracking');
21
20
  var EventEmitter = require('wolfy87-eventemitter');
21
+ var wouter = require('wouter');
22
22
 
23
23
  var MODALS_NAMESPACE = 'modals';
24
24
  var FIELDS_NAMESPACE = 'fields';
package/lib/hooks.js CHANGED
@@ -15,13 +15,13 @@ var screenfull = require('screenfull');
15
15
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
16
16
  var isArray = require('lodash/isArray');
17
17
  var isObject = require('lodash/isObject');
18
+ var raf = require('raf');
18
19
  var createDebug = require('debug');
19
20
  var isString = require('lodash/isString');
20
- var raf = require('raf');
21
21
  var contexts = require('@micromag/core/contexts');
22
+ var cssMediaquery = require('css-mediaquery');
22
23
  var reactIntl = require('react-intl');
23
24
  var dayjs = require('dayjs');
24
- var cssMediaquery = require('css-mediaquery');
25
25
  var clamp = require('lodash/clamp');
26
26
 
27
27
  function useActivityDetector() {
package/lib/index.js CHANGED
@@ -14,11 +14,11 @@ var _inherits = require('@babel/runtime/helpers/inherits');
14
14
  var EventEmitter = require('wolfy87-eventemitter');
15
15
  var changeCase = require('change-case');
16
16
  var uniqBy = require('lodash/uniqBy');
17
- var _typeof = require('@babel/runtime/helpers/typeof');
18
17
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
18
+ var uniq = require('lodash/uniq');
19
+ var _typeof = require('@babel/runtime/helpers/typeof');
19
20
  var isString = require('lodash/isString');
20
21
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
21
- var uniq = require('lodash/uniq');
22
22
  var isEmpty = require('lodash/isEmpty');
23
23
  var tracking = require('@folklore/tracking');
24
24
  var PropTypes$1 = require('prop-types');
package/lib/utils.js CHANGED
@@ -12,8 +12,8 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
12
12
  var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
13
13
  var isArray = require('lodash/isArray');
14
14
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
15
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
16
15
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
16
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
17
17
  var slugify = require('slugify');
18
18
 
19
19
  function addNonBreakingSpaces(text) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.3.781",
3
+ "version": "0.3.789",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -120,6 +120,9 @@
120
120
  "@panneau/filters": "^3.0.301",
121
121
  "@panneau/medias": "^3.0.300",
122
122
  "@panneau/uppy": "^3.0.162",
123
+ "@uppy/core": "^5.1.1",
124
+ "@uppy/dashboard": "^5.0.4",
125
+ "@uppy/react": "^5.1.1",
123
126
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
124
127
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
125
128
  },
@@ -164,5 +167,5 @@
164
167
  "access": "public",
165
168
  "registry": "https://registry.npmjs.org/"
166
169
  },
167
- "gitHead": "95e03bd48803c170ef4efbc5bd204a0c83563c11"
170
+ "gitHead": "60eb4574b9d13a985e7cd317429c06c1f98ab275"
168
171
  }
package/scss/vendor.scss CHANGED
@@ -4,8 +4,8 @@
4
4
  @import './placeholders';
5
5
  @import './mixins';
6
6
  @import '~bootstrap/scss/bootstrap';
7
- @import '~@uppy/core/dist/style';
8
- @import '~@uppy/dashboard/dist/style';
7
+ @import '@uppy/core/css/style.min.css';
8
+ @import '@uppy/dashboard/css/style.min.css';
9
9
 
10
10
  // TODO add more when needed
11
11
  @import '~@panneau/fields/scss/styles';