progress on migrating to heex templates and font-icons
This commit is contained in:
parent
d43daafdb7
commit
3eff955672
21793 changed files with 2161968 additions and 16895 deletions
assets_old/node_modules/svg-sprite-loader/runtime
1010
assets_old/node_modules/svg-sprite-loader/runtime/browser-sprite.build.js
generated
vendored
Normal file
1010
assets_old/node_modules/svg-sprite-loader/runtime/browser-sprite.build.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
44
assets_old/node_modules/svg-sprite-loader/runtime/browser-sprite.js
generated
vendored
Normal file
44
assets_old/node_modules/svg-sprite-loader/runtime/browser-sprite.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
import BrowserSprite from 'svg-baker-runtime/src/browser-sprite';
|
||||
import domready from 'domready';
|
||||
|
||||
const spriteNodeId = '__SVG_SPRITE_NODE__';
|
||||
const spriteGlobalVarName = '__SVG_SPRITE__';
|
||||
const isSpriteExists = !!window[spriteGlobalVarName];
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
let sprite;
|
||||
|
||||
if (isSpriteExists) {
|
||||
sprite = window[spriteGlobalVarName];
|
||||
} else {
|
||||
sprite = new BrowserSprite({
|
||||
attrs: {
|
||||
id: spriteNodeId,
|
||||
'aria-hidden': 'true'
|
||||
}
|
||||
});
|
||||
window[spriteGlobalVarName] = sprite;
|
||||
}
|
||||
|
||||
const loadSprite = () => {
|
||||
/**
|
||||
* Check for page already contains sprite node
|
||||
* If found - attach to and reuse it's content
|
||||
* If not - render and mount the new sprite
|
||||
*/
|
||||
const existing = document.getElementById(spriteNodeId);
|
||||
|
||||
if (existing) {
|
||||
sprite.attach(existing);
|
||||
} else {
|
||||
sprite.mount(document.body, true);
|
||||
}
|
||||
};
|
||||
|
||||
if (document.body) {
|
||||
loadSprite();
|
||||
} else {
|
||||
domready(loadSprite);
|
||||
}
|
||||
|
||||
export default sprite;
|
244
assets_old/node_modules/svg-sprite-loader/runtime/sprite.build.js
generated
vendored
Normal file
244
assets_old/node_modules/svg-sprite-loader/runtime/sprite.build.js
generated
vendored
Normal file
|
@ -0,0 +1,244 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global.Sprite = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
var deepmerge$1 = createCommonjsModule(function (module, exports) {
|
||||
(function (root, factory) {
|
||||
if (typeof undefined === 'function' && undefined.amd) {
|
||||
undefined(factory);
|
||||
} else {
|
||||
module.exports = factory();
|
||||
}
|
||||
}(commonjsGlobal, function () {
|
||||
|
||||
function isMergeableObject(val) {
|
||||
var nonNullObject = val && typeof val === 'object';
|
||||
|
||||
return nonNullObject
|
||||
&& Object.prototype.toString.call(val) !== '[object RegExp]'
|
||||
&& Object.prototype.toString.call(val) !== '[object Date]'
|
||||
}
|
||||
|
||||
function emptyTarget(val) {
|
||||
return Array.isArray(val) ? [] : {}
|
||||
}
|
||||
|
||||
function cloneIfNecessary(value, optionsArgument) {
|
||||
var clone = optionsArgument && optionsArgument.clone === true;
|
||||
return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value
|
||||
}
|
||||
|
||||
function defaultArrayMerge(target, source, optionsArgument) {
|
||||
var destination = target.slice();
|
||||
source.forEach(function(e, i) {
|
||||
if (typeof destination[i] === 'undefined') {
|
||||
destination[i] = cloneIfNecessary(e, optionsArgument);
|
||||
} else if (isMergeableObject(e)) {
|
||||
destination[i] = deepmerge(target[i], e, optionsArgument);
|
||||
} else if (target.indexOf(e) === -1) {
|
||||
destination.push(cloneIfNecessary(e, optionsArgument));
|
||||
}
|
||||
});
|
||||
return destination
|
||||
}
|
||||
|
||||
function mergeObject(target, source, optionsArgument) {
|
||||
var destination = {};
|
||||
if (isMergeableObject(target)) {
|
||||
Object.keys(target).forEach(function (key) {
|
||||
destination[key] = cloneIfNecessary(target[key], optionsArgument);
|
||||
});
|
||||
}
|
||||
Object.keys(source).forEach(function (key) {
|
||||
if (!isMergeableObject(source[key]) || !target[key]) {
|
||||
destination[key] = cloneIfNecessary(source[key], optionsArgument);
|
||||
} else {
|
||||
destination[key] = deepmerge(target[key], source[key], optionsArgument);
|
||||
}
|
||||
});
|
||||
return destination
|
||||
}
|
||||
|
||||
function deepmerge(target, source, optionsArgument) {
|
||||
var array = Array.isArray(source);
|
||||
var options = optionsArgument || { arrayMerge: defaultArrayMerge };
|
||||
var arrayMerge = options.arrayMerge || defaultArrayMerge;
|
||||
|
||||
if (array) {
|
||||
return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
|
||||
} else {
|
||||
return mergeObject(target, source, optionsArgument)
|
||||
}
|
||||
}
|
||||
|
||||
deepmerge.all = function deepmergeAll(array, optionsArgument) {
|
||||
if (!Array.isArray(array) || array.length < 2) {
|
||||
throw new Error('first argument should be an array with at least two elements')
|
||||
}
|
||||
|
||||
// we are sure there are at least 2 values, so it is safe to have no initial value
|
||||
return array.reduce(function(prev, next) {
|
||||
return deepmerge(prev, next, optionsArgument)
|
||||
})
|
||||
};
|
||||
|
||||
return deepmerge
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
var namespaces_1 = createCommonjsModule(function (module, exports) {
|
||||
var namespaces = {
|
||||
svg: {
|
||||
name: 'xmlns',
|
||||
uri: 'http://www.w3.org/2000/svg'
|
||||
},
|
||||
xlink: {
|
||||
name: 'xmlns:xlink',
|
||||
uri: 'http://www.w3.org/1999/xlink'
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = namespaces;
|
||||
module.exports = exports.default;
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {Object} attrs
|
||||
* @return {string}
|
||||
*/
|
||||
var objectToAttrsString = function (attrs) {
|
||||
return Object.keys(attrs).map(function (attr) {
|
||||
var value = attrs[attr].toString().replace(/"/g, '"');
|
||||
return (attr + "=\"" + value + "\"");
|
||||
}).join(' ');
|
||||
};
|
||||
|
||||
var svg = namespaces_1.svg;
|
||||
var xlink = namespaces_1.xlink;
|
||||
|
||||
var defaultAttrs = {};
|
||||
defaultAttrs[svg.name] = svg.uri;
|
||||
defaultAttrs[xlink.name] = xlink.uri;
|
||||
|
||||
/**
|
||||
* @param {string} [content]
|
||||
* @param {Object} [attributes]
|
||||
* @return {string}
|
||||
*/
|
||||
var wrapInSvgString = function (content, attributes) {
|
||||
if ( content === void 0 ) content = '';
|
||||
|
||||
var attrs = deepmerge$1(defaultAttrs, attributes || {});
|
||||
var attrsRendered = objectToAttrsString(attrs);
|
||||
return ("<svg " + attrsRendered + ">" + content + "</svg>");
|
||||
};
|
||||
|
||||
var svg$1 = namespaces_1.svg;
|
||||
var xlink$1 = namespaces_1.xlink;
|
||||
|
||||
var defaultConfig = {
|
||||
attrs: ( obj = {
|
||||
style: ['position: absolute', 'width: 0', 'height: 0'].join('; '),
|
||||
'aria-hidden': 'true'
|
||||
}, obj[svg$1.name] = svg$1.uri, obj[xlink$1.name] = xlink$1.uri, obj )
|
||||
};
|
||||
var obj;
|
||||
|
||||
var Sprite = function Sprite(config) {
|
||||
this.config = deepmerge$1(defaultConfig, config || {});
|
||||
this.symbols = [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Add new symbol. If symbol with the same id exists it will be replaced.
|
||||
* @param {SpriteSymbol} symbol
|
||||
* @return {boolean} `true` - symbol was added, `false` - replaced
|
||||
*/
|
||||
Sprite.prototype.add = function add (symbol) {
|
||||
var ref = this;
|
||||
var symbols = ref.symbols;
|
||||
var existing = this.find(symbol.id);
|
||||
|
||||
if (existing) {
|
||||
symbols[symbols.indexOf(existing)] = symbol;
|
||||
return false;
|
||||
}
|
||||
|
||||
symbols.push(symbol);
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove symbol & destroy it
|
||||
* @param {string} id
|
||||
* @return {boolean} `true` - symbol was found & successfully destroyed, `false` - otherwise
|
||||
*/
|
||||
Sprite.prototype.remove = function remove (id) {
|
||||
var ref = this;
|
||||
var symbols = ref.symbols;
|
||||
var symbol = this.find(id);
|
||||
|
||||
if (symbol) {
|
||||
symbols.splice(symbols.indexOf(symbol), 1);
|
||||
symbol.destroy();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} id
|
||||
* @return {SpriteSymbol|null}
|
||||
*/
|
||||
Sprite.prototype.find = function find (id) {
|
||||
return this.symbols.filter(function (s) { return s.id === id; })[0] || null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} id
|
||||
* @return {boolean}
|
||||
*/
|
||||
Sprite.prototype.has = function has (id) {
|
||||
return this.find(id) !== null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
Sprite.prototype.stringify = function stringify () {
|
||||
var ref = this.config;
|
||||
var attrs = ref.attrs;
|
||||
var stringifiedSymbols = this.symbols.map(function (s) { return s.stringify(); }).join('');
|
||||
return wrapInSvgString(stringifiedSymbols, attrs);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
Sprite.prototype.toString = function toString () {
|
||||
return this.stringify();
|
||||
};
|
||||
|
||||
Sprite.prototype.destroy = function destroy () {
|
||||
this.symbols.forEach(function (s) { return s.destroy(); });
|
||||
};
|
||||
|
||||
var sprite = new Sprite({ attrs: { id: '__SVG_SPRITE_NODE__' } });
|
||||
|
||||
return sprite;
|
||||
|
||||
})));
|
3
assets_old/node_modules/svg-sprite-loader/runtime/sprite.js
generated
vendored
Normal file
3
assets_old/node_modules/svg-sprite-loader/runtime/sprite.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import Sprite from 'svg-baker-runtime/src/sprite';
|
||||
|
||||
export default new Sprite({ attrs: { id: '__SVG_SPRITE_NODE__' } });
|
Loading…
Add table
Add a link
Reference in a new issue