@jesscss/core 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/lib/context.d.ts +352 -0
  4. package/lib/context.d.ts.map +1 -0
  5. package/lib/context.js +636 -0
  6. package/lib/context.js.map +1 -0
  7. package/lib/conversions.d.ts +73 -0
  8. package/lib/conversions.d.ts.map +1 -0
  9. package/lib/conversions.js +253 -0
  10. package/lib/conversions.js.map +1 -0
  11. package/lib/debug-log.d.ts +2 -0
  12. package/lib/debug-log.d.ts.map +1 -0
  13. package/lib/debug-log.js +27 -0
  14. package/lib/debug-log.js.map +1 -0
  15. package/lib/define-function.d.ts +587 -0
  16. package/lib/define-function.d.ts.map +1 -0
  17. package/lib/define-function.js +726 -0
  18. package/lib/define-function.js.map +1 -0
  19. package/lib/deprecation.d.ts +34 -0
  20. package/lib/deprecation.d.ts.map +1 -0
  21. package/lib/deprecation.js +57 -0
  22. package/lib/deprecation.js.map +1 -0
  23. package/lib/index.d.ts +22 -0
  24. package/lib/index.d.ts.map +1 -0
  25. package/lib/index.js +23 -0
  26. package/lib/index.js.map +1 -0
  27. package/lib/jess-error.d.ts +343 -0
  28. package/lib/jess-error.d.ts.map +1 -0
  29. package/lib/jess-error.js +508 -0
  30. package/lib/jess-error.js.map +1 -0
  31. package/lib/logger/deprecation-processing.d.ts +41 -0
  32. package/lib/logger/deprecation-processing.d.ts.map +1 -0
  33. package/lib/logger/deprecation-processing.js +81 -0
  34. package/lib/logger/deprecation-processing.js.map +1 -0
  35. package/lib/logger.d.ts +10 -0
  36. package/lib/logger.d.ts.map +1 -0
  37. package/lib/logger.js +20 -0
  38. package/lib/logger.js.map +1 -0
  39. package/lib/plugin.d.ts +94 -0
  40. package/lib/plugin.d.ts.map +1 -0
  41. package/lib/plugin.js +174 -0
  42. package/lib/plugin.js.map +1 -0
  43. package/lib/tree/ampersand.d.ts +94 -0
  44. package/lib/tree/ampersand.d.ts.map +1 -0
  45. package/lib/tree/ampersand.js +269 -0
  46. package/lib/tree/ampersand.js.map +1 -0
  47. package/lib/tree/any.d.ts +58 -0
  48. package/lib/tree/any.d.ts.map +1 -0
  49. package/lib/tree/any.js +101 -0
  50. package/lib/tree/any.js.map +1 -0
  51. package/lib/tree/at-rule.d.ts +53 -0
  52. package/lib/tree/at-rule.d.ts.map +1 -0
  53. package/lib/tree/at-rule.js +503 -0
  54. package/lib/tree/at-rule.js.map +1 -0
  55. package/lib/tree/block.d.ts +22 -0
  56. package/lib/tree/block.d.ts.map +1 -0
  57. package/lib/tree/block.js +24 -0
  58. package/lib/tree/block.js.map +1 -0
  59. package/lib/tree/bool.d.ts +17 -0
  60. package/lib/tree/bool.d.ts.map +1 -0
  61. package/lib/tree/bool.js +24 -0
  62. package/lib/tree/bool.js.map +1 -0
  63. package/lib/tree/call.d.ts +66 -0
  64. package/lib/tree/call.d.ts.map +1 -0
  65. package/lib/tree/call.js +306 -0
  66. package/lib/tree/call.js.map +1 -0
  67. package/lib/tree/collection.d.ts +30 -0
  68. package/lib/tree/collection.d.ts.map +1 -0
  69. package/lib/tree/collection.js +37 -0
  70. package/lib/tree/collection.js.map +1 -0
  71. package/lib/tree/color.d.ts +101 -0
  72. package/lib/tree/color.d.ts.map +1 -0
  73. package/lib/tree/color.js +513 -0
  74. package/lib/tree/color.js.map +1 -0
  75. package/lib/tree/combinator.d.ts +12 -0
  76. package/lib/tree/combinator.d.ts.map +1 -0
  77. package/lib/tree/combinator.js +8 -0
  78. package/lib/tree/combinator.js.map +1 -0
  79. package/lib/tree/comment.d.ts +20 -0
  80. package/lib/tree/comment.d.ts.map +1 -0
  81. package/lib/tree/comment.js +18 -0
  82. package/lib/tree/comment.js.map +1 -0
  83. package/lib/tree/condition.d.ts +31 -0
  84. package/lib/tree/condition.d.ts.map +1 -0
  85. package/lib/tree/condition.js +103 -0
  86. package/lib/tree/condition.js.map +1 -0
  87. package/lib/tree/control.d.ts +104 -0
  88. package/lib/tree/control.d.ts.map +1 -0
  89. package/lib/tree/control.js +430 -0
  90. package/lib/tree/control.js.map +1 -0
  91. package/lib/tree/declaration-custom.d.ts +18 -0
  92. package/lib/tree/declaration-custom.d.ts.map +1 -0
  93. package/lib/tree/declaration-custom.js +24 -0
  94. package/lib/tree/declaration-custom.js.map +1 -0
  95. package/lib/tree/declaration-var.d.ts +36 -0
  96. package/lib/tree/declaration-var.d.ts.map +1 -0
  97. package/lib/tree/declaration-var.js +63 -0
  98. package/lib/tree/declaration-var.js.map +1 -0
  99. package/lib/tree/declaration.d.ts +78 -0
  100. package/lib/tree/declaration.d.ts.map +1 -0
  101. package/lib/tree/declaration.js +289 -0
  102. package/lib/tree/declaration.js.map +1 -0
  103. package/lib/tree/default-guard.d.ts +15 -0
  104. package/lib/tree/default-guard.d.ts.map +1 -0
  105. package/lib/tree/default-guard.js +19 -0
  106. package/lib/tree/default-guard.js.map +1 -0
  107. package/lib/tree/dimension.d.ts +33 -0
  108. package/lib/tree/dimension.d.ts.map +1 -0
  109. package/lib/tree/dimension.js +291 -0
  110. package/lib/tree/dimension.js.map +1 -0
  111. package/lib/tree/expression.d.ts +24 -0
  112. package/lib/tree/expression.d.ts.map +1 -0
  113. package/lib/tree/expression.js +28 -0
  114. package/lib/tree/expression.js.map +1 -0
  115. package/lib/tree/extend-list.d.ts +23 -0
  116. package/lib/tree/extend-list.d.ts.map +1 -0
  117. package/lib/tree/extend-list.js +20 -0
  118. package/lib/tree/extend-list.js.map +1 -0
  119. package/lib/tree/extend.d.ts +47 -0
  120. package/lib/tree/extend.d.ts.map +1 -0
  121. package/lib/tree/extend.js +292 -0
  122. package/lib/tree/extend.js.map +1 -0
  123. package/lib/tree/function.d.ts +48 -0
  124. package/lib/tree/function.d.ts.map +1 -0
  125. package/lib/tree/function.js +74 -0
  126. package/lib/tree/function.js.map +1 -0
  127. package/lib/tree/import-js.d.ts +35 -0
  128. package/lib/tree/import-js.d.ts.map +1 -0
  129. package/lib/tree/import-js.js +45 -0
  130. package/lib/tree/import-js.js.map +1 -0
  131. package/lib/tree/import-style.d.ts +156 -0
  132. package/lib/tree/import-style.d.ts.map +1 -0
  133. package/lib/tree/import-style.js +556 -0
  134. package/lib/tree/import-style.js.map +1 -0
  135. package/lib/tree/index.d.ts +71 -0
  136. package/lib/tree/index.d.ts.map +1 -0
  137. package/lib/tree/index.js +95 -0
  138. package/lib/tree/index.js.map +1 -0
  139. package/lib/tree/interpolated-reference.d.ts +24 -0
  140. package/lib/tree/interpolated-reference.d.ts.map +1 -0
  141. package/lib/tree/interpolated-reference.js +37 -0
  142. package/lib/tree/interpolated-reference.js.map +1 -0
  143. package/lib/tree/interpolated.d.ts +62 -0
  144. package/lib/tree/interpolated.d.ts.map +1 -0
  145. package/lib/tree/interpolated.js +204 -0
  146. package/lib/tree/interpolated.js.map +1 -0
  147. package/lib/tree/js-array.d.ts +10 -0
  148. package/lib/tree/js-array.d.ts.map +1 -0
  149. package/lib/tree/js-array.js +10 -0
  150. package/lib/tree/js-array.js.map +1 -0
  151. package/lib/tree/js-expr.d.ts +23 -0
  152. package/lib/tree/js-expr.d.ts.map +1 -0
  153. package/lib/tree/js-expr.js +28 -0
  154. package/lib/tree/js-expr.js.map +1 -0
  155. package/lib/tree/js-function.d.ts +20 -0
  156. package/lib/tree/js-function.d.ts.map +1 -0
  157. package/lib/tree/js-function.js +16 -0
  158. package/lib/tree/js-function.js.map +1 -0
  159. package/lib/tree/js-object.d.ts +10 -0
  160. package/lib/tree/js-object.d.ts.map +1 -0
  161. package/lib/tree/js-object.js +10 -0
  162. package/lib/tree/js-object.js.map +1 -0
  163. package/lib/tree/list.d.ts +38 -0
  164. package/lib/tree/list.d.ts.map +1 -0
  165. package/lib/tree/list.js +83 -0
  166. package/lib/tree/list.js.map +1 -0
  167. package/lib/tree/log.d.ts +29 -0
  168. package/lib/tree/log.d.ts.map +1 -0
  169. package/lib/tree/log.js +56 -0
  170. package/lib/tree/log.js.map +1 -0
  171. package/lib/tree/mixin.d.ts +87 -0
  172. package/lib/tree/mixin.d.ts.map +1 -0
  173. package/lib/tree/mixin.js +112 -0
  174. package/lib/tree/mixin.js.map +1 -0
  175. package/lib/tree/negative.d.ts +17 -0
  176. package/lib/tree/negative.d.ts.map +1 -0
  177. package/lib/tree/negative.js +22 -0
  178. package/lib/tree/negative.js.map +1 -0
  179. package/lib/tree/nil.d.ts +31 -0
  180. package/lib/tree/nil.d.ts.map +1 -0
  181. package/lib/tree/nil.js +36 -0
  182. package/lib/tree/nil.js.map +1 -0
  183. package/lib/tree/node-base.d.ts +359 -0
  184. package/lib/tree/node-base.d.ts.map +1 -0
  185. package/lib/tree/node-base.js +884 -0
  186. package/lib/tree/node-base.js.map +1 -0
  187. package/lib/tree/node.d.ts +10 -0
  188. package/lib/tree/node.d.ts.map +1 -0
  189. package/lib/tree/node.js +45 -0
  190. package/lib/tree/node.js.map +1 -0
  191. package/lib/tree/number.d.ts +21 -0
  192. package/lib/tree/number.d.ts.map +1 -0
  193. package/lib/tree/number.js +27 -0
  194. package/lib/tree/number.js.map +1 -0
  195. package/lib/tree/operation.d.ts +26 -0
  196. package/lib/tree/operation.d.ts.map +1 -0
  197. package/lib/tree/operation.js +103 -0
  198. package/lib/tree/operation.js.map +1 -0
  199. package/lib/tree/paren.d.ts +18 -0
  200. package/lib/tree/paren.d.ts.map +1 -0
  201. package/lib/tree/paren.js +86 -0
  202. package/lib/tree/paren.js.map +1 -0
  203. package/lib/tree/query-condition.d.ts +17 -0
  204. package/lib/tree/query-condition.d.ts.map +1 -0
  205. package/lib/tree/query-condition.js +39 -0
  206. package/lib/tree/query-condition.js.map +1 -0
  207. package/lib/tree/quoted.d.ts +27 -0
  208. package/lib/tree/quoted.d.ts.map +1 -0
  209. package/lib/tree/quoted.js +66 -0
  210. package/lib/tree/quoted.js.map +1 -0
  211. package/lib/tree/range.d.ts +33 -0
  212. package/lib/tree/range.d.ts.map +1 -0
  213. package/lib/tree/range.js +47 -0
  214. package/lib/tree/range.js.map +1 -0
  215. package/lib/tree/reference.d.ts +76 -0
  216. package/lib/tree/reference.d.ts.map +1 -0
  217. package/lib/tree/reference.js +521 -0
  218. package/lib/tree/reference.js.map +1 -0
  219. package/lib/tree/rest.d.ts +15 -0
  220. package/lib/tree/rest.d.ts.map +1 -0
  221. package/lib/tree/rest.js +32 -0
  222. package/lib/tree/rest.js.map +1 -0
  223. package/lib/tree/rules-raw.d.ts +17 -0
  224. package/lib/tree/rules-raw.d.ts.map +1 -0
  225. package/lib/tree/rules-raw.js +37 -0
  226. package/lib/tree/rules-raw.js.map +1 -0
  227. package/lib/tree/rules.d.ts +255 -0
  228. package/lib/tree/rules.d.ts.map +1 -0
  229. package/lib/tree/rules.js +2293 -0
  230. package/lib/tree/rules.js.map +1 -0
  231. package/lib/tree/ruleset.d.ts +91 -0
  232. package/lib/tree/ruleset.d.ts.map +1 -0
  233. package/lib/tree/ruleset.js +506 -0
  234. package/lib/tree/ruleset.js.map +1 -0
  235. package/lib/tree/selector-attr.d.ts +31 -0
  236. package/lib/tree/selector-attr.d.ts.map +1 -0
  237. package/lib/tree/selector-attr.js +99 -0
  238. package/lib/tree/selector-attr.js.map +1 -0
  239. package/lib/tree/selector-basic.d.ts +23 -0
  240. package/lib/tree/selector-basic.d.ts.map +1 -0
  241. package/lib/tree/selector-basic.js +34 -0
  242. package/lib/tree/selector-basic.js.map +1 -0
  243. package/lib/tree/selector-capture.d.ts +23 -0
  244. package/lib/tree/selector-capture.d.ts.map +1 -0
  245. package/lib/tree/selector-capture.js +34 -0
  246. package/lib/tree/selector-capture.js.map +1 -0
  247. package/lib/tree/selector-complex.d.ts +40 -0
  248. package/lib/tree/selector-complex.d.ts.map +1 -0
  249. package/lib/tree/selector-complex.js +143 -0
  250. package/lib/tree/selector-complex.js.map +1 -0
  251. package/lib/tree/selector-compound.d.ts +16 -0
  252. package/lib/tree/selector-compound.d.ts.map +1 -0
  253. package/lib/tree/selector-compound.js +114 -0
  254. package/lib/tree/selector-compound.js.map +1 -0
  255. package/lib/tree/selector-interpolated.d.ts +23 -0
  256. package/lib/tree/selector-interpolated.d.ts.map +1 -0
  257. package/lib/tree/selector-interpolated.js +27 -0
  258. package/lib/tree/selector-interpolated.js.map +1 -0
  259. package/lib/tree/selector-list.d.ts +17 -0
  260. package/lib/tree/selector-list.d.ts.map +1 -0
  261. package/lib/tree/selector-list.js +184 -0
  262. package/lib/tree/selector-list.js.map +1 -0
  263. package/lib/tree/selector-pseudo.d.ts +42 -0
  264. package/lib/tree/selector-pseudo.d.ts.map +1 -0
  265. package/lib/tree/selector-pseudo.js +191 -0
  266. package/lib/tree/selector-pseudo.js.map +1 -0
  267. package/lib/tree/selector-simple.d.ts +5 -0
  268. package/lib/tree/selector-simple.d.ts.map +1 -0
  269. package/lib/tree/selector-simple.js +6 -0
  270. package/lib/tree/selector-simple.js.map +1 -0
  271. package/lib/tree/selector.d.ts +43 -0
  272. package/lib/tree/selector.d.ts.map +1 -0
  273. package/lib/tree/selector.js +56 -0
  274. package/lib/tree/selector.js.map +1 -0
  275. package/lib/tree/sequence.d.ts +43 -0
  276. package/lib/tree/sequence.d.ts.map +1 -0
  277. package/lib/tree/sequence.js +148 -0
  278. package/lib/tree/sequence.js.map +1 -0
  279. package/lib/tree/tree.d.ts +87 -0
  280. package/lib/tree/tree.d.ts.map +1 -0
  281. package/lib/tree/tree.js +2 -0
  282. package/lib/tree/tree.js.map +1 -0
  283. package/lib/tree/url.d.ts +18 -0
  284. package/lib/tree/url.d.ts.map +1 -0
  285. package/lib/tree/url.js +35 -0
  286. package/lib/tree/url.js.map +1 -0
  287. package/lib/tree/util/__tests__/debug-log.d.ts +1 -0
  288. package/lib/tree/util/__tests__/debug-log.d.ts.map +1 -0
  289. package/lib/tree/util/__tests__/debug-log.js +36 -0
  290. package/lib/tree/util/__tests__/debug-log.js.map +1 -0
  291. package/lib/tree/util/calculate.d.ts +3 -0
  292. package/lib/tree/util/calculate.d.ts.map +1 -0
  293. package/lib/tree/util/calculate.js +10 -0
  294. package/lib/tree/util/calculate.js.map +1 -0
  295. package/lib/tree/util/cast.d.ts +10 -0
  296. package/lib/tree/util/cast.d.ts.map +1 -0
  297. package/lib/tree/util/cast.js +87 -0
  298. package/lib/tree/util/cast.js.map +1 -0
  299. package/lib/tree/util/cloning.d.ts +4 -0
  300. package/lib/tree/util/cloning.d.ts.map +1 -0
  301. package/lib/tree/util/cloning.js +8 -0
  302. package/lib/tree/util/cloning.js.map +1 -0
  303. package/lib/tree/util/collections.d.ts +57 -0
  304. package/lib/tree/util/collections.d.ts.map +1 -0
  305. package/lib/tree/util/collections.js +136 -0
  306. package/lib/tree/util/collections.js.map +1 -0
  307. package/lib/tree/util/compare.d.ts +11 -0
  308. package/lib/tree/util/compare.d.ts.map +1 -0
  309. package/lib/tree/util/compare.js +89 -0
  310. package/lib/tree/util/compare.js.map +1 -0
  311. package/lib/tree/util/extend-helpers.d.ts +2 -0
  312. package/lib/tree/util/extend-helpers.d.ts.map +1 -0
  313. package/lib/tree/util/extend-helpers.js +2 -0
  314. package/lib/tree/util/extend-helpers.js.map +1 -0
  315. package/lib/tree/util/extend-roots.d.ts +37 -0
  316. package/lib/tree/util/extend-roots.d.ts.map +1 -0
  317. package/lib/tree/util/extend-roots.js +682 -0
  318. package/lib/tree/util/extend-roots.js.map +1 -0
  319. package/lib/tree/util/extend-roots.old.d.ts +132 -0
  320. package/lib/tree/util/extend-roots.old.d.ts.map +1 -0
  321. package/lib/tree/util/extend-roots.old.js +2272 -0
  322. package/lib/tree/util/extend-roots.old.js.map +1 -0
  323. package/lib/tree/util/extend-trace-debug.d.ts +13 -0
  324. package/lib/tree/util/extend-trace-debug.d.ts.map +1 -0
  325. package/lib/tree/util/extend-trace-debug.js +34 -0
  326. package/lib/tree/util/extend-trace-debug.js.map +1 -0
  327. package/lib/tree/util/extend.d.ts +218 -0
  328. package/lib/tree/util/extend.d.ts.map +1 -0
  329. package/lib/tree/util/extend.js +3033 -0
  330. package/lib/tree/util/extend.js.map +1 -0
  331. package/lib/tree/util/find-extendable-locations.d.ts +2 -0
  332. package/lib/tree/util/find-extendable-locations.d.ts.map +1 -0
  333. package/lib/tree/util/find-extendable-locations.js +2 -0
  334. package/lib/tree/util/find-extendable-locations.js.map +1 -0
  335. package/lib/tree/util/format.d.ts +20 -0
  336. package/lib/tree/util/format.d.ts.map +1 -0
  337. package/lib/tree/util/format.js +67 -0
  338. package/lib/tree/util/format.js.map +1 -0
  339. package/lib/tree/util/is-node.d.ts +13 -0
  340. package/lib/tree/util/is-node.d.ts.map +1 -0
  341. package/lib/tree/util/is-node.js +43 -0
  342. package/lib/tree/util/is-node.js.map +1 -0
  343. package/lib/tree/util/print.d.ts +80 -0
  344. package/lib/tree/util/print.d.ts.map +1 -0
  345. package/lib/tree/util/print.js +205 -0
  346. package/lib/tree/util/print.js.map +1 -0
  347. package/lib/tree/util/process-leading-is.d.ts +25 -0
  348. package/lib/tree/util/process-leading-is.d.ts.map +1 -0
  349. package/lib/tree/util/process-leading-is.js +364 -0
  350. package/lib/tree/util/process-leading-is.js.map +1 -0
  351. package/lib/tree/util/recursion-helper.d.ts +15 -0
  352. package/lib/tree/util/recursion-helper.d.ts.map +1 -0
  353. package/lib/tree/util/recursion-helper.js +43 -0
  354. package/lib/tree/util/recursion-helper.js.map +1 -0
  355. package/lib/tree/util/regex.d.ts +4 -0
  356. package/lib/tree/util/regex.d.ts.map +1 -0
  357. package/lib/tree/util/regex.js +4 -0
  358. package/lib/tree/util/regex.js.map +1 -0
  359. package/lib/tree/util/registry-utils.d.ts +192 -0
  360. package/lib/tree/util/registry-utils.d.ts.map +1 -0
  361. package/lib/tree/util/registry-utils.js +1242 -0
  362. package/lib/tree/util/registry-utils.js.map +1 -0
  363. package/lib/tree/util/ruleset-trace.d.ts +4 -0
  364. package/lib/tree/util/ruleset-trace.d.ts.map +1 -0
  365. package/lib/tree/util/ruleset-trace.js +14 -0
  366. package/lib/tree/util/ruleset-trace.js.map +1 -0
  367. package/lib/tree/util/selector-compare.d.ts +2 -0
  368. package/lib/tree/util/selector-compare.d.ts.map +1 -0
  369. package/lib/tree/util/selector-compare.js +2 -0
  370. package/lib/tree/util/selector-compare.js.map +1 -0
  371. package/lib/tree/util/selector-match-core.d.ts +171 -0
  372. package/lib/tree/util/selector-match-core.d.ts.map +1 -0
  373. package/lib/tree/util/selector-match-core.js +1578 -0
  374. package/lib/tree/util/selector-match-core.js.map +1 -0
  375. package/lib/tree/util/selector-utils.d.ts +30 -0
  376. package/lib/tree/util/selector-utils.d.ts.map +1 -0
  377. package/lib/tree/util/selector-utils.js +100 -0
  378. package/lib/tree/util/selector-utils.js.map +1 -0
  379. package/lib/tree/util/serialize-helper.d.ts +13 -0
  380. package/lib/tree/util/serialize-helper.d.ts.map +1 -0
  381. package/lib/tree/util/serialize-helper.js +387 -0
  382. package/lib/tree/util/serialize-helper.js.map +1 -0
  383. package/lib/tree/util/serialize-types.d.ts +9 -0
  384. package/lib/tree/util/serialize-types.d.ts.map +1 -0
  385. package/lib/tree/util/serialize-types.js +216 -0
  386. package/lib/tree/util/serialize-types.js.map +1 -0
  387. package/lib/tree/util/should-operate.d.ts +23 -0
  388. package/lib/tree/util/should-operate.d.ts.map +1 -0
  389. package/lib/tree/util/should-operate.js +46 -0
  390. package/lib/tree/util/should-operate.js.map +1 -0
  391. package/lib/tree/util/sourcemap.d.ts +7 -0
  392. package/lib/tree/util/sourcemap.d.ts.map +1 -0
  393. package/lib/tree/util/sourcemap.js +25 -0
  394. package/lib/tree/util/sourcemap.js.map +1 -0
  395. package/lib/types/config.d.ts +205 -0
  396. package/lib/types/config.d.ts.map +1 -0
  397. package/lib/types/config.js +2 -0
  398. package/lib/types/config.js.map +1 -0
  399. package/lib/types/index.d.ts +15 -0
  400. package/lib/types/index.d.ts.map +1 -0
  401. package/lib/types/index.js +3 -0
  402. package/lib/types/index.js.map +1 -0
  403. package/lib/types/modes.d.ts +24 -0
  404. package/lib/types/modes.d.ts.map +1 -0
  405. package/lib/types/modes.js +2 -0
  406. package/lib/types/modes.js.map +1 -0
  407. package/lib/types.d.ts +61 -0
  408. package/lib/types.d.ts.map +1 -0
  409. package/lib/types.js +2 -0
  410. package/lib/types.js.map +1 -0
  411. package/lib/use-webpack-resolver.d.ts +9 -0
  412. package/lib/use-webpack-resolver.d.ts.map +1 -0
  413. package/lib/use-webpack-resolver.js +41 -0
  414. package/lib/use-webpack-resolver.js.map +1 -0
  415. package/lib/visitor/index.d.ts +136 -0
  416. package/lib/visitor/index.d.ts.map +1 -0
  417. package/lib/visitor/index.js +135 -0
  418. package/lib/visitor/index.js.map +1 -0
  419. package/lib/visitor/less-visitor.d.ts +7 -0
  420. package/lib/visitor/less-visitor.d.ts.map +1 -0
  421. package/lib/visitor/less-visitor.js +7 -0
  422. package/lib/visitor/less-visitor.js.map +1 -0
  423. package/package.json +66 -0
