Release 5.8.2 (#1361)

This commit is contained in:
Rob Madole
2019-05-07 12:32:46 -05:00
committed by GitHub
parent 7703dcff3b
commit 484b16bffc
231 changed files with 1661 additions and 1306 deletions

View File

@@ -1,5 +1,5 @@
/*!
* Font Awesome Pro 5.8.1 by @fontawesome - https://fontawesome.com
* Font Awesome Pro 5.8.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Commercial License)
*/
(function () {
@@ -927,7 +927,7 @@
'data-prefix': prefix,
'data-icon': iconName,
'class': attrClass,
'role': 'img',
'role': extra.attributes.role || 'img',
'xmlns': 'http://www.w3.org/2000/svg',
'viewBox': "0 0 ".concat(width, " ").concat(height)
})
@@ -1068,7 +1068,7 @@
mark: noop$1,
measure: noop$1
};
var preamble = "FA \"5.8.1\"";
var preamble = "FA \"5.8.2\"";
var begin = function begin(name) {
p.mark("".concat(preamble, " ").concat(name, " begins"));
@@ -1135,6 +1135,17 @@
return result;
};
function toHex(unicode) {
var result = '';
for (var i = 0; i < unicode.length; i++) {
var hex = unicode.charCodeAt(i).toString(16);
result += ('000' + hex).slice(-4);
}
return result;
}
function defineIcons(prefix, icons) {
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _params$skipHooks = params.skipHooks,
@@ -1217,10 +1228,10 @@
};
build();
function byUnicode(prefix, unicode) {
return _byUnicode[prefix][unicode];
return (_byUnicode[prefix] || {})[unicode];
}
function byLigature(prefix, ligature) {
return _byLigature[prefix][ligature];
return (_byLigature[prefix] || {})[ligature];
}
function byOldName(name) {
return _byOldName[name] || {
@@ -1455,17 +1466,6 @@
return val;
}
function toHex(unicode) {
var result = '';
for (var i = 0; i < unicode.length; i++) {
var hex = unicode.charCodeAt(i).toString(16);
result += ('000' + hex).slice(-4);
}
return result;
}
function classParser (node) {
var existingPrefix = node.getAttribute('data-prefix');
var existingIconName = node.getAttribute('data-icon');
@@ -1849,7 +1849,12 @@
return;
}
var candidates = toArray(root.querySelectorAll(prefixesDomQuery));
var candidates = [];
try {
candidates = toArray(root.querySelectorAll(prefixesDomQuery));
} catch (e) {// noop
}
if (candidates.length > 0) {
hclAdd('pending');
@@ -1926,11 +1931,13 @@
} else if (fontFamily) {
var content = styles.getPropertyValue('content');
var prefix = ~['Light', 'Regular', 'Solid', 'Brands'].indexOf(fontFamily[1]) ? STYLE_TO_PREFIX[fontFamily[1].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
var iconName = byUnicode(prefix, toHex(content.length === 3 ? content.substr(1, 1) : content)); // Only convert the pseudo element in this :before/:after position into an icon if we haven't
var hexValue = toHex(content.length === 3 ? content.substr(1, 1) : content);
var iconName = byUnicode(prefix, hexValue);
var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't
// already done so with the same prefix and iconName
if (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconName) {
node.setAttribute(pendingAttribute, iconName);
if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
node.setAttribute(pendingAttribute, iconIdentifier);
if (alreadyProcessedPseudoElement) {
// Delete the old one, since we're replacing it with a new one
@@ -1947,7 +1954,7 @@
mask: emptyCanonicalIcon()
},
prefix: prefix,
iconName: iconName,
iconName: iconIdentifier,
extra: extra,
watchable: true
}));