@micromag/core 0.3.606 → 0.3.608

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/utils.js CHANGED
@@ -270,9 +270,9 @@ var getColorAsString = function getColorAsString() {
270
270
  color: value
271
271
  } : value,
272
272
  _ref$color = _ref.color,
273
- color = _ref$color === void 0 ? null : _ref$color,
273
+ color = _ref$color === undefined ? null : _ref$color,
274
274
  _ref$alpha = _ref.alpha,
275
- alpha = _ref$alpha === void 0 ? null : _ref$alpha;
275
+ alpha = _ref$alpha === undefined ? null : _ref$alpha;
276
276
  return alpha !== null || overideAlpha !== null ? tinycolor(color).setAlpha(overideAlpha !== null ? overideAlpha : alpha).toRgbString() : color;
277
277
  };
278
278
 
@@ -310,9 +310,9 @@ var getDeviceScreens = function getDeviceScreens() {
310
310
 
311
311
  var getDisplayName = function getDisplayName(_ref) {
312
312
  var _ref$displayName = _ref.displayName,
313
- displayName = _ref$displayName === void 0 ? null : _ref$displayName,
313
+ displayName = _ref$displayName === undefined ? null : _ref$displayName,
314
314
  _ref$name = _ref.name,
315
- name = _ref$name === void 0 ? null : _ref$name;
315
+ name = _ref$name === undefined ? null : _ref$name;
316
316
  return displayName || name || 'Component';
317
317
  };
318
318
 
@@ -322,9 +322,9 @@ var _getFieldByName = function getFieldByName(fields, name) {
322
322
  return foundField;
323
323
  }
324
324
  var _it$name = it.name,
325
- fieldName = _it$name === void 0 ? null : _it$name,
325
+ fieldName = _it$name === undefined ? null : _it$name,
326
326
  _it$fields = it.fields,
327
- subFields = _it$fields === void 0 ? [] : _it$fields;
327
+ subFields = _it$fields === undefined ? [] : _it$fields;
328
328
  if (name !== null && fieldName === name) {
329
329
  return it;
330
330
  }
@@ -338,22 +338,22 @@ var getFieldFromPath = function getFieldFromPath(path, fields, fieldManager) {
338
338
  return null;
339
339
  }
340
340
  var _foundField$type = foundField.type,
341
- type = _foundField$type === void 0 ? null : _foundField$type,
341
+ type = _foundField$type === undefined ? null : _foundField$type,
342
342
  _foundField$fields = foundField.fields,
343
- fieldFields = _foundField$fields === void 0 ? null : _foundField$fields,
343
+ fieldFields = _foundField$fields === undefined ? null : _foundField$fields,
344
344
  _foundField$field = foundField.field,
345
- field = _foundField$field === void 0 ? null : _foundField$field,
345
+ field = _foundField$field === undefined ? null : _foundField$field,
346
346
  _foundField$itemsFiel = foundField.itemsField,
347
- itemsField = _foundField$itemsFiel === void 0 ? null : _foundField$itemsFiel;
347
+ itemsField = _foundField$itemsFiel === undefined ? null : _foundField$itemsFiel;
348
348
  var finalType = field !== null ? field.type || type : type;
349
349
  var definition = fieldManager.getDefinition(finalType);
350
350
  var _ref = finalType !== null ? definition : foundField,
351
351
  _ref$fields = _ref.fields,
352
- subFields = _ref$fields === void 0 ? null : _ref$fields,
352
+ subFields = _ref$fields === undefined ? null : _ref$fields,
353
353
  _ref$settings = _ref.settings,
354
- settings = _ref$settings === void 0 ? null : _ref$settings,
354
+ settings = _ref$settings === undefined ? null : _ref$settings,
355
355
  _ref$itemsField = _ref.itemsField,
356
- defItemsField = _ref$itemsField === void 0 ? null : _ref$itemsField;
356
+ defItemsField = _ref$itemsField === undefined ? null : _ref$itemsField;
357
357
  var finalItemsField = itemsField || defItemsField;
358
358
  if (finalItemsField !== null && key.match(/^[0-9]+$/)) {
359
359
  return _objectSpread(_objectSpread({}, finalItemsField), {}, {
@@ -384,7 +384,7 @@ var getFontFamily = function getFontFamily(value) {
384
384
  },
385
385
  name = _ref.name,
386
386
  _ref$fallback = _ref.fallback,
387
- fallback = _ref$fallback === void 0 ? null : _ref$fallback;
387
+ fallback = _ref$fallback === undefined ? null : _ref$fallback;
388
388
  return [name, fallback].filter(function (it) {
389
389
  return it !== null;
390
390
  }).map(function (it) {
@@ -397,21 +397,21 @@ var getFooterProps = function getFooterProps() {
397
397
  var footer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
398
398
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
399
399
  _ref$isPreview = _ref.isPreview,
400
- isPreview = _ref$isPreview === void 0 ? false : _ref$isPreview,
400
+ isPreview = _ref$isPreview === undefined ? false : _ref$isPreview,
401
401
  _ref$isView = _ref.isView,
402
- isView = _ref$isView === void 0 ? false : _ref$isView,
402
+ isView = _ref$isView === undefined ? false : _ref$isView,
403
403
  _ref$current = _ref.current,
404
- current = _ref$current === void 0 ? false : _ref$current,
404
+ current = _ref$current === undefined ? false : _ref$current,
405
405
  _ref$openWebView = _ref.openWebView,
406
- openWebView = _ref$openWebView === void 0 ? false : _ref$openWebView,
406
+ openWebView = _ref$openWebView === undefined ? false : _ref$openWebView,
407
407
  _ref$enableInteractio = _ref.enableInteraction,
408
- enableInteraction = _ref$enableInteractio === void 0 ? true : _ref$enableInteractio,
408
+ enableInteraction = _ref$enableInteractio === undefined ? true : _ref$enableInteractio,
409
409
  _ref$disableInteracti = _ref.disableInteraction,
410
- disableInteraction = _ref$disableInteracti === void 0 ? false : _ref$disableInteracti,
410
+ disableInteraction = _ref$disableInteracti === undefined ? false : _ref$disableInteracti,
411
411
  otherProps = _objectWithoutProperties(_ref, _excluded$1);
412
412
  var _ref2 = footer || {},
413
413
  _ref2$callToAction = _ref2.callToAction,
414
- callToAction = _ref2$callToAction === void 0 ? null : _ref2$callToAction;
414
+ callToAction = _ref2$callToAction === undefined ? null : _ref2$callToAction;
415
415
  var footerProps = useMemo(function () {
416
416
  return {
417
417
  callToAction: _objectSpread(_objectSpread({}, callToAction), {}, {
@@ -471,13 +471,13 @@ var getLayersFromBackground = function getLayersFromBackground() {
471
471
  }
472
472
  return (isArray(background) ? background : [background]).reduce(function (layers, _ref) {
473
473
  var _ref$image = _ref.image,
474
- image = _ref$image === void 0 ? null : _ref$image,
474
+ image = _ref$image === undefined ? null : _ref$image,
475
475
  _ref$video = _ref.video,
476
- video = _ref$video === void 0 ? null : _ref$video,
476
+ video = _ref$video === undefined ? null : _ref$video,
477
477
  _ref$media = _ref.media,
478
- media = _ref$media === void 0 ? null : _ref$media,
478
+ media = _ref$media === undefined ? null : _ref$media,
479
479
  _ref$color = _ref.color,
480
- color = _ref$color === void 0 ? null : _ref$color,
480
+ color = _ref$color === undefined ? null : _ref$color,
481
481
  data = _objectWithoutProperties(_ref, _excluded);
482
482
  if (image === null && video === null && color === null) {
483
483
  return layers;
@@ -512,16 +512,16 @@ var getOptimalImageUrl = function getOptimalImageUrl() {
512
512
  var containerHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
513
513
  var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
514
514
  _ref$resolution = _ref.resolution,
515
- resolution = _ref$resolution === void 0 ? 1 : _ref$resolution,
515
+ resolution = _ref$resolution === undefined ? 1 : _ref$resolution,
516
516
  _ref$maxDiff = _ref.maxDiff,
517
- maxDiff = _ref$maxDiff === void 0 ? 800 : _ref$maxDiff;
517
+ maxDiff = _ref$maxDiff === undefined ? 800 : _ref$maxDiff;
518
518
  var _ref2 = media || {},
519
519
  _ref2$sizes = _ref2.sizes,
520
- sizes = _ref2$sizes === void 0 ? null : _ref2$sizes,
520
+ sizes = _ref2$sizes === undefined ? null : _ref2$sizes,
521
521
  _ref2$url = _ref2.url,
522
- defaultUrl = _ref2$url === void 0 ? null : _ref2$url,
522
+ defaultUrl = _ref2$url === undefined ? null : _ref2$url,
523
523
  _ref2$metadata = _ref2.metadata,
524
- _ref2$metadata2 = _ref2$metadata === void 0 ? {} : _ref2$metadata,
524
+ _ref2$metadata2 = _ref2$metadata === undefined ? {} : _ref2$metadata,
525
525
  imgWidth = _ref2$metadata2.width,
526
526
  imgHeight = _ref2$metadata2.height;
527
527
  if (sizes === null || containerWidth === null && containerHeight === null) {
@@ -543,9 +543,9 @@ var getOptimalImageUrl = function getOptimalImageUrl() {
543
543
  var _finalSizes$key = finalSizes[key],
544
544
  url = _finalSizes$key.url,
545
545
  _finalSizes$key$width = _finalSizes$key.width,
546
- width = _finalSizes$key$width === void 0 ? null : _finalSizes$key$width,
546
+ width = _finalSizes$key$width === undefined ? null : _finalSizes$key$width,
547
547
  _finalSizes$key$heigh = _finalSizes$key.height,
548
- height = _finalSizes$key$heigh === void 0 ? null : _finalSizes$key$heigh;
548
+ height = _finalSizes$key$heigh === undefined ? null : _finalSizes$key$heigh;
549
549
  var diffWidth = width !== null && finalContainerWidth !== null ? width - finalContainerWidth : null;
550
550
  var diffHeight = height !== null && finalContainerHeight !== null ? height - finalContainerHeight : null;
551
551
  var isLarger = (diffWidth === null || diffWidth >= 0) && (diffHeight === null || diffHeight >= 0);
@@ -615,9 +615,9 @@ var getScreenExtraField = function getScreenExtraField(intl) {
615
615
  function getScreenFieldsWithStates(definition) {
616
616
  var _ref = definition || {},
617
617
  _ref$fields = _ref.fields,
618
- screenFields = _ref$fields === void 0 ? null : _ref$fields,
618
+ screenFields = _ref$fields === undefined ? null : _ref$fields,
619
619
  _ref$states = _ref.states,
620
- states = _ref$states === void 0 ? null : _ref$states;
620
+ states = _ref$states === undefined ? null : _ref$states;
621
621
  if (states === null) {
622
622
  return screenFields;
623
623
  }
@@ -625,14 +625,14 @@ function getScreenFieldsWithStates(definition) {
625
625
  var _ref2 = current || {},
626
626
  id = _ref2.id,
627
627
  _ref2$fields = _ref2.fields,
628
- fields = _ref2$fields === void 0 ? [] : _ref2$fields,
628
+ fields = _ref2$fields === undefined ? [] : _ref2$fields,
629
629
  _ref2$repeatable = _ref2.repeatable,
630
- repeatable = _ref2$repeatable === void 0 ? false : _ref2$repeatable,
630
+ repeatable = _ref2$repeatable === undefined ? false : _ref2$repeatable,
631
631
  _ref2$fieldName = _ref2.fieldName,
632
- fieldName = _ref2$fieldName === void 0 ? null : _ref2$fieldName,
632
+ fieldName = _ref2$fieldName === undefined ? null : _ref2$fieldName,
633
633
  label = _ref2.label,
634
634
  _ref2$defaultValue = _ref2.defaultValue,
635
- defaultValue = _ref2$defaultValue === void 0 ? null : _ref2$defaultValue;
635
+ defaultValue = _ref2$defaultValue === undefined ? null : _ref2$defaultValue;
636
636
  return [].concat(_toConsumableArray(statesFields), _toConsumableArray(repeatable ? [{
637
637
  type: 'items',
638
638
  name: fieldName || id,
@@ -684,9 +684,9 @@ var getStyleFromAlignment = function getStyleFromAlignment(value) {
684
684
  return null;
685
685
  }
686
686
  var _value$horizontal = value.horizontal,
687
- horizontal = _value$horizontal === void 0 ? null : _value$horizontal,
687
+ horizontal = _value$horizontal === undefined ? null : _value$horizontal,
688
688
  _value$vertical = value.vertical,
689
- vertical = _value$vertical === void 0 ? null : _value$vertical;
689
+ vertical = _value$vertical === undefined ? null : _value$vertical;
690
690
  var justifyContent = getJustifyContent(horizontal);
691
691
  var alignItems = getAlignItems(vertical);
692
692
  return {
@@ -708,11 +708,11 @@ var getStyleFromBorder = function getStyleFromBorder(value) {
708
708
  return null;
709
709
  }
710
710
  var _value$width = value.width,
711
- width = _value$width === void 0 ? null : _value$width,
711
+ width = _value$width === undefined ? null : _value$width,
712
712
  _value$style = value.style,
713
- borderStyle = _value$style === void 0 ? null : _value$style,
713
+ borderStyle = _value$style === undefined ? null : _value$style,
714
714
  _value$color = value.color,
715
- color = _value$color === void 0 ? null : _value$color;
715
+ color = _value$color === undefined ? null : _value$color;
716
716
  return _objectSpread(_objectSpread(_objectSpread({}, width !== null ? {
717
717
  borderWidth: width
718
718
  } : null), borderStyle !== null ? {
@@ -724,15 +724,15 @@ var getStyleFromShadow = function getStyleFromShadow(value) {
724
724
  if (value == null) {
725
725
  return null;
726
726
  }
727
- var _ref = value || {},
727
+ var _ref = value,
728
728
  _ref$shadowAngle = _ref.shadowAngle,
729
- shadowAngle = _ref$shadowAngle === void 0 ? null : _ref$shadowAngle,
729
+ shadowAngle = _ref$shadowAngle === undefined ? null : _ref$shadowAngle,
730
730
  _ref$shadowDistance = _ref.shadowDistance,
731
- shadowDistance = _ref$shadowDistance === void 0 ? null : _ref$shadowDistance,
731
+ shadowDistance = _ref$shadowDistance === undefined ? null : _ref$shadowDistance,
732
732
  _ref$shadowBlur = _ref.shadowBlur,
733
- shadowBlur = _ref$shadowBlur === void 0 ? null : _ref$shadowBlur,
733
+ shadowBlur = _ref$shadowBlur === undefined ? null : _ref$shadowBlur,
734
734
  _ref$shadowColor = _ref.shadowColor,
735
- shadowColor = _ref$shadowColor === void 0 ? null : _ref$shadowColor;
735
+ shadowColor = _ref$shadowColor === undefined ? null : _ref$shadowColor;
736
736
  if (!shadowAngle) return null;
737
737
  var blur = shadowBlur || '0';
738
738
  var color = getColorAsString(shadowColor) || '#000000';
@@ -751,33 +751,33 @@ var getStyleFromBox = function getStyleFromBox(value) {
751
751
  return null;
752
752
  }
753
753
  var _value$backgroundColo = value.backgroundColor,
754
- backgroundColor = _value$backgroundColo === void 0 ? null : _value$backgroundColo,
754
+ backgroundColor = _value$backgroundColo === undefined ? null : _value$backgroundColo,
755
755
  _value$borderRadius = value.borderRadius,
756
- borderRadius = _value$borderRadius === void 0 ? null : _value$borderRadius,
756
+ borderRadius = _value$borderRadius === undefined ? null : _value$borderRadius,
757
757
  _value$padding = value.padding,
758
- padding = _value$padding === void 0 ? null : _value$padding,
758
+ padding = _value$padding === undefined ? null : _value$padding,
759
759
  _value$paddingTop = value.paddingTop,
760
- paddingTop = _value$paddingTop === void 0 ? null : _value$paddingTop,
760
+ paddingTop = _value$paddingTop === undefined ? null : _value$paddingTop,
761
761
  _value$paddingRight = value.paddingRight,
762
- paddingRight = _value$paddingRight === void 0 ? null : _value$paddingRight,
762
+ paddingRight = _value$paddingRight === undefined ? null : _value$paddingRight,
763
763
  _value$paddingBottom = value.paddingBottom,
764
- paddingBottom = _value$paddingBottom === void 0 ? null : _value$paddingBottom,
764
+ paddingBottom = _value$paddingBottom === undefined ? null : _value$paddingBottom,
765
765
  _value$paddingLeft = value.paddingLeft,
766
- paddingLeft = _value$paddingLeft === void 0 ? null : _value$paddingLeft,
766
+ paddingLeft = _value$paddingLeft === undefined ? null : _value$paddingLeft,
767
767
  _value$borderWidth = value.borderWidth,
768
- borderWidth = _value$borderWidth === void 0 ? null : _value$borderWidth,
768
+ borderWidth = _value$borderWidth === undefined ? null : _value$borderWidth,
769
769
  _value$borderStyle = value.borderStyle,
770
- borderStyle = _value$borderStyle === void 0 ? null : _value$borderStyle,
770
+ borderStyle = _value$borderStyle === undefined ? null : _value$borderStyle,
771
771
  _value$borderColor = value.borderColor,
772
- borderColor = _value$borderColor === void 0 ? null : _value$borderColor,
772
+ borderColor = _value$borderColor === undefined ? null : _value$borderColor,
773
773
  _value$shadowAngle = value.shadowAngle,
774
- shadowAngle = _value$shadowAngle === void 0 ? null : _value$shadowAngle,
774
+ shadowAngle = _value$shadowAngle === undefined ? null : _value$shadowAngle,
775
775
  _value$shadowDistance = value.shadowDistance,
776
- shadowDistance = _value$shadowDistance === void 0 ? null : _value$shadowDistance,
776
+ shadowDistance = _value$shadowDistance === undefined ? null : _value$shadowDistance,
777
777
  _value$shadowBlur = value.shadowBlur,
778
- shadowBlur = _value$shadowBlur === void 0 ? null : _value$shadowBlur,
778
+ shadowBlur = _value$shadowBlur === undefined ? null : _value$shadowBlur,
779
779
  _value$shadowColor = value.shadowColor,
780
- shadowColor = _value$shadowColor === void 0 ? null : _value$shadowColor;
780
+ shadowColor = _value$shadowColor === undefined ? null : _value$shadowColor;
781
781
  var border = {
782
782
  width: borderWidth,
783
783
  style: borderStyle,
@@ -793,15 +793,15 @@ var getStyleFromBox = function getStyleFromBox(value) {
793
793
  padding: padding
794
794
  },
795
795
  _ref$top = _ref.top,
796
- paddingValueTop = _ref$top === void 0 ? null : _ref$top,
796
+ paddingValueTop = _ref$top === undefined ? null : _ref$top,
797
797
  _ref$right = _ref.right,
798
- paddingValueRight = _ref$right === void 0 ? null : _ref$right,
798
+ paddingValueRight = _ref$right === undefined ? null : _ref$right,
799
799
  _ref$bottom = _ref.bottom,
800
- paddingValueBottom = _ref$bottom === void 0 ? null : _ref$bottom,
800
+ paddingValueBottom = _ref$bottom === undefined ? null : _ref$bottom,
801
801
  _ref$left = _ref.left,
802
- paddingValueLeft = _ref$left === void 0 ? null : _ref$left,
802
+ paddingValueLeft = _ref$left === undefined ? null : _ref$left,
803
803
  _ref$padding = _ref.padding,
804
- paddingValue = _ref$padding === void 0 ? null : _ref$padding;
804
+ paddingValue = _ref$padding === undefined ? null : _ref$padding;
805
805
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getStyleFromColor(backgroundColor, 'backgroundColor')), borderRadius !== null ? {
806
806
  borderRadius: borderRadius
807
807
  } : null), getStyleFromBorder(border)), getStyleFromShadow(shadow)), padding !== null || paddingValue !== null ? {
@@ -822,13 +822,13 @@ var getStyleFromContainer = function getStyleFromContainer(value) {
822
822
  return null;
823
823
  }
824
824
  var _value$size = value.size,
825
- size = _value$size === void 0 ? {} : _value$size,
825
+ size = _value$size === undefined ? {} : _value$size,
826
826
  _value$backgroundColo = value.backgroundColor,
827
- backgroundColor = _value$backgroundColo === void 0 ? null : _value$backgroundColo;
827
+ backgroundColor = _value$backgroundColo === undefined ? null : _value$backgroundColo;
828
828
  var _size$width = size.width,
829
- width = _size$width === void 0 ? null : _size$width,
829
+ width = _size$width === undefined ? null : _size$width,
830
830
  _size$height = size.height,
831
- height = _size$height === void 0 ? null : _size$height;
831
+ height = _size$height === undefined ? null : _size$height;
832
832
  return _objectSpread(_objectSpread(_objectSpread({}, width ? {
833
833
  width: "".concat(width, "%")
834
834
  } : null), height ? {
@@ -841,9 +841,9 @@ var getStyleFromHighlight = function getStyleFromHighlight(value) {
841
841
  return null;
842
842
  }
843
843
  var _value$textColor = value.textColor,
844
- textColor = _value$textColor === void 0 ? null : _value$textColor,
844
+ textColor = _value$textColor === undefined ? null : _value$textColor,
845
845
  _value$color = value.color,
846
- color = _value$color === void 0 ? null : _value$color;
846
+ color = _value$color === undefined ? null : _value$color;
847
847
  var colorString = color !== null ? getColorAsString(color) : null;
848
848
  var boxShadow = colorString !== null ? "0.05em 0px 0px ".concat(colorString, ", -0.05em 0px 0px ").concat(colorString) : null;
849
849
  return color !== null || textColor !== null ? _objectSpread(_objectSpread(_objectSpread({}, color !== null ? getStyleFromColor(color, 'backgroundColor') : null), textColor !== null ? getStyleFromColor(textColor, 'color') : null), color !== null ? {
@@ -859,17 +859,17 @@ var getStyleFromImage = function getStyleFromImage(value) {
859
859
  return null;
860
860
  }
861
861
  var _value$fit = value.fit,
862
- fit = _value$fit === void 0 ? {} : _value$fit,
862
+ fit = _value$fit === undefined ? {} : _value$fit,
863
863
  _value$backgroundColo = value.backgroundColor,
864
- backgroundColor = _value$backgroundColo === void 0 ? null : _value$backgroundColo;
864
+ backgroundColor = _value$backgroundColo === undefined ? null : _value$backgroundColo;
865
865
  var _fit$size = fit.size,
866
- size = _fit$size === void 0 ? null : _fit$size,
866
+ size = _fit$size === undefined ? null : _fit$size,
867
867
  _fit$position = fit.position,
868
- position = _fit$position === void 0 ? {} : _fit$position;
868
+ position = _fit$position === undefined ? {} : _fit$position;
869
869
  var _position$axisAlign = position.axisAlign,
870
- axisAlign = _position$axisAlign === void 0 ? null : _position$axisAlign,
870
+ axisAlign = _position$axisAlign === undefined ? null : _position$axisAlign,
871
871
  _position$crossAlign = position.crossAlign,
872
- crossAlign = _position$crossAlign === void 0 ? null : _position$crossAlign;
872
+ crossAlign = _position$crossAlign === undefined ? null : _position$crossAlign;
873
873
  return _objectSpread(_objectSpread(_objectSpread({}, size !== null ? {
874
874
  objectFit: size
875
875
  } : null), axisAlign !== null && crossAlign !== null ? {
@@ -882,15 +882,15 @@ var getStyleFromLink = function getStyleFromLink(value) {
882
882
  return null;
883
883
  }
884
884
  var _value$color = value.color,
885
- color = _value$color === void 0 ? null : _value$color,
885
+ color = _value$color === undefined ? null : _value$color,
886
886
  fontStyle = value.fontStyle;
887
887
  var _ref = fontStyle || {},
888
888
  _ref$italic = _ref.italic,
889
- italic = _ref$italic === void 0 ? false : _ref$italic,
889
+ italic = _ref$italic === undefined ? false : _ref$italic,
890
890
  _ref$bold = _ref.bold,
891
- bold = _ref$bold === void 0 ? false : _ref$bold,
891
+ bold = _ref$bold === undefined ? false : _ref$bold,
892
892
  _ref$underline = _ref.underline,
893
- underline = _ref$underline === void 0 ? false : _ref$underline;
893
+ underline = _ref$underline === undefined ? false : _ref$underline;
894
894
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, color !== null ? getStyleFromColor(color, 'color') : null), italic ? {
895
895
  fontStyle: 'italic'
896
896
  } : null), bold ? {
@@ -905,31 +905,31 @@ var getStyleFromText = function getStyleFromText(value) {
905
905
  return null;
906
906
  }
907
907
  var _value$fontFamily = value.fontFamily,
908
- fontFamily = _value$fontFamily === void 0 ? null : _value$fontFamily,
908
+ fontFamily = _value$fontFamily === undefined ? null : _value$fontFamily,
909
909
  _value$fontSize = value.fontSize,
910
- fontSize = _value$fontSize === void 0 ? null : _value$fontSize,
910
+ fontSize = _value$fontSize === undefined ? null : _value$fontSize,
911
911
  _value$fontStyle = value.fontStyle,
912
- fontStyle = _value$fontStyle === void 0 ? null : _value$fontStyle,
912
+ fontStyle = _value$fontStyle === undefined ? null : _value$fontStyle,
913
913
  _value$fontWeight = value.fontWeight,
914
- fontWeight = _value$fontWeight === void 0 ? null : _value$fontWeight,
914
+ fontWeight = _value$fontWeight === undefined ? null : _value$fontWeight,
915
915
  _value$lineHeight = value.lineHeight,
916
- lineHeight = _value$lineHeight === void 0 ? null : _value$lineHeight,
916
+ lineHeight = _value$lineHeight === undefined ? null : _value$lineHeight,
917
917
  _value$letterSpacing = value.letterSpacing,
918
- letterSpacing = _value$letterSpacing === void 0 ? null : _value$letterSpacing,
918
+ letterSpacing = _value$letterSpacing === undefined ? null : _value$letterSpacing,
919
919
  _value$align = value.align,
920
- textAlign = _value$align === void 0 ? null : _value$align,
920
+ textAlign = _value$align === undefined ? null : _value$align,
921
921
  _value$color = value.color,
922
- color = _value$color === void 0 ? null : _value$color;
922
+ color = _value$color === undefined ? null : _value$color;
923
923
  var _ref = fontStyle || {},
924
924
  _ref$italic = _ref.italic,
925
- italic = _ref$italic === void 0 ? false : _ref$italic,
925
+ italic = _ref$italic === undefined ? false : _ref$italic,
926
926
  _ref$bold = _ref.bold,
927
- bold = _ref$bold === void 0 ? false : _ref$bold,
927
+ bold = _ref$bold === undefined ? false : _ref$bold,
928
928
  _ref$underline = _ref.underline,
929
- underline = _ref$underline === void 0 ? false : _ref$underline,
929
+ underline = _ref$underline === undefined ? false : _ref$underline,
930
930
  textTransform = _ref.transform,
931
931
  _ref$outline = _ref.outline,
932
- outline = _ref$outline === void 0 ? false : _ref$outline;
932
+ outline = _ref$outline === undefined ? false : _ref$outline;
933
933
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
934
934
  fontFamily: getFontFamily(fontFamily)
935
935
  }, fontSize !== null ? {
@@ -961,9 +961,9 @@ var getStyleFromMargin = function getStyleFromMargin(value) {
961
961
  return null;
962
962
  }
963
963
  var _value$top = value.top,
964
- marginTop = _value$top === void 0 ? null : _value$top,
964
+ marginTop = _value$top === undefined ? null : _value$top,
965
965
  _value$bottom = value.bottom,
966
- marginBottom = _value$bottom === void 0 ? null : _value$bottom;
966
+ marginBottom = _value$bottom === undefined ? null : _value$bottom;
967
967
  return _objectSpread(_objectSpread({}, marginTop !== null ? {
968
968
  marginTop: marginTop
969
969
  } : null), marginBottom !== null ? {
@@ -1002,15 +1002,15 @@ var isHeaderFilled = function isHeaderFilled() {
1002
1002
  var header = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1003
1003
  var _ref = header || {},
1004
1004
  _ref$badge = _ref.badge,
1005
- badge = _ref$badge === void 0 ? null : _ref$badge;
1005
+ badge = _ref$badge === undefined ? null : _ref$badge;
1006
1006
  var _ref2 = badge || {},
1007
1007
  _ref2$active = _ref2.active,
1008
- badgeActive = _ref2$active === void 0 ? false : _ref2$active,
1008
+ badgeActive = _ref2$active === undefined ? false : _ref2$active,
1009
1009
  _ref2$label = _ref2.label,
1010
- label = _ref2$label === void 0 ? null : _ref2$label;
1010
+ label = _ref2$label === undefined ? null : _ref2$label;
1011
1011
  var _ref3 = label || {},
1012
1012
  _ref3$body = _ref3.body,
1013
- body = _ref3$body === void 0 ? null : _ref3$body;
1013
+ body = _ref3$body === undefined ? null : _ref3$body;
1014
1014
  return badgeActive && body !== null;
1015
1015
  };
1016
1016
 
@@ -1018,15 +1018,15 @@ var isFooterFilled = function isFooterFilled() {
1018
1018
  var footer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1019
1019
  var _ref = footer || {},
1020
1020
  _ref$callToAction = _ref.callToAction,
1021
- callToAction = _ref$callToAction === void 0 ? null : _ref$callToAction;
1021
+ callToAction = _ref$callToAction === undefined ? null : _ref$callToAction;
1022
1022
  var _ref2 = callToAction || {},
1023
1023
  _ref2$active = _ref2.active,
1024
- callToActionActive = _ref2$active === void 0 ? false : _ref2$active,
1024
+ callToActionActive = _ref2$active === undefined ? false : _ref2$active,
1025
1025
  _ref2$label = _ref2.label,
1026
- label = _ref2$label === void 0 ? null : _ref2$label;
1026
+ label = _ref2$label === undefined ? null : _ref2$label;
1027
1027
  var _ref3 = label || {},
1028
1028
  _ref3$body = _ref3.body,
1029
- body = _ref3$body === void 0 ? null : _ref3$body;
1029
+ body = _ref3$body === undefined ? null : _ref3$body;
1030
1030
  return callToActionActive && body !== null;
1031
1031
  };
1032
1032
 
@@ -1043,29 +1043,29 @@ var isIos = function isIos() {
1043
1043
  var isImageFilled = function isImageFilled(image) {
1044
1044
  var _ref = image || {},
1045
1045
  _ref$media = _ref.media,
1046
- media = _ref$media === void 0 ? null : _ref$media,
1046
+ media = _ref$media === undefined ? null : _ref$media,
1047
1047
  _ref$url = _ref.url,
1048
- url = _ref$url === void 0 ? null : _ref$url;
1048
+ url = _ref$url === undefined ? null : _ref$url;
1049
1049
  return media !== null || url !== null;
1050
1050
  };
1051
1051
 
1052
1052
  var isTextFilled$1 = function isTextFilled(text) {
1053
1053
  var _ref = text || {},
1054
1054
  _ref$label = _ref.label,
1055
- label = _ref$label === void 0 ? null : _ref$label;
1055
+ label = _ref$label === undefined ? null : _ref$label;
1056
1056
  var _ref2 = label || {},
1057
1057
  _ref2$length = _ref2.length,
1058
- length = _ref2$length === void 0 ? 0 : _ref2$length;
1058
+ length = _ref2$length === undefined ? 0 : _ref2$length;
1059
1059
  return typeof length === 'number' && length > 0;
1060
1060
  };
1061
1061
 
1062
1062
  var isTextFilled = function isTextFilled(text) {
1063
1063
  var _ref = text || {},
1064
1064
  _ref$body = _ref.body,
1065
- body = _ref$body === void 0 ? null : _ref$body;
1065
+ body = _ref$body === undefined ? null : _ref$body;
1066
1066
  var _ref2 = body || {},
1067
1067
  _ref2$length = _ref2.length,
1068
- length = _ref2$length === void 0 ? 0 : _ref2$length;
1068
+ length = _ref2$length === undefined ? 0 : _ref2$length;
1069
1069
  return typeof length === 'number' && length > 0;
1070
1070
  };
1071
1071
 
@@ -1153,7 +1153,7 @@ var _validateFields = function validateFields(fields, value) {
1153
1153
  var getContrastingColor = function getContrastingColor(backgroundColor) {
1154
1154
  var _ref = backgroundColor || {},
1155
1155
  _ref$color = _ref.color,
1156
- color = _ref$color === void 0 ? 'white' : _ref$color;
1156
+ color = _ref$color === undefined ? 'white' : _ref$color;
1157
1157
  if (tinycolor.equals(color, tinycolor('white'))) {
1158
1158
  return '#A13DFF';
1159
1159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.3.606",
3
+ "version": "0.3.608",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -144,5 +144,5 @@
144
144
  "access": "public",
145
145
  "registry": "https://registry.npmjs.org/"
146
146
  },
147
- "gitHead": "0e2ee772952cc24e6824806bd23a7c65c8858c73"
147
+ "gitHead": "02f8cfe4dde0c33bec9ed7c3bdb671cd8acf78bc"
148
148
  }