@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,73 @@
1
+ import type { Context } from './context.js';
2
+ import type { MaybePromise } from '@jesscss/awaitable-pipe';
3
+ export type ConversionPlugin = (value: unknown) => number | unknown;
4
+ /**
5
+ * PreprocessParams function type for preprocessing entire argument arrays
6
+ * Can be synchronous or asynchronous
7
+ */
8
+ export type PreprocessParams = (args: any[], context: Context) => MaybePromise<any[]>;
9
+ /**
10
+ * Converts percentage values to a fraction of the specified base value
11
+ * @param base - The base value to convert percentages to (e.g., 255 for RGB, 100 for HSL)
12
+ * Memoized so that percentOf(255) always returns the same function instance
13
+ */
14
+ export declare const percentOf: (base: number) => ConversionPlugin;
15
+ /**
16
+ * Converts angle units to degrees
17
+ * Supports: deg, turn, rad, grad
18
+ * Memoized so that angleToDegrees() always returns the same function instance
19
+ */
20
+ export declare const angleToDegrees: () => ConversionPlugin;
21
+ /**
22
+ * Normalizes hue values to 0-360 degree range
23
+ * Supports: deg, turn, rad, grad, % (percentage of 360)
24
+ * Memoized so that normalizeHue() always returns the same function instance
25
+ */
26
+ export declare const normalizeHue: () => ConversionPlugin;
27
+ /**
28
+ * Converts alpha values to 0-1 range
29
+ * Supports: % (percentage of 1), unitless numbers
30
+ * Memoized so that alphaToNumber() always returns the same function instance
31
+ */
32
+ export declare const alphaToNumber: () => ConversionPlugin;
33
+ /**
34
+ * Converts any dimension to a number (removes units)
35
+ * Memoized so that toNumber() always returns the same function instance
36
+ */
37
+ export declare const toNumber: () => ConversionPlugin;
38
+ export declare const clamp: (min: number, max: number) => ConversionPlugin;
39
+ /**
40
+ * Converts length units to pixels
41
+ * Supports: px, em, rem, in, cm, mm, pt, pc
42
+ */
43
+ export declare const lengthToPx: (baseFontSize?: number) => ConversionPlugin;
44
+ /**
45
+ * Converts time units to milliseconds
46
+ * Supports: ms, s
47
+ */
48
+ export declare const timeToMs: () => ConversionPlugin;
49
+ /**
50
+ * Converts frequency units to hertz
51
+ * Supports: hz, khz
52
+ */
53
+ export declare const frequencyToHz: () => ConversionPlugin;
54
+ /**
55
+ * Converts angle units to radians
56
+ * Supports: deg, turn, rad, grad
57
+ */
58
+ export declare const angleToRadians: () => ConversionPlugin;
59
+ /**
60
+ * Creates a preprocessParams function that splits a Sequence into individual arguments.
61
+ * Handles operations with slashes (/) by distributing the left and right operands.
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const rgb = defineFunction('rgb', function(r, g, b, a?) {
66
+ * // ...
67
+ * }, {
68
+ * preprocessParams: [splitSequence()]
69
+ * });
70
+ * ```
71
+ */
72
+ export declare const splitSequence: () => PreprocessParams;
73
+ //# sourceMappingURL=conversions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../src/conversions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,GAAG,OAAO,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;AAqBtF;;;;GAIG;AACH,eAAO,MAAM,SAAS,oCAMpB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,wBAkBzB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,wBAwBvB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa,wBAiBxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,wBAQnB,CAAC;AAEH,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,gBAIhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,eAAc,MAAW,KAAG,gBAiBtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAO,gBAY3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,gBAYhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,gBAkBjC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,QAAO,gBAmChC,CAAC"}
@@ -0,0 +1,253 @@
1
+ import { Dimension, Num } from './tree/index.js';
2
+ import { isNode } from './tree/util/is-node.js';
3
+ /**
4
+ * Simple memoization utility for factory functions
5
+ * Caches results based on stringified arguments
6
+ */
7
+ function memoize(fn) {
8
+ const cache = new Map();
9
+ return (...args) => {
10
+ const key = JSON.stringify(args);
11
+ if (cache.has(key)) {
12
+ return cache.get(key);
13
+ }
14
+ const result = fn(...args);
15
+ cache.set(key, result);
16
+ return result;
17
+ };
18
+ }
19
+ /**
20
+ * Converts percentage values to a fraction of the specified base value
21
+ * @param base - The base value to convert percentages to (e.g., 255 for RGB, 100 for HSL)
22
+ * Memoized so that percentOf(255) always returns the same function instance
23
+ */
24
+ export const percentOf = memoize((base) => (value) => {
25
+ if (value instanceof Dimension && value.value.unit === '%') {
26
+ const converted = value.value.number * base / 100;
27
+ return new Num(converted);
28
+ }
29
+ return value;
30
+ });
31
+ /**
32
+ * Converts angle units to degrees
33
+ * Supports: deg, turn, rad, grad
34
+ * Memoized so that angleToDegrees() always returns the same function instance
35
+ */
36
+ export const angleToDegrees = memoize(() => (value) => {
37
+ if (!(value instanceof Dimension)) {
38
+ return value;
39
+ }
40
+ const { number, unit } = value.value;
41
+ if (unit === 'turn') {
42
+ return new Num(number * 360);
43
+ }
44
+ if (unit === 'rad') {
45
+ return new Num(number * 180 / Math.PI);
46
+ }
47
+ if (unit === 'grad') {
48
+ return new Num(number * 0.9);
49
+ }
50
+ if (unit === 'deg' || unit === '') {
51
+ return new Num(number);
52
+ }
53
+ return value;
54
+ });
55
+ /**
56
+ * Normalizes hue values to 0-360 degree range
57
+ * Supports: deg, turn, rad, grad, % (percentage of 360)
58
+ * Memoized so that normalizeHue() always returns the same function instance
59
+ */
60
+ export const normalizeHue = memoize(() => (value) => {
61
+ if (!(value instanceof Dimension)) {
62
+ return value;
63
+ }
64
+ const { number, unit } = value.value;
65
+ let degrees = number;
66
+ if (unit === 'turn') {
67
+ degrees = number * 360;
68
+ }
69
+ else if (unit === 'rad') {
70
+ degrees = number * 180 / Math.PI;
71
+ }
72
+ else if (unit === 'grad') {
73
+ degrees = number * 0.9;
74
+ }
75
+ else if (unit === '%') {
76
+ degrees = number * 360 / 100;
77
+ }
78
+ else if (unit === 'deg' || unit === '') {
79
+ degrees = number;
80
+ }
81
+ else {
82
+ return value; // Don't convert if unit is not recognized
83
+ }
84
+ // Normalize to 0-360 range
85
+ degrees = ((degrees % 360) + 360) % 360;
86
+ return new Num(degrees);
87
+ });
88
+ /**
89
+ * Converts alpha values to 0-1 range
90
+ * Supports: % (percentage of 1), unitless numbers
91
+ * Memoized so that alphaToNumber() always returns the same function instance
92
+ */
93
+ export const alphaToNumber = memoize(() => (value) => {
94
+ if (!(value instanceof Dimension)) {
95
+ return value;
96
+ }
97
+ const { number, unit } = value.value;
98
+ let result = number;
99
+ if (unit === '%') {
100
+ result = number / 100;
101
+ }
102
+ else if (unit === '') {
103
+ result = number;
104
+ }
105
+ else {
106
+ return value; // Don't convert if unit is not recognized
107
+ }
108
+ const clamped = Math.max(0, Math.min(1, result));
109
+ return new Num(clamped);
110
+ });
111
+ /**
112
+ * Converts any dimension to a number (removes units)
113
+ * Memoized so that toNumber() always returns the same function instance
114
+ */
115
+ export const toNumber = memoize(() => (value) => {
116
+ if (value instanceof Dimension) {
117
+ return new Num(value.value.number); // Extract number from Dimension
118
+ }
119
+ if (value instanceof Num) {
120
+ return new Num(value.value.number);
121
+ }
122
+ return value; // Don't know how to handle this, pass through
123
+ });
124
+ export const clamp = (min, max) => (value) => {
125
+ if (typeof value !== 'number') {
126
+ return Math.max(min, Math.min(max, value));
127
+ }
128
+ };
129
+ /**
130
+ * Converts length units to pixels
131
+ * Supports: px, em, rem, in, cm, mm, pt, pc
132
+ */
133
+ export const lengthToPx = (baseFontSize = 16) => (value) => {
134
+ if (!(value instanceof Dimension)) {
135
+ return value;
136
+ }
137
+ const { number, unit } = value.value;
138
+ switch (unit) {
139
+ case 'px': return new Num(number);
140
+ case 'em': return new Num(number * baseFontSize);
141
+ case 'rem': return new Num(number * baseFontSize);
142
+ case 'in': return new Num(number * 96);
143
+ case 'cm': return new Num(number * 96 / 2.54);
144
+ case 'mm': return new Num(number * 96 / 25.4);
145
+ case 'pt': return new Num(number * 96 / 72);
146
+ case 'pc': return new Num(number * 96 / 6);
147
+ default: return value;
148
+ }
149
+ };
150
+ /**
151
+ * Converts time units to milliseconds
152
+ * Supports: ms, s
153
+ */
154
+ export const timeToMs = () => (value) => {
155
+ if (!(value instanceof Dimension)) {
156
+ return value;
157
+ }
158
+ const { number, unit } = value.value;
159
+ if (unit === 'ms') {
160
+ return new Num(number);
161
+ }
162
+ if (unit === 's') {
163
+ return new Num(number * 1000);
164
+ }
165
+ return value;
166
+ };
167
+ /**
168
+ * Converts frequency units to hertz
169
+ * Supports: hz, khz
170
+ */
171
+ export const frequencyToHz = () => (value) => {
172
+ if (!(value instanceof Dimension)) {
173
+ return value;
174
+ }
175
+ const { number, unit } = value.value;
176
+ if (unit === 'hz') {
177
+ return new Num(number);
178
+ }
179
+ if (unit === 'khz') {
180
+ return new Num(number * 1000);
181
+ }
182
+ return value;
183
+ };
184
+ /**
185
+ * Converts angle units to radians
186
+ * Supports: deg, turn, rad, grad
187
+ */
188
+ export const angleToRadians = () => (value) => {
189
+ if (!(value instanceof Dimension)) {
190
+ return value;
191
+ }
192
+ const { number, unit } = value.value;
193
+ if (unit === 'turn') {
194
+ return new Num(number * 2 * Math.PI);
195
+ }
196
+ if (unit === 'rad') {
197
+ return new Num(number);
198
+ }
199
+ if (unit === 'grad') {
200
+ return new Num(number * Math.PI / 200);
201
+ }
202
+ if (unit === 'deg' || unit === '') {
203
+ return new Num(number * Math.PI / 180);
204
+ }
205
+ return value;
206
+ };
207
+ /**
208
+ * Creates a preprocessParams function that splits a Sequence into individual arguments.
209
+ * Handles operations with slashes (/) by distributing the left and right operands.
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * const rgb = defineFunction('rgb', function(r, g, b, a?) {
214
+ * // ...
215
+ * }, {
216
+ * preprocessParams: [splitSequence()]
217
+ * });
218
+ * ```
219
+ */
220
+ export const splitSequence = () => {
221
+ return (args, context) => {
222
+ // Only process if we have exactly one argument that is a Sequence
223
+ if (args.length !== 1 || !isNode(args[0], 'Sequence')) {
224
+ return args;
225
+ }
226
+ const sequence = args[0];
227
+ // Split the sequence into individual arguments
228
+ const splitArgs = [];
229
+ for (let i = 0; i < sequence.value.length; i++) {
230
+ const item = sequence.value[i];
231
+ // Check if this is the last item and it's an Operation (likely a slash)
232
+ if (i === sequence.value.length - 1 && item.type === 'Operation') {
233
+ const [left, op, right] = item.value;
234
+ // Add the left operand
235
+ splitArgs.push(left);
236
+ // Add the right operand if it exists and is not a placeholder (Num with value 0)
237
+ // This handles test cases where Num(0) is used as a placeholder for undefined
238
+ if (right) {
239
+ const isPlaceholder = right.type === 'Number'
240
+ && right.value?.number === 0;
241
+ if (!isPlaceholder) {
242
+ splitArgs.push(right);
243
+ }
244
+ }
245
+ }
246
+ else {
247
+ splitArgs.push(item);
248
+ }
249
+ }
250
+ return splitArgs;
251
+ };
252
+ };
253
+ //# sourceMappingURL=conversions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversions.js","sourceRoot":"","sources":["../src/conversions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAA6B,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAahD;;;GAGG;AACH,SAAS,OAAO,CACd,EAA6B;IAE7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,OAAO,CAAC,GAAG,IAAU,EAAU,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;QACzB,CAAC;QACD,MAAM,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,IAAY,EAAoB,EAAE,CAAC,CAAC,KAAc,EAAE,EAAE;IACtF,IAAI,KAAK,YAAY,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;QAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,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C;oBACV,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,KAAK,QAAQ;2BACvC,KAAa,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC;oBACxC,IAAI,CAAC,aAAa,EAAE,CAAC;wBACnB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACxB,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function syncLog(data: Record<string, unknown>): void;
2
+ //# sourceMappingURL=debug-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-log.d.ts","sourceRoot":"","sources":["../src/debug-log.ts"],"names":[],"mappings":"AAoBA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAM3D"}
@@ -0,0 +1,27 @@
1
+ import { appendFileSync, existsSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ function findMonorepoRoot(start) {
4
+ let dir = start;
5
+ while (dir !== '/') {
6
+ if (existsSync(join(dir, 'pnpm-workspace.yaml'))) {
7
+ return dir;
8
+ }
9
+ dir = dirname(dir);
10
+ }
11
+ return process.cwd();
12
+ }
13
+ function getSyncLogPath() {
14
+ if (process.env.DEBUG_LOG_PATH)
15
+ return process.env.DEBUG_LOG_PATH;
16
+ const root = findMonorepoRoot(process.cwd());
17
+ return join(root, '.cursor', 'debug.log');
18
+ }
19
+ export function syncLog(data) {
20
+ try {
21
+ appendFileSync(getSyncLogPath(), `${JSON.stringify(data)}\n`);
22
+ }
23
+ catch {
24
+ // Ignore logging failures in debug mode.
25
+ }
26
+ }
27
+ //# sourceMappingURL=debug-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-log.js","sourceRoot":"","sources":["../src/debug-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,SAAS,gBAAgB,CAAC,KAAa;IACrC,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC;QACnB,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,cAAc;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAClE,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAA6B;IACnD,IAAI,CAAC;QACH,cAAc,CAAC,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,yCAAyC;IAC3C,CAAC;AACH,CAAC"}