@@ -0,0 +1,23 @@
1
+ import type { MathMode } from '../../types/modes.js';
2
+ import type { Operator } from './calculate.js';
3
+ import type { Node } from '../node.js';
4
+ export type MathFrameState = {
5
+ mathMode: MathMode;
6
+ /**
7
+ * Boolean stack. The current frame is the top-most value.
8
+ * - `true` enables Less/Sass "math in parens" semantics
9
+ * - `false` explicitly disables it (e.g. for call args)
10
+ */
11
+ parenFrames: ReadonlyArray<boolean>;
12
+ /** Number stack, modeled as a depth counter */
13
+ calcFrames: number;
14
+ };
15
+ export declare function isInParens(parenFrames: ReadonlyArray<boolean>): boolean;
16
+ /**
17
+ * Shared calculation decision logic for both eval-time (`Context.shouldOperate`)
18
+ * and parse-time decisions (Less→Jess conversion).
19
+ *
20
+ * This must remain behaviorally equivalent to `Context.shouldOperate`.
21
+ */
22
+ export declare function shouldOperateWithMathFrames(state: MathFrameState, op: Operator, left: Node, right: Node): boolean;
23
+ //# sourceMappingURL=should-operate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-operate.d.ts","sourceRoot":"","sources":["../../../src/tree/util/should-operate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;OAIG;IACH,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACpC,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,cAAc,EACrB,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,GACV,OAAO,CAqCT"}
@@ -0,0 +1,46 @@
1
+ import { isNode } from './is-node.js';
2
+ export function isInParens(parenFrames) {
3
+ return parenFrames.at(-1) ?? false;
4
+ }
5
+ /**
6
+ * Shared calculation decision logic for both eval-time (`Context.shouldOperate`)
7
+ * and parse-time decisions (Less→Jess conversion).
8
+ *
9
+ * This must remain behaviorally equivalent to `Context.shouldOperate`.
10
+ */
11
+ export function shouldOperateWithMathFrames(state, op, left, right) {
12
+ const { mathMode, calcFrames } = state;
13
+ const inParens = isInParens(state.parenFrames);
14
+ const inCalc = calcFrames !== 0;
15
+ if (inCalc) {
16
+ /** Only collapse safe units */
17
+ if (isNode(left, 'Dimension') && isNode(right, 'Dimension')) {
18
+ const lUnit = left.value.unit;
19
+ const rUnit = right.value.unit;
20
+ if ((op === '+' || op === '-') && lUnit === rUnit) {
21
+ return true;
22
+ }
23
+ /** Can't make square units */
24
+ if (op === '*' && (!lUnit || !rUnit)) {
25
+ return true;
26
+ }
27
+ /** Can't divide by a unit */
28
+ if (op === '/' && !rUnit) {
29
+ return true;
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+ /** Parens for Less/SCSS will set `canOperate` to true */
35
+ if (mathMode === 'always' || inParens) {
36
+ return true;
37
+ }
38
+ if (mathMode === 'parens-division') {
39
+ return op !== '/';
40
+ }
41
+ if (mathMode === 'parens' || mathMode === 'strict') {
42
+ return false;
43
+ }
44
+ return true;
45
+ }
46
+ //# sourceMappingURL=should-operate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-operate.js","sourceRoot":"","sources":["../../../src/tree/util/should-operate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAetC,MAAM,UAAU,UAAU,CAAC,WAAmC;IAC5D,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAqB,EACrB,EAAY,EACZ,IAAU,EACV,KAAW;IAEX,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,UAAU,KAAK,CAAC,CAAC;IAEhC,IAAI,MAAM,EAAE,CAAC;QACX,+BAA+B;QAC/B,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;YAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;YAC/B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,8BAA8B;YAC9B,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC;YACd,CAAC;YACD,6BAA6B;YAC7B,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yDAAyD;IACzD,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;QACnC,OAAO,EAAE,KAAK,GAAG,CAAC;IACpB,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { OutputWriter } from './print.js';
2
+ export type BuildSourceMapOptions = {
3
+ file?: string;
4
+ sourcesContent?: Map<string, string>;
5
+ };
6
+ export declare function buildSourceMap(writer: OutputWriter, opts?: BuildSourceMapOptions): import("@jridgewell/gen-mapping").EncodedSourceMap;
7
+ //# sourceMappingURL=sourcemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourcemap.d.ts","sourceRoot":"","sources":["../../../src/tree/util/sourcemap.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,qBAA0B,sDAuBpF"}
@@ -0,0 +1,25 @@
1
+ import { GenMapping, addMapping, setSourceContent, toEncodedMap } from '@jridgewell/gen-mapping';
2
+ export function buildSourceMap(writer, opts = {}) {
3
+ const map = new GenMapping({ file: opts.file });
4
+ const segs = writer.getSegments();
5
+ for (const s of segs) {
6
+ if (s.source) {
7
+ addMapping(map, {
8
+ generated: { line: s.genLine + 1, column: s.genColumn },
9
+ source: s.source,
10
+ original: { line: s.origLine + 1, column: s.origColumn }
11
+ });
12
+ const content = opts.sourcesContent?.get(s.source);
13
+ if (content !== undefined) {
14
+ setSourceContent(map, s.source, content);
15
+ }
16
+ }
17
+ else {
18
+ addMapping(map, {
19
+ generated: { line: s.genLine + 1, column: s.genColumn }
20
+ });
21
+ }
22
+ }
23
+ return toEncodedMap(map);
24
+ }
25
+ //# sourceMappingURL=sourcemap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourcemap.js","sourceRoot":"","sources":["../../../src/tree/util/sourcemap.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,yBAAyB,CAAC;AAQjC,MAAM,UAAU,cAAc,CAAC,MAAoB,EAAE,OAA8B,EAAE;IACnF,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,IAAI,GAAoB,MAAM,CAAC,WAAW,EAAE,CAAC;IAEnD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;YACb,UAAU,CAAC,GAAG,EAAE;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE;gBACvD,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;aACzD,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,GAAG,EAAE;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE;aACxD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,205 @@
1
+ import type { EqualityMode, MathMode, UnitMode } from './modes.js';
2
+ export type { EqualityMode, MathMode, UnitMode };
3
+ /**
4
+ * Less compiler options.
5
+ *
6
+ * Kept in `@jesscss/core` to avoid cyclic workspace dependencies with `styles-config`.
7
+ * Based on less.js default-options.js and bin/lessc.
8
+ */
9
+ export interface LessOptions {
10
+ /**
11
+ * Inline Javascript - @plugin still allowed
12
+ * @default false
13
+ */
14
+ javascriptEnabled?: boolean;
15
+ /**
16
+ * Outputs a makefile import dependency list to stdout.
17
+ * @default false
18
+ */
19
+ depends?: boolean;
20
+ /**
21
+ * @deprecated Compress using less built-in compression.
22
+ * This does an okay job but does not utilise all the tricks of
23
+ * dedicated css compression.
24
+ * @default false
25
+ */
26
+ compress?: boolean;
27
+ /**
28
+ * Runs the less parser and just reports errors without any output.
29
+ * @default false
30
+ */
31
+ lint?: boolean;
32
+ /**
33
+ * Sets available include paths.
34
+ * If the file in an @import rule does not exist at that exact location,
35
+ * less will look for it at the location(s) passed to this option.
36
+ * @default []
37
+ */
38
+ paths?: string[];
39
+ /**
40
+ * Color output in the terminal
41
+ * @default true
42
+ */
43
+ color?: boolean;
44
+ /**
45
+ * @deprecated This option has confusing behavior and may be removed in a future version.
46
+ *
47
+ * Controls how @import statements for .less files are handled inside selector blocks (rulesets).
48
+ *
49
+ * Behavior:
50
+ * - @import at root level: Always processed
51
+ * - @import inside @-rules (@media, @supports, etc.): Processed (these are not selector blocks)
52
+ * - @import inside selector blocks (.class, #id, etc.): Behavior depends on this option
53
+ *
54
+ * Options:
55
+ * - `false` (default): All @import statements are processed regardless of context.
56
+ * - `true`: @import statements inside selector blocks are silently ignored and not output.
57
+ * - `'error'`: @import statements inside selector blocks will throw an error instead of being silently ignored.
58
+ *
59
+ * Note: Only affects .less file imports. CSS imports (url(...) or .css files) are
60
+ * always output as CSS @import statements regardless of this setting.
61
+ *
62
+ * @see https://github.com/less/less.js/issues/656
63
+ * @default false
64
+ */
65
+ strictImports?: boolean | 'error';
66
+ /**
67
+ * Allow Imports from Insecure HTTPS Hosts
68
+ * @default false
69
+ */
70
+ insecure?: boolean;
71
+ /**
72
+ * Allows you to add a path to every generated import and url in your css.
73
+ * This does not affect less import statements that are processed, just ones
74
+ * that are left in the output css.
75
+ * @default ''
76
+ */
77
+ rootpath?: string;
78
+ /**
79
+ * By default URLs are kept as-is, so if you import a file in a sub-directory
80
+ * that references an image, exactly the same URL will be output in the css.
81
+ * This option allows you to re-write URL's in imported files so that the
82
+ * URL is always relative to the base imported file
83
+ * @default false
84
+ */
85
+ rewriteUrls?: boolean | 'all' | 'local' | 'off';
86
+ /**
87
+ * How to process math operations
88
+ * - 'always': eagerly try to solve all operations
89
+ * - 'parens-division': require parens for division "/"
90
+ * - 'parens' or 'strict': require parens for all operations
91
+ * @default 'parens-division'
92
+ */
93
+ mathMode?: MathMode;
94
+ /**
95
+ * How to handle unit conversions in math operations
96
+ * - 'loose': Less's default 1.x-4.x behavior
97
+ * - 'preserve': Create calc() expressions for unit errors
98
+ * - 'strict': strict unit mode
99
+ * @default 'loose'
100
+ */
101
+ unitMode?: UnitMode;
102
+ /**
103
+ * How to handle equality/coercion in guards and comparisons.
104
+ * - 'coerce': Less-compatible coercion behavior
105
+ * - 'strict': type-strict behavior
106
+ * @default 'coerce'
107
+ */
108
+ equalityMode?: EqualityMode;
109
+ /**
110
+ * @deprecated Use `mathMode` instead. This option maps to `mathMode` as follows:
111
+ * - 0 or 'always' → 'always'
112
+ * - 1 or 'parens-division' → 'parens-division'
113
+ * - 2 or 'parens' or 'strict' → 'parens'
114
+ * - 3 or 'strict-legacy' → 'parens' (removed, will default to 'strict)
115
+ * @default undefined (uses mathMode if provided, otherwise 'parens-division')
116
+ */
117
+ math?: 0 | 1 | 2 | 3 | MathMode | 'strict-legacy';
118
+ /**
119
+ * @deprecated Use `unitMode` instead. If `true`, sets `unitMode` to 'strict'.
120
+ * If `false` or undefined, uses the `unitMode` value (defaults to 'loose').
121
+ * @default false
122
+ */
123
+ strictUnits?: boolean;
124
+ /**
125
+ * Effectively the declaration is put at the top of your base Less file,
126
+ * meaning it can be used but it also can be overridden if this variable
127
+ * is defined in the file.
128
+ * @default null
129
+ */
130
+ globalVars?: Record<string, string> | null;
131
+ /**
132
+ * As opposed to the global variable option, this puts the declaration at the
133
+ * end of your base file, meaning it will override anything defined in your Less file.
134
+ * @default null
135
+ */
136
+ modifyVars?: Record<string, string> | null;
137
+ /**
138
+ * This option allows you to specify a argument to go on to every URL.
139
+ * @default ''
140
+ */
141
+ urlArgs?: string;
142
+ /**
143
+ * @removed The dumpLineNumbers option is not useful nor supported in browsers. Use sourcemaps instead.
144
+ *
145
+ * @default undefined
146
+ */
147
+ dumpLineNumbers?: string;
148
+ /**
149
+ * Source map options
150
+ * @default undefined
151
+ */
152
+ sourceMap?: boolean | {
153
+ sourceMapFullFilename?: string;
154
+ sourceMapRootpath?: string;
155
+ sourceMapBasepath?: string;
156
+ sourceMapURL?: string;
157
+ sourceMapFileInline?: boolean;
158
+ outputSourceFiles?: boolean;
159
+ disableSourcemapAnnotation?: boolean;
160
+ sourceMapOutputFilename?: string;
161
+ sourceMapFilename?: string;
162
+ };
163
+ /**
164
+ * Verbose output
165
+ * @default false
166
+ */
167
+ verbose?: boolean;
168
+ /**
169
+ * Silent mode (suppress errors)
170
+ * @default false
171
+ */
172
+ silent?: boolean;
173
+ /**
174
+ * Quiet mode (suppress warnings)
175
+ * @default false
176
+ */
177
+ quiet?: boolean;
178
+ /**
179
+ * @deprecated This is legacy Less behavior.
180
+ *
181
+ * Controls whether mixins and detached rulesets "leak" their inner rules.
182
+ * When true:
183
+ * - Mixins: Mixin and VarDeclaration nodes are 'public' and 'optional' respectively
184
+ * - Detached rulesets: Mixin and VarDeclaration nodes are 'public' and 'private' respectively
185
+ * When false:
186
+ * - Both mixins and detached rulesets: Mixin and VarDeclaration nodes are 'private'
187
+ * @default true
188
+ */
189
+ leakyRules?: boolean;
190
+ /**
191
+ * Whether to collapse nested selectors (Less 1.x-4.x style flattening)
192
+ * When true, nested selectors like `.parent { .child { } }` are flattened to `.parent .child { }`
193
+ * @default false
194
+ */
195
+ collapseNesting?: boolean;
196
+ /**
197
+ * @deprecated This is legacy Less behavior.
198
+ *
199
+ * Whether to bubble root-only at-rules (@font-face, @keyframes, etc.) to the root
200
+ * when they are nested inside rulesets. Modern CSS supports nesting these at-rules.
201
+ * @default true
202
+ */
203
+ bubbleRootAtRules?: boolean;
204
+ }
205
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;IAEhD;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,GAAG,eAAe,CAAC;IAElD;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAE3C;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAE3C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG;QACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,0BAA0B,CAAC,EAAE,OAAO,CAAC;QACrC,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { type ILexingResult, type IRecognitionException, type IToken } from 'chevrotain';
2
+ import type { Node } from '../tree/index.js';
3
+ export * from './modes.js';
4
+ export * from './config.js';
5
+ export interface IParseResult<T extends Node = Node> {
6
+ lexerResult: ILexingResult;
7
+ errors: IRecognitionException[];
8
+ tree: T;
9
+ warnings?: Array<{
10
+ message: string;
11
+ token?: IToken;
12
+ deprecation?: string;
13
+ }>;
14
+ }
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAE5B,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI;IACjD,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7E"}
@@ -0,0 +1,3 @@
1
+ export * from './modes.js';
2
+ export * from './config.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Math processing modes.
3
+ *
4
+ * Kept in `@jesscss/core` to avoid cyclic workspace dependencies with `styles-config`.
5
+ */
6
+ export type MathMode = 'always' | 'parens-division' | 'parens' | 'strict';
7
+ /**
8
+ * Unit conversion modes.
9
+ *
10
+ * - `loose`: Convert units in some cases, coerce when units don't match
11
+ * - `preserve`: Create calc() when units don't match or are mis-used
12
+ * - `strict`: Throw errors when units are mis-used
13
+ *
14
+ * Kept in `@jesscss/core` to avoid cyclic workspace dependencies with `styles-config`.
15
+ */
16
+ export type UnitMode = 'loose' | 'preserve' | 'strict';
17
+ /**
18
+ * Equality modes for guard/comparison semantics.
19
+ *
20
+ * - `coerce`: Less-compatible coercive equality behavior
21
+ * - `strict`: type-strict equality behavior
22
+ */
23
+ export type EqualityMode = 'coerce' | 'strict';
24
+ //# sourceMappingURL=modes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/types/modes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=modes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modes.js","sourceRoot":"","sources":["../../src/types/modes.ts"],"names":[],"mappings":""}
package/lib/types.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ import type { PluginInterface } from './plugin';
2
+ export declare const enum MathMode {
3
+ /**
4
+ * @note - A Jess file always performs math for expressions,
5
+ * but that's because expressions are only parsed as such
6
+ * when wrapped with `$()`, whereas Less & SCSS try to
7
+ * parse expressions in regular value sequences.
8
+ */
9
+ ALWAYS = 0,
10
+ PARENS_DIVISION = 1,
11
+ PARENS = 2
12
+ }
13
+ export declare const enum UnitMode {
14
+ /** Less's default 1.x-4.x */
15
+ LOOSE = 0,
16
+ /**
17
+ * @todo - I think Less's current strict unit mode is weirder,
18
+ * so this may need another mode depending on behavior. But
19
+ * if it's too weird, it could be a breaking change.
20
+ */
21
+ STRICT = 1
22
+ }
23
+ export interface StylesConfig {
24
+ compile?: {
25
+ plugins?: PluginInterface[];
26
+ searchPaths?: string[];
27
+ enableJavaScript?: boolean;
28
+ mathMode?: MathMode;
29
+ unitMode?: UnitMode;
30
+ };
31
+ output?: {
32
+ collapseNesting?: boolean;
33
+ compress?: boolean;
34
+ sourceMap?: boolean;
35
+ };
36
+ language?: {
37
+ less?: LessOptions;
38
+ [key: string]: LessOptions | Record<string, any> | undefined;
39
+ };
40
+ }
41
+ export interface LessOptions {
42
+ mathMode?: MathMode;
43
+ unitMode?: UnitMode;
44
+ dumpLineNumbers?: string;
45
+ relativeUrls?: boolean;
46
+ compress?: boolean;
47
+ strictMath?: boolean;
48
+ strictUnits?: boolean;
49
+ javascriptEnabled?: boolean;
50
+ sourceMap?: boolean;
51
+ globalVars?: Record<string, any>;
52
+ modifyVars?: Record<string, any>;
53
+ urlArgs?: string;
54
+ rewriteUrls?: boolean;
55
+ rootpath?: string;
56
+ paths?: string[];
57
+ plugin?: any;
58
+ processImports?: boolean;
59
+ syncImport?: boolean;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,0BAAkB,QAAQ;IACxB;;;;;OAKG;IACH,MAAM,IAAI;IACV,eAAe,IAAI;IACnB,MAAM,IAAI;CACX;AAED,0BAAkB,QAAQ;IACxB,6BAA6B;IAC7B,KAAK,IAAI;IACT;;;;OAIG;IACH,MAAM,IAAI;CACX;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,WAAW,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;KAE9D,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
package/lib/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { PluginInterface } from './plugin.js';
2
+ type WebpackResolverInstance = {
3
+ apply(resolver: any): void;
4
+ };
5
+ export type WebpackResolverCtor<Opts> = new (opts?: Opts) => WebpackResolverInstance;
6
+ type InferCtorOpts<C> = C extends new (opts?: infer O) => any ? O : never;
7
+ export declare function useWebpackResolver<Ctor extends WebpackResolverCtor<any>>(CtorRef: Ctor): (opts?: InferCtorOpts<Ctor>) => PluginInterface;
8
+ export {};
9
+ //# sourceMappingURL=use-webpack-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-webpack-resolver.d.ts","sourceRoot":"","sources":["../src/use-webpack-resolver.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,KAAK,uBAAuB,GAAG;IAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAA;CAAE,CAAC;AAC9D,MAAM,MAAM,mBAAmB,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,EAAE,IAAI,KAAK,uBAAuB,CAAC;AACrF,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAE1E,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,mBAAmB,CAAC,GAAG,CAAC,EACtE,OAAO,EAAE,IAAI,GACZ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,eAAe,CAsCjD"}
@@ -0,0 +1,41 @@
1
+ // jess/useWebpackResolver.ts
2
+ import path from 'node:path';
3
+ import fs from 'node:fs';
4
+ import { ResolverFactory, CachedInputFileSystem } from 'enhanced-resolve';
5
+ const { isArray } = Array;
6
+ export function useWebpackResolver(CtorRef) {
7
+ return (opts) => {
8
+ const fileSystem = new CachedInputFileSystem(fs, 4000);
9
+ const pluginInstance = new CtorRef(opts);
10
+ const er = ResolverFactory.createResolver({
11
+ fileSystem,
12
+ plugins: [pluginInstance]
13
+ });
14
+ const resolveOnce = (basedir, request) => new Promise((resolve) => {
15
+ er.resolve({}, basedir, request, {}, (err, out) => {
16
+ resolve(err ? null : out);
17
+ });
18
+ });
19
+ return {
20
+ name: `webpack-resolver(${CtorRef.name || 'ctor'})`,
21
+ async resolve(filePath, currentDir, searchPaths) {
22
+ const bases = [currentDir, ...searchPaths];
23
+ const out = [];
24
+ const seen = new Set();
25
+ filePath = isArray(filePath) ? filePath : [filePath];
26
+ for (const base of bases) {
27
+ const baseDir = path.isAbsolute(base) ? base : path.resolve(currentDir, base);
28
+ for (const path of filePath) {
29
+ const abs = await resolveOnce(baseDir, path);
30
+ if (abs && !seen.has(abs)) {
31
+ seen.add(abs);
32
+ out.push(abs);
33
+ }
34
+ }
35
+ }
36
+ return out;
37
+ }
38
+ };
39
+ };
40
+ }
41
+ //# sourceMappingURL=use-webpack-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-webpack-resolver.js","sourceRoot":"","sources":["../src/use-webpack-resolver.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAM1B,MAAM,UAAU,kBAAkB,CAChC,OAAa;IAEb,OAAO,CAAC,IAA0B,EAAmB,EAAE;QACrD,MAAM,UAAU,GAAG,IAAI,qBAAqB,CAAC,EAAS,EAAE,IAAI,CAAC,CAAC;QAC9D,MAAM,cAAc,GAA4B,IAAI,OAAO,CAAC,IAAW,CAAC,CAAC;QAEzE,MAAM,EAAE,GAAG,eAAe,CAAC,cAAc,CAAC;YACxC,UAAU;YACV,OAAO,EAAE,CAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,OAAe,EAAE,EAAE,CACvD,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,EAAE;YACrC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBAChD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,GAAc,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEL,OAAO;YACL,IAAI,EAAE,oBAAoB,OAAO,CAAC,IAAI,IAAI,MAAM,GAAG;YACnD,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW;gBAC7C,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,GAAG,WAAW,CAAC,CAAC;gBAC3C,MAAM,GAAG,GAAa,EAAE,CAAC;gBACzB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;gBAC/B,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBACrD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;oBAC9E,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;wBAC5B,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;wBAC7C,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;4BAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;4BACd,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBAChB,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,OAAO,GAAG,CAAC;YACb,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}