@micromag/core 0.3.78 → 0.3.86
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 +66 -21
- package/es/hooks.js +28 -4
- package/es/index.js +1 -1
- package/es/utils.js +5 -1
- package/lib/components.js +66 -21
- package/lib/hooks.js +28 -4
- package/lib/index.js +1 -1
- package/lib/utils.js +5 -1
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -2224,6 +2224,42 @@ var Empty = function Empty(_ref) {
|
|
|
2224
2224
|
Empty.propTypes = propTypes$g;
|
|
2225
2225
|
Empty.defaultProps = defaultProps$g;
|
|
2226
2226
|
|
|
2227
|
+
var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
|
|
2228
|
+
var _ref = media || {},
|
|
2229
|
+
_ref$files = _ref.files,
|
|
2230
|
+
files = _ref$files === void 0 ? {} : _ref$files;
|
|
2231
|
+
|
|
2232
|
+
var _ref2 = files || {},
|
|
2233
|
+
_ref2$original = _ref2.original,
|
|
2234
|
+
originalFile = _ref2$original === void 0 ? null : _ref2$original;
|
|
2235
|
+
|
|
2236
|
+
var _ref3 = originalFile || {},
|
|
2237
|
+
_ref3$name = _ref3.name,
|
|
2238
|
+
originalName = _ref3$name === void 0 ? null : _ref3$name,
|
|
2239
|
+
_ref3$mime = _ref3.mime,
|
|
2240
|
+
originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
|
|
2241
|
+
|
|
2242
|
+
var urls = formats.reduce(function (currentUrls, format) {
|
|
2243
|
+
var finalFormat = isObject(format) ? format.format : format;
|
|
2244
|
+
var formatExtension = isObject(format) ? format.name : format;
|
|
2245
|
+
var file = files["webfonts.".concat(formatExtension)] || files[formatExtension] || null;
|
|
2246
|
+
|
|
2247
|
+
if (file !== null) {
|
|
2248
|
+
return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(file.url, "?\") format(\"").concat(finalFormat, "\")")]);
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
var extensionRegExp = new RegExp(".".concat(formatExtension, "$"), 'i');
|
|
2252
|
+
var mimeRegExp = new RegExp("".concat(finalFormat), 'i');
|
|
2253
|
+
|
|
2254
|
+
if (originalName !== null && originalName.match(extensionRegExp) !== null || originalMime !== null && originalMime.match(mimeRegExp) !== null) {
|
|
2255
|
+
return [].concat(_toConsumableArray(currentUrls), ["url(\"".concat(originalFile.url, "?\") format(\"").concat(finalFormat, "\")")]);
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
return currentUrls;
|
|
2259
|
+
}, []);
|
|
2260
|
+
return urls;
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2227
2263
|
var propTypes$f = {
|
|
2228
2264
|
fonts: PropTypes.fonts,
|
|
2229
2265
|
formats: PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.shape({
|
|
@@ -2242,29 +2278,38 @@ var defaultProps$f = {
|
|
|
2242
2278
|
}, 'svg']
|
|
2243
2279
|
};
|
|
2244
2280
|
|
|
2245
|
-
var FontFaces = function FontFaces(
|
|
2246
|
-
var fonts =
|
|
2247
|
-
formats =
|
|
2281
|
+
var FontFaces = function FontFaces(_ref4) {
|
|
2282
|
+
var fonts = _ref4.fonts,
|
|
2283
|
+
formats = _ref4.formats;
|
|
2248
2284
|
var fontFaces = (fonts || []).filter(function (it) {
|
|
2249
2285
|
return isObject(it) && it.type === 'custom' && (it.media || null) !== null;
|
|
2250
|
-
}).
|
|
2251
|
-
var
|
|
2252
|
-
name =
|
|
2253
|
-
|
|
2254
|
-
media =
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2286
|
+
}).reduce(function (fontFontFaces, _ref5) {
|
|
2287
|
+
var _ref5$name = _ref5.name,
|
|
2288
|
+
name = _ref5$name === void 0 ? null : _ref5$name,
|
|
2289
|
+
_ref5$media = _ref5.media,
|
|
2290
|
+
media = _ref5$media === void 0 ? null : _ref5$media,
|
|
2291
|
+
_ref5$variants = _ref5.variants,
|
|
2292
|
+
variants = _ref5$variants === void 0 ? [] : _ref5$variants;
|
|
2293
|
+
|
|
2294
|
+
if (name === null) {
|
|
2295
|
+
return fontFontFaces;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
|
|
2299
|
+
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) {
|
|
2300
|
+
var weight = _ref6.weight,
|
|
2301
|
+
style = _ref6.style,
|
|
2302
|
+
_ref6$media = _ref6.media,
|
|
2303
|
+
variantMedia = _ref6$media === void 0 ? null : _ref6$media;
|
|
2304
|
+
|
|
2305
|
+
if (variantMedia == null) {
|
|
2306
|
+
return null;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
var variantUrls = getUrlsFromMedia(variantMedia, formats);
|
|
2310
|
+
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;
|
|
2311
|
+
})));
|
|
2312
|
+
}, []).filter(function (it) {
|
|
2268
2313
|
return it !== null;
|
|
2269
2314
|
});
|
|
2270
2315
|
return fontFaces.length > 0 ? /*#__PURE__*/React.createElement("style", {
|
package/es/hooks.js
CHANGED
|
@@ -545,11 +545,35 @@ var useLoadedFonts = function useLoadedFonts(fonts) {
|
|
|
545
545
|
name: font
|
|
546
546
|
},
|
|
547
547
|
type = _ref.type,
|
|
548
|
-
name = _ref.name
|
|
548
|
+
name = _ref.name,
|
|
549
|
+
_ref$variants = _ref.variants,
|
|
550
|
+
variants = _ref$variants === void 0 ? [] : _ref$variants;
|
|
549
551
|
|
|
550
552
|
if ((type === 'google' || type === 'custom') && !isFontLoading(name) && !isFontActive(name)) {
|
|
551
553
|
return _objectSpread(_objectSpread({}, newConfig), {}, _defineProperty({}, type, {
|
|
552
|
-
families: [].concat(_toConsumableArray(newConfig !== null ? (newConfig[type] || {}).families || [] : []), [type === 'google' ?
|
|
554
|
+
families: [].concat(_toConsumableArray(newConfig !== null ? (newConfig[type] || {}).families || [] : []), [type === 'google' ? [name, (variants || []).filter(function (it) {
|
|
555
|
+
return it !== null;
|
|
556
|
+
}).join(',')].filter(function (it) {
|
|
557
|
+
return it !== null && it.length > 0;
|
|
558
|
+
}).join(':') : [name, (variants !== null ? [{
|
|
559
|
+
fvd: 'n4'
|
|
560
|
+
}].concat(_toConsumableArray(variants)) : []).map(function (_ref2) {
|
|
561
|
+
var _ref2$fvd = _ref2.fvd,
|
|
562
|
+
fvd = _ref2$fvd === void 0 ? null : _ref2$fvd,
|
|
563
|
+
_ref2$weight = _ref2.weight,
|
|
564
|
+
weight = _ref2$weight === void 0 ? null : _ref2$weight,
|
|
565
|
+
_ref2$style = _ref2.style,
|
|
566
|
+
style = _ref2$style === void 0 ? null : _ref2$style;
|
|
567
|
+
return fvd || [style, weight].filter(function (it) {
|
|
568
|
+
return it !== null;
|
|
569
|
+
}).map(function (it) {
|
|
570
|
+
return "".concat(it).substr(0, 1);
|
|
571
|
+
}).join('');
|
|
572
|
+
}).filter(function (it) {
|
|
573
|
+
return it !== null && it.length > 0;
|
|
574
|
+
}).join(',')].filter(function (it) {
|
|
575
|
+
return it !== null && it.length > 0;
|
|
576
|
+
}).join(':')])
|
|
553
577
|
}));
|
|
554
578
|
}
|
|
555
579
|
|
|
@@ -558,8 +582,8 @@ var useLoadedFonts = function useLoadedFonts(fonts) {
|
|
|
558
582
|
var hasConfig = config !== null;
|
|
559
583
|
|
|
560
584
|
if (hasConfig && typeof window !== 'undefined') {
|
|
561
|
-
import('webfontloader').then(function (
|
|
562
|
-
var WebFont =
|
|
585
|
+
import('webfontloader').then(function (_ref3) {
|
|
586
|
+
var WebFont = _ref3["default"];
|
|
563
587
|
return WebFont.load(_objectSpread(_objectSpread({}, config), {}, {
|
|
564
588
|
timeout: 3000,
|
|
565
589
|
active: function active() {
|
package/es/index.js
CHANGED
|
@@ -1311,7 +1311,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1311
1311
|
itemsField = _fieldDefinition$item === void 0 ? null : _fieldDefinition$item,
|
|
1312
1312
|
_fieldDefinition$sett = fieldDefinition.settings,
|
|
1313
1313
|
settings = _fieldDefinition$sett === void 0 ? [] : _fieldDefinition$sett;
|
|
1314
|
-
return [].concat(_toConsumableArray(patterns), _toConsumableArray(MediasParser.fieldIsMedia(fieldDefinition) ? [new RegExp("^".concat(path, "$"))] : []), _toConsumableArray(MediasParser.fieldIsFontFamily(fieldDefinition) ? [new RegExp("^".concat(path, "\\.media$"))] : []), _toConsumableArray(_this2.getMediaFieldsPattern(subFields, path)), _toConsumableArray(_this2.getMediaFieldsPattern(settings, path)), _toConsumableArray(itemsField !== null ? _this2.getMediaFieldsPattern([itemsField], "".concat(path, "\\.[0-9]+")) : []));
|
|
1314
|
+
return [].concat(_toConsumableArray(patterns), _toConsumableArray(MediasParser.fieldIsMedia(fieldDefinition) ? [new RegExp("^".concat(path, "$"))] : []), _toConsumableArray(MediasParser.fieldIsFontFamily(fieldDefinition) ? [new RegExp("^".concat(path, "\\.media$")), new RegExp("^".concat(path, "\\.variants\\.[0-9]+\\.media$"))] : []), _toConsumableArray(_this2.getMediaFieldsPattern(subFields, path)), _toConsumableArray(_this2.getMediaFieldsPattern(settings, path)), _toConsumableArray(itemsField !== null ? _this2.getMediaFieldsPattern([itemsField], "".concat(path, "\\.[0-9]+")) : []));
|
|
1315
1315
|
}, []);
|
|
1316
1316
|
}
|
|
1317
1317
|
}], [{
|
package/es/utils.js
CHANGED
|
@@ -582,6 +582,8 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
582
582
|
fontSize = _value$fontSize === void 0 ? null : _value$fontSize,
|
|
583
583
|
_value$fontStyle = value.fontStyle,
|
|
584
584
|
fontStyle = _value$fontStyle === void 0 ? null : _value$fontStyle,
|
|
585
|
+
_value$fontWeight = value.fontWeight,
|
|
586
|
+
fontWeight = _value$fontWeight === void 0 ? null : _value$fontWeight,
|
|
585
587
|
_value$lineHeight = value.lineHeight,
|
|
586
588
|
lineHeight = _value$lineHeight === void 0 ? null : _value$lineHeight,
|
|
587
589
|
_value$letterSpacing = value.letterSpacing,
|
|
@@ -602,7 +604,7 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
602
604
|
_ref$outline = _ref.outline,
|
|
603
605
|
outline = _ref$outline === void 0 ? false : _ref$outline;
|
|
604
606
|
|
|
605
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
607
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
606
608
|
fontFamily: getFontFamily(fontFamily)
|
|
607
609
|
}, fontSize !== null ? {
|
|
608
610
|
fontSize: fontSize
|
|
@@ -610,6 +612,8 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
610
612
|
fontStyle: 'italic'
|
|
611
613
|
} : null), bold ? {
|
|
612
614
|
fontWeight: 'bold'
|
|
615
|
+
} : null), fontWeight !== null ? {
|
|
616
|
+
fontWeight: fontWeight
|
|
613
617
|
} : null), underline ? {
|
|
614
618
|
textDecoration: 'underline'
|
|
615
619
|
} : null), textTransform !== null ? {
|
package/lib/components.js
CHANGED
|
@@ -2247,6 +2247,42 @@ var Empty = function Empty(_ref) {
|
|
|
2247
2247
|
Empty.propTypes = propTypes$g;
|
|
2248
2248
|
Empty.defaultProps = defaultProps$g;
|
|
2249
2249
|
|
|
2250
|
+
var getUrlsFromMedia = function getUrlsFromMedia(media, formats) {
|
|
2251
|
+
var _ref = media || {},
|
|
2252
|
+
_ref$files = _ref.files,
|
|
2253
|
+
files = _ref$files === void 0 ? {} : _ref$files;
|
|
2254
|
+
|
|
2255
|
+
var _ref2 = files || {},
|
|
2256
|
+
_ref2$original = _ref2.original,
|
|
2257
|
+
originalFile = _ref2$original === void 0 ? null : _ref2$original;
|
|
2258
|
+
|
|
2259
|
+
var _ref3 = originalFile || {},
|
|
2260
|
+
_ref3$name = _ref3.name,
|
|
2261
|
+
originalName = _ref3$name === void 0 ? null : _ref3$name,
|
|
2262
|
+
_ref3$mime = _ref3.mime,
|
|
2263
|
+
originalMime = _ref3$mime === void 0 ? null : _ref3$mime;
|
|
2264
|
+
|
|
2265
|
+
var urls = formats.reduce(function (currentUrls, format) {
|
|
2266
|
+
var finalFormat = isObject__default["default"](format) ? format.format : format;
|
|
2267
|
+
var formatExtension = isObject__default["default"](format) ? format.name : format;
|
|
2268
|
+
var file = files["webfonts.".concat(formatExtension)] || files[formatExtension] || null;
|
|
2269
|
+
|
|
2270
|
+
if (file !== null) {
|
|
2271
|
+
return [].concat(_toConsumableArray__default["default"](currentUrls), ["url(\"".concat(file.url, "?\") format(\"").concat(finalFormat, "\")")]);
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
var extensionRegExp = new RegExp(".".concat(formatExtension, "$"), 'i');
|
|
2275
|
+
var mimeRegExp = new RegExp("".concat(finalFormat), 'i');
|
|
2276
|
+
|
|
2277
|
+
if (originalName !== null && originalName.match(extensionRegExp) !== null || originalMime !== null && originalMime.match(mimeRegExp) !== null) {
|
|
2278
|
+
return [].concat(_toConsumableArray__default["default"](currentUrls), ["url(\"".concat(originalFile.url, "?\") format(\"").concat(finalFormat, "\")")]);
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
return currentUrls;
|
|
2282
|
+
}, []);
|
|
2283
|
+
return urls;
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2250
2286
|
var propTypes$f = {
|
|
2251
2287
|
fonts: core.PropTypes.fonts,
|
|
2252
2288
|
formats: PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].shape({
|
|
@@ -2265,29 +2301,38 @@ var defaultProps$f = {
|
|
|
2265
2301
|
}, 'svg']
|
|
2266
2302
|
};
|
|
2267
2303
|
|
|
2268
|
-
var FontFaces = function FontFaces(
|
|
2269
|
-
var fonts =
|
|
2270
|
-
formats =
|
|
2304
|
+
var FontFaces = function FontFaces(_ref4) {
|
|
2305
|
+
var fonts = _ref4.fonts,
|
|
2306
|
+
formats = _ref4.formats;
|
|
2271
2307
|
var fontFaces = (fonts || []).filter(function (it) {
|
|
2272
2308
|
return isObject__default["default"](it) && it.type === 'custom' && (it.media || null) !== null;
|
|
2273
|
-
}).
|
|
2274
|
-
var
|
|
2275
|
-
name =
|
|
2276
|
-
|
|
2277
|
-
media =
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2309
|
+
}).reduce(function (fontFontFaces, _ref5) {
|
|
2310
|
+
var _ref5$name = _ref5.name,
|
|
2311
|
+
name = _ref5$name === void 0 ? null : _ref5$name,
|
|
2312
|
+
_ref5$media = _ref5.media,
|
|
2313
|
+
media = _ref5$media === void 0 ? null : _ref5$media,
|
|
2314
|
+
_ref5$variants = _ref5.variants,
|
|
2315
|
+
variants = _ref5$variants === void 0 ? [] : _ref5$variants;
|
|
2316
|
+
|
|
2317
|
+
if (name === null) {
|
|
2318
|
+
return fontFontFaces;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
var urls = media !== null ? getUrlsFromMedia(media, formats) : null;
|
|
2322
|
+
return [].concat(_toConsumableArray__default["default"](fontFontFaces), [urls !== null && urls.length > 0 ? "\n @font-face {\n font-family: \"".concat(name, "\";\n src: ").concat(urls.join(','), ";\n }\n ") : null], _toConsumableArray__default["default"]((variants || []).map(function (_ref6) {
|
|
2323
|
+
var weight = _ref6.weight,
|
|
2324
|
+
style = _ref6.style,
|
|
2325
|
+
_ref6$media = _ref6.media,
|
|
2326
|
+
variantMedia = _ref6$media === void 0 ? null : _ref6$media;
|
|
2327
|
+
|
|
2328
|
+
if (variantMedia == null) {
|
|
2329
|
+
return null;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
var variantUrls = getUrlsFromMedia(variantMedia, formats);
|
|
2333
|
+
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;
|
|
2334
|
+
})));
|
|
2335
|
+
}, []).filter(function (it) {
|
|
2291
2336
|
return it !== null;
|
|
2292
2337
|
});
|
|
2293
2338
|
return fontFaces.length > 0 ? /*#__PURE__*/React__default["default"].createElement("style", {
|
package/lib/hooks.js
CHANGED
|
@@ -581,11 +581,35 @@ var useLoadedFonts = function useLoadedFonts(fonts) {
|
|
|
581
581
|
name: font
|
|
582
582
|
},
|
|
583
583
|
type = _ref.type,
|
|
584
|
-
name = _ref.name
|
|
584
|
+
name = _ref.name,
|
|
585
|
+
_ref$variants = _ref.variants,
|
|
586
|
+
variants = _ref$variants === void 0 ? [] : _ref$variants;
|
|
585
587
|
|
|
586
588
|
if ((type === 'google' || type === 'custom') && !isFontLoading(name) && !isFontActive(name)) {
|
|
587
589
|
return _objectSpread__default["default"](_objectSpread__default["default"]({}, newConfig), {}, _defineProperty__default["default"]({}, type, {
|
|
588
|
-
families: [].concat(_toConsumableArray__default["default"](newConfig !== null ? (newConfig[type] || {}).families || [] : []), [type === 'google' ?
|
|
590
|
+
families: [].concat(_toConsumableArray__default["default"](newConfig !== null ? (newConfig[type] || {}).families || [] : []), [type === 'google' ? [name, (variants || []).filter(function (it) {
|
|
591
|
+
return it !== null;
|
|
592
|
+
}).join(',')].filter(function (it) {
|
|
593
|
+
return it !== null && it.length > 0;
|
|
594
|
+
}).join(':') : [name, (variants !== null ? [{
|
|
595
|
+
fvd: 'n4'
|
|
596
|
+
}].concat(_toConsumableArray__default["default"](variants)) : []).map(function (_ref2) {
|
|
597
|
+
var _ref2$fvd = _ref2.fvd,
|
|
598
|
+
fvd = _ref2$fvd === void 0 ? null : _ref2$fvd,
|
|
599
|
+
_ref2$weight = _ref2.weight,
|
|
600
|
+
weight = _ref2$weight === void 0 ? null : _ref2$weight,
|
|
601
|
+
_ref2$style = _ref2.style,
|
|
602
|
+
style = _ref2$style === void 0 ? null : _ref2$style;
|
|
603
|
+
return fvd || [style, weight].filter(function (it) {
|
|
604
|
+
return it !== null;
|
|
605
|
+
}).map(function (it) {
|
|
606
|
+
return "".concat(it).substr(0, 1);
|
|
607
|
+
}).join('');
|
|
608
|
+
}).filter(function (it) {
|
|
609
|
+
return it !== null && it.length > 0;
|
|
610
|
+
}).join(',')].filter(function (it) {
|
|
611
|
+
return it !== null && it.length > 0;
|
|
612
|
+
}).join(':')])
|
|
589
613
|
}));
|
|
590
614
|
}
|
|
591
615
|
|
|
@@ -594,8 +618,8 @@ var useLoadedFonts = function useLoadedFonts(fonts) {
|
|
|
594
618
|
var hasConfig = config !== null;
|
|
595
619
|
|
|
596
620
|
if (hasConfig && typeof window !== 'undefined') {
|
|
597
|
-
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('webfontloader')); }).then(function (
|
|
598
|
-
var WebFont =
|
|
621
|
+
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('webfontloader')); }).then(function (_ref3) {
|
|
622
|
+
var WebFont = _ref3["default"];
|
|
599
623
|
return WebFont.load(_objectSpread__default["default"](_objectSpread__default["default"]({}, config), {}, {
|
|
600
624
|
timeout: 3000,
|
|
601
625
|
active: function active() {
|
package/lib/index.js
CHANGED
|
@@ -1338,7 +1338,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1338
1338
|
itemsField = _fieldDefinition$item === void 0 ? null : _fieldDefinition$item,
|
|
1339
1339
|
_fieldDefinition$sett = fieldDefinition.settings,
|
|
1340
1340
|
settings = _fieldDefinition$sett === void 0 ? [] : _fieldDefinition$sett;
|
|
1341
|
-
return [].concat(_toConsumableArray__default["default"](patterns), _toConsumableArray__default["default"](MediasParser.fieldIsMedia(fieldDefinition) ? [new RegExp("^".concat(path, "$"))] : []), _toConsumableArray__default["default"](MediasParser.fieldIsFontFamily(fieldDefinition) ? [new RegExp("^".concat(path, "\\.media$"))] : []), _toConsumableArray__default["default"](_this2.getMediaFieldsPattern(subFields, path)), _toConsumableArray__default["default"](_this2.getMediaFieldsPattern(settings, path)), _toConsumableArray__default["default"](itemsField !== null ? _this2.getMediaFieldsPattern([itemsField], "".concat(path, "\\.[0-9]+")) : []));
|
|
1341
|
+
return [].concat(_toConsumableArray__default["default"](patterns), _toConsumableArray__default["default"](MediasParser.fieldIsMedia(fieldDefinition) ? [new RegExp("^".concat(path, "$"))] : []), _toConsumableArray__default["default"](MediasParser.fieldIsFontFamily(fieldDefinition) ? [new RegExp("^".concat(path, "\\.media$")), new RegExp("^".concat(path, "\\.variants\\.[0-9]+\\.media$"))] : []), _toConsumableArray__default["default"](_this2.getMediaFieldsPattern(subFields, path)), _toConsumableArray__default["default"](_this2.getMediaFieldsPattern(settings, path)), _toConsumableArray__default["default"](itemsField !== null ? _this2.getMediaFieldsPattern([itemsField], "".concat(path, "\\.[0-9]+")) : []));
|
|
1342
1342
|
}, []);
|
|
1343
1343
|
}
|
|
1344
1344
|
}], [{
|
package/lib/utils.js
CHANGED
|
@@ -599,6 +599,8 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
599
599
|
fontSize = _value$fontSize === void 0 ? null : _value$fontSize,
|
|
600
600
|
_value$fontStyle = value.fontStyle,
|
|
601
601
|
fontStyle = _value$fontStyle === void 0 ? null : _value$fontStyle,
|
|
602
|
+
_value$fontWeight = value.fontWeight,
|
|
603
|
+
fontWeight = _value$fontWeight === void 0 ? null : _value$fontWeight,
|
|
602
604
|
_value$lineHeight = value.lineHeight,
|
|
603
605
|
lineHeight = _value$lineHeight === void 0 ? null : _value$lineHeight,
|
|
604
606
|
_value$letterSpacing = value.letterSpacing,
|
|
@@ -619,7 +621,7 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
619
621
|
_ref$outline = _ref.outline,
|
|
620
622
|
outline = _ref$outline === void 0 ? false : _ref$outline;
|
|
621
623
|
|
|
622
|
-
return _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({
|
|
624
|
+
return _objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"](_objectSpread__default["default"]({
|
|
623
625
|
fontFamily: getFontFamily(fontFamily)
|
|
624
626
|
}, fontSize !== null ? {
|
|
625
627
|
fontSize: fontSize
|
|
@@ -627,6 +629,8 @@ var getStyleFromText = function getStyleFromText(value) {
|
|
|
627
629
|
fontStyle: 'italic'
|
|
628
630
|
} : null), bold ? {
|
|
629
631
|
fontWeight: 'bold'
|
|
632
|
+
} : null), fontWeight !== null ? {
|
|
633
|
+
fontWeight: fontWeight
|
|
630
634
|
} : null), underline ? {
|
|
631
635
|
textDecoration: 'underline'
|
|
632
636
|
} : null), textTransform !== null ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.86",
|
|
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": "063af274982885b7696d265e6567ab8d44c8b9ad"
|
|
136
136
|
}
|