Release 5.0.3 (#975)
This commit is contained in:
103
advanced-options/use-with-node-js/fontawesome/index.d.ts
vendored
Normal file
103
advanced-options/use-with-node-js/fontawesome/index.d.ts
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
// tslint:disable-next-line:export-just-namespace
|
||||
export = fontawesome;
|
||||
export as namespace fontawesome;
|
||||
import * as commonTypes from '@fortawesome/fontawesome-common-types';
|
||||
declare namespace fontawesome {
|
||||
type IconDefinition = commonTypes.IconDefinition;
|
||||
type IconLookup = commonTypes.IconLookup;
|
||||
type IconName = commonTypes.IconName;
|
||||
type IconPrefix = commonTypes.IconPrefix;
|
||||
const dom: DOM;
|
||||
const library: Library;
|
||||
const parse: { transform(transformString: string): Transform };
|
||||
const config: Config;
|
||||
function noAuto():void;
|
||||
function findIconDefinition(iconLookup: IconLookup): IconDefinition;
|
||||
function text(content: string, params?: Params): Text;
|
||||
function layer(
|
||||
assembler: (
|
||||
addLayerCallback: (layerToAdd: IconLookup | IconLookup[]) => void
|
||||
) => void
|
||||
): Layer;
|
||||
function icon(icon: IconName | IconLookup, params?: IconParams): Icon;
|
||||
|
||||
type IconProp = IconName | [IconPrefix, IconName] | IconLookup;
|
||||
type FlipProp = "horizontal" | "vertical" | "both";
|
||||
type SizeProp =
|
||||
| "xs"
|
||||
| "lg"
|
||||
| "sm"
|
||||
| "1x"
|
||||
| "2x"
|
||||
| "3x"
|
||||
| "4x"
|
||||
| "5x"
|
||||
| "6x"
|
||||
| "7x"
|
||||
| "8x"
|
||||
| "9x"
|
||||
| "10x";
|
||||
type PullProp = "left" | "right";
|
||||
type RotateProp = 90 | 180 | 270;
|
||||
type FaSymbol = string | boolean;
|
||||
interface Config {
|
||||
familyPrefix: IconPrefix;
|
||||
replacementClass: string;
|
||||
autoReplaceSvg: true;
|
||||
autoAddCss: true;
|
||||
autoA11y: true;
|
||||
searchPseudoElements: false;
|
||||
observeMutations: true;
|
||||
keepOriginalSource: true;
|
||||
measurePerformance: false;
|
||||
showMissingIcons: true;
|
||||
}
|
||||
interface FontawesomeObject {
|
||||
readonly abstract: object;
|
||||
readonly html: string;
|
||||
readonly node: HTMLCollection;
|
||||
}
|
||||
interface Icon extends FontawesomeObject, IconDefinition {
|
||||
readonly type: "icon";
|
||||
}
|
||||
interface Text extends FontawesomeObject {
|
||||
readonly type: "text";
|
||||
}
|
||||
interface Layer extends FontawesomeObject {
|
||||
readonly type: "layer";
|
||||
}
|
||||
interface Attributes {
|
||||
[key: string]: number | string;
|
||||
}
|
||||
interface Styles {
|
||||
[key: string]: string;
|
||||
}
|
||||
interface Transform {
|
||||
size?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
rotate?: number;
|
||||
flipX?: boolean;
|
||||
flipY?: boolean;
|
||||
}
|
||||
interface Params {
|
||||
transform?: Transform;
|
||||
title?: string;
|
||||
classes?: string | string[];
|
||||
attributes?: Attributes;
|
||||
styles?: Styles;
|
||||
}
|
||||
interface IconParams extends Params {
|
||||
symbol?: FaSymbol;
|
||||
mask?: IconLookup;
|
||||
}
|
||||
interface DOM {
|
||||
i2svg(params: { node: Node; callback: () => void }): void;
|
||||
css(): string;
|
||||
insertCss(): string;
|
||||
}
|
||||
interface Library {
|
||||
add(...definitions: IconDefinition[]): void;
|
||||
reset(): void;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Font Awesome Pro 5.0.2 by @fontawesome - http://fontawesome.com
|
||||
* Font Awesome Pro 5.0.3 by @fontawesome - http://fontawesome.com
|
||||
* License - http://fontawesome.com/license (Commercial License)
|
||||
*/
|
||||
var noop = function noop() {};
|
||||
@@ -137,16 +137,16 @@ var _default = _extends({
|
||||
|
||||
if (!_default.autoReplaceSvg) _default.observeMutations = false;
|
||||
|
||||
var config = _extends({}, _default);
|
||||
var config$1 = _extends({}, _default);
|
||||
|
||||
WINDOW.FontAwesomeConfig = config;
|
||||
WINDOW.FontAwesomeConfig = config$1;
|
||||
|
||||
function update(newConfig) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$asNewDefault = params.asNewDefault,
|
||||
asNewDefault = _params$asNewDefault === undefined ? false : _params$asNewDefault;
|
||||
|
||||
var validKeys = Object.keys(config);
|
||||
var validKeys = Object.keys(config$1);
|
||||
var ok = asNewDefault ? function (k) {
|
||||
return ~validKeys.indexOf(k) && !~initialKeys.indexOf(k);
|
||||
} : function (k) {
|
||||
@@ -154,7 +154,7 @@ function update(newConfig) {
|
||||
};
|
||||
|
||||
Object.keys(newConfig).forEach(function (configKey) {
|
||||
if (ok(configKey)) config[configKey] = newConfig[configKey];
|
||||
if (ok(configKey)) config$1[configKey] = newConfig[configKey];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -183,9 +183,13 @@ var listener = function listener() {
|
||||
});
|
||||
};
|
||||
|
||||
var loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
||||
var loaded = false;
|
||||
|
||||
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
||||
if (IS_BROWSER) {
|
||||
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
||||
|
||||
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
||||
}
|
||||
|
||||
var domready = function (fn) {
|
||||
if (!DOCUMENT) return;
|
||||
@@ -489,7 +493,7 @@ var asSymbol = function (_ref) {
|
||||
attributes = _ref.attributes,
|
||||
symbol = _ref.symbol;
|
||||
|
||||
var id = symbol === true ? prefix + '-' + config.familyPrefix + '-' + iconName : symbol;
|
||||
var id = symbol === true ? prefix + '-' + config$1.familyPrefix + '-' + iconName : symbol;
|
||||
|
||||
return [{
|
||||
tag: 'svg',
|
||||
@@ -522,7 +526,7 @@ function makeInlineSvgAbstract(params) {
|
||||
height = _ref.height;
|
||||
|
||||
var widthClass = 'fa-w-' + Math.ceil(width / height * 16);
|
||||
var attrClass = [config.replacementClass, iconName ? config.familyPrefix + '-' + iconName : '', widthClass].concat(extra.classes).join(' ');
|
||||
var attrClass = [config$1.replacementClass, iconName ? config$1.familyPrefix + '-' + iconName : '', widthClass].concat(extra.classes).join(' ');
|
||||
|
||||
var content = {
|
||||
children: [],
|
||||
@@ -597,8 +601,8 @@ function makeLayersTextAbstract(params) {
|
||||
}
|
||||
|
||||
var noop$2 = function noop() {};
|
||||
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
|
||||
var preamble = 'FA "5.0.2"';
|
||||
var p = config$1.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
|
||||
var preamble = 'FA "5.0.3"';
|
||||
|
||||
var begin = function begin(name) {
|
||||
p.mark(preamble + ' ' + name + ' begins');
|
||||
@@ -738,7 +742,7 @@ var emptyCanonicalIcon = function emptyCanonicalIcon() {
|
||||
|
||||
function getCanonicalIcon(values) {
|
||||
return values.reduce(function (acc, cls) {
|
||||
var iconName = getIconName(config.familyPrefix, cls);
|
||||
var iconName = getIconName(config$1.familyPrefix, cls);
|
||||
|
||||
if (styles$1[cls]) {
|
||||
acc.prefix = cls;
|
||||
@@ -747,7 +751,7 @@ function getCanonicalIcon(values) {
|
||||
|
||||
acc.iconName = shim.iconName || iconName;
|
||||
acc.prefix = shim.prefix || acc.prefix;
|
||||
} else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
|
||||
} else if (cls !== config$1.replacementClass && cls.indexOf('fa-w-') !== 0) {
|
||||
acc.rest.push(cls);
|
||||
}
|
||||
|
||||
@@ -786,18 +790,18 @@ function isReplaced(node) {
|
||||
var nodeClass = node.getAttribute ? node.getAttribute('class') : null;
|
||||
|
||||
if (nodeClass) {
|
||||
return !!~nodeClass.toString().indexOf(config.replacementClass) || ~nodeClass.toString().indexOf('fa-layers-text');
|
||||
return !!~nodeClass.toString().indexOf(config$1.replacementClass) || ~nodeClass.toString().indexOf('fa-layers-text');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getMutator() {
|
||||
if (config.autoReplaceSvg === true) {
|
||||
if (config$1.autoReplaceSvg === true) {
|
||||
return mutators.replace;
|
||||
}
|
||||
|
||||
var mutator = mutators[config.autoReplaceSvg];
|
||||
var mutator = mutators[config$1.autoReplaceSvg];
|
||||
|
||||
return mutator || mutators.replace;
|
||||
}
|
||||
@@ -811,7 +815,7 @@ var mutators = {
|
||||
}).join('\n');
|
||||
|
||||
if (node.parentNode && node.outerHTML) {
|
||||
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? '<!-- ' + node.outerHTML + ' -->' : '');
|
||||
node.outerHTML = newOuterHTML + (config$1.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? '<!-- ' + node.outerHTML + ' -->' : '');
|
||||
} else if (node.parentNode) {
|
||||
var newNode = document.createElement('span');
|
||||
node.parentNode.replaceChild(newNode, node);
|
||||
@@ -824,16 +828,16 @@ var mutators = {
|
||||
|
||||
// If we already have a replaced node we do not want to continue nesting within it.
|
||||
// Short-circuit to the standard replacement
|
||||
if (~classArray(node).indexOf(config.replacementClass)) {
|
||||
if (~classArray(node).indexOf(config$1.replacementClass)) {
|
||||
return mutators.replace(mutation);
|
||||
}
|
||||
|
||||
var forSvg = new RegExp(config.familyPrefix + '-.*');
|
||||
var forSvg = new RegExp(config$1.familyPrefix + '-.*');
|
||||
|
||||
delete abstract[0].attributes.style;
|
||||
|
||||
var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
|
||||
if (cls === config.replacementClass || cls.match(forSvg)) {
|
||||
if (cls === config$1.replacementClass || cls.match(forSvg)) {
|
||||
acc.toSvg.push(cls);
|
||||
} else {
|
||||
acc.toNode.push(cls);
|
||||
@@ -896,14 +900,14 @@ function observe(options) {
|
||||
|
||||
toArray(objects).forEach(function (mutationRecord) {
|
||||
if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isReplaced(mutationRecord.addedNodes[0])) {
|
||||
if (config.searchPseudoElements) {
|
||||
if (config$1.searchPseudoElements) {
|
||||
pseudoElementsCallback(mutationRecord.target);
|
||||
}
|
||||
|
||||
treeCallback(mutationRecord.target);
|
||||
}
|
||||
|
||||
if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
|
||||
if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config$1.searchPseudoElements) {
|
||||
pseudoElementsCallback(mutationRecord.target.parentNode);
|
||||
}
|
||||
|
||||
@@ -1066,9 +1070,9 @@ var attributesParser = function (node) {
|
||||
|
||||
var title = node.getAttribute('title');
|
||||
|
||||
if (config.autoA11y) {
|
||||
if (config$1.autoA11y) {
|
||||
if (title) {
|
||||
extraAttributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
|
||||
extraAttributes['aria-labelledby'] = config$1.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
extraAttributes['aria-hidden'] = 'true';
|
||||
}
|
||||
@@ -1199,7 +1203,7 @@ function findIcon(iconName, prefix) {
|
||||
height: height,
|
||||
icon: { tag: 'path', attributes: { fill: 'currentColor', d: vectorData[0] } }
|
||||
};
|
||||
} else if (iconName && prefix && !config.showMissingIcons) {
|
||||
} else if (iconName && prefix && !config$1.showMissingIcons) {
|
||||
throw new MissingIcon('Icon is missing for prefix ' + prefix + ' with icon name ' + iconName);
|
||||
}
|
||||
|
||||
@@ -1247,7 +1251,7 @@ function generateLayersText(node, nodeMeta) {
|
||||
height = boundingClientRect.height / computedFontSize;
|
||||
}
|
||||
|
||||
if (config.autoA11y && !title) {
|
||||
if (config$1.autoA11y && !title) {
|
||||
extra.attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
|
||||
@@ -1393,8 +1397,8 @@ var baseStyles = "svg:not(:root).svg-inline--fa {\n overflow: visible; }\n\n.sv
|
||||
var css = function () {
|
||||
var dfp = DEFAULT_FAMILY_PREFIX;
|
||||
var drc = DEFAULT_REPLACEMENT_CLASS;
|
||||
var fp = config.familyPrefix;
|
||||
var rc = config.replacementClass;
|
||||
var fp = config$1.familyPrefix;
|
||||
var rc = config$1.replacementClass;
|
||||
var s = baseStyles;
|
||||
|
||||
if (fp !== dfp || rc !== drc) {
|
||||
@@ -1504,7 +1508,7 @@ function prepIcon(icon) {
|
||||
var _cssInserted = false;
|
||||
|
||||
function ensureCss() {
|
||||
if (!config.autoAddCss) {
|
||||
if (!config$1.autoAddCss) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1570,157 +1574,160 @@ function resolveIcons(next) {
|
||||
}
|
||||
|
||||
var library = new Library();
|
||||
var noAuto = function noAuto() {
|
||||
return auto(false);
|
||||
};
|
||||
|
||||
var api$1 = {
|
||||
noAuto: function noAuto() {
|
||||
auto(false);
|
||||
},
|
||||
var dom = {
|
||||
i2svg: function i2svg() {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
ensureCss();
|
||||
|
||||
var _params$node = params.node,
|
||||
node = _params$node === undefined ? DOCUMENT : _params$node,
|
||||
_params$callback = params.callback,
|
||||
callback = _params$callback === undefined ? function () {} : _params$callback;
|
||||
|
||||
|
||||
dom: {
|
||||
i2svg: function i2svg() {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
ensureCss();
|
||||
|
||||
var _params$node = params.node,
|
||||
node = _params$node === undefined ? DOCUMENT : _params$node,
|
||||
_params$callback = params.callback,
|
||||
callback = _params$callback === undefined ? function () {} : _params$callback;
|
||||
|
||||
|
||||
if (config.searchPseudoElements) {
|
||||
searchPseudoElements(node);
|
||||
}
|
||||
|
||||
onTree(node, callback);
|
||||
},
|
||||
|
||||
css: css,
|
||||
|
||||
insertCss: function insertCss$$1() {
|
||||
insertCss(css());
|
||||
if (config$1.searchPseudoElements) {
|
||||
searchPseudoElements(node);
|
||||
}
|
||||
|
||||
onTree(node, callback);
|
||||
},
|
||||
|
||||
library: library,
|
||||
css: css,
|
||||
|
||||
parse: {
|
||||
transform: function transform(transformString) {
|
||||
return parseTransformString(transformString);
|
||||
}
|
||||
},
|
||||
|
||||
findIconDefinition: findIconDefinition,
|
||||
|
||||
icon: resolveIcons(function (iconDefinition) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform = params.transform,
|
||||
transform = _params$transform === undefined ? meaninglessTransform : _params$transform,
|
||||
_params$symbol = params.symbol,
|
||||
symbol = _params$symbol === undefined ? false : _params$symbol,
|
||||
_params$mask = params.mask,
|
||||
mask = _params$mask === undefined ? null : _params$mask,
|
||||
_params$title = params.title,
|
||||
title = _params$title === undefined ? null : _params$title,
|
||||
_params$classes = params.classes,
|
||||
classes = _params$classes === undefined ? [] : _params$classes,
|
||||
_params$attributes = params.attributes,
|
||||
attributes = _params$attributes === undefined ? {} : _params$attributes,
|
||||
_params$styles = params.styles,
|
||||
styles = _params$styles === undefined ? {} : _params$styles;
|
||||
|
||||
|
||||
if (!iconDefinition) return;
|
||||
|
||||
var prefix = iconDefinition.prefix,
|
||||
iconName = iconDefinition.iconName,
|
||||
icon = iconDefinition.icon;
|
||||
|
||||
|
||||
return apiObject(_extends({ type: 'icon' }, iconDefinition), function () {
|
||||
ensureCss();
|
||||
|
||||
if (config.autoA11y) {
|
||||
if (title) {
|
||||
attributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
return makeInlineSvgAbstract({
|
||||
icons: {
|
||||
main: prepIcon(icon),
|
||||
mask: mask ? prepIcon(mask.icon) : { found: false, width: null, height: null, icon: {} }
|
||||
},
|
||||
prefix: prefix,
|
||||
iconName: iconName,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
symbol: symbol,
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: classes
|
||||
}
|
||||
});
|
||||
});
|
||||
}),
|
||||
|
||||
text: function text(content) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform2 = params.transform,
|
||||
transform = _params$transform2 === undefined ? meaninglessTransform : _params$transform2,
|
||||
_params$title2 = params.title,
|
||||
title = _params$title2 === undefined ? null : _params$title2,
|
||||
_params$classes2 = params.classes,
|
||||
classes = _params$classes2 === undefined ? [] : _params$classes2,
|
||||
_params$attributes2 = params.attributes,
|
||||
attributes = _params$attributes2 === undefined ? {} : _params$attributes2,
|
||||
_params$styles2 = params.styles,
|
||||
styles = _params$styles2 === undefined ? {} : _params$styles2;
|
||||
|
||||
|
||||
return apiObject({ type: 'text', content: content }, function () {
|
||||
ensureCss();
|
||||
|
||||
return makeLayersTextAbstract({
|
||||
content: content,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: [config.familyPrefix + '-layers-text'].concat(toConsumableArray(classes))
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
layer: function layer(assembler) {
|
||||
return apiObject({ type: 'layer' }, function () {
|
||||
ensureCss();
|
||||
|
||||
var children = [];
|
||||
|
||||
assembler(function (args) {
|
||||
Array.isArray(args) ? children = args.map(function (a) {
|
||||
children = children.concat(a.abstract);
|
||||
}) : children = children.concat(args.abstract);
|
||||
});
|
||||
|
||||
return [{
|
||||
tag: 'span',
|
||||
attributes: { class: config.familyPrefix + '-layers' },
|
||||
children: children
|
||||
}];
|
||||
});
|
||||
insertCss: function insertCss$$1() {
|
||||
insertCss(css());
|
||||
}
|
||||
};
|
||||
|
||||
var parse = {
|
||||
transform: function transform(transformString) {
|
||||
return parseTransformString(transformString);
|
||||
}
|
||||
};
|
||||
|
||||
var icon = resolveIcons(function (iconDefinition) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform = params.transform,
|
||||
transform = _params$transform === undefined ? meaninglessTransform : _params$transform,
|
||||
_params$symbol = params.symbol,
|
||||
symbol = _params$symbol === undefined ? false : _params$symbol,
|
||||
_params$mask = params.mask,
|
||||
mask = _params$mask === undefined ? null : _params$mask,
|
||||
_params$title = params.title,
|
||||
title = _params$title === undefined ? null : _params$title,
|
||||
_params$classes = params.classes,
|
||||
classes = _params$classes === undefined ? [] : _params$classes,
|
||||
_params$attributes = params.attributes,
|
||||
attributes = _params$attributes === undefined ? {} : _params$attributes,
|
||||
_params$styles = params.styles,
|
||||
styles = _params$styles === undefined ? {} : _params$styles;
|
||||
|
||||
|
||||
if (!iconDefinition) return;
|
||||
|
||||
var prefix = iconDefinition.prefix,
|
||||
iconName = iconDefinition.iconName,
|
||||
icon = iconDefinition.icon;
|
||||
|
||||
|
||||
return apiObject(_extends({ type: 'icon' }, iconDefinition), function () {
|
||||
ensureCss();
|
||||
|
||||
if (config$1.autoA11y) {
|
||||
if (title) {
|
||||
attributes['aria-labelledby'] = config$1.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
return makeInlineSvgAbstract({
|
||||
icons: {
|
||||
main: prepIcon(icon),
|
||||
mask: mask ? prepIcon(mask.icon) : { found: false, width: null, height: null, icon: {} }
|
||||
},
|
||||
prefix: prefix,
|
||||
iconName: iconName,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
symbol: symbol,
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: classes
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var text = function text(content) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform2 = params.transform,
|
||||
transform = _params$transform2 === undefined ? meaninglessTransform : _params$transform2,
|
||||
_params$title2 = params.title,
|
||||
title = _params$title2 === undefined ? null : _params$title2,
|
||||
_params$classes2 = params.classes,
|
||||
classes = _params$classes2 === undefined ? [] : _params$classes2,
|
||||
_params$attributes2 = params.attributes,
|
||||
attributes = _params$attributes2 === undefined ? {} : _params$attributes2,
|
||||
_params$styles2 = params.styles,
|
||||
styles = _params$styles2 === undefined ? {} : _params$styles2;
|
||||
|
||||
|
||||
return apiObject({ type: 'text', content: content }, function () {
|
||||
ensureCss();
|
||||
|
||||
return makeLayersTextAbstract({
|
||||
content: content,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: [config$1.familyPrefix + '-layers-text'].concat(toConsumableArray(classes))
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var layer = function layer(assembler) {
|
||||
return apiObject({ type: 'layer' }, function () {
|
||||
ensureCss();
|
||||
|
||||
var children = [];
|
||||
|
||||
assembler(function (args) {
|
||||
Array.isArray(args) ? children = args.map(function (a) {
|
||||
children = children.concat(a.abstract);
|
||||
}) : children = children.concat(args.abstract);
|
||||
});
|
||||
|
||||
return [{
|
||||
tag: 'span',
|
||||
attributes: { class: config$1.familyPrefix + '-layers' },
|
||||
children: children
|
||||
}];
|
||||
});
|
||||
};
|
||||
|
||||
var api$1 = {
|
||||
noAuto: noAuto,
|
||||
dom: dom,
|
||||
library: library,
|
||||
parse: parse,
|
||||
findIconDefinition: findIconDefinition,
|
||||
icon: icon,
|
||||
text: text,
|
||||
layer: layer
|
||||
};
|
||||
|
||||
var autoReplace = function autoReplace() {
|
||||
if (config.autoReplaceSvg) api$1.dom.i2svg({ node: DOCUMENT });
|
||||
if (config$1.autoReplaceSvg) api$1.dom.i2svg({ node: DOCUMENT });
|
||||
};
|
||||
|
||||
function bootstrap() {
|
||||
@@ -1734,7 +1741,7 @@ function bootstrap() {
|
||||
autoReplace();
|
||||
}
|
||||
|
||||
if (config.observeMutations && typeof MutationObserver === 'function') {
|
||||
if (config$1.observeMutations && typeof MutationObserver === 'function') {
|
||||
observe({
|
||||
treeCallback: onTree,
|
||||
nodeCallback: onNode,
|
||||
@@ -1766,7 +1773,7 @@ function bootstrap() {
|
||||
|
||||
Object.defineProperty(api$1, 'config', {
|
||||
get: function get() {
|
||||
return config;
|
||||
return config$1;
|
||||
},
|
||||
|
||||
set: function set(newConfig) {
|
||||
@@ -1776,4 +1783,7 @@ Object.defineProperty(api$1, 'config', {
|
||||
|
||||
if (DOCUMENT) bunker(bootstrap);
|
||||
|
||||
var config = api$1.config;
|
||||
|
||||
export { config, icon, noAuto, layer, text, library, dom, parse, findIconDefinition };
|
||||
export default api$1;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*!
|
||||
* Font Awesome Pro 5.0.2 by @fontawesome - http://fontawesome.com
|
||||
* Font Awesome Pro 5.0.3 by @fontawesome - http://fontawesome.com
|
||||
* License - http://fontawesome.com/license (Commercial License)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global.fontawesome = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.fontawesome = {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
var noop = function noop() {};
|
||||
|
||||
@@ -143,16 +143,16 @@ var _default = _extends({
|
||||
|
||||
if (!_default.autoReplaceSvg) _default.observeMutations = false;
|
||||
|
||||
var config = _extends({}, _default);
|
||||
var config$1 = _extends({}, _default);
|
||||
|
||||
WINDOW.FontAwesomeConfig = config;
|
||||
WINDOW.FontAwesomeConfig = config$1;
|
||||
|
||||
function update(newConfig) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$asNewDefault = params.asNewDefault,
|
||||
asNewDefault = _params$asNewDefault === undefined ? false : _params$asNewDefault;
|
||||
|
||||
var validKeys = Object.keys(config);
|
||||
var validKeys = Object.keys(config$1);
|
||||
var ok = asNewDefault ? function (k) {
|
||||
return ~validKeys.indexOf(k) && !~initialKeys.indexOf(k);
|
||||
} : function (k) {
|
||||
@@ -160,7 +160,7 @@ function update(newConfig) {
|
||||
};
|
||||
|
||||
Object.keys(newConfig).forEach(function (configKey) {
|
||||
if (ok(configKey)) config[configKey] = newConfig[configKey];
|
||||
if (ok(configKey)) config$1[configKey] = newConfig[configKey];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -189,9 +189,13 @@ var listener = function listener() {
|
||||
});
|
||||
};
|
||||
|
||||
var loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
||||
var loaded = false;
|
||||
|
||||
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
||||
if (IS_BROWSER) {
|
||||
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
||||
|
||||
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
||||
}
|
||||
|
||||
var domready = function (fn) {
|
||||
if (!DOCUMENT) return;
|
||||
@@ -495,7 +499,7 @@ var asSymbol = function (_ref) {
|
||||
attributes = _ref.attributes,
|
||||
symbol = _ref.symbol;
|
||||
|
||||
var id = symbol === true ? prefix + '-' + config.familyPrefix + '-' + iconName : symbol;
|
||||
var id = symbol === true ? prefix + '-' + config$1.familyPrefix + '-' + iconName : symbol;
|
||||
|
||||
return [{
|
||||
tag: 'svg',
|
||||
@@ -528,7 +532,7 @@ function makeInlineSvgAbstract(params) {
|
||||
height = _ref.height;
|
||||
|
||||
var widthClass = 'fa-w-' + Math.ceil(width / height * 16);
|
||||
var attrClass = [config.replacementClass, iconName ? config.familyPrefix + '-' + iconName : '', widthClass].concat(extra.classes).join(' ');
|
||||
var attrClass = [config$1.replacementClass, iconName ? config$1.familyPrefix + '-' + iconName : '', widthClass].concat(extra.classes).join(' ');
|
||||
|
||||
var content = {
|
||||
children: [],
|
||||
@@ -603,8 +607,8 @@ function makeLayersTextAbstract(params) {
|
||||
}
|
||||
|
||||
var noop$2 = function noop() {};
|
||||
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
|
||||
var preamble = 'FA "5.0.2"';
|
||||
var p = config$1.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
|
||||
var preamble = 'FA "5.0.3"';
|
||||
|
||||
var begin = function begin(name) {
|
||||
p.mark(preamble + ' ' + name + ' begins');
|
||||
@@ -744,7 +748,7 @@ var emptyCanonicalIcon = function emptyCanonicalIcon() {
|
||||
|
||||
function getCanonicalIcon(values) {
|
||||
return values.reduce(function (acc, cls) {
|
||||
var iconName = getIconName(config.familyPrefix, cls);
|
||||
var iconName = getIconName(config$1.familyPrefix, cls);
|
||||
|
||||
if (styles$1[cls]) {
|
||||
acc.prefix = cls;
|
||||
@@ -753,7 +757,7 @@ function getCanonicalIcon(values) {
|
||||
|
||||
acc.iconName = shim.iconName || iconName;
|
||||
acc.prefix = shim.prefix || acc.prefix;
|
||||
} else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
|
||||
} else if (cls !== config$1.replacementClass && cls.indexOf('fa-w-') !== 0) {
|
||||
acc.rest.push(cls);
|
||||
}
|
||||
|
||||
@@ -792,18 +796,18 @@ function isReplaced(node) {
|
||||
var nodeClass = node.getAttribute ? node.getAttribute('class') : null;
|
||||
|
||||
if (nodeClass) {
|
||||
return !!~nodeClass.toString().indexOf(config.replacementClass) || ~nodeClass.toString().indexOf('fa-layers-text');
|
||||
return !!~nodeClass.toString().indexOf(config$1.replacementClass) || ~nodeClass.toString().indexOf('fa-layers-text');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getMutator() {
|
||||
if (config.autoReplaceSvg === true) {
|
||||
if (config$1.autoReplaceSvg === true) {
|
||||
return mutators.replace;
|
||||
}
|
||||
|
||||
var mutator = mutators[config.autoReplaceSvg];
|
||||
var mutator = mutators[config$1.autoReplaceSvg];
|
||||
|
||||
return mutator || mutators.replace;
|
||||
}
|
||||
@@ -817,7 +821,7 @@ var mutators = {
|
||||
}).join('\n');
|
||||
|
||||
if (node.parentNode && node.outerHTML) {
|
||||
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? '<!-- ' + node.outerHTML + ' -->' : '');
|
||||
node.outerHTML = newOuterHTML + (config$1.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? '<!-- ' + node.outerHTML + ' -->' : '');
|
||||
} else if (node.parentNode) {
|
||||
var newNode = document.createElement('span');
|
||||
node.parentNode.replaceChild(newNode, node);
|
||||
@@ -830,16 +834,16 @@ var mutators = {
|
||||
|
||||
// If we already have a replaced node we do not want to continue nesting within it.
|
||||
// Short-circuit to the standard replacement
|
||||
if (~classArray(node).indexOf(config.replacementClass)) {
|
||||
if (~classArray(node).indexOf(config$1.replacementClass)) {
|
||||
return mutators.replace(mutation);
|
||||
}
|
||||
|
||||
var forSvg = new RegExp(config.familyPrefix + '-.*');
|
||||
var forSvg = new RegExp(config$1.familyPrefix + '-.*');
|
||||
|
||||
delete abstract[0].attributes.style;
|
||||
|
||||
var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
|
||||
if (cls === config.replacementClass || cls.match(forSvg)) {
|
||||
if (cls === config$1.replacementClass || cls.match(forSvg)) {
|
||||
acc.toSvg.push(cls);
|
||||
} else {
|
||||
acc.toNode.push(cls);
|
||||
@@ -902,14 +906,14 @@ function observe(options) {
|
||||
|
||||
toArray(objects).forEach(function (mutationRecord) {
|
||||
if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isReplaced(mutationRecord.addedNodes[0])) {
|
||||
if (config.searchPseudoElements) {
|
||||
if (config$1.searchPseudoElements) {
|
||||
pseudoElementsCallback(mutationRecord.target);
|
||||
}
|
||||
|
||||
treeCallback(mutationRecord.target);
|
||||
}
|
||||
|
||||
if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
|
||||
if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config$1.searchPseudoElements) {
|
||||
pseudoElementsCallback(mutationRecord.target.parentNode);
|
||||
}
|
||||
|
||||
@@ -1072,9 +1076,9 @@ var attributesParser = function (node) {
|
||||
|
||||
var title = node.getAttribute('title');
|
||||
|
||||
if (config.autoA11y) {
|
||||
if (config$1.autoA11y) {
|
||||
if (title) {
|
||||
extraAttributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
|
||||
extraAttributes['aria-labelledby'] = config$1.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
extraAttributes['aria-hidden'] = 'true';
|
||||
}
|
||||
@@ -1205,7 +1209,7 @@ function findIcon(iconName, prefix) {
|
||||
height: height,
|
||||
icon: { tag: 'path', attributes: { fill: 'currentColor', d: vectorData[0] } }
|
||||
};
|
||||
} else if (iconName && prefix && !config.showMissingIcons) {
|
||||
} else if (iconName && prefix && !config$1.showMissingIcons) {
|
||||
throw new MissingIcon('Icon is missing for prefix ' + prefix + ' with icon name ' + iconName);
|
||||
}
|
||||
|
||||
@@ -1253,7 +1257,7 @@ function generateLayersText(node, nodeMeta) {
|
||||
height = boundingClientRect.height / computedFontSize;
|
||||
}
|
||||
|
||||
if (config.autoA11y && !title) {
|
||||
if (config$1.autoA11y && !title) {
|
||||
extra.attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
|
||||
@@ -1399,8 +1403,8 @@ var baseStyles = "svg:not(:root).svg-inline--fa {\n overflow: visible; }\n\n.sv
|
||||
var css = function () {
|
||||
var dfp = DEFAULT_FAMILY_PREFIX;
|
||||
var drc = DEFAULT_REPLACEMENT_CLASS;
|
||||
var fp = config.familyPrefix;
|
||||
var rc = config.replacementClass;
|
||||
var fp = config$1.familyPrefix;
|
||||
var rc = config$1.replacementClass;
|
||||
var s = baseStyles;
|
||||
|
||||
if (fp !== dfp || rc !== drc) {
|
||||
@@ -1510,7 +1514,7 @@ function prepIcon(icon) {
|
||||
var _cssInserted = false;
|
||||
|
||||
function ensureCss() {
|
||||
if (!config.autoAddCss) {
|
||||
if (!config$1.autoAddCss) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1576,157 +1580,160 @@ function resolveIcons(next) {
|
||||
}
|
||||
|
||||
var library = new Library();
|
||||
var noAuto = function noAuto() {
|
||||
return auto(false);
|
||||
};
|
||||
|
||||
var api$1 = {
|
||||
noAuto: function noAuto() {
|
||||
auto(false);
|
||||
},
|
||||
var dom = {
|
||||
i2svg: function i2svg() {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
ensureCss();
|
||||
|
||||
var _params$node = params.node,
|
||||
node = _params$node === undefined ? DOCUMENT : _params$node,
|
||||
_params$callback = params.callback,
|
||||
callback = _params$callback === undefined ? function () {} : _params$callback;
|
||||
|
||||
|
||||
dom: {
|
||||
i2svg: function i2svg() {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
|
||||
ensureCss();
|
||||
|
||||
var _params$node = params.node,
|
||||
node = _params$node === undefined ? DOCUMENT : _params$node,
|
||||
_params$callback = params.callback,
|
||||
callback = _params$callback === undefined ? function () {} : _params$callback;
|
||||
|
||||
|
||||
if (config.searchPseudoElements) {
|
||||
searchPseudoElements(node);
|
||||
}
|
||||
|
||||
onTree(node, callback);
|
||||
},
|
||||
|
||||
css: css,
|
||||
|
||||
insertCss: function insertCss$$1() {
|
||||
insertCss(css());
|
||||
if (config$1.searchPseudoElements) {
|
||||
searchPseudoElements(node);
|
||||
}
|
||||
|
||||
onTree(node, callback);
|
||||
},
|
||||
|
||||
library: library,
|
||||
css: css,
|
||||
|
||||
parse: {
|
||||
transform: function transform(transformString) {
|
||||
return parseTransformString(transformString);
|
||||
}
|
||||
},
|
||||
|
||||
findIconDefinition: findIconDefinition,
|
||||
|
||||
icon: resolveIcons(function (iconDefinition) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform = params.transform,
|
||||
transform = _params$transform === undefined ? meaninglessTransform : _params$transform,
|
||||
_params$symbol = params.symbol,
|
||||
symbol = _params$symbol === undefined ? false : _params$symbol,
|
||||
_params$mask = params.mask,
|
||||
mask = _params$mask === undefined ? null : _params$mask,
|
||||
_params$title = params.title,
|
||||
title = _params$title === undefined ? null : _params$title,
|
||||
_params$classes = params.classes,
|
||||
classes = _params$classes === undefined ? [] : _params$classes,
|
||||
_params$attributes = params.attributes,
|
||||
attributes = _params$attributes === undefined ? {} : _params$attributes,
|
||||
_params$styles = params.styles,
|
||||
styles = _params$styles === undefined ? {} : _params$styles;
|
||||
|
||||
|
||||
if (!iconDefinition) return;
|
||||
|
||||
var prefix = iconDefinition.prefix,
|
||||
iconName = iconDefinition.iconName,
|
||||
icon = iconDefinition.icon;
|
||||
|
||||
|
||||
return apiObject(_extends({ type: 'icon' }, iconDefinition), function () {
|
||||
ensureCss();
|
||||
|
||||
if (config.autoA11y) {
|
||||
if (title) {
|
||||
attributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
return makeInlineSvgAbstract({
|
||||
icons: {
|
||||
main: prepIcon(icon),
|
||||
mask: mask ? prepIcon(mask.icon) : { found: false, width: null, height: null, icon: {} }
|
||||
},
|
||||
prefix: prefix,
|
||||
iconName: iconName,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
symbol: symbol,
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: classes
|
||||
}
|
||||
});
|
||||
});
|
||||
}),
|
||||
|
||||
text: function text(content) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform2 = params.transform,
|
||||
transform = _params$transform2 === undefined ? meaninglessTransform : _params$transform2,
|
||||
_params$title2 = params.title,
|
||||
title = _params$title2 === undefined ? null : _params$title2,
|
||||
_params$classes2 = params.classes,
|
||||
classes = _params$classes2 === undefined ? [] : _params$classes2,
|
||||
_params$attributes2 = params.attributes,
|
||||
attributes = _params$attributes2 === undefined ? {} : _params$attributes2,
|
||||
_params$styles2 = params.styles,
|
||||
styles = _params$styles2 === undefined ? {} : _params$styles2;
|
||||
|
||||
|
||||
return apiObject({ type: 'text', content: content }, function () {
|
||||
ensureCss();
|
||||
|
||||
return makeLayersTextAbstract({
|
||||
content: content,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: [config.familyPrefix + '-layers-text'].concat(toConsumableArray(classes))
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
layer: function layer(assembler) {
|
||||
return apiObject({ type: 'layer' }, function () {
|
||||
ensureCss();
|
||||
|
||||
var children = [];
|
||||
|
||||
assembler(function (args) {
|
||||
Array.isArray(args) ? children = args.map(function (a) {
|
||||
children = children.concat(a.abstract);
|
||||
}) : children = children.concat(args.abstract);
|
||||
});
|
||||
|
||||
return [{
|
||||
tag: 'span',
|
||||
attributes: { class: config.familyPrefix + '-layers' },
|
||||
children: children
|
||||
}];
|
||||
});
|
||||
insertCss: function insertCss$$1() {
|
||||
insertCss(css());
|
||||
}
|
||||
};
|
||||
|
||||
var parse = {
|
||||
transform: function transform(transformString) {
|
||||
return parseTransformString(transformString);
|
||||
}
|
||||
};
|
||||
|
||||
var icon = resolveIcons(function (iconDefinition) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform = params.transform,
|
||||
transform = _params$transform === undefined ? meaninglessTransform : _params$transform,
|
||||
_params$symbol = params.symbol,
|
||||
symbol = _params$symbol === undefined ? false : _params$symbol,
|
||||
_params$mask = params.mask,
|
||||
mask = _params$mask === undefined ? null : _params$mask,
|
||||
_params$title = params.title,
|
||||
title = _params$title === undefined ? null : _params$title,
|
||||
_params$classes = params.classes,
|
||||
classes = _params$classes === undefined ? [] : _params$classes,
|
||||
_params$attributes = params.attributes,
|
||||
attributes = _params$attributes === undefined ? {} : _params$attributes,
|
||||
_params$styles = params.styles,
|
||||
styles = _params$styles === undefined ? {} : _params$styles;
|
||||
|
||||
|
||||
if (!iconDefinition) return;
|
||||
|
||||
var prefix = iconDefinition.prefix,
|
||||
iconName = iconDefinition.iconName,
|
||||
icon = iconDefinition.icon;
|
||||
|
||||
|
||||
return apiObject(_extends({ type: 'icon' }, iconDefinition), function () {
|
||||
ensureCss();
|
||||
|
||||
if (config$1.autoA11y) {
|
||||
if (title) {
|
||||
attributes['aria-labelledby'] = config$1.replacementClass + '-title-' + nextUniqueId();
|
||||
} else {
|
||||
attributes['aria-hidden'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
return makeInlineSvgAbstract({
|
||||
icons: {
|
||||
main: prepIcon(icon),
|
||||
mask: mask ? prepIcon(mask.icon) : { found: false, width: null, height: null, icon: {} }
|
||||
},
|
||||
prefix: prefix,
|
||||
iconName: iconName,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
symbol: symbol,
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: classes
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var text = function text(content) {
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _params$transform2 = params.transform,
|
||||
transform = _params$transform2 === undefined ? meaninglessTransform : _params$transform2,
|
||||
_params$title2 = params.title,
|
||||
title = _params$title2 === undefined ? null : _params$title2,
|
||||
_params$classes2 = params.classes,
|
||||
classes = _params$classes2 === undefined ? [] : _params$classes2,
|
||||
_params$attributes2 = params.attributes,
|
||||
attributes = _params$attributes2 === undefined ? {} : _params$attributes2,
|
||||
_params$styles2 = params.styles,
|
||||
styles = _params$styles2 === undefined ? {} : _params$styles2;
|
||||
|
||||
|
||||
return apiObject({ type: 'text', content: content }, function () {
|
||||
ensureCss();
|
||||
|
||||
return makeLayersTextAbstract({
|
||||
content: content,
|
||||
transform: _extends({}, meaninglessTransform, transform),
|
||||
title: title,
|
||||
extra: {
|
||||
attributes: attributes,
|
||||
styles: styles,
|
||||
classes: [config$1.familyPrefix + '-layers-text'].concat(toConsumableArray(classes))
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var layer = function layer(assembler) {
|
||||
return apiObject({ type: 'layer' }, function () {
|
||||
ensureCss();
|
||||
|
||||
var children = [];
|
||||
|
||||
assembler(function (args) {
|
||||
Array.isArray(args) ? children = args.map(function (a) {
|
||||
children = children.concat(a.abstract);
|
||||
}) : children = children.concat(args.abstract);
|
||||
});
|
||||
|
||||
return [{
|
||||
tag: 'span',
|
||||
attributes: { class: config$1.familyPrefix + '-layers' },
|
||||
children: children
|
||||
}];
|
||||
});
|
||||
};
|
||||
|
||||
var api$1 = {
|
||||
noAuto: noAuto,
|
||||
dom: dom,
|
||||
library: library,
|
||||
parse: parse,
|
||||
findIconDefinition: findIconDefinition,
|
||||
icon: icon,
|
||||
text: text,
|
||||
layer: layer
|
||||
};
|
||||
|
||||
var autoReplace = function autoReplace() {
|
||||
if (config.autoReplaceSvg) api$1.dom.i2svg({ node: DOCUMENT });
|
||||
if (config$1.autoReplaceSvg) api$1.dom.i2svg({ node: DOCUMENT });
|
||||
};
|
||||
|
||||
function bootstrap() {
|
||||
@@ -1740,7 +1747,7 @@ function bootstrap() {
|
||||
autoReplace();
|
||||
}
|
||||
|
||||
if (config.observeMutations && typeof MutationObserver === 'function') {
|
||||
if (config$1.observeMutations && typeof MutationObserver === 'function') {
|
||||
observe({
|
||||
treeCallback: onTree,
|
||||
nodeCallback: onNode,
|
||||
@@ -1772,7 +1779,7 @@ function bootstrap() {
|
||||
|
||||
Object.defineProperty(api$1, 'config', {
|
||||
get: function get() {
|
||||
return config;
|
||||
return config$1;
|
||||
},
|
||||
|
||||
set: function set(newConfig) {
|
||||
@@ -1782,6 +1789,19 @@ Object.defineProperty(api$1, 'config', {
|
||||
|
||||
if (DOCUMENT) bunker(bootstrap);
|
||||
|
||||
return api$1;
|
||||
var config = api$1.config;
|
||||
|
||||
exports.config = config;
|
||||
exports['default'] = api$1;
|
||||
exports.icon = icon;
|
||||
exports.noAuto = noAuto;
|
||||
exports.layer = layer;
|
||||
exports.text = text;
|
||||
exports.library = library;
|
||||
exports.dom = dom;
|
||||
exports.parse = parse;
|
||||
exports.findIconDefinition = findIconDefinition;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
{
|
||||
"name": "Geremia Taglialatela",
|
||||
"web": "http://twitter.com/gtagliala"
|
||||
},
|
||||
{
|
||||
"name": "Mike Wilkerson",
|
||||
"web": "http://twitter.com/mw77"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
@@ -42,12 +46,15 @@
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"dependencies": {},
|
||||
"version": "1.1.0",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-common-types": "^0.1.0"
|
||||
},
|
||||
"version": "1.1.1",
|
||||
"name": "@fortawesome/fontawesome",
|
||||
"main": "index.js",
|
||||
"module": "index.es.js",
|
||||
"jsnext:main": "index.es.js",
|
||||
"style": "styles.css",
|
||||
"license": "UNLICENSED"
|
||||
"license": "UNLICENSED",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Font Awesome Pro 5.0.2 by @fontawesome - http://fontawesome.com
|
||||
* Font Awesome Pro 5.0.3 by @fontawesome - http://fontawesome.com
|
||||
* License - http://fontawesome.com/license (Commercial License)
|
||||
*/
|
||||
svg:not(:root).svg-inline--fa {
|
||||
|
||||
Reference in New Issue
Block a user