less 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Gruntfile.js +3 -13
- package/dist/less.js +260 -219
- package/dist/less.min.js +3 -3
- package/dist/less.min.js.map +1 -1
- package/lib/less/contexts.js +1 -1
- package/lib/less/contexts.js.map +1 -1
- package/lib/less/environment/abstract-file-manager.js +3 -3
- package/lib/less/environment/abstract-file-manager.js.map +1 -1
- package/lib/less/environment/abstract-plugin-loader.js +2 -2
- package/lib/less/environment/abstract-plugin-loader.js.map +1 -1
- package/lib/less/environment/environment.js +1 -1
- package/lib/less/environment/environment.js.map +1 -1
- package/lib/less/functions/color.js +1 -1
- package/lib/less/functions/color.js.map +1 -1
- package/lib/less/functions/data-uri.js +3 -3
- package/lib/less/functions/data-uri.js.map +1 -1
- package/lib/less/functions/function-caller.js +1 -1
- package/lib/less/functions/function-caller.js.map +1 -1
- package/lib/less/functions/index.js +4 -2
- package/lib/less/functions/index.js.map +1 -1
- package/lib/less/functions/math.js +1 -1
- package/lib/less/functions/math.js.map +1 -1
- package/lib/less/functions/number.js +6 -3
- package/lib/less/functions/number.js.map +1 -1
- package/lib/less/functions/style.js +28 -0
- package/lib/less/functions/style.js.map +1 -0
- package/lib/less/functions/svg.js +5 -5
- package/lib/less/functions/svg.js.map +1 -1
- package/lib/less/functions/types.js +1 -1
- package/lib/less/functions/types.js.map +1 -1
- package/lib/less/import-manager.js +2 -2
- package/lib/less/import-manager.js.map +1 -1
- package/lib/less/index.js +8 -8
- package/lib/less/index.js.map +1 -1
- package/lib/less/less-error.js +10 -10
- package/lib/less/less-error.js.map +1 -1
- package/lib/less/parse-tree.js +1 -1
- package/lib/less/parse-tree.js.map +1 -1
- package/lib/less/parser/chunker.js +1 -1
- package/lib/less/parser/chunker.js.map +1 -1
- package/lib/less/parser/parser-input.js +1 -1
- package/lib/less/parser/parser-input.js.map +1 -1
- package/lib/less/parser/parser.js +49 -19
- package/lib/less/parser/parser.js.map +1 -1
- package/lib/less/source-map-builder.js +2 -2
- package/lib/less/source-map-builder.js.map +1 -1
- package/lib/less/transform-tree.js +1 -1
- package/lib/less/transform-tree.js.map +1 -1
- package/lib/less/tree/assignment.js +1 -1
- package/lib/less/tree/assignment.js.map +1 -1
- package/lib/less/tree/atrule.js +4 -4
- package/lib/less/tree/atrule.js.map +1 -1
- package/lib/less/tree/attribute.js +1 -1
- package/lib/less/tree/attribute.js.map +1 -1
- package/lib/less/tree/call.js +2 -2
- package/lib/less/tree/call.js.map +1 -1
- package/lib/less/tree/color.js +6 -6
- package/lib/less/tree/color.js.map +1 -1
- package/lib/less/tree/comment.js +1 -1
- package/lib/less/tree/comment.js.map +1 -1
- package/lib/less/tree/debug-info.js +5 -5
- package/lib/less/tree/debug-info.js.map +1 -1
- package/lib/less/tree/declaration.js +1 -1
- package/lib/less/tree/declaration.js.map +1 -1
- package/lib/less/tree/dimension.js +2 -2
- package/lib/less/tree/dimension.js.map +1 -1
- package/lib/less/tree/expression.js +5 -1
- package/lib/less/tree/expression.js.map +1 -1
- package/lib/less/tree/javascript.js +1 -1
- package/lib/less/tree/javascript.js.map +1 -1
- package/lib/less/tree/js-eval-node.js +5 -5
- package/lib/less/tree/js-eval-node.js.map +1 -1
- package/lib/less/tree/mixin-call.js +6 -6
- package/lib/less/tree/mixin-call.js.map +1 -1
- package/lib/less/tree/mixin-definition.js +2 -2
- package/lib/less/tree/mixin-definition.js.map +1 -1
- package/lib/less/tree/namespace-value.js +5 -5
- package/lib/less/tree/namespace-value.js.map +1 -1
- package/lib/less/tree/property.js +2 -2
- package/lib/less/tree/property.js.map +1 -1
- package/lib/less/tree/quoted.js +2 -2
- package/lib/less/tree/quoted.js.map +1 -1
- package/lib/less/tree/ruleset.js +7 -7
- package/lib/less/tree/ruleset.js.map +1 -1
- package/lib/less/tree/unit.js +1 -1
- package/lib/less/tree/unit.js.map +1 -1
- package/lib/less/tree/url.js +2 -2
- package/lib/less/tree/url.js.map +1 -1
- package/lib/less/tree/variable-call.js +1 -1
- package/lib/less/tree/variable-call.js.map +1 -1
- package/lib/less/tree/variable.js +3 -3
- package/lib/less/tree/variable.js.map +1 -1
- package/lib/less/utils.js +2 -2
- package/lib/less/utils.js.map +1 -1
- package/lib/less/visitors/extend-visitor.js +4 -4
- package/lib/less/visitors/extend-visitor.js.map +1 -1
- package/lib/less/visitors/to-css-visitor.js +3 -3
- package/lib/less/visitors/to-css-visitor.js.map +1 -1
- package/lib/less/visitors/visitor.js +2 -2
- package/lib/less/visitors/visitor.js.map +1 -1
- package/lib/less-browser/add-default-options.js +1 -1
- package/lib/less-browser/add-default-options.js.map +1 -1
- package/lib/less-browser/bootstrap.js +3 -3
- package/lib/less-browser/bootstrap.js.map +1 -1
- package/lib/less-browser/browser.js +1 -1
- package/lib/less-browser/browser.js.map +1 -1
- package/lib/less-browser/cache.js +6 -6
- package/lib/less-browser/cache.js.map +1 -1
- package/lib/less-browser/error-reporting.js +9 -9
- package/lib/less-browser/error-reporting.js.map +1 -1
- package/lib/less-browser/file-manager.js +3 -3
- package/lib/less-browser/file-manager.js.map +1 -1
- package/lib/less-browser/index.js +11 -11
- package/lib/less-browser/index.js.map +1 -1
- package/lib/less-node/file-manager.js +1 -1
- package/lib/less-node/file-manager.js.map +1 -1
- package/lib/less-node/image-size.js +1 -1
- package/lib/less-node/image-size.js.map +1 -1
- package/lib/less-node/index.js +1 -1
- package/lib/less-node/index.js.map +1 -1
- package/lib/less-node/lessc-helper.js +1 -1
- package/lib/less-node/lessc-helper.js.map +1 -1
- package/lib/less-node/url-file-manager.js +4 -4
- package/lib/less-node/url-file-manager.js.map +1 -1
- package/package.json +140 -140
- package/test/browser/css/plugin/plugin.css +1 -1
- package/test/browser/css/relative-urls/urls.css +8 -8
- package/test/browser/css/rewrite-urls/urls.css +8 -8
- package/test/browser/css/urls.css +12 -12
- package/test/browser/generator/generate.js +1 -1
- package/test/browser/generator/runner.config.js +18 -16
- package/test/browser/generator/template.js +17 -7
- package/test/browser/generator/utils.js +14 -0
- package/test/browser/less/relative-urls/urls.less +1 -1
- package/test/browser/less/rewrite-urls/urls.less +1 -1
- package/test/browser/less/rootpath/urls.less +1 -1
- package/test/browser/less/rootpath-relative/urls.less +1 -1
- package/test/browser/less/rootpath-rewrite-urls/urls.less +1 -1
- package/test/browser/less/urls.less +2 -2
- package/tsconfig.json +20 -19
- package/LICENSE +0 -177
package/dist/less.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Less - Leaner CSS v4.2.
|
|
2
|
+
* Less - Leaner CSS v4.2.1
|
|
3
3
|
* http://lesscss.org
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2024, Alexis Sellier <self@cloudhead.net>
|
|
6
6
|
* Licensed under the Apache-2.0 License.
|
|
7
7
|
*
|
|
8
8
|
* @license Apache-2.0
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
13
13
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
14
14
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.less = factory());
|
|
15
|
-
}(this, (function () { 'use strict';
|
|
15
|
+
})(this, (function () { 'use strict';
|
|
16
16
|
|
|
17
17
|
// Export a new default each time
|
|
18
18
|
function defaultOptions () {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
// Strip the query-string
|
|
104
104
|
var href = sheet.href || '';
|
|
105
105
|
// If there is no title set, use the filename, minus the extension
|
|
106
|
-
var id = "less:"
|
|
106
|
+
var id = "less:".concat(sheet.title || extractId(href));
|
|
107
107
|
// If this has already been inserted into the DOM, we may need to replace it
|
|
108
108
|
var oldStyleNode = document.getElementById(id);
|
|
109
109
|
var keepOldStyleNode = false;
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
this[propName] = environmentFunc.bind(externalEnvironment);
|
|
248
248
|
}
|
|
249
249
|
else if (i_1 < requiredFunctions.length) {
|
|
250
|
-
this.warn("missing required function in environment - "
|
|
250
|
+
this.warn("missing required function in environment - ".concat(propName));
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -725,20 +725,20 @@
|
|
|
725
725
|
color = this.toHSL();
|
|
726
726
|
args = [
|
|
727
727
|
this.fround(context, color.h),
|
|
728
|
-
this.fround(context, color.s * 100)
|
|
729
|
-
this.fround(context, color.l * 100)
|
|
728
|
+
"".concat(this.fround(context, color.s * 100), "%"),
|
|
729
|
+
"".concat(this.fround(context, color.l * 100), "%")
|
|
730
730
|
].concat(args);
|
|
731
731
|
}
|
|
732
732
|
if (colorFunction) {
|
|
733
733
|
// Values are capped between `0` and `255`, rounded and zero-padded.
|
|
734
|
-
return colorFunction
|
|
734
|
+
return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? '' : ' ')), ")");
|
|
735
735
|
}
|
|
736
736
|
color = this.toRGB();
|
|
737
737
|
if (compress) {
|
|
738
738
|
var splitcolor = color.split('');
|
|
739
739
|
// Convert color to short format
|
|
740
740
|
if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {
|
|
741
|
-
color = "#"
|
|
741
|
+
color = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
return color;
|
|
@@ -850,10 +850,10 @@
|
|
|
850
850
|
return Math.min(Math.max(v, 0), max);
|
|
851
851
|
}
|
|
852
852
|
function toHex(v) {
|
|
853
|
-
return "#"
|
|
853
|
+
return "#".concat(v.map(function (c) {
|
|
854
854
|
c = clamp$1(Math.round(c), 255);
|
|
855
855
|
return (c < 16 ? '0' : '') + c.toString(16);
|
|
856
|
-
}).join('');
|
|
856
|
+
}).join(''));
|
|
857
857
|
}
|
|
858
858
|
|
|
859
859
|
var Paren = function (node) {
|
|
@@ -962,6 +962,47 @@
|
|
|
962
962
|
ALL: 2
|
|
963
963
|
};
|
|
964
964
|
|
|
965
|
+
/******************************************************************************
|
|
966
|
+
Copyright (c) Microsoft Corporation.
|
|
967
|
+
|
|
968
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
969
|
+
purpose with or without fee is hereby granted.
|
|
970
|
+
|
|
971
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
972
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
973
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
974
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
975
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
976
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
977
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
978
|
+
***************************************************************************** */
|
|
979
|
+
|
|
980
|
+
var __assign = function() {
|
|
981
|
+
__assign = Object.assign || function __assign(t) {
|
|
982
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
983
|
+
s = arguments[i];
|
|
984
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
985
|
+
}
|
|
986
|
+
return t;
|
|
987
|
+
};
|
|
988
|
+
return __assign.apply(this, arguments);
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
function __spreadArray(to, from, pack) {
|
|
992
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
993
|
+
if (ar || !(i in from)) {
|
|
994
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
995
|
+
ar[i] = from[i];
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1002
|
+
var e = new Error(message);
|
|
1003
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1004
|
+
};
|
|
1005
|
+
|
|
965
1006
|
/**
|
|
966
1007
|
* Returns the object type of the given payload
|
|
967
1008
|
*
|
|
@@ -975,7 +1016,7 @@
|
|
|
975
1016
|
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
|
|
976
1017
|
*
|
|
977
1018
|
* @param {*} payload
|
|
978
|
-
* @returns {payload is
|
|
1019
|
+
* @returns {payload is PlainObject}
|
|
979
1020
|
*/
|
|
980
1021
|
function isPlainObject(payload) {
|
|
981
1022
|
if (getType(payload) !== 'Object')
|
|
@@ -992,28 +1033,6 @@
|
|
|
992
1033
|
return getType(payload) === 'Array';
|
|
993
1034
|
}
|
|
994
1035
|
|
|
995
|
-
/*! *****************************************************************************
|
|
996
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
997
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
998
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
999
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1000
|
-
|
|
1001
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
1002
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
1003
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
1004
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
1005
|
-
|
|
1006
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
1007
|
-
and limitations under the License.
|
|
1008
|
-
***************************************************************************** */
|
|
1009
|
-
function __spreadArrays() {
|
|
1010
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1011
|
-
s += arguments[i].length;
|
|
1012
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1013
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1014
|
-
r[k] = a[j];
|
|
1015
|
-
return r;
|
|
1016
|
-
}
|
|
1017
1036
|
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
1018
1037
|
var propType = {}.propertyIsEnumerable.call(originalObject, key)
|
|
1019
1038
|
? 'enumerable'
|
|
@@ -1035,21 +1054,21 @@
|
|
|
1035
1054
|
* @export
|
|
1036
1055
|
* @template T
|
|
1037
1056
|
* @param {T} target Target can be anything
|
|
1038
|
-
* @param {Options} [options={}] Options can be `props` or `nonenumerable`
|
|
1057
|
+
* @param {Options} [options = {}] Options can be `props` or `nonenumerable`
|
|
1039
1058
|
* @returns {T} the target with replaced values
|
|
1040
1059
|
* @export
|
|
1041
1060
|
*/
|
|
1042
1061
|
function copy(target, options) {
|
|
1043
|
-
if (options === void 0) {
|
|
1044
|
-
|
|
1062
|
+
if (options === void 0) { options = {}; }
|
|
1063
|
+
if (isArray(target)) {
|
|
1064
|
+
return target.map(function (item) { return copy(item, options); });
|
|
1045
1065
|
}
|
|
1046
|
-
if (
|
|
1047
|
-
return target.map(function (i) { return copy(i, options); });
|
|
1048
|
-
if (!isPlainObject(target))
|
|
1066
|
+
if (!isPlainObject(target)) {
|
|
1049
1067
|
return target;
|
|
1068
|
+
}
|
|
1050
1069
|
var props = Object.getOwnPropertyNames(target);
|
|
1051
1070
|
var symbols = Object.getOwnPropertySymbols(target);
|
|
1052
|
-
return
|
|
1071
|
+
return __spreadArray(__spreadArray([], props, true), symbols, true).reduce(function (carry, key) {
|
|
1053
1072
|
if (isArray(options.props) && !options.props.includes(key)) {
|
|
1054
1073
|
return carry;
|
|
1055
1074
|
}
|
|
@@ -1288,16 +1307,16 @@
|
|
|
1288
1307
|
if (options.stylize) {
|
|
1289
1308
|
var type = typeof options.stylize;
|
|
1290
1309
|
if (type !== 'function') {
|
|
1291
|
-
throw Error("options.stylize should be a function, got a "
|
|
1310
|
+
throw Error("options.stylize should be a function, got a ".concat(type, "!"));
|
|
1292
1311
|
}
|
|
1293
1312
|
stylize = options.stylize;
|
|
1294
1313
|
}
|
|
1295
1314
|
if (this.line !== null) {
|
|
1296
1315
|
if (typeof extract[0] === 'string') {
|
|
1297
|
-
error.push(stylize(this.line - 1
|
|
1316
|
+
error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), 'grey'));
|
|
1298
1317
|
}
|
|
1299
1318
|
if (typeof extract[1] === 'string') {
|
|
1300
|
-
var errorTxt = this.line
|
|
1319
|
+
var errorTxt = "".concat(this.line, " ");
|
|
1301
1320
|
if (extract[1]) {
|
|
1302
1321
|
errorTxt += extract[1].slice(0, this.column) +
|
|
1303
1322
|
stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +
|
|
@@ -1306,21 +1325,21 @@
|
|
|
1306
1325
|
error.push(errorTxt);
|
|
1307
1326
|
}
|
|
1308
1327
|
if (typeof extract[2] === 'string') {
|
|
1309
|
-
error.push(stylize(this.line + 1
|
|
1328
|
+
error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), 'grey'));
|
|
1310
1329
|
}
|
|
1311
|
-
error = error.join('\n') + stylize('', 'reset')
|
|
1330
|
+
error = "".concat(error.join('\n') + stylize('', 'reset'), "\n");
|
|
1312
1331
|
}
|
|
1313
|
-
message += stylize(this.type
|
|
1332
|
+
message += stylize("".concat(this.type, "Error: ").concat(this.message), 'red');
|
|
1314
1333
|
if (this.filename) {
|
|
1315
1334
|
message += stylize(' in ', 'red') + this.filename;
|
|
1316
1335
|
}
|
|
1317
1336
|
if (this.line) {
|
|
1318
|
-
message += stylize(" on line "
|
|
1337
|
+
message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), 'grey');
|
|
1319
1338
|
}
|
|
1320
|
-
message += "\n"
|
|
1339
|
+
message += "\n".concat(error);
|
|
1321
1340
|
if (this.callLine) {
|
|
1322
|
-
message += stylize('from ', 'red') + (this.filename || '')
|
|
1323
|
-
message += stylize(this.callLine, 'grey')
|
|
1341
|
+
message += "".concat(stylize('from ', 'red') + (this.filename || ''), "/n");
|
|
1342
|
+
message += "".concat(stylize(this.callLine, 'grey'), " ").concat(this.callExtract, "/n");
|
|
1324
1343
|
}
|
|
1325
1344
|
return message;
|
|
1326
1345
|
};
|
|
@@ -1380,9 +1399,9 @@
|
|
|
1380
1399
|
var fnName;
|
|
1381
1400
|
visitArgs.visitDeeper = true;
|
|
1382
1401
|
if (!func) {
|
|
1383
|
-
fnName = "visit"
|
|
1402
|
+
fnName = "visit".concat(node.type);
|
|
1384
1403
|
func = impl[fnName] || _noop;
|
|
1385
|
-
funcOut = impl[fnName
|
|
1404
|
+
funcOut = impl["".concat(fnName, "Out")] || _noop;
|
|
1386
1405
|
this._visitInCache[nodeTypeIndex] = func;
|
|
1387
1406
|
this._visitOutCache[nodeTypeIndex] = funcOut;
|
|
1388
1407
|
}
|
|
@@ -1578,7 +1597,7 @@
|
|
|
1578
1597
|
if (isPathLocalRelative(path) &&
|
|
1579
1598
|
isPathRelative(rootpath) &&
|
|
1580
1599
|
isPathLocalRelative(newPath) === false) {
|
|
1581
|
-
newPath = "./"
|
|
1600
|
+
newPath = "./".concat(newPath);
|
|
1582
1601
|
}
|
|
1583
1602
|
return newPath;
|
|
1584
1603
|
};
|
|
@@ -1985,9 +2004,9 @@
|
|
|
1985
2004
|
selector = extend.selector.toCSS({});
|
|
1986
2005
|
}
|
|
1987
2006
|
catch (_) { }
|
|
1988
|
-
if (!indices[extend.index
|
|
1989
|
-
indices[extend.index
|
|
1990
|
-
logger$1.warn("extend '"
|
|
2007
|
+
if (!indices["".concat(extend.index, " ").concat(selector)]) {
|
|
2008
|
+
indices["".concat(extend.index, " ").concat(selector)] = true;
|
|
2009
|
+
logger$1.warn("extend '".concat(selector, "' has no matches"));
|
|
1991
2010
|
}
|
|
1992
2011
|
});
|
|
1993
2012
|
};
|
|
@@ -2068,7 +2087,7 @@
|
|
|
2068
2087
|
selectorTwo = extendsToAdd[0].selector.toCSS();
|
|
2069
2088
|
}
|
|
2070
2089
|
catch (e) { }
|
|
2071
|
-
throw { message: "extend circular reference detected. One of the circular extends is currently:"
|
|
2090
|
+
throw { message: "extend circular reference detected. One of the circular extends is currently:".concat(selectorOne, ":extend(").concat(selectorTwo, ")") };
|
|
2072
2091
|
}
|
|
2073
2092
|
// now process the new extends on the existing rules so that we can handle a extending b extending c extending
|
|
2074
2093
|
// d extending e...
|
|
@@ -2509,7 +2528,7 @@
|
|
|
2509
2528
|
// be considered illegal css as it has to be on the first line
|
|
2510
2529
|
if (this.charset) {
|
|
2511
2530
|
if (atRuleNode.debugInfo) {
|
|
2512
|
-
var comment = new tree.Comment("/* "
|
|
2531
|
+
var comment = new tree.Comment("/* ".concat(atRuleNode.toCSS(this._context).replace(/\n/g, ''), " */\n"));
|
|
2513
2532
|
comment.debugInfo = atRuleNode.debugInfo;
|
|
2514
2533
|
return this._visitor.visit(comment);
|
|
2515
2534
|
}
|
|
@@ -2530,11 +2549,11 @@
|
|
|
2530
2549
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2531
2550
|
}
|
|
2532
2551
|
if (ruleNode instanceof tree.Call) {
|
|
2533
|
-
throw { message: "Function '"
|
|
2552
|
+
throw { message: "Function '".concat(ruleNode.name, "' did not return a root node"),
|
|
2534
2553
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2535
2554
|
}
|
|
2536
2555
|
if (ruleNode.type && !ruleNode.allowRoot) {
|
|
2537
|
-
throw { message: ruleNode.type
|
|
2556
|
+
throw { message: "".concat(ruleNode.type, " node returned by a function is not valid here"),
|
|
2538
2557
|
index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename };
|
|
2539
2558
|
}
|
|
2540
2559
|
}
|
|
@@ -2767,7 +2786,7 @@
|
|
|
2767
2786
|
if (matched) {
|
|
2768
2787
|
continue;
|
|
2769
2788
|
}
|
|
2770
|
-
return fail("unmatched `"
|
|
2789
|
+
return fail("unmatched `".concat(String.fromCharCode(cc), "`"), currentChunkStartIndex);
|
|
2771
2790
|
case 47: // /, check for comment
|
|
2772
2791
|
if (parenLevel || (chunkerCurrentIndex == len - 1)) {
|
|
2773
2792
|
continue;
|
|
@@ -3270,7 +3289,7 @@
|
|
|
3270
3289
|
return result;
|
|
3271
3290
|
}
|
|
3272
3291
|
error(msg || (typeof arg === 'string'
|
|
3273
|
-
? "expected '"
|
|
3292
|
+
? "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'")
|
|
3274
3293
|
: 'unexpected token'));
|
|
3275
3294
|
}
|
|
3276
3295
|
// Specialization of expect()
|
|
@@ -3278,7 +3297,7 @@
|
|
|
3278
3297
|
if (parserInput.$char(arg)) {
|
|
3279
3298
|
return arg;
|
|
3280
3299
|
}
|
|
3281
|
-
error(msg || "expected '"
|
|
3300
|
+
error(msg || "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'"));
|
|
3282
3301
|
}
|
|
3283
3302
|
function getDebugInfo(index) {
|
|
3284
3303
|
var filename = fileInfo.filename;
|
|
@@ -3355,8 +3374,8 @@
|
|
|
3355
3374
|
}
|
|
3356
3375
|
};
|
|
3357
3376
|
}
|
|
3358
|
-
globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars)
|
|
3359
|
-
modifyVars = (additionalData && additionalData.modifyVars) ? "\n"
|
|
3377
|
+
globalVars = (additionalData && additionalData.globalVars) ? "".concat(Parser.serializeVars(additionalData.globalVars), "\n") : '';
|
|
3378
|
+
modifyVars = (additionalData && additionalData.modifyVars) ? "\n".concat(Parser.serializeVars(additionalData.modifyVars)) : '';
|
|
3360
3379
|
if (context.pluginManager) {
|
|
3361
3380
|
var preProcessors = context.pluginManager.getPreProcessors();
|
|
3362
3381
|
for (var i_1 = 0; i_1 < preProcessors.length; i_1++) {
|
|
@@ -3622,6 +3641,32 @@
|
|
|
3622
3641
|
parserInput.forget();
|
|
3623
3642
|
return new (tree.Call)(name, args, index + currentIndex, fileInfo);
|
|
3624
3643
|
},
|
|
3644
|
+
declarationCall: function () {
|
|
3645
|
+
var validCall;
|
|
3646
|
+
var args;
|
|
3647
|
+
var index = parserInput.i;
|
|
3648
|
+
parserInput.save();
|
|
3649
|
+
validCall = parserInput.$re(/^[\w]+\(/);
|
|
3650
|
+
if (!validCall) {
|
|
3651
|
+
parserInput.forget();
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
validCall = validCall.substring(0, validCall.length - 1);
|
|
3655
|
+
var rule = this.ruleProperty();
|
|
3656
|
+
var value;
|
|
3657
|
+
if (rule) {
|
|
3658
|
+
value = this.value();
|
|
3659
|
+
}
|
|
3660
|
+
if (rule && value) {
|
|
3661
|
+
args = [new (tree.Declaration)(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)];
|
|
3662
|
+
}
|
|
3663
|
+
if (!parserInput.$char(')')) {
|
|
3664
|
+
parserInput.restore('Could not parse call arguments or missing \')\'');
|
|
3665
|
+
return;
|
|
3666
|
+
}
|
|
3667
|
+
parserInput.forget();
|
|
3668
|
+
return new (tree.Call)(validCall, args, index + currentIndex, fileInfo);
|
|
3669
|
+
},
|
|
3625
3670
|
//
|
|
3626
3671
|
// Parsing rules for functions with non-standard args, e.g.:
|
|
3627
3672
|
//
|
|
@@ -3774,7 +3819,7 @@
|
|
|
3774
3819
|
var curly;
|
|
3775
3820
|
var index = parserInput.i;
|
|
3776
3821
|
if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) {
|
|
3777
|
-
return new (tree.Variable)("@"
|
|
3822
|
+
return new (tree.Variable)("@".concat(curly[1]), index + currentIndex, fileInfo);
|
|
3778
3823
|
}
|
|
3779
3824
|
},
|
|
3780
3825
|
//
|
|
@@ -3794,7 +3839,7 @@
|
|
|
3794
3839
|
var curly;
|
|
3795
3840
|
var index = parserInput.i;
|
|
3796
3841
|
if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) {
|
|
3797
|
-
return new (tree.Property)("$"
|
|
3842
|
+
return new (tree.Property)("$".concat(curly[1]), index + currentIndex, fileInfo);
|
|
3798
3843
|
}
|
|
3799
3844
|
},
|
|
3800
3845
|
//
|
|
@@ -4325,10 +4370,10 @@
|
|
|
4325
4370
|
value = parserInput.$re(/^\d+/);
|
|
4326
4371
|
if (!value) {
|
|
4327
4372
|
value = expect(parsers.entities.variable, 'Could not parse alpha');
|
|
4328
|
-
value = "@{"
|
|
4373
|
+
value = "@{".concat(value.name.slice(1), "}");
|
|
4329
4374
|
}
|
|
4330
4375
|
expectChar(')');
|
|
4331
|
-
return new tree.Quoted('', "alpha(opacity="
|
|
4376
|
+
return new tree.Quoted('', "alpha(opacity=".concat(value, ")"));
|
|
4332
4377
|
},
|
|
4333
4378
|
//
|
|
4334
4379
|
// A Selector Element
|
|
@@ -4706,6 +4751,10 @@
|
|
|
4706
4751
|
if (e) {
|
|
4707
4752
|
value.push(e);
|
|
4708
4753
|
}
|
|
4754
|
+
if (parserInput.peek(',')) {
|
|
4755
|
+
value.push(new (tree.Anonymous)(',', parserInput.i));
|
|
4756
|
+
parserInput.$char(',');
|
|
4757
|
+
}
|
|
4709
4758
|
} while (e);
|
|
4710
4759
|
done = testCurrentChar();
|
|
4711
4760
|
if (value.length > 0) {
|
|
@@ -4725,7 +4774,7 @@
|
|
|
4725
4774
|
value = parserInput.$parseUntil(tok);
|
|
4726
4775
|
if (value) {
|
|
4727
4776
|
if (typeof value === 'string') {
|
|
4728
|
-
error("Expected '"
|
|
4777
|
+
error("Expected '".concat(value, "'"), 'Parse');
|
|
4729
4778
|
}
|
|
4730
4779
|
if (value.length === 1 && value[0] === ' ') {
|
|
4731
4780
|
parserInput.forget();
|
|
@@ -4833,7 +4882,7 @@
|
|
|
4833
4882
|
var rangeP;
|
|
4834
4883
|
parserInput.save();
|
|
4835
4884
|
do {
|
|
4836
|
-
e = entities.keyword() || entities.variable() || entities.mixinLookup();
|
|
4885
|
+
e = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup();
|
|
4837
4886
|
if (e) {
|
|
4838
4887
|
nodes.push(e);
|
|
4839
4888
|
}
|
|
@@ -5014,7 +5063,7 @@
|
|
|
5014
5063
|
}
|
|
5015
5064
|
nonVendorSpecificName = name;
|
|
5016
5065
|
if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
|
|
5017
|
-
nonVendorSpecificName = "@"
|
|
5066
|
+
nonVendorSpecificName = "@".concat(name.slice(name.indexOf('-', 2) + 1));
|
|
5018
5067
|
}
|
|
5019
5068
|
switch (nonVendorSpecificName) {
|
|
5020
5069
|
case '@charset':
|
|
@@ -5042,13 +5091,13 @@
|
|
|
5042
5091
|
if (hasIdentifier) {
|
|
5043
5092
|
value = this.entity();
|
|
5044
5093
|
if (!value) {
|
|
5045
|
-
error("expected "
|
|
5094
|
+
error("expected ".concat(name, " identifier"));
|
|
5046
5095
|
}
|
|
5047
5096
|
}
|
|
5048
5097
|
else if (hasExpression) {
|
|
5049
5098
|
value = this.expression();
|
|
5050
5099
|
if (!value) {
|
|
5051
|
-
error("expected "
|
|
5100
|
+
error("expected ".concat(name, " expression"));
|
|
5052
5101
|
}
|
|
5053
5102
|
}
|
|
5054
5103
|
else if (hasUnknown) {
|
|
@@ -5056,7 +5105,7 @@
|
|
|
5056
5105
|
hasBlock = (parserInput.currentChar() === '{');
|
|
5057
5106
|
if (!value) {
|
|
5058
5107
|
if (!hasBlock && parserInput.currentChar() !== ';') {
|
|
5059
|
-
error(name
|
|
5108
|
+
error("".concat(name, " rule is missing block or ending semi-colon"));
|
|
5060
5109
|
}
|
|
5061
5110
|
}
|
|
5062
5111
|
else if (!value.value) {
|
|
@@ -5294,7 +5343,7 @@
|
|
|
5294
5343
|
return;
|
|
5295
5344
|
}
|
|
5296
5345
|
if (!parserInput.$char(')')) {
|
|
5297
|
-
parserInput.restore("expected ')' got '"
|
|
5346
|
+
parserInput.restore("expected ')' got '".concat(parserInput.currentChar(), "'"));
|
|
5298
5347
|
return;
|
|
5299
5348
|
}
|
|
5300
5349
|
parserInput.forget();
|
|
@@ -5462,8 +5511,8 @@
|
|
|
5462
5511
|
name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?
|
|
5463
5512
|
new (tree.Keyword)(s) :
|
|
5464
5513
|
(s.charAt(0) === '@' ?
|
|
5465
|
-
new (tree.Variable)("@"
|
|
5466
|
-
new (tree.Property)("$"
|
|
5514
|
+
new (tree.Variable)("@".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo) :
|
|
5515
|
+
new (tree.Property)("$".concat(s.slice(2, -1)), index[k] + currentIndex, fileInfo));
|
|
5467
5516
|
}
|
|
5468
5517
|
return name;
|
|
5469
5518
|
}
|
|
@@ -5477,7 +5526,7 @@
|
|
|
5477
5526
|
for (var name_1 in vars) {
|
|
5478
5527
|
if (Object.hasOwnProperty.call(vars, name_1)) {
|
|
5479
5528
|
var value = vars[name_1];
|
|
5480
|
-
s += ((name_1[0] === '@') ? '' : '@') + name_1
|
|
5529
|
+
s += "".concat(((name_1[0] === '@') ? '' : '@') + name_1, ": ").concat(value).concat((String(value).slice(-1) === ';') ? '' : ';');
|
|
5481
5530
|
}
|
|
5482
5531
|
}
|
|
5483
5532
|
return s;
|
|
@@ -5697,7 +5746,7 @@
|
|
|
5697
5746
|
var Declaration = function (name, value, important, merge, index, currentFileInfo, inline, variable) {
|
|
5698
5747
|
this.name = name;
|
|
5699
5748
|
this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);
|
|
5700
|
-
this.important = important ? " "
|
|
5749
|
+
this.important = important ? " ".concat(important.trim()) : '';
|
|
5701
5750
|
this.merge = merge;
|
|
5702
5751
|
this._index = index;
|
|
5703
5752
|
this._fileInfo = currentFileInfo;
|
|
@@ -5769,19 +5818,19 @@
|
|
|
5769
5818
|
});
|
|
5770
5819
|
|
|
5771
5820
|
function asComment(ctx) {
|
|
5772
|
-
return "/* line "
|
|
5821
|
+
return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n");
|
|
5773
5822
|
}
|
|
5774
5823
|
function asMediaQuery(ctx) {
|
|
5775
5824
|
var filenameWithProtocol = ctx.debugInfo.fileName;
|
|
5776
5825
|
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
|
|
5777
|
-
filenameWithProtocol = "file://"
|
|
5826
|
+
filenameWithProtocol = "file://".concat(filenameWithProtocol);
|
|
5778
5827
|
}
|
|
5779
|
-
return "@media -sass-debug-info{filename{font-family:"
|
|
5828
|
+
return "@media -sass-debug-info{filename{font-family:".concat(filenameWithProtocol.replace(/([.:/\\])/g, function (a) {
|
|
5780
5829
|
if (a == '\\') {
|
|
5781
5830
|
a = '/';
|
|
5782
5831
|
}
|
|
5783
|
-
return "\\"
|
|
5784
|
-
})
|
|
5832
|
+
return "\\".concat(a);
|
|
5833
|
+
}), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n");
|
|
5785
5834
|
}
|
|
5786
5835
|
function debugInfo(context, ctx, lineSeparator) {
|
|
5787
5836
|
var result = '';
|
|
@@ -6114,11 +6163,11 @@
|
|
|
6114
6163
|
var name_2 = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?
|
|
6115
6164
|
r.name[0].value : r.name;
|
|
6116
6165
|
// Properties don't overwrite as they can merge
|
|
6117
|
-
if (!hash["$"
|
|
6118
|
-
hash["$"
|
|
6166
|
+
if (!hash["$".concat(name_2)]) {
|
|
6167
|
+
hash["$".concat(name_2)] = [r];
|
|
6119
6168
|
}
|
|
6120
6169
|
else {
|
|
6121
|
-
hash["$"
|
|
6170
|
+
hash["$".concat(name_2)].push(r);
|
|
6122
6171
|
}
|
|
6123
6172
|
}
|
|
6124
6173
|
return hash;
|
|
@@ -6291,7 +6340,7 @@
|
|
|
6291
6340
|
var paths = this.paths;
|
|
6292
6341
|
var pathCnt = paths.length;
|
|
6293
6342
|
var pathSubCnt = void 0;
|
|
6294
|
-
sep = context.compress ? ',' : (",\n"
|
|
6343
|
+
sep = context.compress ? ',' : (",\n".concat(tabSetStr));
|
|
6295
6344
|
for (i = 0; i < pathCnt; i++) {
|
|
6296
6345
|
path = paths[i];
|
|
6297
6346
|
if (!(pathSubCnt = path.length)) {
|
|
@@ -6326,14 +6375,14 @@
|
|
|
6326
6375
|
}
|
|
6327
6376
|
context.lastRule = currentLastRule;
|
|
6328
6377
|
if (!context.lastRule && rule.isVisible()) {
|
|
6329
|
-
output.add(context.compress ? '' : ("\n"
|
|
6378
|
+
output.add(context.compress ? '' : ("\n".concat(tabRuleStr)));
|
|
6330
6379
|
}
|
|
6331
6380
|
else {
|
|
6332
6381
|
context.lastRule = false;
|
|
6333
6382
|
}
|
|
6334
6383
|
}
|
|
6335
6384
|
if (!this.root) {
|
|
6336
|
-
output.add((context.compress ? '}' : "\n"
|
|
6385
|
+
output.add((context.compress ? '}' : "\n".concat(tabSetStr, "}")));
|
|
6337
6386
|
context.tabLevel--;
|
|
6338
6387
|
}
|
|
6339
6388
|
if (!output.isEmpty() && !context.compress && this.firstRoot) {
|
|
@@ -6688,18 +6737,18 @@
|
|
|
6688
6737
|
return;
|
|
6689
6738
|
}
|
|
6690
6739
|
// Non-compressed
|
|
6691
|
-
var tabSetStr = "\n"
|
|
6740
|
+
var tabSetStr = "\n".concat(Array(context.tabLevel).join(' ')), tabRuleStr = "".concat(tabSetStr, " ");
|
|
6692
6741
|
if (!ruleCnt) {
|
|
6693
|
-
output.add(" {"
|
|
6742
|
+
output.add(" {".concat(tabSetStr, "}"));
|
|
6694
6743
|
}
|
|
6695
6744
|
else {
|
|
6696
|
-
output.add(" {"
|
|
6745
|
+
output.add(" {".concat(tabRuleStr));
|
|
6697
6746
|
rules[0].genCSS(context, output);
|
|
6698
6747
|
for (i = 1; i < ruleCnt; i++) {
|
|
6699
6748
|
output.add(tabRuleStr);
|
|
6700
6749
|
rules[i].genCSS(context, output);
|
|
6701
6750
|
}
|
|
6702
|
-
output.add(tabSetStr
|
|
6751
|
+
output.add("".concat(tabSetStr, "}"));
|
|
6703
6752
|
}
|
|
6704
6753
|
context.tabLevel--;
|
|
6705
6754
|
}
|
|
@@ -6756,7 +6805,7 @@
|
|
|
6756
6805
|
toString: function () {
|
|
6757
6806
|
var i, returnStr = this.numerator.join('*');
|
|
6758
6807
|
for (i = 0; i < this.denominator.length; i++) {
|
|
6759
|
-
returnStr += "/"
|
|
6808
|
+
returnStr += "/".concat(this.denominator[i]);
|
|
6760
6809
|
}
|
|
6761
6810
|
return returnStr;
|
|
6762
6811
|
},
|
|
@@ -6868,7 +6917,7 @@
|
|
|
6868
6917
|
},
|
|
6869
6918
|
genCSS: function (context, output) {
|
|
6870
6919
|
if ((context && context.strictUnits) && !this.unit.isSingular()) {
|
|
6871
|
-
throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "
|
|
6920
|
+
throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".concat(this.unit.toString()));
|
|
6872
6921
|
}
|
|
6873
6922
|
var value = this.fround(context, this.value);
|
|
6874
6923
|
var strValue = String(value);
|
|
@@ -6909,7 +6958,7 @@
|
|
|
6909
6958
|
other = other.convertTo(this.unit.usedUnits());
|
|
6910
6959
|
if (context.strictUnits && other.unit.toString() !== unit.toString()) {
|
|
6911
6960
|
throw new Error('Incompatible units. Change the units or use the unit function. '
|
|
6912
|
-
+
|
|
6961
|
+
+ "Bad units: '".concat(unit.toString(), "' and '").concat(other.unit.toString(), "'."));
|
|
6913
6962
|
}
|
|
6914
6963
|
value = this._operate(context, op, this.value, other.value);
|
|
6915
6964
|
}
|
|
@@ -7037,44 +7086,6 @@
|
|
|
7037
7086
|
}
|
|
7038
7087
|
});
|
|
7039
7088
|
|
|
7040
|
-
/*! *****************************************************************************
|
|
7041
|
-
Copyright (c) Microsoft Corporation.
|
|
7042
|
-
|
|
7043
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7044
|
-
purpose with or without fee is hereby granted.
|
|
7045
|
-
|
|
7046
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7047
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7048
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7049
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7050
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7051
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7052
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7053
|
-
***************************************************************************** */
|
|
7054
|
-
var __assign = function () {
|
|
7055
|
-
__assign = Object.assign || function __assign(t) {
|
|
7056
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7057
|
-
s = arguments[i];
|
|
7058
|
-
for (var p in s)
|
|
7059
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7060
|
-
t[p] = s[p];
|
|
7061
|
-
}
|
|
7062
|
-
return t;
|
|
7063
|
-
};
|
|
7064
|
-
return __assign.apply(this, arguments);
|
|
7065
|
-
};
|
|
7066
|
-
function __spreadArray(to, from, pack) {
|
|
7067
|
-
if (pack || arguments.length === 2)
|
|
7068
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7069
|
-
if (ar || !(i in from)) {
|
|
7070
|
-
if (!ar)
|
|
7071
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
7072
|
-
ar[i] = from[i];
|
|
7073
|
-
}
|
|
7074
|
-
}
|
|
7075
|
-
return to.concat(ar || from);
|
|
7076
|
-
}
|
|
7077
|
-
|
|
7078
7089
|
var Expression = function (value, noSpacing) {
|
|
7079
7090
|
this.value = value;
|
|
7080
7091
|
this.noSpacing = noSpacing;
|
|
@@ -7125,7 +7136,10 @@
|
|
|
7125
7136
|
for (var i_1 = 0; i_1 < this.value.length; i_1++) {
|
|
7126
7137
|
this.value[i_1].genCSS(context, output);
|
|
7127
7138
|
if (!this.noSpacing && i_1 + 1 < this.value.length) {
|
|
7128
|
-
|
|
7139
|
+
if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) ||
|
|
7140
|
+
this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ',') {
|
|
7141
|
+
output.add(' ');
|
|
7142
|
+
}
|
|
7129
7143
|
}
|
|
7130
7144
|
}
|
|
7131
7145
|
},
|
|
@@ -7178,7 +7192,7 @@
|
|
|
7178
7192
|
return item;
|
|
7179
7193
|
});
|
|
7180
7194
|
if (evalArgs === false) {
|
|
7181
|
-
return this.func.apply(this, __spreadArray([this.context], args));
|
|
7195
|
+
return this.func.apply(this, __spreadArray([this.context], args, false));
|
|
7182
7196
|
}
|
|
7183
7197
|
return this.func.apply(this, args);
|
|
7184
7198
|
};
|
|
@@ -7243,7 +7257,7 @@
|
|
|
7243
7257
|
}
|
|
7244
7258
|
throw {
|
|
7245
7259
|
type: e.type || 'Runtime',
|
|
7246
|
-
message: "Error evaluating function `"
|
|
7260
|
+
message: "Error evaluating function `".concat(this.name, "`").concat(e.message ? ": ".concat(e.message) : ''),
|
|
7247
7261
|
index: this.getIndex(),
|
|
7248
7262
|
filename: this.fileInfo().filename,
|
|
7249
7263
|
line: e.lineNumber,
|
|
@@ -7271,7 +7285,7 @@
|
|
|
7271
7285
|
return new Call(this.name, args, this.getIndex(), this.fileInfo());
|
|
7272
7286
|
},
|
|
7273
7287
|
genCSS: function (context, output) {
|
|
7274
|
-
output.add(this.name
|
|
7288
|
+
output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex());
|
|
7275
7289
|
for (var i_1 = 0; i_1 < this.args.length; i_1++) {
|
|
7276
7290
|
this.args[i_1].genCSS(context, output);
|
|
7277
7291
|
if (i_1 + 1 < this.args.length) {
|
|
@@ -7292,11 +7306,11 @@
|
|
|
7292
7306
|
eval: function (context) {
|
|
7293
7307
|
var variable, name = this.name;
|
|
7294
7308
|
if (name.indexOf('@@') === 0) {
|
|
7295
|
-
name = "@"
|
|
7309
|
+
name = "@".concat(new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value);
|
|
7296
7310
|
}
|
|
7297
7311
|
if (this.evaluating) {
|
|
7298
7312
|
throw { type: 'Name',
|
|
7299
|
-
message: "Recursive variable definition for "
|
|
7313
|
+
message: "Recursive variable definition for ".concat(name),
|
|
7300
7314
|
filename: this.fileInfo().filename,
|
|
7301
7315
|
index: this.getIndex() };
|
|
7302
7316
|
}
|
|
@@ -7323,7 +7337,7 @@
|
|
|
7323
7337
|
}
|
|
7324
7338
|
else {
|
|
7325
7339
|
throw { type: 'Name',
|
|
7326
|
-
message: "variable "
|
|
7340
|
+
message: "variable ".concat(name, " is undefined"),
|
|
7327
7341
|
filename: this.fileInfo().filename,
|
|
7328
7342
|
index: this.getIndex() };
|
|
7329
7343
|
}
|
|
@@ -7353,7 +7367,7 @@
|
|
|
7353
7367
|
var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;
|
|
7354
7368
|
if (this.evaluating) {
|
|
7355
7369
|
throw { type: 'Name',
|
|
7356
|
-
message: "Recursive property reference for "
|
|
7370
|
+
message: "Recursive property reference for ".concat(name),
|
|
7357
7371
|
filename: this.fileInfo().filename,
|
|
7358
7372
|
index: this.getIndex() };
|
|
7359
7373
|
}
|
|
@@ -7382,7 +7396,7 @@
|
|
|
7382
7396
|
}
|
|
7383
7397
|
else {
|
|
7384
7398
|
throw { type: 'Name',
|
|
7385
|
-
message: "Property '"
|
|
7399
|
+
message: "Property '".concat(name, "' is undefined"),
|
|
7386
7400
|
filename: this.currentFileInfo.filename,
|
|
7387
7401
|
index: this.index };
|
|
7388
7402
|
}
|
|
@@ -7421,7 +7435,7 @@
|
|
|
7421
7435
|
if (this.cif) {
|
|
7422
7436
|
value = value + ' ' + this.cif;
|
|
7423
7437
|
}
|
|
7424
|
-
return "["
|
|
7438
|
+
return "[".concat(value, "]");
|
|
7425
7439
|
}
|
|
7426
7440
|
});
|
|
7427
7441
|
|
|
@@ -7453,11 +7467,11 @@
|
|
|
7453
7467
|
var that = this;
|
|
7454
7468
|
var value = this.value;
|
|
7455
7469
|
var variableReplacement = function (_, name) {
|
|
7456
|
-
var v = new Variable("@"
|
|
7470
|
+
var v = new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context, true);
|
|
7457
7471
|
return (v instanceof Quoted) ? v.value : v.toCSS();
|
|
7458
7472
|
};
|
|
7459
7473
|
var propertyReplacement = function (_, name) {
|
|
7460
|
-
var v = new Property("$"
|
|
7474
|
+
var v = new Property("$".concat(name), that.getIndex(), that.fileInfo()).eval(context, true);
|
|
7461
7475
|
return (v instanceof Quoted) ? v.value : v.toCSS();
|
|
7462
7476
|
};
|
|
7463
7477
|
function iterativeReplace(value, regexp, replacementFnc) {
|
|
@@ -7484,7 +7498,7 @@
|
|
|
7484
7498
|
});
|
|
7485
7499
|
|
|
7486
7500
|
function escapePath(path) {
|
|
7487
|
-
return path.replace(/[()'"\s]/g, function (match) { return "\\"
|
|
7501
|
+
return path.replace(/[()'"\s]/g, function (match) { return "\\".concat(match); });
|
|
7488
7502
|
}
|
|
7489
7503
|
var URL = function (val, index, currentFileInfo, isEvald) {
|
|
7490
7504
|
this.value = val;
|
|
@@ -7525,7 +7539,7 @@
|
|
|
7525
7539
|
var delimiter = val.value.indexOf('?') === -1 ? '?' : '&';
|
|
7526
7540
|
var urlArgs = delimiter + context.urlArgs;
|
|
7527
7541
|
if (val.value.indexOf('#') !== -1) {
|
|
7528
|
-
val.value = val.value.replace('#', urlArgs
|
|
7542
|
+
val.value = val.value.replace('#', "".concat(urlArgs, "#"));
|
|
7529
7543
|
}
|
|
7530
7544
|
else {
|
|
7531
7545
|
val.value += urlArgs;
|
|
@@ -7828,13 +7842,13 @@
|
|
|
7828
7842
|
index: this.getIndex() };
|
|
7829
7843
|
}
|
|
7830
7844
|
expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
|
|
7831
|
-
return that.jsify(new Variable("@"
|
|
7845
|
+
return that.jsify(new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context));
|
|
7832
7846
|
});
|
|
7833
7847
|
try {
|
|
7834
|
-
expression = new Function("return ("
|
|
7848
|
+
expression = new Function("return (".concat(expression, ")"));
|
|
7835
7849
|
}
|
|
7836
7850
|
catch (e) {
|
|
7837
|
-
throw { message: "JavaScript evaluation error: "
|
|
7851
|
+
throw { message: "JavaScript evaluation error: ".concat(e.message, " from `").concat(expression, "`"),
|
|
7838
7852
|
filename: this.fileInfo().filename,
|
|
7839
7853
|
index: this.getIndex() };
|
|
7840
7854
|
}
|
|
@@ -7854,7 +7868,7 @@
|
|
|
7854
7868
|
result = expression.call(evalContext);
|
|
7855
7869
|
}
|
|
7856
7870
|
catch (e) {
|
|
7857
|
-
throw { message: "JavaScript evaluation error: '"
|
|
7871
|
+
throw { message: "JavaScript evaluation error: '".concat(e.name, ": ").concat(e.message.replace(/["]/g, '\''), "'"),
|
|
7858
7872
|
filename: this.fileInfo().filename,
|
|
7859
7873
|
index: this.getIndex() };
|
|
7860
7874
|
}
|
|
@@ -7862,7 +7876,7 @@
|
|
|
7862
7876
|
},
|
|
7863
7877
|
jsify: function (obj) {
|
|
7864
7878
|
if (Array.isArray(obj.value) && (obj.value.length > 1)) {
|
|
7865
|
-
return "["
|
|
7879
|
+
return "[".concat(obj.value.map(function (v) { return v.toCSS(); }).join(', '), "]");
|
|
7866
7880
|
}
|
|
7867
7881
|
else {
|
|
7868
7882
|
return obj.toCSS();
|
|
@@ -7885,7 +7899,7 @@
|
|
|
7885
7899
|
return new Dimension(result);
|
|
7886
7900
|
}
|
|
7887
7901
|
else if (type === 'string') {
|
|
7888
|
-
return new Quoted("\""
|
|
7902
|
+
return new Quoted("\"".concat(result, "\""), result, this.escaped, this._index);
|
|
7889
7903
|
}
|
|
7890
7904
|
else if (Array.isArray(result)) {
|
|
7891
7905
|
return new Anonymous(result.join(', '));
|
|
@@ -7912,7 +7926,7 @@
|
|
|
7912
7926
|
return this;
|
|
7913
7927
|
},
|
|
7914
7928
|
genCSS: function (context, output) {
|
|
7915
|
-
output.add(this.key
|
|
7929
|
+
output.add("".concat(this.key, "="));
|
|
7916
7930
|
if (this.value.genCSS) {
|
|
7917
7931
|
this.value.genCSS(context, output);
|
|
7918
7932
|
}
|
|
@@ -8119,7 +8133,7 @@
|
|
|
8119
8133
|
eval: function (context) {
|
|
8120
8134
|
var rules;
|
|
8121
8135
|
var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);
|
|
8122
|
-
var error = new LessError({ message: "Could not evaluate variable call "
|
|
8136
|
+
var error = new LessError({ message: "Could not evaluate variable call ".concat(this.variable) });
|
|
8123
8137
|
if (!detachedRuleset.ruleset) {
|
|
8124
8138
|
if (detachedRuleset.rules) {
|
|
8125
8139
|
rules = detachedRuleset;
|
|
@@ -8167,31 +8181,31 @@
|
|
|
8167
8181
|
}
|
|
8168
8182
|
else if (name.charAt(0) === '@') {
|
|
8169
8183
|
if (name.charAt(1) === '@') {
|
|
8170
|
-
name = "@"
|
|
8184
|
+
name = "@".concat(new Variable(name.substr(1)).eval(context).value);
|
|
8171
8185
|
}
|
|
8172
8186
|
if (rules.variables) {
|
|
8173
8187
|
rules = rules.variable(name);
|
|
8174
8188
|
}
|
|
8175
8189
|
if (!rules) {
|
|
8176
8190
|
throw { type: 'Name',
|
|
8177
|
-
message: "variable "
|
|
8191
|
+
message: "variable ".concat(name, " not found"),
|
|
8178
8192
|
filename: this.fileInfo().filename,
|
|
8179
8193
|
index: this.getIndex() };
|
|
8180
8194
|
}
|
|
8181
8195
|
}
|
|
8182
8196
|
else {
|
|
8183
8197
|
if (name.substring(0, 2) === '$@') {
|
|
8184
|
-
name = "$"
|
|
8198
|
+
name = "$".concat(new Variable(name.substr(1)).eval(context).value);
|
|
8185
8199
|
}
|
|
8186
8200
|
else {
|
|
8187
|
-
name = name.charAt(0) === '$' ? name : "$"
|
|
8201
|
+
name = name.charAt(0) === '$' ? name : "$".concat(name);
|
|
8188
8202
|
}
|
|
8189
8203
|
if (rules.properties) {
|
|
8190
8204
|
rules = rules.property(name);
|
|
8191
8205
|
}
|
|
8192
8206
|
if (!rules) {
|
|
8193
8207
|
throw { type: 'Name',
|
|
8194
|
-
message: "property \""
|
|
8208
|
+
message: "property \"".concat(name.substr(1), "\" not found"),
|
|
8195
8209
|
filename: this.fileInfo().filename,
|
|
8196
8210
|
index: this.getIndex() };
|
|
8197
8211
|
}
|
|
@@ -8284,7 +8298,7 @@
|
|
|
8284
8298
|
continue;
|
|
8285
8299
|
}
|
|
8286
8300
|
else {
|
|
8287
|
-
throw { type: 'Runtime', message: "Named argument for "
|
|
8301
|
+
throw { type: 'Runtime', message: "Named argument for ".concat(this.name, " ").concat(args[i].name, " not found") };
|
|
8288
8302
|
}
|
|
8289
8303
|
}
|
|
8290
8304
|
}
|
|
@@ -8319,7 +8333,7 @@
|
|
|
8319
8333
|
frame.resetCache();
|
|
8320
8334
|
}
|
|
8321
8335
|
else {
|
|
8322
|
-
throw { type: 'Runtime', message: "wrong number of arguments for "
|
|
8336
|
+
throw { type: 'Runtime', message: "wrong number of arguments for ".concat(this.name, " (").concat(argsLength, " for ").concat(this.arity, ")") };
|
|
8323
8337
|
}
|
|
8324
8338
|
frame.prependRule(new Declaration(name, val));
|
|
8325
8339
|
evaldArguments[i] = val;
|
|
@@ -8534,7 +8548,7 @@
|
|
|
8534
8548
|
defaultResult = defTrue;
|
|
8535
8549
|
if ((count[defTrue] + count[defFalse]) > 1) {
|
|
8536
8550
|
throw { type: 'Runtime',
|
|
8537
|
-
message: "Ambiguous use of `default()` found when matching for `"
|
|
8551
|
+
message: "Ambiguous use of `default()` found when matching for `".concat(this.format(args), "`"),
|
|
8538
8552
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8539
8553
|
}
|
|
8540
8554
|
}
|
|
@@ -8564,12 +8578,12 @@
|
|
|
8564
8578
|
}
|
|
8565
8579
|
if (isOneFound) {
|
|
8566
8580
|
throw { type: 'Runtime',
|
|
8567
|
-
message: "No matching definition was found for `"
|
|
8581
|
+
message: "No matching definition was found for `".concat(this.format(args), "`"),
|
|
8568
8582
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8569
8583
|
}
|
|
8570
8584
|
else {
|
|
8571
8585
|
throw { type: 'Name',
|
|
8572
|
-
message: this.selector.toCSS().trim()
|
|
8586
|
+
message: "".concat(this.selector.toCSS().trim(), " is undefined"),
|
|
8573
8587
|
index: this.getIndex(), filename: this.fileInfo().filename };
|
|
8574
8588
|
}
|
|
8575
8589
|
},
|
|
@@ -8583,10 +8597,10 @@
|
|
|
8583
8597
|
}
|
|
8584
8598
|
},
|
|
8585
8599
|
format: function (args) {
|
|
8586
|
-
return this.selector.toCSS().trim()
|
|
8600
|
+
return "".concat(this.selector.toCSS().trim(), "(").concat(args ? args.map(function (a) {
|
|
8587
8601
|
var argValue = '';
|
|
8588
8602
|
if (a.name) {
|
|
8589
|
-
argValue += a.name
|
|
8603
|
+
argValue += "".concat(a.name, ":");
|
|
8590
8604
|
}
|
|
8591
8605
|
if (a.value.toCSS) {
|
|
8592
8606
|
argValue += a.value.toCSS();
|
|
@@ -8595,7 +8609,7 @@
|
|
|
8595
8609
|
argValue += '???';
|
|
8596
8610
|
}
|
|
8597
8611
|
return argValue;
|
|
8598
|
-
}).join(', ') : ''
|
|
8612
|
+
}).join(', ') : '', ")");
|
|
8599
8613
|
}
|
|
8600
8614
|
});
|
|
8601
8615
|
|
|
@@ -8705,7 +8719,7 @@
|
|
|
8705
8719
|
diff += '../';
|
|
8706
8720
|
}
|
|
8707
8721
|
for (i = 0; i < urlDirectories.length - 1; i++) {
|
|
8708
|
-
diff += urlDirectories[i]
|
|
8722
|
+
diff += "".concat(urlDirectories[i], "/");
|
|
8709
8723
|
}
|
|
8710
8724
|
return diff;
|
|
8711
8725
|
};
|
|
@@ -8730,13 +8744,13 @@
|
|
|
8730
8744
|
var i;
|
|
8731
8745
|
var baseUrlParts;
|
|
8732
8746
|
if (!urlParts) {
|
|
8733
|
-
throw new Error("Could not parse sheet href - '"
|
|
8747
|
+
throw new Error("Could not parse sheet href - '".concat(url, "'"));
|
|
8734
8748
|
}
|
|
8735
8749
|
// Stylesheets in IE don't always return the full path
|
|
8736
8750
|
if (baseUrl && (!urlParts[1] || urlParts[2])) {
|
|
8737
8751
|
baseUrlParts = baseUrl.match(urlPartsRegex);
|
|
8738
8752
|
if (!baseUrlParts) {
|
|
8739
|
-
throw new Error("Could not parse page url - '"
|
|
8753
|
+
throw new Error("Could not parse page url - '".concat(baseUrl, "'"));
|
|
8740
8754
|
}
|
|
8741
8755
|
urlParts[1] = urlParts[1] || baseUrlParts[1] || '';
|
|
8742
8756
|
if (!urlParts[2]) {
|
|
@@ -8865,7 +8879,7 @@
|
|
|
8865
8879
|
AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) {
|
|
8866
8880
|
if (options && !plugin.setOptions) {
|
|
8867
8881
|
return new LessError({
|
|
8868
|
-
message: "Options have been provided but the plugin "
|
|
8882
|
+
message: "Options have been provided but the plugin ".concat(name, " does not support any options.")
|
|
8869
8883
|
});
|
|
8870
8884
|
}
|
|
8871
8885
|
try {
|
|
@@ -8885,7 +8899,7 @@
|
|
|
8885
8899
|
if (plugin.minVersion) {
|
|
8886
8900
|
if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {
|
|
8887
8901
|
return new LessError({
|
|
8888
|
-
message: "Plugin "
|
|
8902
|
+
message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion))
|
|
8889
8903
|
});
|
|
8890
8904
|
}
|
|
8891
8905
|
}
|
|
@@ -9354,7 +9368,7 @@
|
|
|
9354
9368
|
if ((c instanceof Quoted) &&
|
|
9355
9369
|
(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {
|
|
9356
9370
|
var val = c.value.slice(1);
|
|
9357
|
-
return new Color(val, undefined, "#"
|
|
9371
|
+
return new Color(val, undefined, "#".concat(val));
|
|
9358
9372
|
}
|
|
9359
9373
|
if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {
|
|
9360
9374
|
c.value = undefined;
|
|
@@ -9491,7 +9505,7 @@
|
|
|
9491
9505
|
}
|
|
9492
9506
|
var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);
|
|
9493
9507
|
if (!fileSync.contents) {
|
|
9494
|
-
logger$1.warn("Skipped data-uri embedding of "
|
|
9508
|
+
logger$1.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found"));
|
|
9495
9509
|
return fallback(this, filePathNode || mimetypeNode);
|
|
9496
9510
|
}
|
|
9497
9511
|
var buf = fileSync.contents;
|
|
@@ -9499,8 +9513,8 @@
|
|
|
9499
9513
|
return fallback(this, filePathNode);
|
|
9500
9514
|
}
|
|
9501
9515
|
buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
|
|
9502
|
-
var uri = "data:"
|
|
9503
|
-
return new URL(new Quoted("\""
|
|
9516
|
+
var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment);
|
|
9517
|
+
return new URL(new Quoted("\"".concat(uri, "\""), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
|
|
9504
9518
|
} };
|
|
9505
9519
|
});
|
|
9506
9520
|
|
|
@@ -9696,8 +9710,11 @@
|
|
|
9696
9710
|
if (!(current instanceof Dimension)) {
|
|
9697
9711
|
if (Array.isArray(args[i].value)) {
|
|
9698
9712
|
Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
|
|
9713
|
+
continue;
|
|
9714
|
+
}
|
|
9715
|
+
else {
|
|
9716
|
+
throw { type: 'Argument', message: 'incompatible types' };
|
|
9699
9717
|
}
|
|
9700
|
-
continue;
|
|
9701
9718
|
}
|
|
9702
9719
|
currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();
|
|
9703
9720
|
unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
|
|
@@ -9722,7 +9739,7 @@
|
|
|
9722
9739
|
return order[0];
|
|
9723
9740
|
}
|
|
9724
9741
|
args = order.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
|
|
9725
|
-
return new Anonymous((isMin ? 'min' : 'max'
|
|
9742
|
+
return new Anonymous("".concat(isMin ? 'min' : 'max', "(").concat(args, ")"));
|
|
9726
9743
|
};
|
|
9727
9744
|
var number = {
|
|
9728
9745
|
min: function () {
|
|
@@ -9858,7 +9875,7 @@
|
|
|
9858
9875
|
throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
|
|
9859
9876
|
' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
|
|
9860
9877
|
}
|
|
9861
|
-
returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><"
|
|
9878
|
+
returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><".concat(gradientType, "Gradient id=\"g\" ").concat(gradientDirectionSvg, ">");
|
|
9862
9879
|
for (i = 0; i < stops.length; i += 1) {
|
|
9863
9880
|
if (stops[i] instanceof Expression) {
|
|
9864
9881
|
color = stops[i].value[0];
|
|
@@ -9873,12 +9890,12 @@
|
|
|
9873
9890
|
}
|
|
9874
9891
|
positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';
|
|
9875
9892
|
alpha = color.alpha;
|
|
9876
|
-
returner += "<stop offset=\""
|
|
9893
|
+
returner += "<stop offset=\"".concat(positionValue, "\" stop-color=\"").concat(color.toRGB(), "\"").concat(alpha < 1 ? " stop-opacity=\"".concat(alpha, "\"") : '', "/>");
|
|
9877
9894
|
}
|
|
9878
|
-
returner += "</"
|
|
9895
|
+
returner += "</".concat(gradientType, "Gradient><rect ").concat(rectangleDimension, " fill=\"url(#g)\" /></svg>");
|
|
9879
9896
|
returner = encodeURIComponent(returner);
|
|
9880
|
-
returner = "data:image/svg+xml,"
|
|
9881
|
-
return new URL(new Quoted("'"
|
|
9897
|
+
returner = "data:image/svg+xml,".concat(returner);
|
|
9898
|
+
return new URL(new Quoted("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
|
|
9882
9899
|
} };
|
|
9883
9900
|
});
|
|
9884
9901
|
|
|
@@ -9925,7 +9942,7 @@
|
|
|
9925
9942
|
unit: function (val, unit) {
|
|
9926
9943
|
if (!(val instanceof Dimension)) {
|
|
9927
9944
|
throw { type: 'Argument',
|
|
9928
|
-
message: "the first argument to unit must be a number"
|
|
9945
|
+
message: "the first argument to unit must be a number".concat(val instanceof Operation ? '. Have you forgotten parenthesis?' : '') };
|
|
9929
9946
|
}
|
|
9930
9947
|
if (unit) {
|
|
9931
9948
|
if (unit instanceof Keyword) {
|
|
@@ -9945,6 +9962,29 @@
|
|
|
9945
9962
|
}
|
|
9946
9963
|
};
|
|
9947
9964
|
|
|
9965
|
+
var styleExpression = function (args) {
|
|
9966
|
+
var _this = this;
|
|
9967
|
+
args = Array.prototype.slice.call(args);
|
|
9968
|
+
switch (args.length) {
|
|
9969
|
+
case 0: throw { type: 'Argument', message: 'one or more arguments required' };
|
|
9970
|
+
}
|
|
9971
|
+
var entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];
|
|
9972
|
+
args = entityList.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
|
|
9973
|
+
return new Variable("style(".concat(args, ")"));
|
|
9974
|
+
};
|
|
9975
|
+
var style$1 = {
|
|
9976
|
+
style: function () {
|
|
9977
|
+
var args = [];
|
|
9978
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9979
|
+
args[_i] = arguments[_i];
|
|
9980
|
+
}
|
|
9981
|
+
try {
|
|
9982
|
+
return styleExpression.call(this, args);
|
|
9983
|
+
}
|
|
9984
|
+
catch (e) { }
|
|
9985
|
+
},
|
|
9986
|
+
};
|
|
9987
|
+
|
|
9948
9988
|
var functions = (function (environment) {
|
|
9949
9989
|
var functions = { functionRegistry: functionRegistry, functionCaller: functionCaller };
|
|
9950
9990
|
// register functions
|
|
@@ -9959,6 +9999,7 @@
|
|
|
9959
9999
|
functionRegistry.addMultiple(string);
|
|
9960
10000
|
functionRegistry.addMultiple(svg());
|
|
9961
10001
|
functionRegistry.addMultiple(types);
|
|
10002
|
+
functionRegistry.addMultiple(style$1);
|
|
9962
10003
|
return functions;
|
|
9963
10004
|
});
|
|
9964
10005
|
|
|
@@ -9989,7 +10030,7 @@
|
|
|
9989
10030
|
}
|
|
9990
10031
|
value = new tree.Value([value]);
|
|
9991
10032
|
}
|
|
9992
|
-
return new tree.Declaration("@"
|
|
10033
|
+
return new tree.Declaration("@".concat(k), value, false, null, 0);
|
|
9993
10034
|
});
|
|
9994
10035
|
evalEnv.frames = [new tree.Ruleset(null, variables)];
|
|
9995
10036
|
}
|
|
@@ -10372,13 +10413,13 @@
|
|
|
10372
10413
|
if (this.sourceMap === undefined) {
|
|
10373
10414
|
return '';
|
|
10374
10415
|
}
|
|
10375
|
-
sourceMapURL = "data:application/json;base64,"
|
|
10416
|
+
sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap));
|
|
10376
10417
|
}
|
|
10377
10418
|
if (this.options.disableSourcemapAnnotation) {
|
|
10378
10419
|
return '';
|
|
10379
10420
|
}
|
|
10380
10421
|
if (sourceMapURL) {
|
|
10381
|
-
return "/*# sourceMappingURL="
|
|
10422
|
+
return "/*# sourceMappingURL=".concat(sourceMapURL, " */");
|
|
10382
10423
|
}
|
|
10383
10424
|
return '';
|
|
10384
10425
|
};
|
|
@@ -10505,7 +10546,7 @@
|
|
|
10505
10546
|
var importedEqualsRoot = fullPath === importManager.rootFilename;
|
|
10506
10547
|
if (importOptions.optional && e) {
|
|
10507
10548
|
callback(null, { rules: [] }, false, null);
|
|
10508
|
-
logger$1.info("The file "
|
|
10549
|
+
logger$1.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional."));
|
|
10509
10550
|
}
|
|
10510
10551
|
else {
|
|
10511
10552
|
// Inline imports aren't cached here.
|
|
@@ -10528,7 +10569,7 @@
|
|
|
10528
10569
|
};
|
|
10529
10570
|
var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);
|
|
10530
10571
|
if (!fileManager) {
|
|
10531
|
-
fileParsedFunc({ message: "Could not find a file-manager for "
|
|
10572
|
+
fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) });
|
|
10532
10573
|
return;
|
|
10533
10574
|
}
|
|
10534
10575
|
var loadFileCallback = function (loadedFile) {
|
|
@@ -10751,7 +10792,7 @@
|
|
|
10751
10792
|
return render;
|
|
10752
10793
|
}
|
|
10753
10794
|
|
|
10754
|
-
var version = "4.2.
|
|
10795
|
+
var version = "4.2.1";
|
|
10755
10796
|
|
|
10756
10797
|
function parseNodeVersion(version) {
|
|
10757
10798
|
var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len
|
|
@@ -10778,7 +10819,7 @@
|
|
|
10778
10819
|
importManager = ImportManager(environment);
|
|
10779
10820
|
var render = Render(environment, parseTree);
|
|
10780
10821
|
var parse = Parse(environment, parseTree, importManager);
|
|
10781
|
-
var v = parseNodeVersion_1("v"
|
|
10822
|
+
var v = parseNodeVersion_1("v".concat(version));
|
|
10782
10823
|
var initial = {
|
|
10783
10824
|
version: [v.major, v.minor, v.patch],
|
|
10784
10825
|
data: data,
|
|
@@ -10859,7 +10900,7 @@
|
|
|
10859
10900
|
if (typeof xhr.overrideMimeType === 'function') {
|
|
10860
10901
|
xhr.overrideMimeType('text/css');
|
|
10861
10902
|
}
|
|
10862
|
-
logger.debug("XHR: Getting '"
|
|
10903
|
+
logger.debug("XHR: Getting '".concat(url, "'"));
|
|
10863
10904
|
xhr.open('GET', url, async);
|
|
10864
10905
|
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
|
|
10865
10906
|
xhr.send(null);
|
|
@@ -10916,7 +10957,7 @@
|
|
|
10916
10957
|
return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: new Date() } });
|
|
10917
10958
|
}
|
|
10918
10959
|
catch (e) {
|
|
10919
|
-
return reject({ filename: href, message: "Error loading file "
|
|
10960
|
+
return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e.message) });
|
|
10920
10961
|
}
|
|
10921
10962
|
}
|
|
10922
10963
|
self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {
|
|
@@ -10925,7 +10966,7 @@
|
|
|
10925
10966
|
// Use remote copy (re-parse)
|
|
10926
10967
|
resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified } });
|
|
10927
10968
|
}, function doXHRError(status, url) {
|
|
10928
|
-
reject({ type: 'File', message: "'"
|
|
10969
|
+
reject({ type: 'File', message: "'".concat(url, "' wasn't found (").concat(status, ")"), href: href });
|
|
10929
10970
|
});
|
|
10930
10971
|
});
|
|
10931
10972
|
}
|
|
@@ -10998,7 +11039,7 @@
|
|
|
10998
11039
|
|
|
10999
11040
|
var ErrorReporting = (function (window, less, options) {
|
|
11000
11041
|
function errorHTML(e, rootHref) {
|
|
11001
|
-
var id = "less-error-message:"
|
|
11042
|
+
var id = "less-error-message:".concat(extractId(rootHref || ''));
|
|
11002
11043
|
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
|
|
11003
11044
|
var elem = window.document.createElement('div');
|
|
11004
11045
|
var timer;
|
|
@@ -11008,8 +11049,8 @@
|
|
|
11008
11049
|
var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1];
|
|
11009
11050
|
elem.id = id;
|
|
11010
11051
|
elem.className = 'less-error-message';
|
|
11011
|
-
content = "<h3>"
|
|
11012
|
-
|
|
11052
|
+
content = "<h3>".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file') +
|
|
11053
|
+
"</h3><p>in <a href=\"".concat(filename, "\">").concat(filenameNoPath, "</a> ");
|
|
11013
11054
|
var errorline = function (e, i, classname) {
|
|
11014
11055
|
if (e.extract[i] !== undefined) {
|
|
11015
11056
|
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
|
@@ -11021,10 +11062,10 @@
|
|
|
11021
11062
|
errorline(e, 0, '');
|
|
11022
11063
|
errorline(e, 1, 'line');
|
|
11023
11064
|
errorline(e, 2, '');
|
|
11024
|
-
content += "on line "
|
|
11065
|
+
content += "on line ".concat(e.line, ", column ").concat(e.column + 1, ":</p><ul>").concat(errors.join(''), "</ul>");
|
|
11025
11066
|
}
|
|
11026
11067
|
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
|
11027
|
-
content += "<br/>Stack Trace</br />"
|
|
11068
|
+
content += "<br/>Stack Trace</br />".concat(e.stack.split('\n').slice(1).join('<br/>'));
|
|
11028
11069
|
}
|
|
11029
11070
|
elem.innerHTML = content;
|
|
11030
11071
|
// CSS for error messages
|
|
@@ -11094,7 +11135,7 @@
|
|
|
11094
11135
|
}
|
|
11095
11136
|
}
|
|
11096
11137
|
function removeErrorHTML(path) {
|
|
11097
|
-
var node = window.document.getElementById("less-error-message:"
|
|
11138
|
+
var node = window.document.getElementById("less-error-message:".concat(extractId(path)));
|
|
11098
11139
|
if (node) {
|
|
11099
11140
|
node.parentNode.removeChild(node);
|
|
11100
11141
|
}
|
|
@@ -11112,7 +11153,7 @@
|
|
|
11112
11153
|
var template = '{line} {content}';
|
|
11113
11154
|
var filename = e.filename || rootHref;
|
|
11114
11155
|
var errors = [];
|
|
11115
|
-
var content = (e.type || 'Syntax'
|
|
11156
|
+
var content = "".concat(e.type || 'Syntax', "Error: ").concat(e.message || 'There is an error in your .less file', " in ").concat(filename);
|
|
11116
11157
|
var errorline = function (e, i, classname) {
|
|
11117
11158
|
if (e.extract[i] !== undefined) {
|
|
11118
11159
|
errors.push(template.replace(/\{line\}/, (parseInt(e.line, 10) || 0) + (i - 1))
|
|
@@ -11124,10 +11165,10 @@
|
|
|
11124
11165
|
errorline(e, 0, '');
|
|
11125
11166
|
errorline(e, 1, 'line');
|
|
11126
11167
|
errorline(e, 2, '');
|
|
11127
|
-
content += " on line "
|
|
11168
|
+
content += " on line ".concat(e.line, ", column ").concat(e.column + 1, ":\n").concat(errors.join('\n'));
|
|
11128
11169
|
}
|
|
11129
11170
|
if (e.stack && (e.extract || options.logLevel >= 4)) {
|
|
11130
|
-
content += "\nStack Trace\n"
|
|
11171
|
+
content += "\nStack Trace\n".concat(e.stack);
|
|
11131
11172
|
}
|
|
11132
11173
|
less.logger.error(content);
|
|
11133
11174
|
}
|
|
@@ -11160,24 +11201,24 @@
|
|
|
11160
11201
|
return {
|
|
11161
11202
|
setCSS: function (path, lastModified, modifyVars, styles) {
|
|
11162
11203
|
if (cache) {
|
|
11163
|
-
logger.info("saving "
|
|
11204
|
+
logger.info("saving ".concat(path, " to cache."));
|
|
11164
11205
|
try {
|
|
11165
11206
|
cache.setItem(path, styles);
|
|
11166
|
-
cache.setItem(path
|
|
11207
|
+
cache.setItem("".concat(path, ":timestamp"), lastModified);
|
|
11167
11208
|
if (modifyVars) {
|
|
11168
|
-
cache.setItem(path
|
|
11209
|
+
cache.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars));
|
|
11169
11210
|
}
|
|
11170
11211
|
}
|
|
11171
11212
|
catch (e) {
|
|
11172
11213
|
// TODO - could do with adding more robust error handling
|
|
11173
|
-
logger.error("failed to save \""
|
|
11214
|
+
logger.error("failed to save \"".concat(path, "\" to local storage for caching."));
|
|
11174
11215
|
}
|
|
11175
11216
|
}
|
|
11176
11217
|
},
|
|
11177
11218
|
getCSS: function (path, webInfo, modifyVars) {
|
|
11178
11219
|
var css = cache && cache.getItem(path);
|
|
11179
|
-
var timestamp = cache && cache.getItem(path
|
|
11180
|
-
var vars = cache && cache.getItem(path
|
|
11220
|
+
var timestamp = cache && cache.getItem("".concat(path, ":timestamp"));
|
|
11221
|
+
var vars = cache && cache.getItem("".concat(path, ":vars"));
|
|
11181
11222
|
modifyVars = modifyVars || {};
|
|
11182
11223
|
vars = vars || '{}'; // if not set, treat as the JSON representation of an empty object
|
|
11183
11224
|
if (timestamp && webInfo.lastModified &&
|
|
@@ -11428,19 +11469,19 @@
|
|
|
11428
11469
|
return;
|
|
11429
11470
|
}
|
|
11430
11471
|
if (webInfo.local) {
|
|
11431
|
-
less.logger.info("Loading "
|
|
11472
|
+
less.logger.info("Loading ".concat(sheet.href, " from cache."));
|
|
11432
11473
|
}
|
|
11433
11474
|
else {
|
|
11434
|
-
less.logger.info("Rendered "
|
|
11475
|
+
less.logger.info("Rendered ".concat(sheet.href, " successfully."));
|
|
11435
11476
|
}
|
|
11436
11477
|
browser.createCSS(window.document, css, sheet);
|
|
11437
|
-
less.logger.info("CSS for "
|
|
11478
|
+
less.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(new Date() - endTime, "ms"));
|
|
11438
11479
|
// Count completed sheet
|
|
11439
11480
|
remainingSheets--;
|
|
11440
11481
|
// Check if the last remaining sheet was processed and then call the promise
|
|
11441
11482
|
if (remainingSheets === 0) {
|
|
11442
11483
|
totalMilliseconds = new Date() - startTime;
|
|
11443
|
-
less.logger.info("Less has finished. CSS generated in "
|
|
11484
|
+
less.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms"));
|
|
11444
11485
|
resolve({
|
|
11445
11486
|
startTime: startTime,
|
|
11446
11487
|
endTime: endTime,
|
|
@@ -11514,4 +11555,4 @@
|
|
|
11514
11555
|
|
|
11515
11556
|
return less;
|
|
11516
11557
|
|
|
11517
|
-
}))
|
|
11558
|
+
}));
|