Initial import with skill sheet working
This commit is contained in:
43
node_modules/less/lib/less-browser/add-default-options.js
generated
vendored
Normal file
43
node_modules/less/lib/less-browser/add-default-options.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var utils_1 = require("./utils");
|
||||
var browser_1 = tslib_1.__importDefault(require("./browser"));
|
||||
exports.default = (function (window, options) {
|
||||
// use options from the current script tag data attribues
|
||||
(0, utils_1.addDataAttr)(options, browser_1.default.currentScript(window));
|
||||
if (options.isFileProtocol === undefined) {
|
||||
options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);
|
||||
}
|
||||
// Load styles asynchronously (default: false)
|
||||
//
|
||||
// This is set to `false` by default, so that the body
|
||||
// doesn't start loading before the stylesheets are parsed.
|
||||
// Setting this to `true` can result in flickering.
|
||||
//
|
||||
options.async = options.async || false;
|
||||
options.fileAsync = options.fileAsync || false;
|
||||
// Interval between watch polls
|
||||
options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);
|
||||
options.env = options.env || (window.location.hostname == '127.0.0.1' ||
|
||||
window.location.hostname == '0.0.0.0' ||
|
||||
window.location.hostname == 'localhost' ||
|
||||
(window.location.port &&
|
||||
window.location.port.length > 0) ||
|
||||
options.isFileProtocol ? 'development'
|
||||
: 'production');
|
||||
var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);
|
||||
if (dumpLineNumbers) {
|
||||
options.dumpLineNumbers = dumpLineNumbers[1];
|
||||
}
|
||||
if (options.useFileCache === undefined) {
|
||||
options.useFileCache = true;
|
||||
}
|
||||
if (options.onReady === undefined) {
|
||||
options.onReady = true;
|
||||
}
|
||||
if (options.relativeUrls) {
|
||||
options.rewriteUrls = 'all';
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=add-default-options.js.map
|
1
node_modules/less/lib/less-browser/add-default-options.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/add-default-options.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"add-default-options.js","sourceRoot":"","sources":["../../src/less-browser/add-default-options.js"],"names":[],"mappings":";;;AAAA,iCAAoC;AACpC,8DAAgC;AAEhC,mBAAe,UAAC,MAAM,EAAE,OAAO;IAE3B,yDAAyD;IACzD,IAAA,mBAAW,EAAC,OAAO,EAAE,iBAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE;QACtC,OAAO,CAAC,cAAc,GAAG,wDAAwD,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACpH;IAED,8CAA8C;IAC9C,EAAE;IACF,sDAAsD;IACtD,2DAA2D;IAC3D,mDAAmD;IACnD,EAAE;IACF,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IACvC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;IAE/C,+BAA+B;IAC/B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEtE,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,WAAW;QACjE,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,SAAS;QACrC,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,WAAW;QACvC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI;YACjB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACpC,OAAO,CAAC,cAAc,CAAmB,CAAC,CAAC,aAAa;QACxD,CAAC,CAAC,YAAY,CAAC,CAAC;IAEpB,IAAM,eAAe,GAAG,4CAA4C,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChG,IAAI,eAAe,EAAE;QACjB,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QACpC,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;KAC/B;IAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QAC/B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;KAC1B;IAED,IAAI,OAAO,CAAC,YAAY,EAAE;QACtB,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;KAC/B;AACL,CAAC,EAAC","sourcesContent":["import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n"]}
|
61
node_modules/less/lib/less-browser/bootstrap.js
generated
vendored
Normal file
61
node_modules/less/lib/less-browser/bootstrap.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
/**
|
||||
* Kicks off less and compiles any stylesheets
|
||||
* used in the browser distributed version of less
|
||||
* to kick-start less using the browser api
|
||||
*/
|
||||
var default_options_1 = tslib_1.__importDefault(require("../less/default-options"));
|
||||
var add_default_options_1 = tslib_1.__importDefault(require("./add-default-options"));
|
||||
var index_1 = tslib_1.__importDefault(require("./index"));
|
||||
var options = (0, default_options_1.default)();
|
||||
if (window.less) {
|
||||
for (var key in window.less) {
|
||||
if (Object.prototype.hasOwnProperty.call(window.less, key)) {
|
||||
options[key] = window.less[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
(0, add_default_options_1.default)(window, options);
|
||||
options.plugins = options.plugins || [];
|
||||
if (window.LESS_PLUGINS) {
|
||||
options.plugins = options.plugins.concat(window.LESS_PLUGINS);
|
||||
}
|
||||
var less = (0, index_1.default)(window, options);
|
||||
exports.default = less;
|
||||
window.less = less;
|
||||
var css;
|
||||
var head;
|
||||
var style;
|
||||
// Always restore page visibility
|
||||
function resolveOrReject(data) {
|
||||
if (data.filename) {
|
||||
console.warn(data);
|
||||
}
|
||||
if (!options.async) {
|
||||
head.removeChild(style);
|
||||
}
|
||||
}
|
||||
if (options.onReady) {
|
||||
if (/!watch/.test(window.location.hash)) {
|
||||
less.watch();
|
||||
}
|
||||
// Simulate synchronous stylesheet loading by hiding page rendering
|
||||
if (!options.async) {
|
||||
css = 'body { display: none !important }';
|
||||
head = document.head || document.getElementsByTagName('head')[0];
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = css;
|
||||
}
|
||||
else {
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
head.appendChild(style);
|
||||
}
|
||||
less.registerStylesheetsImmediately();
|
||||
less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);
|
||||
}
|
||||
//# sourceMappingURL=bootstrap.js.map
|
1
node_modules/less/lib/less-browser/bootstrap.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/bootstrap.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/less-browser/bootstrap.js"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oFAAqD;AACrD,sFAAsD;AACtD,0DAA2B;AAE3B,IAAM,OAAO,GAAG,IAAA,yBAAc,GAAE,CAAC;AAEjC,IAAI,MAAM,CAAC,IAAI,EAAE;IACb,KAAK,IAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE;QAC3B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;YACxD,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnC;KACJ;CACJ;AACD,IAAA,6BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;AAExC,IAAI,MAAM,CAAC,YAAY,EAAE;IACrB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;CACjE;AAED,IAAM,IAAI,GAAG,IAAA,eAAI,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnC,kBAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;AAEnB,IAAI,GAAG,CAAC;AACR,IAAI,IAAI,CAAC;AACT,IAAI,KAAK,CAAC;AAEV,iCAAiC;AACjC,SAAS,eAAe,CAAC,IAAI;IACzB,IAAI,IAAI,CAAC,QAAQ,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACtB;IACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAChB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAC3B;AACL,CAAC;AAED,IAAI,OAAO,CAAC,OAAO,EAAE;IACjB,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACrC,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB;IACD,mEAAmE;IACnE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAChB,GAAG,GAAG,mCAAmC,CAAC;QAC1C,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAExC,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;QACxB,IAAI,KAAK,CAAC,UAAU,EAAE;YAClB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;SAClC;aAAM;YACH,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAC3B;IACD,IAAI,CAAC,8BAA8B,EAAE,CAAC;IACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;CAC3G","sourcesContent":["/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (Object.prototype.hasOwnProperty.call(window.less, key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n"]}
|
62
node_modules/less/lib/less-browser/browser.js
generated
vendored
Normal file
62
node_modules/less/lib/less-browser/browser.js
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var utils = tslib_1.__importStar(require("./utils"));
|
||||
exports.default = {
|
||||
createCSS: function (document, styles, sheet) {
|
||||
// Strip the query-string
|
||||
var href = sheet.href || '';
|
||||
// If there is no title set, use the filename, minus the extension
|
||||
var id = "less:".concat(sheet.title || utils.extractId(href));
|
||||
// If this has already been inserted into the DOM, we may need to replace it
|
||||
var oldStyleNode = document.getElementById(id);
|
||||
var keepOldStyleNode = false;
|
||||
// Create a new stylesheet node for insertion or (if necessary) replacement
|
||||
var styleNode = document.createElement('style');
|
||||
styleNode.setAttribute('type', 'text/css');
|
||||
if (sheet.media) {
|
||||
styleNode.setAttribute('media', sheet.media);
|
||||
}
|
||||
styleNode.id = id;
|
||||
if (!styleNode.styleSheet) {
|
||||
styleNode.appendChild(document.createTextNode(styles));
|
||||
// If new contents match contents of oldStyleNode, don't replace oldStyleNode
|
||||
keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&
|
||||
oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
// If there is no oldStyleNode, just append; otherwise, only append if we need
|
||||
// to replace oldStyleNode with an updated stylesheet
|
||||
if (oldStyleNode === null || keepOldStyleNode === false) {
|
||||
var nextEl = sheet && sheet.nextSibling || null;
|
||||
if (nextEl) {
|
||||
nextEl.parentNode.insertBefore(styleNode, nextEl);
|
||||
}
|
||||
else {
|
||||
head.appendChild(styleNode);
|
||||
}
|
||||
}
|
||||
if (oldStyleNode && keepOldStyleNode === false) {
|
||||
oldStyleNode.parentNode.removeChild(oldStyleNode);
|
||||
}
|
||||
// For IE.
|
||||
// This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.
|
||||
// See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head
|
||||
if (styleNode.styleSheet) {
|
||||
try {
|
||||
styleNode.styleSheet.cssText = styles;
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error('Couldn\'t reassign styleSheet.cssText.');
|
||||
}
|
||||
}
|
||||
},
|
||||
currentScript: function (window) {
|
||||
var document = window.document;
|
||||
return document.currentScript || (function () {
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
return scripts[scripts.length - 1];
|
||||
})();
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=browser.js.map
|
1
node_modules/less/lib/less-browser/browser.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/browser.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/less-browser/browser.js"],"names":[],"mappings":";;;AAAA,qDAAiC;AAEjC,kBAAe;IACX,SAAS,EAAE,UAAU,QAAQ,EAAE,MAAM,EAAE,KAAK;QACxC,yBAAyB;QACzB,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAE9B,kEAAkE;QAClE,IAAM,EAAE,GAAG,eAAQ,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAE,CAAC;QAE1D,4EAA4E;QAC5E,IAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,2EAA2E;QAC3E,IAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAClD,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC3C,IAAI,KAAK,CAAC,KAAK,EAAE;YACb,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;SAChD;QACD,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;QAElB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;YACvB,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;YAEvD,6EAA6E;YAC7E,gBAAgB,GAAG,CAAC,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC9G,YAAY,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAC7E;QAED,IAAM,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtD,8EAA8E;QAC9E,qDAAqD;QACrD,IAAI,YAAY,KAAK,IAAI,IAAI,gBAAgB,KAAK,KAAK,EAAE;YACrD,IAAM,MAAM,GAAG,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC;YAClD,IAAI,MAAM,EAAE;gBACR,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;aACrD;iBAAM;gBACH,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;aAC/B;SACJ;QACD,IAAI,YAAY,IAAI,gBAAgB,KAAK,KAAK,EAAE;YAC5C,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SACrD;QAED,UAAU;QACV,sGAAsG;QACtG,mJAAmJ;QACnJ,IAAI,SAAS,CAAC,UAAU,EAAE;YACtB,IAAI;gBACA,SAAS,CAAC,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC;aACzC;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;aAC7D;SACJ;IACL,CAAC;IACD,aAAa,EAAE,UAAS,MAAM;QAC1B,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,OAAO,QAAQ,CAAC,aAAa,IAAI,CAAC;YAC9B,IAAM,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YACxD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;CACJ,CAAC","sourcesContent":["import * as utils from './utils';\n\nexport default {\n createCSS: function (document, styles, sheet) {\n // Strip the query-string\n const href = sheet.href || '';\n\n // If there is no title set, use the filename, minus the extension\n const id = `less:${sheet.title || utils.extractId(href)}`;\n\n // If this has already been inserted into the DOM, we may need to replace it\n const oldStyleNode = document.getElementById(id);\n let keepOldStyleNode = false;\n\n // Create a new stylesheet node for insertion or (if necessary) replacement\n const styleNode = document.createElement('style');\n styleNode.setAttribute('type', 'text/css');\n if (sheet.media) {\n styleNode.setAttribute('media', sheet.media);\n }\n styleNode.id = id;\n\n if (!styleNode.styleSheet) {\n styleNode.appendChild(document.createTextNode(styles));\n\n // If new contents match contents of oldStyleNode, don't replace oldStyleNode\n keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n"]}
|
45
node_modules/less/lib/less-browser/cache.js
generated
vendored
Normal file
45
node_modules/less/lib/less-browser/cache.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
// Cache system is a bit outdated and could do with work
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = (function (window, options, logger) {
|
||||
var cache = null;
|
||||
if (options.env !== 'development') {
|
||||
try {
|
||||
cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;
|
||||
}
|
||||
catch (_) { }
|
||||
}
|
||||
return {
|
||||
setCSS: function (path, lastModified, modifyVars, styles) {
|
||||
if (cache) {
|
||||
logger.info("saving ".concat(path, " to cache."));
|
||||
try {
|
||||
cache.setItem(path, styles);
|
||||
cache.setItem("".concat(path, ":timestamp"), lastModified);
|
||||
if (modifyVars) {
|
||||
cache.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars));
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// TODO - could do with adding more robust error handling
|
||||
logger.error("failed to save \"".concat(path, "\" to local storage for caching."));
|
||||
}
|
||||
}
|
||||
},
|
||||
getCSS: function (path, webInfo, modifyVars) {
|
||||
var css = cache && cache.getItem(path);
|
||||
var timestamp = cache && cache.getItem("".concat(path, ":timestamp"));
|
||||
var vars = cache && cache.getItem("".concat(path, ":vars"));
|
||||
modifyVars = modifyVars || {};
|
||||
vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object
|
||||
if (timestamp && webInfo.lastModified &&
|
||||
(new Date(webInfo.lastModified).valueOf() ===
|
||||
new Date(timestamp).valueOf()) &&
|
||||
JSON.stringify(modifyVars) === vars) {
|
||||
// Use local copy
|
||||
return css;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=cache.js.map
|
1
node_modules/less/lib/less-browser/cache.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/cache.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/less-browser/cache.js"],"names":[],"mappings":";AAAA,wDAAwD;;AAExD,mBAAe,UAAC,MAAM,EAAE,OAAO,EAAE,MAAM;IACnC,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,OAAO,CAAC,GAAG,KAAK,aAAa,EAAE;QAC/B,IAAI;YACA,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;SACrF;QAAC,OAAO,CAAC,EAAE,GAAE;KACjB;IACD,OAAO;QACH,MAAM,EAAE,UAAS,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM;YACnD,IAAI,KAAK,EAAE;gBACP,MAAM,CAAC,IAAI,CAAC,iBAAU,IAAI,eAAY,CAAC,CAAC;gBACxC,IAAI;oBACA,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAC5B,KAAK,CAAC,OAAO,CAAC,UAAG,IAAI,eAAY,EAAE,YAAY,CAAC,CAAC;oBACjD,IAAI,UAAU,EAAE;wBACZ,KAAK,CAAC,OAAO,CAAC,UAAG,IAAI,UAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;qBAC7D;iBACJ;gBAAC,OAAO,CAAC,EAAE;oBACR,yDAAyD;oBACzD,MAAM,CAAC,KAAK,CAAC,2BAAmB,IAAI,qCAAiC,CAAC,CAAC;iBAC1E;aACJ;QACL,CAAC;QACD,MAAM,EAAE,UAAS,IAAI,EAAE,OAAO,EAAE,UAAU;YACtC,IAAM,GAAG,GAAS,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAM,SAAS,GAAG,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,UAAG,IAAI,eAAY,CAAC,CAAC;YAC9D,IAAI,IAAI,GAAQ,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,UAAG,IAAI,UAAO,CAAC,CAAC;YAEvD,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;YAC9B,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,kEAAkE;YAEvF,IAAI,SAAS,IAAI,OAAO,CAAC,YAAY;gBACjC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;oBACrC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;gBAClC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;gBACrC,iBAAiB;gBACjB,OAAO,GAAG,CAAC;aACd;QACL,CAAC;KACJ,CAAC;AACN,CAAC,EAAC","sourcesContent":["// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n"]}
|
162
node_modules/less/lib/less-browser/error-reporting.js
generated
vendored
Normal file
162
node_modules/less/lib/less-browser/error-reporting.js
generated
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var utils = tslib_1.__importStar(require("./utils"));
|
||||
var browser_1 = tslib_1.__importDefault(require("./browser"));
|
||||
exports.default = (function (window, less, options) {
|
||||
function errorHTML(e, rootHref) {
|
||||
var id = "less-error-message:".concat(utils.extractId(rootHref || ''));
|
||||
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
|
||||
var elem = window.document.createElement('div');
|
||||
var timer;
|
||||
var content;
|
||||
var errors = [];
|
||||
var filename = e.filename || rootHref;
|
||||
var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1];
|
||||
elem.id = id;
|
||||
elem.className = 'less-error-message';
|
||||
content = "<h3>".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file') +
|
||||
"</h3><p>in <a href=\"".concat(filename, "\">").concat(filenameNoPath, "</a> ");
|
||||
var errorline = function (e, i, classname) {
|
||||
if (e.extract[i] !== undefined) {
|
||||
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
||||
.replace(/\{class\}/, classname)
|
||||
.replace(/\{content\}/, e.extract[i]));
|
||||
}
|
||||
};
|
||||
if (e.line) {
|
||||
errorline(e, 0, '');
|
||||
errorline(e, 1, 'line');
|
||||
errorline(e, 2, '');
|
||||
content += "on line ".concat(e.line, ", column ").concat(e.column + 1, ":</p><ul>").concat(errors.join(''), "</ul>");
|
||||
}
|
||||
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
||||
content += "<br/>Stack Trace</br />".concat(e.stack.split('\n').slice(1).join('<br/>'));
|
||||
}
|
||||
elem.innerHTML = content;
|
||||
// CSS for error messages
|
||||
browser_1.default.createCSS(window.document, [
|
||||
'.less-error-message ul, .less-error-message li {',
|
||||
'list-style-type: none;',
|
||||
'margin-right: 15px;',
|
||||
'padding: 4px 0;',
|
||||
'margin: 0;',
|
||||
'}',
|
||||
'.less-error-message label {',
|
||||
'font-size: 12px;',
|
||||
'margin-right: 15px;',
|
||||
'padding: 4px 0;',
|
||||
'color: #cc7777;',
|
||||
'}',
|
||||
'.less-error-message pre {',
|
||||
'color: #dd6666;',
|
||||
'padding: 4px 0;',
|
||||
'margin: 0;',
|
||||
'display: inline-block;',
|
||||
'}',
|
||||
'.less-error-message pre.line {',
|
||||
'color: #ff0000;',
|
||||
'}',
|
||||
'.less-error-message h3 {',
|
||||
'font-size: 20px;',
|
||||
'font-weight: bold;',
|
||||
'padding: 15px 0 5px 0;',
|
||||
'margin: 0;',
|
||||
'}',
|
||||
'.less-error-message a {',
|
||||
'color: #10a',
|
||||
'}',
|
||||
'.less-error-message .error {',
|
||||
'color: red;',
|
||||
'font-weight: bold;',
|
||||
'padding-bottom: 2px;',
|
||||
'border-bottom: 1px dashed red;',
|
||||
'}'
|
||||
].join('\n'), { title: 'error-message' });
|
||||
elem.style.cssText = [
|
||||
'font-family: Arial, sans-serif',
|
||||
'border: 1px solid #e00',
|
||||
'background-color: #eee',
|
||||
'border-radius: 5px',
|
||||
'-webkit-border-radius: 5px',
|
||||
'-moz-border-radius: 5px',
|
||||
'color: #e00',
|
||||
'padding: 15px',
|
||||
'margin-bottom: 15px'
|
||||
].join(';');
|
||||
if (options.env === 'development') {
|
||||
timer = setInterval(function () {
|
||||
var document = window.document;
|
||||
var body = document.body;
|
||||
if (body) {
|
||||
if (document.getElementById(id)) {
|
||||
body.replaceChild(elem, document.getElementById(id));
|
||||
}
|
||||
else {
|
||||
body.insertBefore(elem, body.firstChild);
|
||||
}
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
}
|
||||
function removeErrorHTML(path) {
|
||||
var node = window.document.getElementById("less-error-message:".concat(utils.extractId(path)));
|
||||
if (node) {
|
||||
node.parentNode.removeChild(node);
|
||||
}
|
||||
}
|
||||
function removeErrorConsole() {
|
||||
// no action
|
||||
}
|
||||
function removeError(path) {
|
||||
if (!options.errorReporting || options.errorReporting === 'html') {
|
||||
removeErrorHTML(path);
|
||||
}
|
||||
else if (options.errorReporting === 'console') {
|
||||
removeErrorConsole(path);
|
||||
}
|
||||
else if (typeof options.errorReporting === 'function') {
|
||||
options.errorReporting('remove', path);
|
||||
}
|
||||
}
|
||||
function errorConsole(e, rootHref) {
|
||||
var template = '{line} {content}';
|
||||
var filename = e.filename || rootHref;
|
||||
var errors = [];
|
||||
var content = "".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file', " in ").concat(filename);
|
||||
var errorline = function (e, i, classname) {
|
||||
if (e.extract[i] !== undefined) {
|
||||
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
||||
.replace(/\{class\}/, classname)
|
||||
.replace(/\{content\}/, e.extract[i]));
|
||||
}
|
||||
};
|
||||
if (e.line) {
|
||||
errorline(e, 0, '');
|
||||
errorline(e, 1, 'line');
|
||||
errorline(e, 2, '');
|
||||
content += " on line ".concat(e.line, ", column ").concat(e.column + 1, ":\n").concat(errors.join('\n'));
|
||||
}
|
||||
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
||||
content += "\nStack Trace\n".concat(e.stack);
|
||||
}
|
||||
less.logger.error(content);
|
||||
}
|
||||
function error(e, rootHref) {
|
||||
if (!options.errorReporting || options.errorReporting === 'html') {
|
||||
errorHTML(e, rootHref);
|
||||
}
|
||||
else if (options.errorReporting === 'console') {
|
||||
errorConsole(e, rootHref);
|
||||
}
|
||||
else if (typeof options.errorReporting === 'function') {
|
||||
options.errorReporting('add', e, rootHref);
|
||||
}
|
||||
}
|
||||
return {
|
||||
add: error,
|
||||
remove: removeError
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=error-reporting.js.map
|
1
node_modules/less/lib/less-browser/error-reporting.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/error-reporting.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
102
node_modules/less/lib/less-browser/file-manager.js
generated
vendored
Normal file
102
node_modules/less/lib/less-browser/file-manager.js
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var abstract_file_manager_js_1 = tslib_1.__importDefault(require("../less/environment/abstract-file-manager.js"));
|
||||
var options;
|
||||
var logger;
|
||||
var fileCache = {};
|
||||
// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load
|
||||
var FileManager = function () { };
|
||||
FileManager.prototype = Object.assign(new abstract_file_manager_js_1.default(), {
|
||||
alwaysMakePathsAbsolute: function () {
|
||||
return true;
|
||||
},
|
||||
join: function (basePath, laterPath) {
|
||||
if (!basePath) {
|
||||
return laterPath;
|
||||
}
|
||||
return this.extractUrlParts(laterPath, basePath).path;
|
||||
},
|
||||
doXHR: function (url, type, callback, errback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
var async = options.isFileProtocol ? options.fileAsync : true;
|
||||
if (typeof xhr.overrideMimeType === 'function') {
|
||||
xhr.overrideMimeType('text/css');
|
||||
}
|
||||
logger.debug("XHR: Getting '".concat(url, "'"));
|
||||
xhr.open('GET', url, async);
|
||||
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
|
||||
xhr.send(null);
|
||||
function handleResponse(xhr, callback, errback) {
|
||||
if (xhr.status >= 200 && xhr.status < 300) {
|
||||
callback(xhr.responseText, xhr.getResponseHeader('Last-Modified'));
|
||||
}
|
||||
else if (typeof errback === 'function') {
|
||||
errback(xhr.status, url);
|
||||
}
|
||||
}
|
||||
if (options.isFileProtocol && !options.fileAsync) {
|
||||
if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {
|
||||
callback(xhr.responseText);
|
||||
}
|
||||
else {
|
||||
errback(xhr.status, url);
|
||||
}
|
||||
}
|
||||
else if (async) {
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4) {
|
||||
handleResponse(xhr, callback, errback);
|
||||
}
|
||||
};
|
||||
}
|
||||
else {
|
||||
handleResponse(xhr, callback, errback);
|
||||
}
|
||||
},
|
||||
supports: function () {
|
||||
return true;
|
||||
},
|
||||
clearFileCache: function () {
|
||||
fileCache = {};
|
||||
},
|
||||
loadFile: function (filename, currentDirectory, options) {
|
||||
// TODO: Add prefix support like less-node?
|
||||
// What about multiple paths?
|
||||
if (currentDirectory && !this.isPathAbsolute(filename)) {
|
||||
filename = currentDirectory + filename;
|
||||
}
|
||||
filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;
|
||||
options = options || {};
|
||||
// sheet may be set to the stylesheet for the initial load or a collection of properties including
|
||||
// some context variables for imports
|
||||
var hrefParts = this.extractUrlParts(filename, window.location.href);
|
||||
var href = hrefParts.url;
|
||||
var self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (options.useFileCache && fileCache[href]) {
|
||||
try {
|
||||
var lessText = fileCache[href];
|
||||
return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() } });
|
||||
}
|
||||
catch (e) {
|
||||
return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e.message) });
|
||||
}
|
||||
}
|
||||
self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {
|
||||
// per file cache
|
||||
fileCache[href] = data;
|
||||
// Use remote copy (re-parse)
|
||||
resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } });
|
||||
}, function doXHRError(status, url) {
|
||||
reject({ type: 'File', message: "'".concat(url, "' wasn't found (").concat(status, ")"), href: href });
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
exports.default = (function (opts, log) {
|
||||
options = opts;
|
||||
logger = log;
|
||||
return FileManager;
|
||||
});
|
||||
//# sourceMappingURL=file-manager.js.map
|
1
node_modules/less/lib/less-browser/file-manager.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/file-manager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
node_modules/less/lib/less-browser/image-size.js
generated
vendored
Normal file
28
node_modules/less/lib/less-browser/image-size.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var function_registry_1 = tslib_1.__importDefault(require("./../less/functions/function-registry"));
|
||||
exports.default = (function () {
|
||||
function imageSize() {
|
||||
throw {
|
||||
type: 'Runtime',
|
||||
message: 'Image size functions are not supported in browser version of less'
|
||||
};
|
||||
}
|
||||
var imageFunctions = {
|
||||
'image-size': function (filePathNode) {
|
||||
imageSize(this, filePathNode);
|
||||
return -1;
|
||||
},
|
||||
'image-width': function (filePathNode) {
|
||||
imageSize(this, filePathNode);
|
||||
return -1;
|
||||
},
|
||||
'image-height': function (filePathNode) {
|
||||
imageSize(this, filePathNode);
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
function_registry_1.default.addMultiple(imageFunctions);
|
||||
});
|
||||
//# sourceMappingURL=image-size.js.map
|
1
node_modules/less/lib/less-browser/image-size.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/image-size.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"image-size.js","sourceRoot":"","sources":["../../src/less-browser/image-size.js"],"names":[],"mappings":";;;AACA,oGAAqE;AAErE,mBAAe;IACX,SAAS,SAAS;QACd,MAAM;YACF,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,mEAAmE;SAC/E,CAAC;IACN,CAAC;IAED,IAAM,cAAc,GAAG;QACnB,YAAY,EAAE,UAAS,YAAY;YAC/B,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;QACD,aAAa,EAAE,UAAS,YAAY;YAChC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;QACD,cAAc,EAAE,UAAS,YAAY;YACjC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC9B,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;KACJ,CAAC;IAEF,2BAAgB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC,EAAC","sourcesContent":["\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"]}
|
258
node_modules/less/lib/less-browser/index.js
generated
vendored
Normal file
258
node_modules/less/lib/less-browser/index.js
generated
vendored
Normal file
@ -0,0 +1,258 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
//
|
||||
// index.js
|
||||
// Should expose the additional browser functions on to the less object
|
||||
//
|
||||
var utils_1 = require("./utils");
|
||||
var less_1 = tslib_1.__importDefault(require("../less"));
|
||||
var browser_1 = tslib_1.__importDefault(require("./browser"));
|
||||
var file_manager_1 = tslib_1.__importDefault(require("./file-manager"));
|
||||
var plugin_loader_1 = tslib_1.__importDefault(require("./plugin-loader"));
|
||||
var log_listener_1 = tslib_1.__importDefault(require("./log-listener"));
|
||||
var error_reporting_1 = tslib_1.__importDefault(require("./error-reporting"));
|
||||
var cache_1 = tslib_1.__importDefault(require("./cache"));
|
||||
var image_size_1 = tslib_1.__importDefault(require("./image-size"));
|
||||
exports.default = (function (window, options) {
|
||||
var document = window.document;
|
||||
var less = (0, less_1.default)();
|
||||
less.options = options;
|
||||
var environment = less.environment;
|
||||
var FileManager = (0, file_manager_1.default)(options, less.logger);
|
||||
var fileManager = new FileManager();
|
||||
environment.addFileManager(fileManager);
|
||||
less.FileManager = FileManager;
|
||||
less.PluginLoader = plugin_loader_1.default;
|
||||
(0, log_listener_1.default)(less, options);
|
||||
var errors = (0, error_reporting_1.default)(window, less, options);
|
||||
var cache = less.cache = options.cache || (0, cache_1.default)(window, options, less.logger);
|
||||
(0, image_size_1.default)(less.environment);
|
||||
// Setup user functions - Deprecate?
|
||||
if (options.functions) {
|
||||
less.functions.functionRegistry.addMultiple(options.functions);
|
||||
}
|
||||
var typePattern = /^text\/(x-)?less$/;
|
||||
function clone(obj) {
|
||||
var cloned = {};
|
||||
for (var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
cloned[prop] = obj[prop];
|
||||
}
|
||||
}
|
||||
return cloned;
|
||||
}
|
||||
// only really needed for phantom
|
||||
function bind(func, thisArg) {
|
||||
var curryArgs = Array.prototype.slice.call(arguments, 2);
|
||||
return function () {
|
||||
var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));
|
||||
return func.apply(thisArg, args);
|
||||
};
|
||||
}
|
||||
function loadStyles(modifyVars) {
|
||||
var styles = document.getElementsByTagName('style');
|
||||
var style;
|
||||
for (var i = 0; i < styles.length; i++) {
|
||||
style = styles[i];
|
||||
if (style.type.match(typePattern)) {
|
||||
var instanceOptions = clone(options);
|
||||
instanceOptions.modifyVars = modifyVars;
|
||||
var lessText = style.innerHTML || '';
|
||||
instanceOptions.filename = document.location.href.replace(/#.*$/, '');
|
||||
/* jshint loopfunc:true */
|
||||
// use closure to store current style
|
||||
less.render(lessText, instanceOptions, bind(function (style, e, result) {
|
||||
if (e) {
|
||||
errors.add(e, 'inline');
|
||||
}
|
||||
else {
|
||||
style.type = 'text/css';
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = result.css;
|
||||
}
|
||||
else {
|
||||
style.innerHTML = result.css;
|
||||
}
|
||||
}
|
||||
}, null, style));
|
||||
}
|
||||
}
|
||||
}
|
||||
function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
|
||||
var instanceOptions = clone(options);
|
||||
(0, utils_1.addDataAttr)(instanceOptions, sheet);
|
||||
instanceOptions.mime = sheet.type;
|
||||
if (modifyVars) {
|
||||
instanceOptions.modifyVars = modifyVars;
|
||||
}
|
||||
function loadInitialFileCallback(loadedFile) {
|
||||
var data = loadedFile.contents;
|
||||
var path = loadedFile.filename;
|
||||
var webInfo = loadedFile.webInfo;
|
||||
var newFileInfo = {
|
||||
currentDirectory: fileManager.getPath(path),
|
||||
filename: path,
|
||||
rootFilename: path,
|
||||
rewriteUrls: instanceOptions.rewriteUrls
|
||||
};
|
||||
newFileInfo.entryPath = newFileInfo.currentDirectory;
|
||||
newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;
|
||||
if (webInfo) {
|
||||
webInfo.remaining = remaining;
|
||||
var css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);
|
||||
if (!reload && css) {
|
||||
webInfo.local = true;
|
||||
callback(null, css, data, sheet, webInfo, path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// TODO add tests around how this behaves when reloading
|
||||
errors.remove(path);
|
||||
instanceOptions.rootFileInfo = newFileInfo;
|
||||
less.render(data, instanceOptions, function (e, result) {
|
||||
if (e) {
|
||||
e.href = path;
|
||||
callback(e);
|
||||
}
|
||||
else {
|
||||
cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);
|
||||
callback(null, result.css, data, sheet, webInfo, path);
|
||||
}
|
||||
});
|
||||
}
|
||||
fileManager.loadFile(sheet.href, null, instanceOptions, environment)
|
||||
.then(function (loadedFile) {
|
||||
loadInitialFileCallback(loadedFile);
|
||||
}).catch(function (err) {
|
||||
console.log(err);
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
function loadStyleSheets(callback, reload, modifyVars) {
|
||||
for (var i = 0; i < less.sheets.length; i++) {
|
||||
loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);
|
||||
}
|
||||
}
|
||||
function initRunningMode() {
|
||||
if (less.env === 'development') {
|
||||
less.watchTimer = setInterval(function () {
|
||||
if (less.watchMode) {
|
||||
fileManager.clearFileCache();
|
||||
/**
|
||||
* @todo remove when this is typed with JSDoc
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
loadStyleSheets(function (e, css, _, sheet, webInfo) {
|
||||
if (e) {
|
||||
errors.add(e, e.href || sheet.href);
|
||||
}
|
||||
else if (css) {
|
||||
browser_1.default.createCSS(window.document, css, sheet);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, options.poll);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Watch mode
|
||||
//
|
||||
less.watch = function () {
|
||||
if (!less.watchMode) {
|
||||
less.env = 'development';
|
||||
initRunningMode();
|
||||
}
|
||||
this.watchMode = true;
|
||||
return true;
|
||||
};
|
||||
less.unwatch = function () { clearInterval(less.watchTimer); this.watchMode = false; return false; };
|
||||
//
|
||||
// Synchronously get all <link> tags with the 'rel' attribute set to
|
||||
// "stylesheet/less".
|
||||
//
|
||||
less.registerStylesheetsImmediately = function () {
|
||||
var links = document.getElementsByTagName('link');
|
||||
less.sheets = [];
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
|
||||
(links[i].type.match(typePattern)))) {
|
||||
less.sheets.push(links[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
//
|
||||
// Asynchronously get all <link> tags with the 'rel' attribute set to
|
||||
// "stylesheet/less", returning a Promise.
|
||||
//
|
||||
less.registerStylesheets = function () { return new Promise(function (resolve) {
|
||||
less.registerStylesheetsImmediately();
|
||||
resolve();
|
||||
}); };
|
||||
//
|
||||
// With this function, it's possible to alter variables and re-render
|
||||
// CSS without reloading less-files
|
||||
//
|
||||
less.modifyVars = function (record) { return less.refresh(true, record, false); };
|
||||
less.refresh = function (reload, modifyVars, clearFileCache) {
|
||||
if ((reload || clearFileCache) && clearFileCache !== false) {
|
||||
fileManager.clearFileCache();
|
||||
}
|
||||
return new Promise(function (resolve, reject) {
|
||||
var startTime;
|
||||
var endTime;
|
||||
var totalMilliseconds;
|
||||
var remainingSheets;
|
||||
startTime = endTime = new Date();
|
||||
// Set counter for remaining unprocessed sheets
|
||||
remainingSheets = less.sheets.length;
|
||||
if (remainingSheets === 0) {
|
||||
endTime = new Date();
|
||||
totalMilliseconds = endTime - startTime;
|
||||
less.logger.info('Less has finished and no sheets were loaded.');
|
||||
resolve({
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
totalMilliseconds: totalMilliseconds,
|
||||
sheets: less.sheets.length
|
||||
});
|
||||
}
|
||||
else {
|
||||
// Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array
|
||||
loadStyleSheets(function (e, css, _, sheet, webInfo) {
|
||||
if (e) {
|
||||
errors.add(e, e.href || sheet.href);
|
||||
reject(e);
|
||||
return;
|
||||
}
|
||||
if (webInfo.local) {
|
||||
less.logger.info("Loading ".concat(sheet.href, " from cache."));
|
||||
}
|
||||
else {
|
||||
less.logger.info("Rendered ".concat(sheet.href, " successfully."));
|
||||
}
|
||||
browser_1.default.createCSS(window.document, css, sheet);
|
||||
less.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(new Date() - endTime, "ms"));
|
||||
// Count completed sheet
|
||||
remainingSheets--;
|
||||
// Check if the last remaining sheet was processed and then call the promise
|
||||
if (remainingSheets === 0) {
|
||||
totalMilliseconds = new Date() - startTime;
|
||||
less.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms"));
|
||||
resolve({
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
totalMilliseconds: totalMilliseconds,
|
||||
sheets: less.sheets.length
|
||||
});
|
||||
}
|
||||
endTime = new Date();
|
||||
}, reload, modifyVars);
|
||||
}
|
||||
loadStyles(modifyVars);
|
||||
});
|
||||
};
|
||||
less.refreshStyles = loadStyles;
|
||||
return less;
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/less/lib/less-browser/index.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/less/lib/less-browser/log-listener.js
generated
vendored
Normal file
43
node_modules/less/lib/less-browser/log-listener.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = (function (less, options) {
|
||||
var logLevel_debug = 4;
|
||||
var logLevel_info = 3;
|
||||
var logLevel_warn = 2;
|
||||
var logLevel_error = 1;
|
||||
// The amount of logging in the javascript console.
|
||||
// 3 - Debug, information and errors
|
||||
// 2 - Information and errors
|
||||
// 1 - Errors
|
||||
// 0 - None
|
||||
// Defaults to 2
|
||||
options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);
|
||||
if (!options.loggers) {
|
||||
options.loggers = [{
|
||||
debug: function (msg) {
|
||||
if (options.logLevel >= logLevel_debug) {
|
||||
console.log(msg);
|
||||
}
|
||||
},
|
||||
info: function (msg) {
|
||||
if (options.logLevel >= logLevel_info) {
|
||||
console.log(msg);
|
||||
}
|
||||
},
|
||||
warn: function (msg) {
|
||||
if (options.logLevel >= logLevel_warn) {
|
||||
console.warn(msg);
|
||||
}
|
||||
},
|
||||
error: function (msg) {
|
||||
if (options.logLevel >= logLevel_error) {
|
||||
console.error(msg);
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
for (var i = 0; i < options.loggers.length; i++) {
|
||||
less.logger.addListener(options.loggers[i]);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=log-listener.js.map
|
1
node_modules/less/lib/less-browser/log-listener.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/log-listener.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"log-listener.js","sourceRoot":"","sources":["../../src/less-browser/log-listener.js"],"names":[],"mappings":";;AAAA,mBAAe,UAAC,IAAI,EAAE,OAAO;IACzB,IAAM,cAAc,GAAG,CAAC,CAAC;IACzB,IAAM,aAAa,GAAG,CAAC,CAAC;IACxB,IAAM,aAAa,GAAG,CAAC,CAAC;IACxB,IAAM,cAAc,GAAG,CAAC,CAAC;IAEzB,mDAAmD;IACnD,oCAAoC;IACpC,6BAA6B;IAC7B,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,OAAO,CAAC,QAAQ,GAAG,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,CAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAElJ,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QAClB,OAAO,CAAC,OAAO,GAAG,CAAC;gBACf,KAAK,EAAE,UAAS,GAAG;oBACf,IAAI,OAAO,CAAC,QAAQ,IAAI,cAAc,EAAE;wBACpC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;qBACpB;gBACL,CAAC;gBACD,IAAI,EAAE,UAAS,GAAG;oBACd,IAAI,OAAO,CAAC,QAAQ,IAAI,aAAa,EAAE;wBACnC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;qBACpB;gBACL,CAAC;gBACD,IAAI,EAAE,UAAS,GAAG;oBACd,IAAI,OAAO,CAAC,QAAQ,IAAI,aAAa,EAAE;wBACnC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;qBACrB;gBACL,CAAC;gBACD,KAAK,EAAE,UAAS,GAAG;oBACf,IAAI,OAAO,CAAC,QAAQ,IAAI,cAAc,EAAE;wBACpC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;qBACtB;gBACL,CAAC;aACJ,CAAC,CAAC;KACN;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/C;AACL,CAAC,EAAC","sourcesContent":["export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n"]}
|
24
node_modules/less/lib/less-browser/plugin-loader.js
generated
vendored
Normal file
24
node_modules/less/lib/less-browser/plugin-loader.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
/**
|
||||
* @todo Add tests for browser `@plugin`
|
||||
*/
|
||||
var abstract_plugin_loader_js_1 = tslib_1.__importDefault(require("../less/environment/abstract-plugin-loader.js"));
|
||||
/**
|
||||
* Browser Plugin Loader
|
||||
*/
|
||||
var PluginLoader = function (less) {
|
||||
this.less = less;
|
||||
// Should we shim this.require for browser? Probably not?
|
||||
};
|
||||
PluginLoader.prototype = Object.assign(new abstract_plugin_loader_js_1.default(), {
|
||||
loadPlugin: function (filename, basePath, context, environment, fileManager) {
|
||||
return new Promise(function (fulfill, reject) {
|
||||
fileManager.loadFile(filename, basePath, context, environment)
|
||||
.then(fulfill).catch(reject);
|
||||
});
|
||||
}
|
||||
});
|
||||
exports.default = PluginLoader;
|
||||
//# sourceMappingURL=plugin-loader.js.map
|
1
node_modules/less/lib/less-browser/plugin-loader.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/plugin-loader.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"plugin-loader.js","sourceRoot":"","sources":["../../src/less-browser/plugin-loader.js"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oHAAiF;AAEjF;;GAEG;AACH,IAAM,YAAY,GAAG,UAAS,IAAI;IAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,yDAAyD;AAC7D,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,mCAAoB,EAAE,EAAE;IAC/D,UAAU,YAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW;QAC5D,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YAC/B,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC;iBACzD,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,YAAY,CAAC","sourcesContent":["/**\n * @todo Add tests for browser `@plugin`\n */\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nconst PluginLoader = function(less) {\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n};\n\nPluginLoader.prototype = Object.assign(new AbstractPluginLoader(), {\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n});\n\nexport default PluginLoader;\n\n"]}
|
32
node_modules/less/lib/less-browser/utils.js
generated
vendored
Normal file
32
node_modules/less/lib/less-browser/utils.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addDataAttr = exports.extractId = void 0;
|
||||
function extractId(href) {
|
||||
return href.replace(/^[a-z-]+:\/+?[^/]+/, '') // Remove protocol & domain
|
||||
.replace(/[?&]livereload=\w+/, '') // Remove LiveReload cachebuster
|
||||
.replace(/^\//, '') // Remove root /
|
||||
.replace(/\.[a-zA-Z]+$/, '') // Remove simple extension
|
||||
.replace(/[^.\w-]+/g, '-') // Replace illegal characters
|
||||
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
|
||||
}
|
||||
exports.extractId = extractId;
|
||||
function addDataAttr(options, tag) {
|
||||
if (!tag) {
|
||||
return;
|
||||
} // in case of tag is null or undefined
|
||||
for (var opt in tag.dataset) {
|
||||
if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) {
|
||||
if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {
|
||||
options[opt] = tag.dataset[opt];
|
||||
}
|
||||
else {
|
||||
try {
|
||||
options[opt] = JSON.parse(tag.dataset[opt]);
|
||||
}
|
||||
catch (_) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.addDataAttr = addDataAttr;
|
||||
//# sourceMappingURL=utils.js.map
|
1
node_modules/less/lib/less-browser/utils.js.map
generated
vendored
Normal file
1
node_modules/less/lib/less-browser/utils.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/less-browser/utils.js"],"names":[],"mappings":";;;AACA,SAAgB,SAAS,CAAC,IAAI;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAE,2BAA2B;SACrE,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAQ,gCAAgC;SACzE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAyB,gBAAgB;SAC3D,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAgB,0BAA0B;SACrE,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAiB,6BAA6B;SACvE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAuB,yCAAyC;AAC7F,CAAC;AAPD,8BAOC;AAED,SAAgB,WAAW,CAAC,OAAO,EAAE,GAAG;IACpC,IAAI,CAAC,GAAG,EAAE;QAAC,OAAO;KAAC,CAAC,sCAAsC;IAC1D,KAAK,IAAM,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE;QAC3B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;YACxD,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,iBAAiB,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,gBAAgB,EAAE;gBAC9F,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;aACnC;iBAAM;gBACH,IAAI;oBACA,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;iBAC/C;gBACD,OAAO,CAAC,EAAE,GAAE;aACf;SACJ;KACJ;AACL,CAAC;AAdD,kCAcC","sourcesContent":["\nexport function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^/]+/, '') // Remove protocol & domain\n .replace(/[?&]livereload=\\w+/, '') // Remove LiveReload cachebuster\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}\n\nexport function addDataAttr(options, tag) {\n if (!tag) {return;} // in case of tag is null or undefined\n for (const opt in tag.dataset) {\n if (Object.prototype.hasOwnProperty.call(tag.dataset, opt)) {\n if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {\n options[opt] = tag.dataset[opt];\n } else {\n try {\n options[opt] = JSON.parse(tag.dataset[opt]);\n }\n catch (_) {}\n }\n }\n }\n}\n"]}
|
Reference in New Issue
Block a user