less 3.13.1 → 4.1.0
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 +1 -1
- package/bin/lessc +14 -3
- package/dist/less.js +11156 -11157
- package/dist/less.min.js +3 -3
- package/dist/less.min.js.map +1 -1
- package/lib/less/constants.js +2 -2
- package/lib/less/constants.js.map +1 -1
- package/lib/less/contexts.js +88 -110
- package/lib/less/contexts.js.map +1 -1
- package/lib/less/data/index.js +3 -5
- package/lib/less/data/index.js.map +1 -1
- package/lib/less/default-options.js +57 -53
- package/lib/less/default-options.js.map +1 -1
- package/lib/less/environment/abstract-file-manager.js +6 -6
- package/lib/less/environment/abstract-file-manager.js.map +1 -1
- package/lib/less/environment/abstract-plugin-loader.js +7 -13
- package/lib/less/environment/abstract-plugin-loader.js.map +1 -1
- package/lib/less/environment/environment.js +9 -11
- package/lib/less/environment/environment.js.map +1 -1
- package/lib/less/functions/boolean.js +14 -6
- package/lib/less/functions/boolean.js.map +1 -1
- package/lib/less/functions/color-blending.js +2 -4
- package/lib/less/functions/color-blending.js.map +1 -1
- package/lib/less/functions/color.js +41 -9
- package/lib/less/functions/color.js.map +1 -1
- package/lib/less/functions/data-uri.js +5 -26
- package/lib/less/functions/data-uri.js.map +1 -1
- package/lib/less/functions/default.js +2 -4
- package/lib/less/functions/default.js.map +1 -1
- package/lib/less/functions/function-caller.js +19 -35
- package/lib/less/functions/function-caller.js.map +1 -1
- package/lib/less/functions/index.js +14 -16
- package/lib/less/functions/index.js.map +1 -1
- package/lib/less/functions/list.js +21 -12
- package/lib/less/functions/list.js.map +1 -1
- package/lib/less/functions/math-helper.js +2 -4
- package/lib/less/functions/math-helper.js.map +1 -1
- package/lib/less/functions/math.js +2 -4
- package/lib/less/functions/math.js.map +1 -1
- package/lib/less/functions/number.js +12 -8
- package/lib/less/functions/number.js.map +1 -1
- package/lib/less/functions/string.js +4 -6
- package/lib/less/functions/string.js.map +1 -1
- package/lib/less/functions/svg.js +6 -8
- package/lib/less/functions/svg.js.map +1 -1
- package/lib/less/functions/types.js +9 -11
- package/lib/less/functions/types.js.map +1 -1
- package/lib/less/import-manager.js +6 -27
- package/lib/less/import-manager.js.map +1 -1
- package/lib/less/index.js +48 -82
- package/lib/less/index.js.map +1 -1
- package/lib/less/less-error.js +6 -24
- package/lib/less/less-error.js.map +1 -1
- package/lib/less/parse-tree.js +8 -8
- package/lib/less/parse-tree.js.map +1 -1
- package/lib/less/parse.js +11 -31
- package/lib/less/parse.js.map +1 -1
- package/lib/less/parser/chunker.js +4 -2
- package/lib/less/parser/chunker.js.map +1 -1
- package/lib/less/parser/parser-input.js +2 -4
- package/lib/less/parser/parser-input.js.map +1 -1
- package/lib/less/parser/parser.js +8 -29
- package/lib/less/parser/parser.js.map +1 -1
- package/lib/less/plugin-manager.js +2 -3
- package/lib/less/plugin-manager.js.map +1 -1
- package/lib/less/render.js +6 -22
- package/lib/less/render.js.map +1 -1
- package/lib/less/source-map-builder.js +4 -2
- package/lib/less/source-map-builder.js.map +1 -1
- package/lib/less/source-map-output.js +5 -7
- package/lib/less/source-map-output.js.map +1 -1
- package/lib/less/transform-tree.js +9 -9
- package/lib/less/transform-tree.js.map +1 -1
- package/lib/less/tree/anonymous.js +19 -20
- package/lib/less/tree/anonymous.js.map +1 -1
- package/lib/less/tree/assignment.js +22 -23
- package/lib/less/tree/assignment.js.map +1 -1
- package/lib/less/tree/atrule.js +105 -116
- package/lib/less/tree/atrule.js.map +1 -1
- package/lib/less/tree/attribute.js +18 -19
- package/lib/less/tree/attribute.js.map +1 -1
- package/lib/less/tree/call.js +68 -69
- package/lib/less/tree/call.js.map +1 -1
- package/lib/less/tree/color.js +163 -172
- package/lib/less/tree/color.js.map +1 -1
- package/lib/less/tree/combinator.js +9 -10
- package/lib/less/tree/combinator.js.map +1 -1
- package/lib/less/tree/comment.js +15 -16
- package/lib/less/tree/comment.js.map +1 -1
- package/lib/less/tree/condition.js +29 -30
- package/lib/less/tree/condition.js.map +1 -1
- package/lib/less/tree/debug-info.js +32 -30
- package/lib/less/tree/debug-info.js.map +1 -1
- package/lib/less/tree/declaration.js +71 -95
- package/lib/less/tree/declaration.js.map +1 -1
- package/lib/less/tree/detached-ruleset.js +18 -38
- package/lib/less/tree/detached-ruleset.js.map +1 -1
- package/lib/less/tree/dimension.js +126 -129
- package/lib/less/tree/dimension.js.map +1 -1
- package/lib/less/tree/element.js +40 -41
- package/lib/less/tree/element.js.map +1 -1
- package/lib/less/tree/expression.js +55 -74
- package/lib/less/tree/expression.js.map +1 -1
- package/lib/less/tree/extend.js +28 -34
- package/lib/less/tree/extend.js.map +1 -1
- package/lib/less/tree/import.js +120 -140
- package/lib/less/tree/import.js.map +1 -1
- package/lib/less/tree/index.js +37 -39
- package/lib/less/tree/index.js.map +1 -1
- package/lib/less/tree/javascript.js +23 -24
- package/lib/less/tree/javascript.js.map +1 -1
- package/lib/less/tree/js-eval-node.js +51 -50
- package/lib/less/tree/js-eval-node.js.map +1 -1
- package/lib/less/tree/keyword.js +10 -11
- package/lib/less/tree/keyword.js.map +1 -1
- package/lib/less/tree/media.js +111 -131
- package/lib/less/tree/media.js.map +1 -1
- package/lib/less/tree/mixin-call.js +156 -160
- package/lib/less/tree/mixin-call.js.map +1 -1
- package/lib/less/tree/mixin-definition.js +164 -184
- package/lib/less/tree/mixin-definition.js.map +1 -1
- package/lib/less/tree/namespace-value.js +53 -57
- package/lib/less/tree/namespace-value.js.map +1 -1
- package/lib/less/tree/negative.js +16 -17
- package/lib/less/tree/negative.js.map +1 -1
- package/lib/less/tree/node.js +39 -39
- package/lib/less/tree/node.js.map +1 -1
- package/lib/less/tree/operation.js +41 -63
- package/lib/less/tree/operation.js.map +1 -1
- package/lib/less/tree/paren.js +13 -14
- package/lib/less/tree/paren.js.map +1 -1
- package/lib/less/tree/property.js +48 -49
- package/lib/less/tree/property.js.map +1 -1
- package/lib/less/tree/quoted.js +50 -51
- package/lib/less/tree/quoted.js.map +1 -1
- package/lib/less/tree/ruleset.js +665 -702
- package/lib/less/tree/ruleset.js.map +1 -1
- package/lib/less/tree/selector.js +105 -106
- package/lib/less/tree/selector.js.map +1 -1
- package/lib/less/tree/unicode-descriptor.js +5 -6
- package/lib/less/tree/unicode-descriptor.js.map +1 -1
- package/lib/less/tree/unit.js +99 -120
- package/lib/less/tree/unit.js.map +1 -1
- package/lib/less/tree/url.js +44 -45
- package/lib/less/tree/url.js.map +1 -1
- package/lib/less/tree/value.js +27 -26
- package/lib/less/tree/value.js.map +1 -1
- package/lib/less/tree/variable-call.js +30 -31
- package/lib/less/tree/variable-call.js.map +1 -1
- package/lib/less/tree/variable.js +46 -48
- package/lib/less/tree/variable.js.map +1 -1
- package/lib/less/utils.js +5 -23
- package/lib/less/utils.js.map +1 -1
- package/lib/less/visitors/extend-visitor.js +14 -41
- package/lib/less/visitors/extend-visitor.js.map +1 -1
- package/lib/less/visitors/import-sequencer.js +2 -7
- package/lib/less/visitors/import-sequencer.js.map +1 -1
- package/lib/less/visitors/import-visitor.js +7 -33
- package/lib/less/visitors/import-visitor.js.map +1 -1
- package/lib/less/visitors/index.js +7 -9
- package/lib/less/visitors/index.js.map +1 -1
- package/lib/less/visitors/join-selector-visitor.js +2 -4
- package/lib/less/visitors/join-selector-visitor.js.map +1 -1
- package/lib/less/visitors/to-css-visitor.js +4 -6
- package/lib/less/visitors/to-css-visitor.js.map +1 -1
- package/lib/less/visitors/visitor.js +4 -12
- package/lib/less/visitors/visitor.js.map +1 -1
- package/lib/less-browser/add-default-options.js +2 -4
- package/lib/less-browser/add-default-options.js.map +1 -1
- package/lib/less-browser/bootstrap.js +4 -6
- package/lib/less-browser/bootstrap.js.map +1 -1
- package/lib/less-browser/browser.js +2 -20
- package/lib/less-browser/browser.js.map +1 -1
- package/lib/less-browser/error-reporting.js +3 -24
- package/lib/less-browser/error-reporting.js.map +1 -1
- package/lib/less-browser/file-manager.js +17 -36
- package/lib/less-browser/file-manager.js.map +1 -1
- package/lib/less-browser/image-size.js +2 -4
- package/lib/less-browser/image-size.js.map +1 -1
- package/lib/less-browser/index.js +9 -11
- package/lib/less-browser/index.js.map +1 -1
- package/lib/less-browser/plugin-loader.js +10 -29
- package/lib/less-browser/plugin-loader.js.map +1 -1
- package/lib/less-node/file-manager.js +15 -34
- package/lib/less-node/file-manager.js.map +1 -1
- package/lib/less-node/image-size.js +4 -6
- package/lib/less-node/image-size.js.map +1 -1
- package/lib/less-node/index.js +10 -16
- package/lib/less-node/index.js.map +1 -1
- package/lib/less-node/plugin-loader.js +23 -42
- package/lib/less-node/plugin-loader.js.map +1 -1
- package/lib/less-node/url-file-manager.js +23 -38
- package/lib/less-node/url-file-manager.js.map +1 -1
- package/package.json +12 -9
- package/test/browser/less/errors/image-height-error.txt +1 -1
- package/test/browser/less/errors/image-size-error.txt +1 -1
- package/test/browser/less/errors/image-width-error.txt +1 -1
- package/test/index.js +28 -9
- package/test/less-test.js +36 -16
- package/tsconfig.json +1 -0
package/lib/less/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/less/constants.js"],"names":[],"mappings":";;;AACa,QAAA,IAAI,GAAG;IAChB,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,CAAC;IACT,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/less/constants.js"],"names":[],"mappings":";;;AACa,QAAA,IAAI,GAAG;IAChB,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,CAAC;IACT,6BAA6B;CAChC,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;CACT,CAAC","sourcesContent":["\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};"]}
|
package/lib/less/contexts.js
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
22
4
|
var contexts = {};
|
|
23
5
|
exports.default = contexts;
|
|
24
|
-
var Constants = __importStar(require("./constants"));
|
|
6
|
+
var Constants = tslib_1.__importStar(require("./constants"));
|
|
25
7
|
var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {
|
|
26
8
|
if (!original) {
|
|
27
9
|
return;
|
|
@@ -72,100 +54,96 @@ var evalCopyProperties = [
|
|
|
72
54
|
'importantScope',
|
|
73
55
|
'rewriteUrls' // option - whether to adjust URL's to be relative
|
|
74
56
|
];
|
|
57
|
+
contexts.Eval = function (options, frames) {
|
|
58
|
+
copyFromOriginal(options, this, evalCopyProperties);
|
|
59
|
+
if (typeof this.paths === 'string') {
|
|
60
|
+
this.paths = [this.paths];
|
|
61
|
+
}
|
|
62
|
+
this.frames = frames || [];
|
|
63
|
+
this.importantScope = this.importantScope || [];
|
|
64
|
+
};
|
|
65
|
+
contexts.Eval.prototype.enterCalc = function () {
|
|
66
|
+
if (!this.calcStack) {
|
|
67
|
+
this.calcStack = [];
|
|
68
|
+
}
|
|
69
|
+
this.calcStack.push(true);
|
|
70
|
+
this.inCalc = true;
|
|
71
|
+
};
|
|
72
|
+
contexts.Eval.prototype.exitCalc = function () {
|
|
73
|
+
this.calcStack.pop();
|
|
74
|
+
if (!this.calcStack.length) {
|
|
75
|
+
this.inCalc = false;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
contexts.Eval.prototype.inParenthesis = function () {
|
|
79
|
+
if (!this.parensStack) {
|
|
80
|
+
this.parensStack = [];
|
|
81
|
+
}
|
|
82
|
+
this.parensStack.push(true);
|
|
83
|
+
};
|
|
84
|
+
contexts.Eval.prototype.outOfParenthesis = function () {
|
|
85
|
+
this.parensStack.pop();
|
|
86
|
+
};
|
|
87
|
+
contexts.Eval.prototype.inCalc = false;
|
|
88
|
+
contexts.Eval.prototype.mathOn = true;
|
|
89
|
+
contexts.Eval.prototype.isMathOn = function (op) {
|
|
90
|
+
if (!this.mathOn) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (this.math > Constants.Math.PARENS_DIVISION) {
|
|
97
|
+
return this.parensStack && this.parensStack.length;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
};
|
|
101
|
+
contexts.Eval.prototype.pathRequiresRewrite = function (path) {
|
|
102
|
+
var isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;
|
|
103
|
+
return isRelative(path);
|
|
104
|
+
};
|
|
105
|
+
contexts.Eval.prototype.rewritePath = function (path, rootpath) {
|
|
106
|
+
var newPath;
|
|
107
|
+
rootpath = rootpath || '';
|
|
108
|
+
newPath = this.normalizePath(rootpath + path);
|
|
109
|
+
// If a path was explicit relative and the rootpath was not an absolute path
|
|
110
|
+
// we must ensure that the new path is also explicit relative.
|
|
111
|
+
if (isPathLocalRelative(path) &&
|
|
112
|
+
isPathRelative(rootpath) &&
|
|
113
|
+
isPathLocalRelative(newPath) === false) {
|
|
114
|
+
newPath = "./" + newPath;
|
|
115
|
+
}
|
|
116
|
+
return newPath;
|
|
117
|
+
};
|
|
118
|
+
contexts.Eval.prototype.normalizePath = function (path) {
|
|
119
|
+
var segments = path.split('/').reverse();
|
|
120
|
+
var segment;
|
|
121
|
+
path = [];
|
|
122
|
+
while (segments.length !== 0) {
|
|
123
|
+
segment = segments.pop();
|
|
124
|
+
switch (segment) {
|
|
125
|
+
case '.':
|
|
126
|
+
break;
|
|
127
|
+
case '..':
|
|
128
|
+
if ((path.length === 0) || (path[path.length - 1] === '..')) {
|
|
129
|
+
path.push(segment);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
path.pop();
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
default:
|
|
136
|
+
path.push(segment);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return path.join('/');
|
|
141
|
+
};
|
|
75
142
|
function isPathRelative(path) {
|
|
76
143
|
return !/^(?:[a-z-]+:|\/|#)/i.test(path);
|
|
77
144
|
}
|
|
78
145
|
function isPathLocalRelative(path) {
|
|
79
146
|
return path.charAt(0) === '.';
|
|
80
147
|
}
|
|
81
|
-
|
|
82
|
-
function Eval(options, frames) {
|
|
83
|
-
copyFromOriginal(options, this, evalCopyProperties);
|
|
84
|
-
if (typeof this.paths === 'string') {
|
|
85
|
-
this.paths = [this.paths];
|
|
86
|
-
}
|
|
87
|
-
this.frames = frames || [];
|
|
88
|
-
this.importantScope = this.importantScope || [];
|
|
89
|
-
this.inCalc = false;
|
|
90
|
-
this.mathOn = true;
|
|
91
|
-
}
|
|
92
|
-
Eval.prototype.enterCalc = function () {
|
|
93
|
-
if (!this.calcStack) {
|
|
94
|
-
this.calcStack = [];
|
|
95
|
-
}
|
|
96
|
-
this.calcStack.push(true);
|
|
97
|
-
this.inCalc = true;
|
|
98
|
-
};
|
|
99
|
-
Eval.prototype.exitCalc = function () {
|
|
100
|
-
this.calcStack.pop();
|
|
101
|
-
if (!this.calcStack.length) {
|
|
102
|
-
this.inCalc = false;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
Eval.prototype.inParenthesis = function () {
|
|
106
|
-
if (!this.parensStack) {
|
|
107
|
-
this.parensStack = [];
|
|
108
|
-
}
|
|
109
|
-
this.parensStack.push(true);
|
|
110
|
-
};
|
|
111
|
-
;
|
|
112
|
-
Eval.prototype.outOfParenthesis = function () {
|
|
113
|
-
this.parensStack.pop();
|
|
114
|
-
};
|
|
115
|
-
;
|
|
116
|
-
Eval.prototype.isMathOn = function (op) {
|
|
117
|
-
if (!this.mathOn) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (this.math > Constants.Math.PARENS_DIVISION) {
|
|
124
|
-
return this.parensStack && this.parensStack.length;
|
|
125
|
-
}
|
|
126
|
-
return true;
|
|
127
|
-
};
|
|
128
|
-
Eval.prototype.pathRequiresRewrite = function (path) {
|
|
129
|
-
var isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;
|
|
130
|
-
return isRelative(path);
|
|
131
|
-
};
|
|
132
|
-
Eval.prototype.rewritePath = function (path, rootpath) {
|
|
133
|
-
var newPath;
|
|
134
|
-
rootpath = rootpath || '';
|
|
135
|
-
newPath = this.normalizePath(rootpath + path);
|
|
136
|
-
// If a path was explicit relative and the rootpath was not an absolute path
|
|
137
|
-
// we must ensure that the new path is also explicit relative.
|
|
138
|
-
if (isPathLocalRelative(path) &&
|
|
139
|
-
isPathRelative(rootpath) &&
|
|
140
|
-
isPathLocalRelative(newPath) === false) {
|
|
141
|
-
newPath = "./" + newPath;
|
|
142
|
-
}
|
|
143
|
-
return newPath;
|
|
144
|
-
};
|
|
145
|
-
Eval.prototype.normalizePath = function (path) {
|
|
146
|
-
var segments = path.split('/').reverse();
|
|
147
|
-
var segment;
|
|
148
|
-
path = [];
|
|
149
|
-
while (segments.length !== 0) {
|
|
150
|
-
segment = segments.pop();
|
|
151
|
-
switch (segment) {
|
|
152
|
-
case '.':
|
|
153
|
-
break;
|
|
154
|
-
case '..':
|
|
155
|
-
if ((path.length === 0) || (path[path.length - 1] === '..')) {
|
|
156
|
-
path.push(segment);
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
path.pop();
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
|
-
default:
|
|
163
|
-
path.push(segment);
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return path.join('/');
|
|
168
|
-
};
|
|
169
|
-
return Eval;
|
|
170
|
-
}());
|
|
148
|
+
// todo - do the same for the toCSS ?
|
|
171
149
|
//# sourceMappingURL=contexts.js.map
|
package/lib/less/contexts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/less/contexts.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contexts.js","sourceRoot":"","sources":["../../src/less/contexts.js"],"names":[],"mappings":";;;AAAA,IAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,kBAAe,QAAQ,CAAC;AACxB,6DAAyC;AAEzC,IAAM,gBAAgB,GAAG,SAAS,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,gBAAgB;IACtF,IAAI,CAAC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IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,IAAI;IAClD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3C,IAAI,OAAO,CAAC;IAEZ,IAAI,GAAG,EAAE,CAAC;IACV,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;QACzB,QAAS,OAAO,EAAG;YACf,KAAK,GAAG;gBACJ,MAAM;YACV,KAAK,IAAI;gBACL,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE;oBACzD,IAAI,CAAC,IAAI,CAAE,OAAO,CAAE,CAAC;iBACxB;qBAAM;oBACH,IAAI,CAAC,GAAG,EAAE,CAAC;iBACd;gBACD,MAAM;YACV;gBACI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACnB,MAAM;SACb;KACJ;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,SAAS,cAAc,CAAC,IAAI;IACxB,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAI;IAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAClC,CAAC;AAED,qCAAqC","sourcesContent":["const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (original.hasOwnProperty(propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\ncontexts.Eval = function(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n};\n\ncontexts.Eval.prototype.enterCalc = function () {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n};\n\ncontexts.Eval.prototype.exitCalc = function () {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n};\n\ncontexts.Eval.prototype.inParenthesis = function () {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n};\n\ncontexts.Eval.prototype.outOfParenthesis = function () {\n this.parensStack.pop();\n};\n\ncontexts.Eval.prototype.inCalc = false;\ncontexts.Eval.prototype.mathOn = true;\ncontexts.Eval.prototype.isMathOn = function (op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n};\n\ncontexts.Eval.prototype.pathRequiresRewrite = function (path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n};\n\ncontexts.Eval.prototype.rewritePath = function (path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n};\n\ncontexts.Eval.prototype.normalizePath = function (path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n};\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\n// todo - do the same for the toCSS ?\n"]}
|
package/lib/less/data/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var colors_1 = tslib_1.__importDefault(require("./colors"));
|
|
5
|
+
var unit_conversions_1 = tslib_1.__importDefault(require("./unit-conversions"));
|
|
8
6
|
exports.default = { colors: colors_1.default, unitConversions: unit_conversions_1.default };
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/less/data/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/less/data/index.js"],"names":[],"mappings":";;;AAAA,4DAA8B;AAC9B,gFAAiD;AAEjD,kBAAe,EAAE,MAAM,kBAAA,EAAE,eAAe,4BAAA,EAAE,CAAC","sourcesContent":["import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n"]}
|
|
@@ -1,57 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// Export a new default each time
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
4
|
+
function default_1() {
|
|
5
|
+
return {
|
|
6
|
+
/* Inline Javascript - @plugin still allowed */
|
|
7
|
+
javascriptEnabled: false,
|
|
8
|
+
/* Outputs a makefile import dependency list to stdout. */
|
|
9
|
+
depends: false,
|
|
10
|
+
/* (DEPRECATED) Compress using less built-in compression.
|
|
11
|
+
* This does an okay job but does not utilise all the tricks of
|
|
12
|
+
* dedicated css compression. */
|
|
13
|
+
compress: false,
|
|
14
|
+
/* Runs the less parser and just reports errors without any output. */
|
|
15
|
+
lint: false,
|
|
16
|
+
/* Sets available include paths.
|
|
17
|
+
* If the file in an @import rule does not exist at that exact location,
|
|
18
|
+
* less will look for it at the location(s) passed to this option.
|
|
19
|
+
* You might use this for instance to specify a path to a library which
|
|
20
|
+
* you want to be referenced simply and relatively in the less files. */
|
|
21
|
+
paths: [],
|
|
22
|
+
/* color output in the terminal */
|
|
23
|
+
color: true,
|
|
24
|
+
/* The strictImports controls whether the compiler will allow an @import inside of either
|
|
25
|
+
* @media blocks or (a later addition) other selector blocks.
|
|
26
|
+
* See: https://github.com/less/less.js/issues/656 */
|
|
27
|
+
strictImports: false,
|
|
28
|
+
/* Allow Imports from Insecure HTTPS Hosts */
|
|
29
|
+
insecure: false,
|
|
30
|
+
/* Allows you to add a path to every generated import and url in your css.
|
|
31
|
+
* This does not affect less import statements that are processed, just ones
|
|
32
|
+
* that are left in the output css. */
|
|
33
|
+
rootpath: '',
|
|
34
|
+
/* By default URLs are kept as-is, so if you import a file in a sub-directory
|
|
35
|
+
* that references an image, exactly the same URL will be output in the css.
|
|
36
|
+
* This option allows you to re-write URL's in imported files so that the
|
|
37
|
+
* URL is always relative to the base imported file */
|
|
38
|
+
rewriteUrls: false,
|
|
39
|
+
/* How to process math
|
|
40
|
+
* 0 always - eagerly try to solve all operations
|
|
41
|
+
* 1 parens-division - require parens for division "/"
|
|
42
|
+
* 2 parens | strict - require parens for all operations
|
|
43
|
+
* 3 strict-legacy - legacy strict behavior (super-strict)
|
|
44
|
+
*/
|
|
45
|
+
math: 1,
|
|
46
|
+
/* Without this option, less attempts to guess at the output unit when it does maths. */
|
|
47
|
+
strictUnits: false,
|
|
48
|
+
/* Effectively the declaration is put at the top of your base Less file,
|
|
49
|
+
* meaning it can be used but it also can be overridden if this variable
|
|
50
|
+
* is defined in the file. */
|
|
51
|
+
globalVars: null,
|
|
52
|
+
/* As opposed to the global variable option, this puts the declaration at the
|
|
53
|
+
* end of your base file, meaning it will override anything defined in your Less file. */
|
|
54
|
+
modifyVars: null,
|
|
55
|
+
/* This option allows you to specify a argument to go on to every URL. */
|
|
56
|
+
urlArgs: ''
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
exports.default = default_1;
|
|
60
|
+
;
|
|
57
61
|
//# sourceMappingURL=default-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-options.js","sourceRoot":"","sources":["../../src/less/default-options.js"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"default-options.js","sourceRoot":"","sources":["../../src/less/default-options.js"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC;IACI,OAAO;QACH,+CAA+C;QAC/C,iBAAiB,EAAE,KAAK;QAExB,0DAA0D;QAC1D,OAAO,EAAE,KAAK;QAEd;;wCAEgC;QAChC,QAAQ,EAAE,KAAK;QAEf,sEAAsE;QACtE,IAAI,EAAE,KAAK;QAEX;;;;gFAIwE;QACxE,KAAK,EAAE,EAAE;QAET,kCAAkC;QAClC,KAAK,EAAE,IAAI;QAEX;;6DAEqD;QACrD,aAAa,EAAE,KAAK;QAEpB,6CAA6C;QAC7C,QAAQ,EAAE,KAAK;QAEf;;8CAEsC;QACtC,QAAQ,EAAE,EAAE;QAEZ;;;8DAGsD;QACtD,WAAW,EAAE,KAAK;QAElB;;;;;WAKG;QACH,IAAI,EAAE,CAAC;QAEP,wFAAwF;QACxF,WAAW,EAAE,KAAK;QAElB;;qCAE6B;QAC7B,UAAU,EAAE,IAAI;QAEhB;iGACyF;QACzF,UAAU,EAAE,IAAI;QAEhB,0EAA0E;QAC1E,OAAO,EAAE,EAAE;KACd,CAAA;AACL,CAAC;AApED,4BAoEC;AAAA,CAAC","sourcesContent":["// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n};"]}
|
|
@@ -23,9 +23,12 @@ var AbstractFileManager = /** @class */ (function () {
|
|
|
23
23
|
AbstractFileManager.prototype.tryAppendLessExtension = function (path) {
|
|
24
24
|
return this.tryAppendExtension(path, '.less');
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
AbstractFileManager.prototype.supportsSync = function () {
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () {
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
29
32
|
AbstractFileManager.prototype.isPathAbsolute = function (filename) {
|
|
30
33
|
return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename);
|
|
31
34
|
};
|
|
@@ -36,7 +39,6 @@ var AbstractFileManager = /** @class */ (function () {
|
|
|
36
39
|
}
|
|
37
40
|
return basePath + laterPath;
|
|
38
41
|
};
|
|
39
|
-
;
|
|
40
42
|
AbstractFileManager.prototype.pathDiff = function (url, baseUrl) {
|
|
41
43
|
// diff between two paths to create a relative path
|
|
42
44
|
var urlParts = this.extractUrlParts(url);
|
|
@@ -65,7 +67,6 @@ var AbstractFileManager = /** @class */ (function () {
|
|
|
65
67
|
}
|
|
66
68
|
return diff;
|
|
67
69
|
};
|
|
68
|
-
;
|
|
69
70
|
// helper function, not part of API
|
|
70
71
|
AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) {
|
|
71
72
|
// urlParts[1] = protocol://hostname/ OR /
|
|
@@ -115,7 +116,6 @@ var AbstractFileManager = /** @class */ (function () {
|
|
|
115
116
|
returner.url = returner.fileUrl + (urlParts[5] || '');
|
|
116
117
|
return returner;
|
|
117
118
|
};
|
|
118
|
-
;
|
|
119
119
|
return AbstractFileManager;
|
|
120
120
|
}());
|
|
121
121
|
exports.default = AbstractFileManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-file-manager.js","sourceRoot":"","sources":["../../../src/less/environment/abstract-file-manager.js"],"names":[],"mappings":";;AAAA;IAAA;
|
|
1
|
+
{"version":3,"file":"abstract-file-manager.js","sourceRoot":"","sources":["../../../src/less/environment/abstract-file-manager.js"],"names":[],"mappings":";;AAAA;IAAA;IAmIA,CAAC;IAlIG,qCAAO,GAAP,UAAQ,QAAQ;QACZ,IAAI,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC,EAAE;YACP,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACnC;QACD,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,EAAE;YACP,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClC;QACD,IAAI,CAAC,GAAG,CAAC,EAAE;YACP,OAAO,EAAE,CAAC;SACb;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,gDAAkB,GAAlB,UAAmB,IAAI,EAAE,GAAG;QACxB,OAAO,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;IACnE,CAAC;IAED,oDAAsB,GAAtB,UAAuB,IAAI;QACvB,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,0CAAY,GAAZ;QACI,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,qDAAuB,GAAvB;QACI,OAAO,KAAK,CAAC;IACjB,CA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,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC;IACpB,CAAC;IACL,0BAAC;AAAD,CAAC,AAnID,IAmIC;AAED,kBAAe,mBAAmB,CAAC","sourcesContent":["class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([\\?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n }\n\n supportsSync() {\n return false;\n }\n\n alwaysMakePathsAbsolute() {\n return false;\n }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n }\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n\n const urlParts = this.extractUrlParts(url);\n\n const baseUrlParts = this.extractUrlParts(baseUrl);\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n }\n\n // helper function, not part of API\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^\\/\\?#]*\\/)|([\\/\\\\]))?((?:[^\\/\\\\\\?#]*[\\/\\\\])*)([^\\/\\\\\\?#]*)([#\\?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n }\n}\n\nexport default AbstractFileManager;\n"]}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var function_registry_1 = tslib_1.__importDefault(require("../functions/function-registry"));
|
|
5
|
+
var less_error_1 = tslib_1.__importDefault(require("../less-error"));
|
|
8
6
|
var AbstractPluginLoader = /** @class */ (function () {
|
|
9
7
|
function AbstractPluginLoader() {
|
|
10
8
|
// Implemented by Node.js plugin loader
|
|
11
|
-
this.require = function () {
|
|
9
|
+
this.require = function () {
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
12
12
|
}
|
|
13
13
|
AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) {
|
|
14
|
-
var loader;
|
|
15
|
-
var registry;
|
|
16
|
-
var pluginObj;
|
|
17
|
-
var localModule;
|
|
18
|
-
var pluginManager;
|
|
19
|
-
var filename;
|
|
20
|
-
var result;
|
|
14
|
+
var loader, registry, pluginObj, localModule, pluginManager, filename, result;
|
|
21
15
|
pluginManager = context.pluginManager;
|
|
22
16
|
if (fileInfo) {
|
|
23
17
|
if (typeof fileInfo === 'string') {
|