less 4.0.1-alpha.0 → 4.1.2

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.
Files changed (187) hide show
  1. package/.eslintignore +2 -1
  2. package/.eslintrc.json +70 -2
  3. package/Gruntfile.js +8 -23
  4. package/dist/less.js +1161 -1132
  5. package/dist/less.min.js +3 -3
  6. package/dist/less.min.js.map +1 -1
  7. package/lib/less/constants.js +2 -1
  8. package/lib/less/constants.js.map +1 -1
  9. package/lib/less/contexts.js +2 -20
  10. package/lib/less/contexts.js.map +1 -1
  11. package/lib/less/data/index.js +3 -5
  12. package/lib/less/data/index.js.map +1 -1
  13. package/lib/less/environment/abstract-plugin-loader.js +3 -5
  14. package/lib/less/environment/abstract-plugin-loader.js.map +1 -1
  15. package/lib/less/environment/environment.js +2 -4
  16. package/lib/less/environment/environment.js.map +1 -1
  17. package/lib/less/functions/boolean.js +14 -6
  18. package/lib/less/functions/boolean.js.map +1 -1
  19. package/lib/less/functions/color-blending.js +2 -4
  20. package/lib/less/functions/color-blending.js.map +1 -1
  21. package/lib/less/functions/color.js +7 -9
  22. package/lib/less/functions/color.js.map +1 -1
  23. package/lib/less/functions/data-uri.js +5 -26
  24. package/lib/less/functions/data-uri.js.map +1 -1
  25. package/lib/less/functions/default.js +2 -4
  26. package/lib/less/functions/default.js.map +1 -1
  27. package/lib/less/functions/function-caller.js +7 -12
  28. package/lib/less/functions/function-caller.js.map +1 -1
  29. package/lib/less/functions/index.js +14 -16
  30. package/lib/less/functions/index.js.map +1 -1
  31. package/lib/less/functions/list.js +11 -13
  32. package/lib/less/functions/list.js.map +1 -1
  33. package/lib/less/functions/math-helper.js +2 -4
  34. package/lib/less/functions/math-helper.js.map +1 -1
  35. package/lib/less/functions/math.js +2 -4
  36. package/lib/less/functions/math.js.map +1 -1
  37. package/lib/less/functions/number.js +4 -6
  38. package/lib/less/functions/number.js.map +1 -1
  39. package/lib/less/functions/string.js +4 -6
  40. package/lib/less/functions/string.js.map +1 -1
  41. package/lib/less/functions/svg.js +6 -8
  42. package/lib/less/functions/svg.js.map +1 -1
  43. package/lib/less/functions/types.js +11 -12
  44. package/lib/less/functions/types.js.map +1 -1
  45. package/lib/less/import-manager.js +6 -27
  46. package/lib/less/import-manager.js.map +1 -1
  47. package/lib/less/index.js +25 -43
  48. package/lib/less/index.js.map +1 -1
  49. package/lib/less/less-error.js +2 -20
  50. package/lib/less/less-error.js.map +1 -1
  51. package/lib/less/parse-tree.js +4 -6
  52. package/lib/less/parse-tree.js.map +1 -1
  53. package/lib/less/parse.js +6 -27
  54. package/lib/less/parse.js.map +1 -1
  55. package/lib/less/parser/parser-input.js +2 -4
  56. package/lib/less/parser/parser-input.js.map +1 -1
  57. package/lib/less/parser/parser.js +10 -31
  58. package/lib/less/parser/parser.js.map +1 -1
  59. package/lib/less/render.js +2 -20
  60. package/lib/less/render.js.map +1 -1
  61. package/lib/less/source-map-output.js +5 -1
  62. package/lib/less/source-map-output.js.map +1 -1
  63. package/lib/less/transform-tree.js +4 -6
  64. package/lib/less/transform-tree.js.map +1 -1
  65. package/lib/less/tree/anonymous.js +22 -41
  66. package/lib/less/tree/anonymous.js.map +1 -1
  67. package/lib/less/tree/assignment.js +15 -34
  68. package/lib/less/tree/assignment.js.map +1 -1
  69. package/lib/less/tree/atrule.js +49 -68
  70. package/lib/less/tree/atrule.js.map +1 -1
  71. package/lib/less/tree/attribute.js +16 -35
  72. package/lib/less/tree/attribute.js.map +1 -1
  73. package/lib/less/tree/call.js +20 -39
  74. package/lib/less/tree/call.js.map +1 -1
  75. package/lib/less/tree/color.js +75 -94
  76. package/lib/less/tree/color.js.map +1 -1
  77. package/lib/less/tree/combinator.js +16 -35
  78. package/lib/less/tree/combinator.js.map +1 -1
  79. package/lib/less/tree/comment.js +17 -36
  80. package/lib/less/tree/comment.js.map +1 -1
  81. package/lib/less/tree/condition.js +16 -35
  82. package/lib/less/tree/condition.js.map +1 -1
  83. package/lib/less/tree/debug-info.js.map +1 -1
  84. package/lib/less/tree/declaration.js +36 -74
  85. package/lib/less/tree/declaration.js.map +1 -1
  86. package/lib/less/tree/detached-ruleset.js +19 -57
  87. package/lib/less/tree/detached-ruleset.js.map +1 -1
  88. package/lib/less/tree/dimension.js +36 -53
  89. package/lib/less/tree/dimension.js.map +1 -1
  90. package/lib/less/tree/element.js +34 -53
  91. package/lib/less/tree/element.js.map +1 -1
  92. package/lib/less/tree/expression.js +23 -61
  93. package/lib/less/tree/expression.js.map +1 -1
  94. package/lib/less/tree/extend.js +34 -53
  95. package/lib/less/tree/extend.js.map +1 -1
  96. package/lib/less/tree/import.js +46 -84
  97. package/lib/less/tree/import.js.map +1 -1
  98. package/lib/less/tree/index.js +71 -46
  99. package/lib/less/tree/index.js.map +1 -1
  100. package/lib/less/tree/javascript.js +16 -35
  101. package/lib/less/tree/javascript.js.map +1 -1
  102. package/lib/less/tree/js-eval-node.js +14 -31
  103. package/lib/less/tree/js-eval-node.js.map +1 -1
  104. package/lib/less/tree/keyword.js +10 -29
  105. package/lib/less/tree/keyword.js.map +1 -1
  106. package/lib/less/tree/media.js +40 -78
  107. package/lib/less/tree/media.js.map +1 -1
  108. package/lib/less/tree/mixin-call.js +34 -47
  109. package/lib/less/tree/mixin-call.js.map +1 -1
  110. package/lib/less/tree/mixin-definition.js +51 -89
  111. package/lib/less/tree/mixin-definition.js.map +1 -1
  112. package/lib/less/tree/namespace-value.js +22 -37
  113. package/lib/less/tree/namespace-value.js.map +1 -1
  114. package/lib/less/tree/negative.js +14 -33
  115. package/lib/less/tree/negative.js.map +1 -1
  116. package/lib/less/tree/node.js +20 -7
  117. package/lib/less/tree/node.js.map +1 -1
  118. package/lib/less/tree/operation.js +22 -59
  119. package/lib/less/tree/operation.js.map +1 -1
  120. package/lib/less/tree/paren.js +12 -31
  121. package/lib/less/tree/paren.js.map +1 -1
  122. package/lib/less/tree/property.js +21 -36
  123. package/lib/less/tree/property.js.map +1 -1
  124. package/lib/less/tree/quoted.js +25 -44
  125. package/lib/less/tree/quoted.js.map +1 -1
  126. package/lib/less/tree/ruleset.js +69 -107
  127. package/lib/less/tree/ruleset.js.map +1 -1
  128. package/lib/less/tree/selector.js +38 -57
  129. package/lib/less/tree/selector.js.map +1 -1
  130. package/lib/less/tree/unicode-descriptor.js +8 -27
  131. package/lib/less/tree/unicode-descriptor.js.map +1 -1
  132. package/lib/less/tree/unit.js +38 -76
  133. package/lib/less/tree/unit.js.map +1 -1
  134. package/lib/less/tree/url.js +20 -39
  135. package/lib/less/tree/url.js.map +1 -1
  136. package/lib/less/tree/value.js +21 -40
  137. package/lib/less/tree/value.js.map +1 -1
  138. package/lib/less/tree/variable-call.js +17 -36
  139. package/lib/less/tree/variable-call.js.map +1 -1
  140. package/lib/less/tree/variable.js +21 -36
  141. package/lib/less/tree/variable.js.map +1 -1
  142. package/lib/less/utils.js +5 -33
  143. package/lib/less/utils.js.map +1 -1
  144. package/lib/less/visitors/extend-visitor.js +5 -26
  145. package/lib/less/visitors/extend-visitor.js.map +1 -1
  146. package/lib/less/visitors/import-sequencer.js.map +1 -1
  147. package/lib/less/visitors/import-visitor.js +5 -26
  148. package/lib/less/visitors/import-visitor.js.map +1 -1
  149. package/lib/less/visitors/index.js +7 -9
  150. package/lib/less/visitors/index.js.map +1 -1
  151. package/lib/less/visitors/join-selector-visitor.js +2 -4
  152. package/lib/less/visitors/join-selector-visitor.js.map +1 -1
  153. package/lib/less/visitors/to-css-visitor.js +7 -7
  154. package/lib/less/visitors/to-css-visitor.js.map +1 -1
  155. package/lib/less/visitors/visitor.js +2 -4
  156. package/lib/less/visitors/visitor.js.map +1 -1
  157. package/lib/less-browser/add-default-options.js +2 -4
  158. package/lib/less-browser/add-default-options.js.map +1 -1
  159. package/lib/less-browser/bootstrap.js +4 -6
  160. package/lib/less-browser/bootstrap.js.map +1 -1
  161. package/lib/less-browser/browser.js +2 -20
  162. package/lib/less-browser/browser.js.map +1 -1
  163. package/lib/less-browser/error-reporting.js +3 -24
  164. package/lib/less-browser/error-reporting.js.map +1 -1
  165. package/lib/less-browser/file-manager.js +17 -36
  166. package/lib/less-browser/file-manager.js.map +1 -1
  167. package/lib/less-browser/image-size.js +2 -4
  168. package/lib/less-browser/image-size.js.map +1 -1
  169. package/lib/less-browser/index.js +9 -11
  170. package/lib/less-browser/index.js.map +1 -1
  171. package/lib/less-browser/plugin-loader.js +10 -29
  172. package/lib/less-browser/plugin-loader.js.map +1 -1
  173. package/lib/less-node/file-manager.js +15 -34
  174. package/lib/less-node/file-manager.js.map +1 -1
  175. package/lib/less-node/image-size.js +4 -6
  176. package/lib/less-node/image-size.js.map +1 -1
  177. package/lib/less-node/index.js +6 -8
  178. package/lib/less-node/index.js.map +1 -1
  179. package/lib/less-node/plugin-loader.js +23 -42
  180. package/lib/less-node/plugin-loader.js.map +1 -1
  181. package/lib/less-node/url-file-manager.js +24 -39
  182. package/lib/less-node/url-file-manager.js.map +1 -1
  183. package/package.json +20 -17
  184. package/test/index.js +20 -2
  185. package/test/less-test.js +36 -16
  186. package/tsconfig.json +6 -0
  187. package/LICENSE +0 -177
