Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.1.3 #3722

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 65 additions & 44 deletions dist/less.js
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/**
* Less - Leaner CSS v4.1.2
* Less - Leaner CSS v4.1.3
* http://lesscss.org
*
* Copyright (c) 2009-2021, Alexis Sellier <[email protected]>
* Copyright (c) 2009-2022, Alexis Sellier <[email protected]>
* Licensed under the Apache-2.0 License.
*
* @license Apache-2.0
Expand Down Expand Up @@ -80,6 80,9 @@
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
}
function addDataAttr(options, tag) {
if (!tag) {
return;
} // in case of tag is null or undefined
for (var opt in tag.dataset) {
if (tag.dataset.hasOwnProperty(opt)) {
if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {
Expand Down Expand Up @@ -1599,41 1602,38 @@
}
});

var debugInfo = /** @class */ (function () {
function debugInfo(context, ctx, lineSeparator) {
var result = '';
if (context.dumpLineNumbers && !context.compress) {
switch (context.dumpLineNumbers) {
case 'comments':
result = debugInfo.asComment(ctx);
break;
case 'mediaquery':
result = debugInfo.asMediaQuery(ctx);
break;
case 'all':
result = debugInfo.asComment(ctx) (lineSeparator || '') debugInfo.asMediaQuery(ctx);
break;
}
}
return result;
function asComment(ctx) {
return "/* line " ctx.debugInfo.lineNumber ", " ctx.debugInfo.fileName " */\n";
}
function asMediaQuery(ctx) {
var filenameWithProtocol = ctx.debugInfo.fileName;
if (!/^[a-z] :\/\//i.test(filenameWithProtocol)) {
filenameWithProtocol = "file://" filenameWithProtocol;
}
debugInfo.asComment = function (ctx) {
return "/* line " ctx.debugInfo.lineNumber ", " ctx.debugInfo.fileName " */\n";
};
debugInfo.asMediaQuery = function (ctx) {
var filenameWithProtocol = ctx.debugInfo.fileName;
if (!/^[a-z] :\/\//i.test(filenameWithProtocol)) {
filenameWithProtocol = "file://" filenameWithProtocol;
return "@media -sass-debug-info{filename{font-family:" filenameWithProtocol.replace(/([.:\/\\])/g, function (a) {
if (a == '\\') {
a = '\/';
}
return "@media -sass-debug-info{filename{font-family:" filenameWithProtocol.replace(/([.:\/\\])/g, function (a) {
if (a == '\\') {
a = '\/';
}
return "\\" a;
}) "}line{font-family:\\00003" ctx.debugInfo.lineNumber "}}\n";
};
return debugInfo;
}());
return "\\" a;
}) "}line{font-family:\\00003" ctx.debugInfo.lineNumber "}}\n";
}
function debugInfo(context, ctx, lineSeparator) {
var result = '';
if (context.dumpLineNumbers && !context.compress) {
switch (context.dumpLineNumbers) {
case 'comments':
result = asComment(ctx);
break;
case 'mediaquery':
result = asMediaQuery(ctx);
break;
case 'all':
result = asComment(ctx) (lineSeparator || '') asMediaQuery(ctx);
break;
}
}
return result;
}

var Comment = function (value, isLineComment, index, currentFileInfo) {
this.value = value;
Expand Down Expand Up @@ -3387,15 3387,16 @@
}
});

var Attribute = function (key, op, value) {
var Attribute = function (key, op, value, cif) {
this.key = key;
this.op = op;
this.value = value;
this.cif = cif;
};
Attribute.prototype = Object.assign(new Node(), {
type: 'Attribute',
eval: function (context) {
return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value);
return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value, this.cif);
},
genCSS: function (context, output) {
output.add(this.toCSS(context));
Expand All @@ -3406,6 3407,9 @@
value = this.op;
value = (this.value.toCSS ? this.value.toCSS(context) : this.value);
}
if (this.cif) {
value = value " " this.cif;
}
return "[" value "]";
}
});
Expand Down Expand Up @@ -6654,11 6658,20 @@
//
parse: function (str, callback, additionalData) {
var root;
var error = null;
var err = null;
var globalVars;
var modifyVars;
var ignored;
var preText = '';
// Optionally disable @plugin parsing
if (additionalData && additionalData.disablePluginRule) {
parsers.plugin = function () {
var dir = parserInput.$re(/^@plugin?\s /);
if (dir) {
error('@plugin statements are not allowed when disablePluginRule is set to true');
}
};
}
globalVars = (additionalData && additionalData.globalVars) ? Parser.serializeVars(additionalData.globalVars) "\n" : '';
modifyVars = (additionalData && additionalData.modifyVars) ? "\n" Parser.serializeVars(additionalData.modifyVars) : '';
if (context.pluginManager) {
Expand Down Expand Up @@ -6723,15 6736,15 @@
message = '. Possibly missing something';
}
}
error = new LessError({
err = new LessError({
type: 'Parse',
message: message,
index: endInfo.furthest,
filename: fileInfo.filename
}, imports);
}
var finish = function (e) {
e = error || e || imports.error;
e = err || e || imports.error;
if (e) {
if (!(e instanceof LessError)) {
e = new LessError(e, imports, fileInfo.filename);
Expand Down Expand Up @@ -7808,15 7821,23 @@
var key;
var val;
var op;
//
// case-insensitive flag
// e.g. [attr operator value i]
//
var cif;
if (!(key = entities.variableCurly())) {
key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.) /);
}
op = parserInput.$re(/^[|~*$^]?=/);
if (op) {
val = entities.quoted() || parserInput.$re(/^[0-9] %/) || parserInput.$re(/^[\w-] /) || entities.variableCurly();
if (val) {
cif = parserInput.$re(/^[iIsS]/);
}
}
expectChar(']');
return new (tree.Attribute)(key, op, val);
return new (tree.Attribute)(key, op, val, cif);
},
//
// The `block` rule is used by `ruleset` and `mixin.definition`.
Expand Down Expand Up @@ -8063,7 8084,7 @@
var path;
var features;
var index = parserInput.i;
var dir = parserInput.$re(/^@import?\s /);
var dir = parserInput.$re(/^@import\s /);
if (dir) {
var options = (dir ? this.importOptions() : null) || {};
if ((path = this.entities.quoted() || this.entities.url())) {
Expand Down Expand Up @@ -8214,7 8235,7 @@
var args;
var options;
var index = parserInput.i;
var dir = parserInput.$re(/^@plugin?\s /);
var dir = parserInput.$re(/^@plugin\s /);
if (dir) {
args = this.pluginArgs();
if (args) {
Expand Down Expand Up @@ -10575,7 10596,7 @@
return render;
}

var version = "4.1.2";
var version = "4.1.3";

function parseNodeVersion(version) {
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
Expand Down
6 changes: 3 additions & 3 deletions dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
{
"name": "@less/root",
"private": true,
"version": "3.13.0",
"version": "4.1.3",
"description": "Less monorepo",
"homepage": "http://lesscss.org",
"scripts": {
Expand Down
Loading