Release 5.15.0 (#1527)

This commit is contained in:
Rob Madole
2020-09-29 08:14:18 -05:00
committed by GitHub
parent 882465b4fb
commit 83ef8188b6
15997 changed files with 137891 additions and 32905 deletions

View File

@@ -1,5 +1,5 @@
/*!
* Font Awesome Pro 5.14.0 by @fontawesome - https://fontawesome.com
* Font Awesome Pro 5.15.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license (Commercial License)
*/
(function () {
@@ -187,6 +187,7 @@
'fal': 'light',
'fad': 'duotone',
'fab': 'brands',
'fak': 'kit',
'fa': 'solid'
};
var STYLE_TO_PREFIX = {
@@ -194,10 +195,12 @@
'regular': 'far',
'light': 'fal',
'duotone': 'fad',
'brands': 'fab'
'brands': 'fab',
'kit': 'fak'
};
var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
var FONT_FAMILY_PATTERN = /Font Awesome 5 (Solid|Regular|Light|Duotone|Brands|Free|Pro)/;
var FONT_FAMILY_PATTERN = /Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/; // TODO: do we need to handle font-weight for kit SVG pseudo-elements?
var FONT_WEIGHT_TO_PREFIX = {
'900': 'fas',
'400': 'far',
@@ -948,9 +951,12 @@
width = _ref.width,
height = _ref.height;
var widthClass = "fa-w-".concat(Math.ceil(width / height * 16));
var isUploadedIcon = prefix === 'fak';
var widthClass = isUploadedIcon ? '' : "fa-w-".concat(Math.ceil(width / height * 16));
var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
return extra.classes.indexOf(c) === -1;
}).filter(function (c) {
return c !== '' || !!c;
}).concat(extra.classes).join(' ');
var content = {
children: [],
@@ -963,6 +969,9 @@
'viewBox': "0 0 ".concat(width, " ").concat(height)
})
};
var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
width: "".concat(width / height * 16 * 0.0625, "em")
} : {};
if (watchable) {
content.attributes[DATA_FA_I2SVG] = '';
@@ -984,7 +993,7 @@
maskId: maskId,
transform: transform,
symbol: symbol,
styles: extra.styles
styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
});
var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
@@ -1100,7 +1109,7 @@
mark: noop$1,
measure: noop$1
};
var preamble = "FA \"5.14.0\"";
var preamble = "FA \"5.15.0\"";
var begin = function begin(name) {
p.mark("".concat(preamble, " ").concat(name, " begins"));
@@ -1177,6 +1186,35 @@
return result;
}
function codePointAt(string, index) {
/*! https://mths.be/codepointat v0.2.0 by @mathias */
var size = string.length;
var first = string.charCodeAt(index);
var second;
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
}
/**
* Used to check that the character is between the E000..F8FF private unicode
* range
*/
function isPrivateUnicode(iconName) {
if (iconName.length !== 1) {
return false;
} else {
var cp = codePointAt(iconName, 0);
return cp >= 57344 && cp <= 63743;
}
}
function defineIcons(prefix, icons) {
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -1286,7 +1324,7 @@
if (styles$1[cls]) {
acc.prefix = cls;
} else if (config.autoFetchSvg && ['fas', 'far', 'fal', 'fad', 'fab', 'fa'].indexOf(cls) > -1) {
} else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {
acc.prefix = cls;
} else if (iconName) {
var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};
@@ -1348,7 +1386,7 @@
}).join('\n');
if (node.parentNode && node.outerHTML) {
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " -->") : '');
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " Font Awesome fontawesome.com -->") : '');
} else if (node.parentNode) {
var newNode = document.createElement('span');
node.parentNode.replaceChild(newNode, node);
@@ -1755,6 +1793,27 @@
};
var styles$2 = namespace.styles;
function resolveCustomIconVersion() {
var kitConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var iconName = arguments.length > 1 ? arguments[1] : undefined;
if (iconName && isPrivateUnicode(iconName)) {
if (kitConfig && kitConfig.iconUploads) {
var iconUploads = kitConfig.iconUploads;
var descriptiveIconName = Object.keys(iconUploads).find(function (key) {
return iconUploads[key] && iconUploads[key].u && iconUploads[key].u === toHex(iconName);
});
if (descriptiveIconName) {
return iconUploads[descriptiveIconName].v;
}
}
} else {
if (kitConfig && kitConfig.iconUploads && kitConfig.iconUploads[iconName] && kitConfig.iconUploads[iconName].v) {
return kitConfig.iconUploads[iconName].v;
}
}
}
function asFoundIcon(icon) {
var width = icon[0];
var height = icon[1];
@@ -1817,11 +1876,11 @@
var icon = styles$2[prefix][iconName];
return resolve(asFoundIcon(icon));
}
var kitToken = null;
var iconVersion = resolveCustomIconVersion(WINDOW.FontAwesomeKitConfig, iconName);
var headers = {};
if (_typeof(WINDOW.FontAwesomeKitConfig) === 'object' && typeof window.FontAwesomeKitConfig.token === 'string') {
headers['fa-kit-token'] = WINDOW.FontAwesomeKitConfig.token;
if (WINDOW.FontAwesomeKitConfig && WINDOW.FontAwesomeKitConfig.token) {
kitToken = WINDOW.FontAwesomeKitConfig.token;
}
if (iconName && prefix && !config.showMissingIcons) {
@@ -2012,8 +2071,10 @@
node.removeChild(alreadyProcessedPseudoElement);
return resolve();
} else if (fontFamily && content !== 'none' && content !== '') {
var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands'].indexOf(fontFamily[1]) ? STYLE_TO_PREFIX[fontFamily[1].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
var hexValue = toHex(content.length === 3 ? content.substr(1, 1) : content);
var _content = styles.getPropertyValue('content');
var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
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