@@ -1,63 +1,46 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __importDefault = (this && this.__importDefault) || function (mod) {
16
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
- };
18
2
  Object.defineProperty(exports, "__esModule", { value: true });
19
- var node_1 = __importDefault(require("./node"));
20
- var paren_1 = __importDefault(require("./paren"));
21
- var combinator_1 = __importDefault(require("./combinator"));
22
- var Element = /** @class */ (function (_super) {
23
- __extends(Element, _super);
24
- function Element(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {
25
- var _this = _super.call(this) || this;
26
- _this.combinator = combinator instanceof combinator_1.default ?
27
- combinator : new combinator_1.default(combinator);
28
- if (typeof value === 'string') {
29
- _this.value = value.trim();
30
- }
31
- else if (value) {
32
- _this.value = value;
33
- }
34
- else {
35
- _this.value = '';
36
- }
37
- _this.isVariable = isVariable;
38
- _this._index = index;
39
- _this._fileInfo = currentFileInfo;
40
- _this.copyVisibilityInfo(visibilityInfo);
41
- _this.setParent(_this.combinator, _this);
42
- return _this;
3
+ var tslib_1 = require("tslib");
4
+ var node_1 = tslib_1.__importDefault(require("./node"));
5
+ var paren_1 = tslib_1.__importDefault(require("./paren"));
6
+ var combinator_1 = tslib_1.__importDefault(require("./combinator"));
7
+ var Element = function (combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {
8
+ this.combinator = combinator instanceof combinator_1.default ?
9
+ combinator : new combinator_1.default(combinator);
10
+ if (typeof value === 'string') {
11
+ this.value = value.trim();
43
12
  }
44
- Element.prototype.accept = function (visitor) {
13
+ else if (value) {
14
+ this.value = value;
15
+ }
16
+ else {
17
+ this.value = '';
18
+ }
19
+ this.isVariable = isVariable;
20
+ this._index = index;
21
+ this._fileInfo = currentFileInfo;
22
+ this.copyVisibilityInfo(visibilityInfo);
23
+ this.setParent(this.combinator, this);
24
+ };
25
+ Element.prototype = Object.assign(new node_1.default(), {
26
+ type: 'Element',
27
+ accept: function (visitor) {
45
28
  var value = this.value;
46
29
  this.combinator = visitor.visit(this.combinator);
47
30
  if (typeof value === 'object') {
48
31
  this.value = visitor.visit(value);
49
32
  }
50
- };
51
- Element.prototype.eval = function (context) {
33
+ },
34
+ eval: function (context) {
52
35
  return new Element(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo());
53
- };
54
- Element.prototype.clone = function () {
36
+ },
37
+ clone: function () {
55
38
  return new Element(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo());
56
- };
57
- Element.prototype.genCSS = function (context, output) {
39
+ },
40
+ genCSS: function (context, output) {
58
41
  output.add(this.toCSS(context), this.fileInfo(), this.getIndex());
59
- };
60
- Element.prototype.toCSS = function (context) {
42
+ },
43
+ toCSS: function (context) {
61
44
  context = context || {};
62
45
  var value = this.value;
63
46
  var firstSelector = context.firstSelector;
@@ -74,9 +57,7 @@ var Element = /** @class */ (function (_super) {
74
57
  else {
75
58
  return this.combinator.toCSS(context) + value;
76
59
  }
77
- };
78
- return Element;
79
- }(node_1.default));
80
- Element.prototype.type = 'Element';
60
+ }
61
+ });
81
62
  exports.default = Element;
82
63
  //# sourceMappingURL=element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/less/tree/element.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,kDAA4B;AAC5B,4DAAsC;AAEtC;IAAsB,2BAAI;IACtB,iBAAY,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc;QAAjF,YACI,iBAAO,SAiBV;QAfG,KAAI,CAAC,UAAU,GAAG,UAAU,YAAY,oBAAU,CAAC,CAAC;YAChD,UAAU,CAAC,CAAC,CAAC,IAAI,oBAAU,CAAC,UAAU,CAAC,CAAC;QAE5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC3B,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;SAC7B;aAAM,IAAI,KAAK,EAAE;YACd,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACtB;aAAM;YACH,KAAI,CAAC,KAAK,GAAG,EAAE,CAAC;SACnB;QACD,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,KAAI,CAAC,SAAS,GAAG,eAAe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AL,UAAM,OAAO;QACT,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,IAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,KAAK,YAAY,eAAK,EAAE;YACxB,8DAA8D;YAC9D,yDAAyD;YACzD,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;SAChC;QACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnD,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;QACtC,IAAI,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACzD,OAAO,EAAE,CAAC;SACb;aAAM;YACH,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;SACjD;IACL,CAAC;IACL,cAAC;AAAD,CAAC,AAlED,CAAsB,cAAI,GAkEzB;AAED,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC;AACnC,kBAAe,OAAO,CAAC","sourcesContent":["import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nclass Element extends Node {\n constructor(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n }\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n }\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n }\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n}\n\nElement.prototype.type = 'Element';\nexport default Element;\n"]}
1
+ {"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/less/tree/element.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,0DAA4B;AAC5B,oEAAsC;AAEtC,IAAM,OAAO,GAAG,UAAS,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc;IAC1F,IAAI,CAAC,UAAU,GAAG,UAAU,YAAY,oBAAU,CAAC,CAAC;QAChD,UAAU,CAAC,CAAC,CAAC,IAAI,oBAAU,CAAC,UAAU,CAAC,CAAC;IAE5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;KAC7B;SAAM,IAAI,KAAK,EAAE;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;SAAM;QACH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACnB;IACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC,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IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,YAAC,OAAO;QACT,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,IAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,KAAK,YAAY,eAAK,EAAE;YACxB,8DAA8D;YAC9D,yDAAyD;YACzD,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;SAChC;QACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnD,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;QACtC,IAAI,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACzD,OAAO,EAAE,CAAC;SACb;aAAM;YACH,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;SACjD;IACL,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,OAAO,CAAC","sourcesContent":["import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nconst Element = function(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n}\n\nElement.prototype = Object.assign(new Node(), {\n type: 'Element',\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n },\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n },\n\n toCSS(context) {\n context = context || {};\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n});\n\nexport default Element;\n"]}
@@ -1,61 +1,25 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
2
  Object.defineProperty(exports, "__esModule", { value: true });
38
- var node_1 = __importDefault(require("./node"));
39
- var paren_1 = __importDefault(require("./paren"));
40
- var comment_1 = __importDefault(require("./comment"));
41
- var dimension_1 = __importDefault(require("./dimension"));
42
- var Constants = __importStar(require("../constants"));
3
+ var tslib_1 = require("tslib");
4
+ var node_1 = tslib_1.__importDefault(require("./node"));
5
+ var paren_1 = tslib_1.__importDefault(require("./paren"));
6
+ var comment_1 = tslib_1.__importDefault(require("./comment"));
7
+ var dimension_1 = tslib_1.__importDefault(require("./dimension"));
8
+ var Constants = tslib_1.__importStar(require("../constants"));
43
9
  var MATH = Constants.Math;
44
- var Expression = /** @class */ (function (_super) {
45
- __extends(Expression, _super);
46
- function Expression(value, noSpacing) {
47
- var _this = _super.call(this) || this;
48
- _this.value = value;
49
- _this.noSpacing = noSpacing;
50
- if (!value) {
51
- throw new Error('Expression requires an array parameter');
52
- }
53
- return _this;
10
+ var Expression = function (value, noSpacing) {
11
+ this.value = value;
12
+ this.noSpacing = noSpacing;
13
+ if (!value) {
14
+ throw new Error('Expression requires an array parameter');
54
15
  }
55
- Expression.prototype.accept = function (visitor) {
16
+ };
17
+ Expression.prototype = Object.assign(new node_1.default(), {
18
+ type: 'Expression',
19
+ accept: function (visitor) {
56
20
  this.value = visitor.visitArray(this.value);
57
- };
58
- Expression.prototype.eval = function (context) {
21
+ },
22
+ eval: function (context) {
59
23
  var returnValue;
60
24
  var mathOn = context.isMathOn();
61
25
  var inParenthesis = this.parens;
@@ -88,22 +52,20 @@ var Expression = /** @class */ (function (_super) {
88
52
  returnValue = new paren_1.default(returnValue);
89
53
  }
90
54
  return returnValue;
91
- };
92
- Expression.prototype.genCSS = function (context, output) {
55
+ },
56
+ genCSS: function (context, output) {
93
57
  for (var i = 0; i < this.value.length; i++) {
94
58
  this.value[i].genCSS(context, output);
95
59
  if (!this.noSpacing && i + 1 < this.value.length) {
96
60
  output.add(' ');
97
61
  }
98
62
  }
99
- };
100
- Expression.prototype.throwAwayComments = function () {
63
+ },
64
+ throwAwayComments: function () {
101
65
  this.value = this.value.filter(function (v) {
102
66
  return !(v instanceof comment_1.default);
103
67
  });
104
- };
105
- return Expression;
106
- }(node_1.default));
107
- Expression.prototype.type = 'Expression';
68
+ }
69
+ });
108
70
  exports.default = Expression;
109
71
  //# sourceMappingURL=expression.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/less/tree/expression.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,kDAA4B;AAC5B,sDAAgC;AAChC,0DAAoC;AACpC,sDAA0C;AAC1C,IAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;AAE5B;IAAyB,8BAAI;IACzB,oBAAY,KAAK,EAAE,SAAS;QAA5B,YACI,iBAAO,SAOV;QALG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC7D;;IACL,CAAC;IAED,2BAAM,GAAN,UAAO,OAAO;QACV,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,yBAAI,GAAJ,UAAK,OAAO;QACR,IAAI,WAAW,CAAC;QAChB,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAM,aAAa,G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AC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACnB;SACJ;IACL,CAAC;IAED,sCAAiB,GAAjB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAS,CAAC;YACrC,OAAO,CAAC,CAAC,CAAC,YAAY,iBAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC;IACL,iBAAC;AAAD,CAAC,AA/DD,CAAyB,cAAI,GA+D5B;AAED,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY,CAAC;AACzC,kBAAe,UAAU,CAAC","sourcesContent":["import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nclass Expression extends Node {\n constructor(value, noSpacing) {\n super();\n\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n }\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n }\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n }\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n }\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n}\n\nExpression.prototype.type = 'Expression';\nexport default Expression;\n"]}
1
+ {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/less/tree/expression.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,0DAA4B;AAC5B,8DAAgC;AAChC,kEAAoC;AACpC,8DAA0C;AAC1C,IAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;AAE5B,IAAM,UAAU,GAAG,UAAS,KAAK,EAAE,SAAS;IACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC7D;AACL,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC7C,IAAI,EAAE,YAAY;IAElB,MAAM,YAAC,OAAO;QACV,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,YAAC,OAAO;QACR,IAAI,WAAW,CAAC;QAChB,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAClC,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QAElC,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,aAAa,EAAE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AAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACnB;SACJ;IACL,CAAC;IAED,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAS,CAAC;YACrC,OAAO,CAAC,CAAC,CAAC,YAAY,iBAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC","sourcesContent":["import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nconst Expression = function(value, noSpacing) {\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n};\n\nExpression.prototype = Object.assign(new Node(), {\n type: 'Expression',\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n },\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n const inParenthesis = this.parens;\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(function (e) {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n },\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n },\n\n throwAwayComments() {\n this.value = this.value.filter(function(v) {\n return !(v instanceof Comment);\n });\n }\n});\n\nexport default Expression;\n"]}
@@ -1,59 +1,42 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __importDefault = (this && this.__importDefault) || function (mod) {
16
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
- };
18
2
  Object.defineProperty(exports, "__esModule", { value: true });
19
- var node_1 = __importDefault(require("./node"));
20
- var selector_1 = __importDefault(require("./selector"));
21
- var Extend = /** @class */ (function (_super) {
22
- __extends(Extend, _super);
23
- function Extend(selector, option, index, currentFileInfo, visibilityInfo) {
24
- var _this = _super.call(this) || this;
25
- _this.selector = selector;
26
- _this.option = option;
27
- _this.object_id = Extend.next_id++;
28
- _this.parent_ids = [_this.object_id];
29
- _this._index = index;
30
- _this._fileInfo = currentFileInfo;
31
- _this.copyVisibilityInfo(visibilityInfo);
32
- _this.allowRoot = true;
33
- switch (option) {
34
- case 'all':
35
- _this.allowBefore = true;
36
- _this.allowAfter = true;
37
- break;
38
- default:
39
- _this.allowBefore = false;
40
- _this.allowAfter = false;
41
- break;
42
- }
43
- _this.setParent(_this.selector, _this);
44
- return _this;
3
+ var tslib_1 = require("tslib");
4
+ var node_1 = tslib_1.__importDefault(require("./node"));
5
+ var selector_1 = tslib_1.__importDefault(require("./selector"));
6
+ var Extend = function (selector, option, index, currentFileInfo, visibilityInfo) {
7
+ this.selector = selector;
8
+ this.option = option;
9
+ this.object_id = Extend.next_id++;
10
+ this.parent_ids = [this.object_id];
11
+ this._index = index;
12
+ this._fileInfo = currentFileInfo;
13
+ this.copyVisibilityInfo(visibilityInfo);
14
+ this.allowRoot = true;
15
+ switch (option) {
16
+ case 'all':
17
+ this.allowBefore = true;
18
+ this.allowAfter = true;
19
+ break;
20
+ default:
21
+ this.allowBefore = false;
22
+ this.allowAfter = false;
23
+ break;
45
24
  }
46
- Extend.prototype.accept = function (visitor) {
25
+ this.setParent(this.selector, this);
26
+ };
27
+ Extend.prototype = Object.assign(new node_1.default(), {
28
+ type: 'Extend',
29
+ accept: function (visitor) {
47
30
  this.selector = visitor.visit(this.selector);
48
- };
49
- Extend.prototype.eval = function (context) {
31
+ },
32
+ eval: function (context) {
50
33
  return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());
51
- };
52
- Extend.prototype.clone = function (context) {
34
+ },
35
+ clone: function (context) {
53
36
  return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());
54
- };
37
+ },
55
38
  // it concatenates (joins) all selectors in selector array
56
- Extend.prototype.findSelfSelectors = function (selectors) {
39
+ findSelfSelectors: function (selectors) {
57
40
  var selfElements = [], i, selectorElements;
58
41
  for (i = 0; i < selectors.length; i++) {
59
42
  selectorElements = selectors[i].elements;
@@ -66,10 +49,8 @@ var Extend = /** @class */ (function (_super) {
66
49
  }
67
50
  this.selfSelectors = [new selector_1.default(selfElements)];
68
51
  this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());
69
- };
70
- return Extend;
71
- }(node_1.default));
52
+ }
53
+ });
72
54
  Extend.next_id = 0;
73
- Extend.prototype.type = 'Extend';
74
55
  exports.default = Extend;
75
56
  //# sourceMappingURL=extend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../src/less/tree/extend.js"],"names":[],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AAC","sourcesContent":["import Node from './node';\nimport Selector from './selector';\n\nclass Extend extends Node {\n constructor(selector, option, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n }\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n }\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n}\n\nExtend.next_id = 0;\n\nExtend.prototype.type = 'Extend';\nexport default Extend;\n"]}
1
+ {"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../src/less/tree/extend.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,gEAAkC;AAElC,IAAM,MAAM,GAAG,UAAS,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc;IAC5E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAA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,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED,0DAA0D;IAC1D,iBAAiB,YAAC,SAAS;QACvB,IAAI,YAAY,GAAG,EAAE,EAAE,CAAC,EAAE,gBAAgB,CAAC;QAE3C,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YACzC,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,KAAK,EAAE,EAAE;gBACjF,gBAAgB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC;aAC9C;YACD,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;SAC7D;QAED,IAAI,CAAC,aAAa,GAAG,CAAC,IAAI,kBAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACpE,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AACnB,kBAAe,MAAM,CAAC","sourcesContent":["import Node from './node';\nimport Selector from './selector';\n\nconst Extend = function(selector, option, index, currentFileInfo, visibilityInfo) {\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n};\n\nExtend.prototype = Object.assign(new Node(), {\n type: 'Extend',\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n },\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n },\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [], i, selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n});\n\nExtend.next_id = 0;\nexport default Extend;\n"]}
@@ -1,48 +1,14 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
2
  Object.defineProperty(exports, "__esModule", { value: true });
38
- var node_1 = __importDefault(require("./node"));
39
- var media_1 = __importDefault(require("./media"));
40
- var url_1 = __importDefault(require("./url"));
41
- var quoted_1 = __importDefault(require("./quoted"));
42
- var ruleset_1 = __importDefault(require("./ruleset"));
43
- var anonymous_1 = __importDefault(require("./anonymous"));
44
- var utils = __importStar(require("../utils"));
45
- var less_error_1 = __importDefault(require("../less-error"));
3
+ var tslib_1 = require("tslib");
4
+ var node_1 = tslib_1.__importDefault(require("./node"));
5
+ var media_1 = tslib_1.__importDefault(require("./media"));
6
+ var url_1 = tslib_1.__importDefault(require("./url"));
7
+ var quoted_1 = tslib_1.__importDefault(require("./quoted"));
8
+ var ruleset_1 = tslib_1.__importDefault(require("./ruleset"));
9
+ var anonymous_1 = tslib_1.__importDefault(require("./anonymous"));
10
+ var utils = tslib_1.__importStar(require("../utils"));
11
+ var less_error_1 = tslib_1.__importDefault(require("../less-error"));
46
12
  //
47
13
  // CSS @import node
48
14
  //
@@ -55,31 +21,29 @@ var less_error_1 = __importDefault(require("../less-error"));
55
21
  // `import,push`, we also pass it a callback, which it'll call once
56
22
  // the file has been fetched, and parsed.
57
23
  //
58
- var Import = /** @class */ (function (_super) {
59
- __extends(Import, _super);
60
- function Import(path, features, options, index, currentFileInfo, visibilityInfo) {
61
- var _this = _super.call(this) || this;
62
- _this.options = options;
63
- _this._index = index;
64
- _this._fileInfo = currentFileInfo;
65
- _this.path = path;
66
- _this.features = features;
67
- _this.allowRoot = true;
68
- if (_this.options.less !== undefined || _this.options.inline) {
69
- _this.css = !_this.options.less || _this.options.inline;
70
- }
71
- else {
72
- var pathValue = _this.getPath();
73
- if (pathValue && /[#\.\&\?]css([\?;].*)?$/.test(pathValue)) {
74
- _this.css = true;
75
- }
24
+ var Import = function (path, features, options, index, currentFileInfo, visibilityInfo) {
25
+ this.options = options;
26
+ this._index = index;
27
+ this._fileInfo = currentFileInfo;
28
+ this.path = path;
29
+ this.features = features;
30
+ this.allowRoot = true;
31
+ if (this.options.less !== undefined || this.options.inline) {
32
+ this.css = !this.options.less || this.options.inline;
33
+ }
34
+ else {
35
+ var pathValue = this.getPath();
36
+ if (pathValue && /[#\.\&\?]css([\?;].*)?$/.test(pathValue)) {
37
+ this.css = true;
76
38
  }
77
- _this.copyVisibilityInfo(visibilityInfo);
78
- _this.setParent(_this.features, _this);
79
- _this.setParent(_this.path, _this);
80
- return _this;
81
39
  }
82
- Import.prototype.accept = function (visitor) {
40
+ this.copyVisibilityInfo(visibilityInfo);
41
+ this.setParent(this.features, this);
42
+ this.setParent(this.path, this);
43
+ };
44
+ Import.prototype = Object.assign(new node_1.default(), {
45
+ type: 'Import',
46
+ accept: function (visitor) {
83
47
  if (this.features) {
84
48
  this.features = visitor.visit(this.features);
85
49
  }
@@ -87,8 +51,8 @@ var Import = /** @class */ (function (_super) {
87
51
  if (!this.options.isPlugin && !this.options.inline && this.root) {
88
52
  this.root = visitor.visit(this.root);
89
53
  }
90
- };
91
- Import.prototype.genCSS = function (context, output) {
54
+ },
55
+ genCSS: function (context, output) {
92
56
  if (this.css && this.path._fileInfo.reference === undefined) {
93
57
  output.add('@import ', this._fileInfo, this._index);
94
58
  this.path.genCSS(context, output);
@@ -98,12 +62,12 @@ var Import = /** @class */ (function (_super) {
98
62
  }
99
63
  output.add(';');
100
64
  }
101
- };
102
- Import.prototype.getPath = function () {
65
+ },
66
+ getPath: function () {
103
67
  return (this.path instanceof url_1.default) ?
104
68
  this.path.value.value : this.path.value;
105
- };
106
- Import.prototype.isVariableImport = function () {
69
+ },
70
+ isVariableImport: function () {
107
71
  var path = this.path;
108
72
  if (path instanceof url_1.default) {
109
73
  path = path.value;
@@ -112,15 +76,15 @@ var Import = /** @class */ (function (_super) {
112
76
  return path.containsVariables();
113
77
  }
114
78
  return true;
115
- };
116
- Import.prototype.evalForImport = function (context) {
79
+ },
80
+ evalForImport: function (context) {
117
81
  var path = this.path;
118
82
  if (path instanceof url_1.default) {
119
83
  path = path.value;
120
84
  }
121
85
  return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());
122
- };
123
- Import.prototype.evalPath = function (context) {
86
+ },
87
+ evalPath: function (context) {
124
88
  var path = this.path.eval(context);
125
89
  var fileInfo = this._fileInfo;
126
90
  if (!(path instanceof url_1.default)) {
@@ -136,8 +100,8 @@ var Import = /** @class */ (function (_super) {
136
100
  }
137
101
  }
138
102
  return path;
139
- };
140
- Import.prototype.eval = function (context) {
103
+ },
104
+ eval: function (context) {
141
105
  var result = this.doEval(context);
142
106
  if (this.options.reference || this.blocksVisibility()) {
143
107
  if (result.length || result.length === 0) {
@@ -150,8 +114,8 @@ var Import = /** @class */ (function (_super) {
150
114
  }
151
115
  }
152
116
  return result;
153
- };
154
- Import.prototype.doEval = function (context) {
117
+ },
118
+ doEval: function (context) {
155
119
  var ruleset;
156
120
  var registry;
157
121
  var features = this.features && this.features.eval(context);
@@ -201,9 +165,7 @@ var Import = /** @class */ (function (_super) {
201
165
  else {
202
166
  return [];
203
167
  }
204
- };
205
- return Import;
206
- }(node_1.default));
207
- Import.prototype.type = 'Import';
168
+ }
169
+ });
208
170
  exports.default = Import;
209
171
  //# sourceMappingURL=import.js.map