@dazl/shorthands-opener 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.md +3 -0
  2. package/dist/compounds/compound-css-data.d.ts +22 -0
  3. package/dist/compounds/compound-css-data.d.ts.map +1 -0
  4. package/dist/compounds/compound-css-data.js +2 -0
  5. package/dist/compounds/compound-css-data.js.map +1 -0
  6. package/dist/compounds/compound-mapper.d.ts +4 -0
  7. package/dist/compounds/compound-mapper.d.ts.map +1 -0
  8. package/dist/compounds/compound-mapper.js +10 -0
  9. package/dist/compounds/compound-mapper.js.map +1 -0
  10. package/dist/compounds/compound-parser-utils.d.ts +3 -0
  11. package/dist/compounds/compound-parser-utils.d.ts.map +1 -0
  12. package/dist/compounds/compound-parser-utils.js +33 -0
  13. package/dist/compounds/compound-parser-utils.js.map +1 -0
  14. package/dist/compounds/compound-types.d.ts +26 -0
  15. package/dist/compounds/compound-types.d.ts.map +1 -0
  16. package/dist/compounds/compound-types.js +2 -0
  17. package/dist/compounds/compound-types.js.map +1 -0
  18. package/dist/compounds/compound-value-parsers.d.ts +6 -0
  19. package/dist/compounds/compound-value-parsers.d.ts.map +1 -0
  20. package/dist/compounds/compound-value-parsers.js +5 -0
  21. package/dist/compounds/compound-value-parsers.js.map +1 -0
  22. package/dist/compounds/index.d.ts +6 -0
  23. package/dist/compounds/index.d.ts.map +1 -0
  24. package/dist/compounds/index.js +6 -0
  25. package/dist/compounds/index.js.map +1 -0
  26. package/dist/compounds/parsers/index.d.ts +2 -0
  27. package/dist/compounds/parsers/index.d.ts.map +1 -0
  28. package/dist/compounds/parsers/index.js +2 -0
  29. package/dist/compounds/parsers/index.js.map +1 -0
  30. package/dist/compounds/parsers/shadow-compound.d.ts +5 -0
  31. package/dist/compounds/parsers/shadow-compound.d.ts.map +1 -0
  32. package/dist/compounds/parsers/shadow-compound.js +39 -0
  33. package/dist/compounds/parsers/shadow-compound.js.map +1 -0
  34. package/dist/css-data-types/data-types-consts.d.ts +212 -0
  35. package/dist/css-data-types/data-types-consts.d.ts.map +1 -0
  36. package/dist/css-data-types/data-types-consts.js +790 -0
  37. package/dist/css-data-types/data-types-consts.js.map +1 -0
  38. package/dist/css-data-types/data-types-predicates.d.ts +32 -0
  39. package/dist/css-data-types/data-types-predicates.d.ts.map +1 -0
  40. package/dist/css-data-types/data-types-predicates.js +353 -0
  41. package/dist/css-data-types/data-types-predicates.js.map +1 -0
  42. package/dist/css-data-types/data-types-state-machines.d.ts +14 -0
  43. package/dist/css-data-types/data-types-state-machines.d.ts.map +1 -0
  44. package/dist/css-data-types/data-types-state-machines.js +129 -0
  45. package/dist/css-data-types/data-types-state-machines.js.map +1 -0
  46. package/dist/css-data-types/data-types-types.d.ts +26 -0
  47. package/dist/css-data-types/data-types-types.d.ts.map +1 -0
  48. package/dist/css-data-types/data-types-types.js +2 -0
  49. package/dist/css-data-types/data-types-types.js.map +1 -0
  50. package/dist/css-data-types/data-types-utils.d.ts +31 -0
  51. package/dist/css-data-types/data-types-utils.d.ts.map +1 -0
  52. package/dist/css-data-types/data-types-utils.js +176 -0
  53. package/dist/css-data-types/data-types-utils.js.map +1 -0
  54. package/dist/css-data-types/data-types.d.ts +64 -0
  55. package/dist/css-data-types/data-types.d.ts.map +1 -0
  56. package/dist/css-data-types/data-types.js +304 -0
  57. package/dist/css-data-types/data-types.js.map +1 -0
  58. package/dist/css-data-types/index.d.ts +7 -0
  59. package/dist/css-data-types/index.d.ts.map +1 -0
  60. package/dist/css-data-types/index.js +7 -0
  61. package/dist/css-data-types/index.js.map +1 -0
  62. package/dist/index.d.ts +5 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +5 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/shorthands/index.d.ts +8 -0
  67. package/dist/shorthands/index.d.ts.map +1 -0
  68. package/dist/shorthands/index.js +8 -0
  69. package/dist/shorthands/index.js.map +1 -0
  70. package/dist/shorthands/openers/background-position-shorthand.d.ts +5 -0
  71. package/dist/shorthands/openers/background-position-shorthand.d.ts.map +1 -0
  72. package/dist/shorthands/openers/background-position-shorthand.js +173 -0
  73. package/dist/shorthands/openers/background-position-shorthand.js.map +1 -0
  74. package/dist/shorthands/openers/background-shorthand.d.ts +5 -0
  75. package/dist/shorthands/openers/background-shorthand.d.ts.map +1 -0
  76. package/dist/shorthands/openers/background-shorthand.js +88 -0
  77. package/dist/shorthands/openers/background-shorthand.js.map +1 -0
  78. package/dist/shorthands/openers/border-image-shorthand.d.ts +5 -0
  79. package/dist/shorthands/openers/border-image-shorthand.d.ts.map +1 -0
  80. package/dist/shorthands/openers/border-image-shorthand.js +16 -0
  81. package/dist/shorthands/openers/border-image-shorthand.js.map +1 -0
  82. package/dist/shorthands/openers/border-radius-shorthand.d.ts +5 -0
  83. package/dist/shorthands/openers/border-radius-shorthand.d.ts.map +1 -0
  84. package/dist/shorthands/openers/border-radius-shorthand.js +61 -0
  85. package/dist/shorthands/openers/border-radius-shorthand.js.map +1 -0
  86. package/dist/shorthands/openers/border-shorthand.d.ts +20 -0
  87. package/dist/shorthands/openers/border-shorthand.d.ts.map +1 -0
  88. package/dist/shorthands/openers/border-shorthand.js +90 -0
  89. package/dist/shorthands/openers/border-shorthand.js.map +1 -0
  90. package/dist/shorthands/openers/flex-flow-shorthand.d.ts +5 -0
  91. package/dist/shorthands/openers/flex-flow-shorthand.d.ts.map +1 -0
  92. package/dist/shorthands/openers/flex-flow-shorthand.js +13 -0
  93. package/dist/shorthands/openers/flex-flow-shorthand.js.map +1 -0
  94. package/dist/shorthands/openers/flex-shorthand.d.ts +5 -0
  95. package/dist/shorthands/openers/flex-shorthand.d.ts.map +1 -0
  96. package/dist/shorthands/openers/flex-shorthand.js +55 -0
  97. package/dist/shorthands/openers/flex-shorthand.js.map +1 -0
  98. package/dist/shorthands/openers/font-shorthand.d.ts +5 -0
  99. package/dist/shorthands/openers/font-shorthand.d.ts.map +1 -0
  100. package/dist/shorthands/openers/font-shorthand.js +60 -0
  101. package/dist/shorthands/openers/font-shorthand.js.map +1 -0
  102. package/dist/shorthands/openers/gap-shorthand.d.ts +5 -0
  103. package/dist/shorthands/openers/gap-shorthand.d.ts.map +1 -0
  104. package/dist/shorthands/openers/gap-shorthand.js +28 -0
  105. package/dist/shorthands/openers/gap-shorthand.js.map +1 -0
  106. package/dist/shorthands/openers/grid-axis-shorthand.d.ts +6 -0
  107. package/dist/shorthands/openers/grid-axis-shorthand.d.ts.map +1 -0
  108. package/dist/shorthands/openers/grid-axis-shorthand.js +36 -0
  109. package/dist/shorthands/openers/grid-axis-shorthand.js.map +1 -0
  110. package/dist/shorthands/openers/grid-gap-shorthand.d.ts +5 -0
  111. package/dist/shorthands/openers/grid-gap-shorthand.d.ts.map +1 -0
  112. package/dist/shorthands/openers/grid-gap-shorthand.js +21 -0
  113. package/dist/shorthands/openers/grid-gap-shorthand.js.map +1 -0
  114. package/dist/shorthands/openers/grid-shorthand.d.ts +8 -0
  115. package/dist/shorthands/openers/grid-shorthand.d.ts.map +1 -0
  116. package/dist/shorthands/openers/grid-shorthand.js +145 -0
  117. package/dist/shorthands/openers/grid-shorthand.js.map +1 -0
  118. package/dist/shorthands/openers/grid-template-shorthand.d.ts +10 -0
  119. package/dist/shorthands/openers/grid-template-shorthand.d.ts.map +1 -0
  120. package/dist/shorthands/openers/grid-template-shorthand.js +113 -0
  121. package/dist/shorthands/openers/grid-template-shorthand.js.map +1 -0
  122. package/dist/shorthands/openers/index.d.ts +22 -0
  123. package/dist/shorthands/openers/index.d.ts.map +1 -0
  124. package/dist/shorthands/openers/index.js +22 -0
  125. package/dist/shorthands/openers/index.js.map +1 -0
  126. package/dist/shorthands/openers/list-style-shorthand.d.ts +5 -0
  127. package/dist/shorthands/openers/list-style-shorthand.d.ts.map +1 -0
  128. package/dist/shorthands/openers/list-style-shorthand.js +15 -0
  129. package/dist/shorthands/openers/list-style-shorthand.js.map +1 -0
  130. package/dist/shorthands/openers/margin-shorthand.d.ts +5 -0
  131. package/dist/shorthands/openers/margin-shorthand.d.ts.map +1 -0
  132. package/dist/shorthands/openers/margin-shorthand.js +11 -0
  133. package/dist/shorthands/openers/margin-shorthand.js.map +1 -0
  134. package/dist/shorthands/openers/outline-shorthand.d.ts +5 -0
  135. package/dist/shorthands/openers/outline-shorthand.d.ts.map +1 -0
  136. package/dist/shorthands/openers/outline-shorthand.js +14 -0
  137. package/dist/shorthands/openers/outline-shorthand.js.map +1 -0
  138. package/dist/shorthands/openers/overflow-shorthand.d.ts +5 -0
  139. package/dist/shorthands/openers/overflow-shorthand.d.ts.map +1 -0
  140. package/dist/shorthands/openers/overflow-shorthand.js +21 -0
  141. package/dist/shorthands/openers/overflow-shorthand.js.map +1 -0
  142. package/dist/shorthands/openers/padding-shorthand.d.ts +5 -0
  143. package/dist/shorthands/openers/padding-shorthand.d.ts.map +1 -0
  144. package/dist/shorthands/openers/padding-shorthand.js +11 -0
  145. package/dist/shorthands/openers/padding-shorthand.js.map +1 -0
  146. package/dist/shorthands/openers/place-content-shorthand.d.ts +5 -0
  147. package/dist/shorthands/openers/place-content-shorthand.d.ts.map +1 -0
  148. package/dist/shorthands/openers/place-content-shorthand.js +29 -0
  149. package/dist/shorthands/openers/place-content-shorthand.js.map +1 -0
  150. package/dist/shorthands/openers/place-items-shorthand.d.ts +5 -0
  151. package/dist/shorthands/openers/place-items-shorthand.d.ts.map +1 -0
  152. package/dist/shorthands/openers/place-items-shorthand.js +23 -0
  153. package/dist/shorthands/openers/place-items-shorthand.js.map +1 -0
  154. package/dist/shorthands/openers/text-decoration-shorthand.d.ts +5 -0
  155. package/dist/shorthands/openers/text-decoration-shorthand.d.ts.map +1 -0
  156. package/dist/shorthands/openers/text-decoration-shorthand.js +14 -0
  157. package/dist/shorthands/openers/text-decoration-shorthand.js.map +1 -0
  158. package/dist/shorthands/shorthand-css-data.d.ts +120 -0
  159. package/dist/shorthands/shorthand-css-data.d.ts.map +1 -0
  160. package/dist/shorthands/shorthand-css-data.js +48 -0
  161. package/dist/shorthands/shorthand-css-data.js.map +1 -0
  162. package/dist/shorthands/shorthand-mapper.d.ts +6 -0
  163. package/dist/shorthands/shorthand-mapper.d.ts.map +1 -0
  164. package/dist/shorthands/shorthand-mapper.js +72 -0
  165. package/dist/shorthands/shorthand-mapper.js.map +1 -0
  166. package/dist/shorthands/shorthand-parser-errors.d.ts +25 -0
  167. package/dist/shorthands/shorthand-parser-errors.d.ts.map +1 -0
  168. package/dist/shorthands/shorthand-parser-errors.js +41 -0
  169. package/dist/shorthands/shorthand-parser-errors.js.map +1 -0
  170. package/dist/shorthands/shorthand-parser-utils.d.ts +24 -0
  171. package/dist/shorthands/shorthand-parser-utils.d.ts.map +1 -0
  172. package/dist/shorthands/shorthand-parser-utils.js +398 -0
  173. package/dist/shorthands/shorthand-parser-utils.js.map +1 -0
  174. package/dist/shorthands/shorthand-types.d.ts +64 -0
  175. package/dist/shorthands/shorthand-types.d.ts.map +1 -0
  176. package/dist/shorthands/shorthand-types.js +2 -0
  177. package/dist/shorthands/shorthand-types.js.map +1 -0
  178. package/dist/shorthands/shorthands-ast-evaluation.d.ts +5 -0
  179. package/dist/shorthands/shorthands-ast-evaluation.d.ts.map +1 -0
  180. package/dist/shorthands/shorthands-ast-evaluation.js +19 -0
  181. package/dist/shorthands/shorthands-ast-evaluation.js.map +1 -0
  182. package/dist/tokenizers/css-value-tokenizer.d.ts +43 -0
  183. package/dist/tokenizers/css-value-tokenizer.d.ts.map +1 -0
  184. package/dist/tokenizers/css-value-tokenizer.js +154 -0
  185. package/dist/tokenizers/css-value-tokenizer.js.map +1 -0
  186. package/dist/tokenizers/index.d.ts +2 -0
  187. package/dist/tokenizers/index.d.ts.map +1 -0
  188. package/dist/tokenizers/index.js +2 -0
  189. package/dist/tokenizers/index.js.map +1 -0
  190. package/package.json +54 -0
  191. package/src/compounds/compound-css-data.ts +24 -0
  192. package/src/compounds/compound-mapper.ts +21 -0
  193. package/src/compounds/compound-parser-utils.ts +47 -0
  194. package/src/compounds/compound-types.ts +35 -0
  195. package/src/compounds/compound-value-parsers.ts +12 -0
  196. package/src/compounds/index.ts +5 -0
  197. package/src/compounds/parsers/index.ts +1 -0
  198. package/src/compounds/parsers/shadow-compound.ts +56 -0
  199. package/src/css-data-types/data-types-consts.ts +877 -0
  200. package/src/css-data-types/data-types-predicates.ts +477 -0
  201. package/src/css-data-types/data-types-state-machines.ts +169 -0
  202. package/src/css-data-types/data-types-types.ts +43 -0
  203. package/src/css-data-types/data-types-utils.ts +258 -0
  204. package/src/css-data-types/data-types.ts +435 -0
  205. package/src/css-data-types/index.ts +6 -0
  206. package/src/index.ts +4 -0
  207. package/src/shorthands/index.ts +7 -0
  208. package/src/shorthands/openers/background-position-shorthand.ts +180 -0
  209. package/src/shorthands/openers/background-shorthand.ts +161 -0
  210. package/src/shorthands/openers/border-image-shorthand.ts +35 -0
  211. package/src/shorthands/openers/border-radius-shorthand.ts +93 -0
  212. package/src/shorthands/openers/border-shorthand.ts +198 -0
  213. package/src/shorthands/openers/flex-flow-shorthand.ts +24 -0
  214. package/src/shorthands/openers/flex-shorthand.ts +79 -0
  215. package/src/shorthands/openers/font-shorthand.ts +85 -0
  216. package/src/shorthands/openers/gap-shorthand.ts +47 -0
  217. package/src/shorthands/openers/grid-axis-shorthand.ts +61 -0
  218. package/src/shorthands/openers/grid-gap-shorthand.ts +40 -0
  219. package/src/shorthands/openers/grid-shorthand.ts +260 -0
  220. package/src/shorthands/openers/grid-template-shorthand.ts +176 -0
  221. package/src/shorthands/openers/index.ts +21 -0
  222. package/src/shorthands/openers/list-style-shorthand.ts +33 -0
  223. package/src/shorthands/openers/margin-shorthand.ts +20 -0
  224. package/src/shorthands/openers/outline-shorthand.ts +27 -0
  225. package/src/shorthands/openers/overflow-shorthand.ts +40 -0
  226. package/src/shorthands/openers/padding-shorthand.ts +21 -0
  227. package/src/shorthands/openers/place-content-shorthand.ts +49 -0
  228. package/src/shorthands/openers/place-items-shorthand.ts +43 -0
  229. package/src/shorthands/openers/text-decoration-shorthand.ts +27 -0
  230. package/src/shorthands/shorthand-css-data.ts +210 -0
  231. package/src/shorthands/shorthand-mapper.ts +157 -0
  232. package/src/shorthands/shorthand-parser-errors.ts +47 -0
  233. package/src/shorthands/shorthand-parser-utils.ts +602 -0
  234. package/src/shorthands/shorthand-types.ts +107 -0
  235. package/src/shorthands/shorthands-ast-evaluation.ts +38 -0
  236. package/src/tokenizers/css-value-tokenizer.ts +220 -0
  237. package/src/tokenizers/index.ts +1 -0
@@ -0,0 +1,7 @@
1
+ export * from './data-types-consts.js';
2
+ export * from './data-types.js';
3
+ export * from './data-types-predicates.js';
4
+ export * from './data-types-state-machines.js';
5
+ export * from './data-types-types.js';
6
+ export * from './data-types-utils.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/css-data-types/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './css-data-types/index.js';
2
+ export * from './shorthands/index.js';
3
+ export * from './compounds/index.js';
4
+ export * from './tokenizers/index.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './css-data-types/index.js';
2
+ export * from './shorthands/index.js';
3
+ export * from './compounds/index.js';
4
+ export * from './tokenizers/index.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './shorthand-css-data.js';
2
+ export * from './shorthand-types.js';
3
+ export * from './shorthand-parser-errors.js';
4
+ export * from './shorthands-ast-evaluation.js';
5
+ export * from './shorthand-parser-utils.js';
6
+ export * from './shorthand-mapper.js';
7
+ export * from './openers/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shorthands/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './shorthand-css-data.js';
2
+ export * from './shorthand-types.js';
3
+ export * from './shorthand-parser-errors.js';
4
+ export * from './shorthands-ast-evaluation.js';
5
+ export * from './shorthand-parser-utils.js';
6
+ export * from './shorthand-mapper.js';
7
+ export * from './openers/index.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shorthands/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { ShorthandCloser, ShorthandOpener } from '../shorthand-types.js';
2
+ import type { BackgroundPositionLonghand, OpenedBackgroundPositionShorthand } from '../shorthand-css-data.js';
3
+ export declare const openBackgroundPositionShorthand: <V>() => ShorthandOpener<V, BackgroundPositionLonghand, OpenedBackgroundPositionShorthand<V>>;
4
+ export declare const closeBackgroundPositionShorthand: <V>() => ShorthandCloser<V, BackgroundPositionLonghand, OpenedBackgroundPositionShorthand<V>>;
5
+ //# sourceMappingURL=background-position-shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-position-shorthand.d.ts","sourceRoot":"","sources":["../../../src/shorthands/openers/background-position-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAY5F,OAAO,KAAK,EAAE,0BAA0B,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AA4J9G,eAAO,MAAM,+BAA+B,GACvC,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,0BAA0B,EAAE,iCAAiC,CAAC,CAAC,CAAC,CAIzF,CAAC;AAEN,eAAO,MAAM,gCAAgC,GAAI,CAAC,OAAK,eAAe,CAClE,CAAC,EACD,0BAA0B,EAC1B,iCAAiC,CAAC,CAAC,CAAC,CACkE,CAAC"}
@@ -0,0 +1,173 @@
1
+ import { BG_POSITION_CENTER_KEYWORD, BG_POSITION_HORIZONTAL_KEYWORDS_MAP, BG_POSITION_VERTICAL_KEYWORDS_MAP, lengthPercentageDataType, universalDataType, unorderedListPredicate, } from '../../css-data-types/index.js';
2
+ import { createCssValueAST } from '../../tokenizers/index.js';
3
+ import { NoDataTypeMatchError } from '../shorthand-parser-errors.js';
4
+ import { evaluateAst } from '../shorthands-ast-evaluation.js';
5
+ import { createShorthandCloser, shorthandCloserTemplate } from '../shorthand-parser-utils.js';
6
+ const centerKeyword = unorderedListPredicate(BG_POSITION_CENTER_KEYWORD);
7
+ const xKeyword = unorderedListPredicate(BG_POSITION_HORIZONTAL_KEYWORDS_MAP);
8
+ const yKeyword = unorderedListPredicate(BG_POSITION_VERTICAL_KEYWORDS_MAP);
9
+ const lengthPercentageValue = lengthPercentageDataType.predicate;
10
+ const universalValue = universalDataType.predicate;
11
+ function backgroundPositionOpener(nodes) {
12
+ if (nodes.some((node) => node.value.type === ',')) {
13
+ throw new Error('background-position value with a single layer should be provided.');
14
+ }
15
+ // 1-value syntax
16
+ if (nodes.length === 1) {
17
+ const node = nodes[0];
18
+ if (centerKeyword(node.value) || universalValue(node.value)) {
19
+ return {
20
+ 'background-position-x': [node],
21
+ 'background-position-y': [node],
22
+ };
23
+ }
24
+ else if (xKeyword(node.value) || lengthPercentageValue(node.value)) {
25
+ return {
26
+ 'background-position-x': [node],
27
+ 'background-position-y': [{ value: createCssValueAST('center')[0], isImplicit: true }],
28
+ };
29
+ }
30
+ else if (yKeyword(node.value)) {
31
+ return {
32
+ 'background-position-x': [{ value: createCssValueAST('center')[0], isImplicit: true }],
33
+ 'background-position-y': [node],
34
+ };
35
+ }
36
+ else {
37
+ throw new NoDataTypeMatchError(node.value.text);
38
+ }
39
+ }
40
+ // 2-value syntax
41
+ if (nodes.length === 2) {
42
+ const [node1, node2] = nodes;
43
+ if (centerKeyword(node1.value)) {
44
+ if (centerKeyword(node2.value) || yKeyword(node2.value) || lengthPercentageValue(node2.value)) {
45
+ return {
46
+ 'background-position-x': [node1],
47
+ 'background-position-y': [node2],
48
+ };
49
+ }
50
+ else if (xKeyword(node2.value)) {
51
+ return {
52
+ 'background-position-x': [node2],
53
+ 'background-position-y': [node1],
54
+ };
55
+ }
56
+ else {
57
+ throw new NoDataTypeMatchError(node2.value.text);
58
+ }
59
+ }
60
+ else if (xKeyword(node1.value) || lengthPercentageValue(node1.value)) {
61
+ if (centerKeyword(node2.value) || yKeyword(node2.value) || lengthPercentageValue(node2.value)) {
62
+ return {
63
+ 'background-position-x': [node1],
64
+ 'background-position-y': [node2],
65
+ };
66
+ }
67
+ else {
68
+ throw new NoDataTypeMatchError(node2.value.text);
69
+ }
70
+ }
71
+ else if (yKeyword(node1.value)) {
72
+ if (centerKeyword(node2.value) || xKeyword(node2.value) || lengthPercentageValue(node2.value)) {
73
+ return {
74
+ 'background-position-x': [node2],
75
+ 'background-position-y': [node1],
76
+ };
77
+ }
78
+ else {
79
+ throw new NoDataTypeMatchError(node2.value.text);
80
+ }
81
+ }
82
+ else {
83
+ throw new NoDataTypeMatchError(node1.value.text);
84
+ }
85
+ }
86
+ // 3-value syntax
87
+ if (nodes.length === 3) {
88
+ const [node1, node2, node3] = nodes;
89
+ if (centerKeyword(node1.value)) {
90
+ if (xKeyword(node2.value) && lengthPercentageValue(node3.value)) {
91
+ return {
92
+ 'background-position-x': [node2, node3],
93
+ 'background-position-y': [node1],
94
+ };
95
+ }
96
+ else if (yKeyword(node2.value) && lengthPercentageValue(node3.value)) {
97
+ return {
98
+ 'background-position-x': [node1],
99
+ 'background-position-y': [node2, node3],
100
+ };
101
+ }
102
+ else {
103
+ throw new Error('Invalid data types of the second and third values.');
104
+ }
105
+ }
106
+ else if (xKeyword(node1.value)) {
107
+ if (yKeyword(node2.value) && lengthPercentageValue(node3.value)) {
108
+ return {
109
+ 'background-position-x': [node1],
110
+ 'background-position-y': [node2, node3],
111
+ };
112
+ }
113
+ else if (lengthPercentageValue(node2.value) && (yKeyword(node3.value) || centerKeyword(node3.value))) {
114
+ return {
115
+ 'background-position-x': [node1, node2],
116
+ 'background-position-y': [node3],
117
+ };
118
+ }
119
+ else {
120
+ throw new Error('Invalid data types of the second and third values.');
121
+ }
122
+ }
123
+ else if (yKeyword(node1.value)) {
124
+ if (xKeyword(node2.value) && lengthPercentageValue(node3.value)) {
125
+ return {
126
+ 'background-position-x': [node2, node3],
127
+ 'background-position-y': [node1],
128
+ };
129
+ }
130
+ else if (lengthPercentageValue(node2.value) && (xKeyword(node3.value) || centerKeyword(node3.value))) {
131
+ return {
132
+ 'background-position-x': [node3],
133
+ 'background-position-y': [node1, node2],
134
+ };
135
+ }
136
+ else {
137
+ throw new Error('Invalid data types of the second and third values.');
138
+ }
139
+ }
140
+ else {
141
+ throw new NoDataTypeMatchError(node1.value.text);
142
+ }
143
+ }
144
+ // 4-value syntax
145
+ if (nodes.length === 4) {
146
+ const [node1, node2, node3, node4] = nodes;
147
+ if (!lengthPercentageValue(node2.value) || !lengthPercentageValue(node4.value)) {
148
+ throw new Error('The second and fourth values are not <length-percentage>.');
149
+ }
150
+ if (xKeyword(node1.value) && yKeyword(node3.value)) {
151
+ return {
152
+ 'background-position-x': [node1, node2],
153
+ 'background-position-y': [node3, node4],
154
+ };
155
+ }
156
+ else if (yKeyword(node1.value) && xKeyword(node3.value)) {
157
+ return {
158
+ 'background-position-x': [node3, node4],
159
+ 'background-position-y': [node1, node2],
160
+ };
161
+ }
162
+ else {
163
+ throw new Error('Invalid data types of the first and third values.');
164
+ }
165
+ }
166
+ throw new Error('Invalid shorthand syntax: 0 or more than 4 values.');
167
+ }
168
+ export const openBackgroundPositionShorthand = () => (shortHand, api) => {
169
+ const astNodes = evaluateAst(shortHand, api);
170
+ return backgroundPositionOpener(astNodes);
171
+ };
172
+ export const closeBackgroundPositionShorthand = () => createShorthandCloser(shorthandCloserTemplate `${'background-position-x'} ${'background-position-y'}`);
173
+ //# sourceMappingURL=background-position-shorthand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-position-shorthand.js","sourceRoot":"","sources":["../../../src/shorthands/openers/background-position-shorthand.ts"],"names":[],"mappings":"AACA,OAAO,EACH,0BAA0B,EAC1B,mCAAmC,EACnC,iCAAiC,EACjC,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAA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,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO;gBACH,uBAAuB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;gBACvC,uBAAuB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;aAC1C,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzE,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GACxC,GAA4F,EAAE,CAC9F,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC7C,OAAO,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAI9C,EAAE,CAAC,qBAAqB,CAAC,uBAAuB,CAAA,GAAG,uBAAuB,IAAI,uBAAuB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Backgrounds, OpenedBackgroundShorthand } from '../shorthand-css-data.js';
2
+ import type { ShorthandOpener, ShorthandCloser } from '../shorthand-types.js';
3
+ export declare const openBackgroundShorthand: <V>() => ShorthandOpener<V, Backgrounds, OpenedBackgroundShorthand<V>>;
4
+ export declare const closeBackgroundShorthand: <V>() => ShorthandCloser<V, Backgrounds, OpenedBackgroundShorthand<V>>;
5
+ //# sourceMappingURL=background-shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-shorthand.d.ts","sourceRoot":"","sources":["../../../src/shorthands/openers/background-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAmB,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,KAAK,EAIR,eAAe,EAEf,eAAe,EAElB,MAAM,uBAAuB,CAAC;AAyB/B,eAAO,MAAM,uBAAuB,GAAI,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,yBAAyB,CAAC,CAAC,CAAC,CA6DzG,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAChC,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,yBAAyB,CAAC,CAAC,CAAC,CA8DlE,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { imageSourceDataType, bgPositionDataType, bgSizeDataType, repeatStyleDataType, attachmentDataType, backgroundOriginDataType, backgroundClipDataType, backgroundColorDataType, } from '../../css-data-types/index.js';
2
+ import { valueTextNode } from '../../tokenizers/index.js';
3
+ import { splitSimpleShorthandOpener, unorderedListShorthandOpener, getOpenedLayer, layersShorthandOpener, createShorthandOpener, getOpenedNode, shorthandCloserTemplate, fixAstNodesPositions, } from '../shorthand-parser-utils.js';
4
+ // background
5
+ export const openBackgroundShorthand = () => {
6
+ const bgLayerShorthandParts = [
7
+ { prop: 'background-image', dataType: imageSourceDataType },
8
+ { prop: 'background-position', dataType: bgPositionDataType, multipleItems: true },
9
+ { prop: 'background-size', dataType: bgSizeDataType, multipleItems: true },
10
+ { prop: 'background-repeat', dataType: repeatStyleDataType, multipleItems: true },
11
+ { prop: 'background-attachment', dataType: attachmentDataType },
12
+ {
13
+ prop: 'background-origin',
14
+ dataType: backgroundOriginDataType,
15
+ partOpener: splitSimpleShorthandOpener(['background-origin', 'background-clip']),
16
+ },
17
+ { prop: 'background-clip', dataType: backgroundClipDataType },
18
+ ];
19
+ const lastBgLayerShorthandParts = [
20
+ {
21
+ prop: 'background-color',
22
+ dataType: backgroundColorDataType,
23
+ },
24
+ ].concat(bgLayerShorthandParts);
25
+ const openBackgroundShorthandLayerInner = unorderedListShorthandOpener(bgLayerShorthandParts);
26
+ const openBackgroundShorthandLastLayerInner = unorderedListShorthandOpener(lastBgLayerShorthandParts);
27
+ const backgroundShorthandOpener = createShorthandOpener({
28
+ prop: 'background',
29
+ parts: lastBgLayerShorthandParts,
30
+ shorthandOpener: (astNodes, api) => layersShorthandOpener('background', openBackgroundShorthandLayerInner, bgLayerShorthandParts, openBackgroundShorthandLastLayerInner, lastBgLayerShorthandParts)(astNodes, api),
31
+ });
32
+ const multipleItemProps = bgLayerShorthandParts
33
+ .filter((part) => part.multipleItems)
34
+ .map((part) => part.prop);
35
+ return (shortHand, api) => {
36
+ const openedShorthand = backgroundShorthandOpener(shortHand, api);
37
+ const layers = [];
38
+ let currLayer;
39
+ for (let i = 0; (currLayer = getOpenedLayer(openedShorthand, i, multipleItemProps)) !== undefined; i++) {
40
+ layers.push(currLayer);
41
+ }
42
+ const color = layers[0]['background-color'];
43
+ for (const layer of layers) {
44
+ delete layer['background-color'];
45
+ }
46
+ return {
47
+ layers: layers,
48
+ color,
49
+ };
50
+ };
51
+ };
52
+ export const closeBackgroundShorthand = () => (opened, api, detachExpression) => {
53
+ const layerTemplate = shorthandCloserTemplate `${'background-image'} ${'background-position'} / ${'background-size'} ${'background-repeat'} ${'background-attachment'} ${'background-origin'} ${'background-clip'}`;
54
+ const backgroundLayerCloser = (opened, api, detachExpressions = false) => {
55
+ const multiExpressions = [];
56
+ // Background shorthand syntax allows an arbitrary order of sub-properties. So, in most
57
+ // cases, it's safe to omit implicit values. One exception is background-position: it
58
+ // cannot be skipped if there is an explicitly specified background-size. Also, we can
59
+ // omit unnecessary duplicates: when background-origin and background-clip are equal,
60
+ // we can omit background-clip and keep a single value for both.
61
+ function isSafeToOmit(propName, value) {
62
+ if (propName === 'background-position' && opened['background-size'].some((n) => !n.isImplicit)) {
63
+ return false;
64
+ }
65
+ const isImplicit = Array.isArray(value) ? value.every((n) => n.isImplicit) : value.isImplicit;
66
+ const unnecessaryBackgroundClip = propName === 'background-clip' &&
67
+ opened['background-clip'].value.text === opened['background-origin'].value.text;
68
+ return isImplicit || unnecessaryBackgroundClip;
69
+ }
70
+ return fixAstNodesPositions(layerTemplate.strings.reduce((nodes, currString, index) => {
71
+ const currKey = layerTemplate.keys[index];
72
+ if (currKey === undefined || isSafeToOmit(currKey, opened[currKey])) {
73
+ return nodes;
74
+ }
75
+ return nodes.concat(valueTextNode(currString), getOpenedNode(opened[currKey], api, detachExpressions, multiExpressions));
76
+ }, []), api);
77
+ };
78
+ let nonColorLayers = [];
79
+ opened.layers.forEach((layer) => {
80
+ nonColorLayers = nonColorLayers.concat(backgroundLayerCloser(layer, api, detachExpression));
81
+ nonColorLayers.push({ ...valueTextNode(','), type: ',' });
82
+ });
83
+ nonColorLayers.pop();
84
+ return fixAstNodesPositions(opened.color.isImplicit
85
+ ? nonColorLayers
86
+ : nonColorLayers.concat(getOpenedNode(opened.color, api, detachExpression)), api);
87
+ };
88
+ //# sourceMappingURL=background-shorthand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-shorthand.js","sourceRoot":"","sources":["../../../src/shorthands/openers/background-shorthand.ts"],"names":[],"mappings":"AAWA,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACH,0BAA0B,EAC1B,4BAA4B,EAC5B,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,aAAa;AACb,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAqE,EAAE;IAC1G,MAAM,qBAAqB,GAAuB;QAC9C,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,mBAAmB,EAAE;QAC3D,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,IAAI,EAAE;QAClF,EAAE,IAAI,EAAE,iBAAiB,EAAE,Q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gB,CAAC,CAAC,CAAC;QAC5F,cAAc,CAAC,IAAI,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,GAAG,EAAE,CAAC;IAErB,OAAO,oBAAoB,CACvB,MAAM,CAAC,KAAK,CAAC,UAAU;QACnB,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,EAC/E,GAAG,CACN,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { BorderImages, OpenedBorderImageShorthand } from '../shorthand-css-data.js';
2
+ import type { ShorthandOpener, GetShorthandCloser } from '../shorthand-types.js';
3
+ export declare const openBorderImageShorthand: <V>() => ShorthandOpener<V, BorderImages, OpenedBorderImageShorthand<V>>;
4
+ export declare const closeBorderImageShorthand: GetShorthandCloser<BorderImages>;
5
+ //# sourceMappingURL=border-image-shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-image-shorthand.d.ts","sourceRoot":"","sources":["../../../src/shorthands/openers/border-image-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAiBjF,eAAO,MAAM,wBAAwB,GAAI,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAWpC,CAAC;AAE1E,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,YAAY,CAGlE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { imageSourceDataType, borderImageSliceDataType, borderImageWidthDataType, borderImageOutsetDataType, borderImageRepeatDataType, } from '../../css-data-types/index.js';
2
+ import { unorderedListShorthandOpener, createShorthandOpener, shorthandCloserTemplate, createShorthandCloser, } from '../shorthand-parser-utils.js';
3
+ // border-image
4
+ export const openBorderImageShorthand = () => createShorthandOpener({
5
+ prop: 'border-image',
6
+ parts: [
7
+ { prop: 'border-image-source', dataType: imageSourceDataType },
8
+ { prop: 'border-image-slice', dataType: borderImageSliceDataType, multipleItems: true },
9
+ { prop: 'border-image-width', dataType: borderImageWidthDataType, multipleItems: true },
10
+ { prop: 'border-image-outset', dataType: borderImageOutsetDataType, multipleItems: true },
11
+ { prop: 'border-image-repeat', dataType: borderImageRepeatDataType, multipleItems: true },
12
+ ],
13
+ shorthandOpener: (astNodes, api, parts) => unorderedListShorthandOpener(parts)(astNodes, api),
14
+ });
15
+ export const closeBorderImageShorthand = () => createShorthandCloser(shorthandCloserTemplate `${'border-image-source'} ${'border-image-slice'} / ${'border-image-width'} / ${'border-image-outset'} ${'border-image-repeat'}`);
16
+ //# sourceMappingURL=border-image-shorthand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-image-shorthand.js","sourceRoot":"","sources":["../../../src/shorthands/openers/border-image-shorthand.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACxB,MAAM,8BAA8B,CAAC;AAEtC,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAuE,EAAE,CAC7G,qBAAqB,CAAC;IAClB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,mBAAmB,EAAE;QAC9D,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,aAAa,EAAE,IAAI,EAAE;QACvF,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,aAAa,EAAE,IAAI,EAAE;QACvF,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,yBAAyB,EAAE,aAAa,EAAE,IAAI,EAAE;QACzF,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,yBAAyB,EAAE,aAAa,EAAE,IAAI,EAAE;KAC5F;IACD,eAAe,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC;CAChG,CAAoE,CAAC;AAE1E,MAAM,CAAC,MAAM,yBAAyB,GAAqC,GAAM,EAAE,CAC/E,qBAAqB,CACjB,uBAAuB,CAAc,GAAG,qBAAqB,IAAI,oBAAoB,MAAM,oBAAoB,MAAM,qBAAqB,IAAI,qBAAqB,EAAE,CACxK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { BorderRadiuses, OpenedBorderRadiusShorthand } from '../shorthand-css-data.js';
2
+ import type { SimpleOpenedShorthand, ShorthandOpener, ShorthandCloser } from '../shorthand-types.js';
3
+ export declare const openBorderRadiusShorthand: <V>() => ShorthandOpener<V, BorderRadiuses, OpenedBorderRadiusShorthand<V>>;
4
+ export declare const closeBorderRadiusShorthand: <V>() => ShorthandCloser<V, BorderRadiuses, SimpleOpenedShorthand<V, BorderRadiuses>[]>;
5
+ //# sourceMappingURL=border-radius-shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-radius-shorthand.d.ts","sourceRoot":"","sources":["../../../src/shorthands/openers/border-radius-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,KAAK,EAGR,qBAAqB,EACrB,eAAe,EACf,eAAe,EAClB,MAAM,uBAAuB,CAAC;AAc/B,eAAO,MAAM,yBAAyB,GAAI,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,cAAc,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAqDhH,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAClC,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,cAAc,EAAE,qBAAqB,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,CAenF,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { ALWAYS_DATA_TYPE, INTERNAL_VALUE_SEPERATOR } from '../../css-data-types/index.js';
2
+ import { valueTextNode } from '../../tokenizers/index.js';
3
+ import { edgesShorthandOpener, getShorthandLayers, getOpenedLayer, createShorthandOpener, edgesShorthandCloser, fixAstNodesPositions, } from '../shorthand-parser-utils.js';
4
+ // border-radius
5
+ export const openBorderRadiusShorthand = () => {
6
+ const singleBorderRadiusShorthandOpenerInner = edgesShorthandOpener('border-radius', true);
7
+ const borderRadiusShorthandOpener = createShorthandOpener({
8
+ prop: 'border-radius',
9
+ parts: [
10
+ {
11
+ prop: 'border-radius',
12
+ dataType: ALWAYS_DATA_TYPE,
13
+ openedProps: [
14
+ 'border-top-left-radius',
15
+ 'border-top-right-radius',
16
+ 'border-bottom-right-radius',
17
+ 'border-bottom-left-radius',
18
+ ],
19
+ },
20
+ ],
21
+ shorthandOpener: (astNodes, api) => {
22
+ const [firstLayer, secondLayer] = getShorthandLayers(astNodes, INTERNAL_VALUE_SEPERATOR);
23
+ const firstOpened = singleBorderRadiusShorthandOpenerInner(firstLayer, api);
24
+ const secondOpened = secondLayer && secondLayer.length > 0
25
+ ? singleBorderRadiusShorthandOpenerInner(secondLayer, api)
26
+ : undefined;
27
+ const opened = {};
28
+ const props = Object.keys(firstOpened);
29
+ for (const prop of props) {
30
+ opened[prop] = [firstOpened[prop]];
31
+ if (secondOpened) {
32
+ opened[prop].push(secondOpened[prop]);
33
+ }
34
+ }
35
+ return opened;
36
+ },
37
+ });
38
+ return (shortHand, api) => {
39
+ const openedShorthand = borderRadiusShorthandOpener(shortHand, api);
40
+ const layers = [];
41
+ let currLayer;
42
+ for (let i = 0; (currLayer = getOpenedLayer(openedShorthand, i)) !==
43
+ undefined; i++) {
44
+ layers.push(currLayer);
45
+ }
46
+ return layers;
47
+ };
48
+ };
49
+ export const closeBorderRadiusShorthand = () => (opened, api, detachExpression) => {
50
+ if (!opened[0]) {
51
+ return [];
52
+ }
53
+ const borderRadiusLayerCloser = edgesShorthandCloser('border-radius', true);
54
+ let closedLayers = [];
55
+ closedLayers = closedLayers.concat(borderRadiusLayerCloser(opened[0], api, detachExpression));
56
+ if (opened[1]) {
57
+ closedLayers = closedLayers.concat(valueTextNode(INTERNAL_VALUE_SEPERATOR), borderRadiusLayerCloser(opened[1], api, detachExpression));
58
+ }
59
+ return fixAstNodesPositions(closedLayers, api);
60
+ };
61
+ //# sourceMappingURL=border-radius-shorthand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-radius-shorthand.js","sourceRoot":"","sources":["../../../src/shorthands/openers/border-radius-shorthand.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA0E,EAAE;IACjH,MAAM,sCAAsC,GAAG,oBAAoB,CAAoB,eAAe,EAAE,IAAI,CAAC,CAAC;IAE9G,MAAM,2BAA2B,GAAG,qBAAqB,CAAoB;QACzE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE;YACH;gBACI,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,gBAAgB;gBAC1B,WAAW,EAAE;oBACT,wBAAwB;oBACxB,y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C;QAC3B,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GACnC,GAAsF,EAAE,CACxF,CAAC,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE;IAC9B,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACd,CAAC;IACD,MAAM,uBAAuB,GAAG,oBAAoB,CAAoB,eAAe,EAAE,IAAI,CAAC,CAAC;IAC/F,IAAI,YAAY,GAAoB,EAAE,CAAC;IACvC,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC9F,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACZ,YAAY,GAAG,YAAY,CAAC,MAAM,CAC9B,aAAa,CAAC,wBAAwB,CAAC,EACvC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAC5D,CAAC;IACN,CAAC;IACD,OAAO,oBAAoB,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { BorderStyles, BorderWidths, BorderColors, BordersShallow, Borders, BordersTop, BordersRight, BordersBottom, BordersLeft } from '../shorthand-css-data.js';
2
+ import type { GetSimpleShorthandOpener, ShorthandCloser, GetShorthandCloser } from '../shorthand-types.js';
3
+ export declare const openBorderShorthand: GetSimpleShorthandOpener<Borders>;
4
+ export declare const openBorderShorthandShallow: GetSimpleShorthandOpener<BordersShallow>;
5
+ export declare const closeBorderShorthand: <V>() => ShorthandCloser<V, Borders>;
6
+ export declare const openBorderTopShorthand: GetSimpleShorthandOpener<BordersTop>;
7
+ export declare const closeBorderTopShorthand: GetShorthandCloser<BordersTop>;
8
+ export declare const openBorderRightShorthand: GetSimpleShorthandOpener<BordersRight>;
9
+ export declare const closeBorderRightShorthand: GetShorthandCloser<BordersRight>;
10
+ export declare const openBorderBottomShorthand: GetSimpleShorthandOpener<BordersBottom>;
11
+ export declare const closeBorderBottomShorthand: GetShorthandCloser<BordersBottom>;
12
+ export declare const openBorderLeftShorthand: GetSimpleShorthandOpener<BordersLeft>;
13
+ export declare const closeBorderLeftShorthand: GetShorthandCloser<BordersLeft>;
14
+ export declare const openBorderStyleShorthand: GetSimpleShorthandOpener<BorderStyles>;
15
+ export declare const closeBorderStyleShorthand: GetShorthandCloser<BorderStyles>;
16
+ export declare const openBorderWidthShorthand: GetSimpleShorthandOpener<BorderWidths>;
17
+ export declare const closeBorderWidthShorthand: GetShorthandCloser<BorderWidths>;
18
+ export declare const openBorderColorShorthand: GetSimpleShorthandOpener<BorderColors>;
19
+ export declare const closeBorderColorShorthand: GetShorthandCloser<BorderColors>;
20
+ //# sourceMappingURL=border-shorthand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-shorthand.d.ts","sourceRoot":"","sources":["../../../src/shorthands/openers/border-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,OAAO,EACP,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAIR,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EACrB,MAAM,uBAAuB,CAAC;AAkD/B,eAAO,MAAM,mBAAmB,EAAE,wBAAwB,CAAC,OAAO,CAUvB,CAAC;AAE5C,eAAO,MAAM,0BAA0B,EAAE,wBAAwB,CAAC,cAAc,CAI/E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC5B,CAAC,OAAK,eAAe,CAAC,CAAC,EAAE,OAAO,CA2BhC,CAAC;AAgBN,eAAO,MAAM,sBAAsB,EAAE,wBAAwB,CAAC,UAAU,CACrB,CAAC;AAEpD,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,UAAU,CAM9D,CAAC;AAGN,eAAO,MAAM,wBAAwB,EAAE,wBAAwB,CAAC,YAAY,CACrB,CAAC;AAExD,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,YAAY,CAMlE,CAAC;AAGN,eAAO,MAAM,yBAAyB,EAAE,wBAAwB,CAAC,aAAa,CACrB,CAAC;AAE1D,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CAAC,aAAa,CAMpE,CAAC;AAGN,eAAO,MAAM,uBAAuB,EAAE,wBAAwB,CAAC,WAAW,CACrB,CAAC;AAEtD,eAAO,MAAM,wBAAwB,EAAE,kBAAkB,CAAC,WAAW,CAMhE,CAAC;AAGN,eAAO,MAAM,wBAAwB,EAAE,wBAAwB,CAAC,YAAY,CACT,CAAC;AAEpE,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,YAAY,CACd,CAAC;AAG1D,eAAO,MAAM,wBAAwB,EAAE,wBAAwB,CAAC,YAAY,CACT,CAAC;AAEpE,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,YAAY,CACd,CAAC;AAG1D,eAAO,MAAM,wBAAwB,EAAE,wBAAwB,CAAC,YAAY,CACT,CAAC;AAEpE,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,YAAY,CACd,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { lineStyleDataType, lineWidthDataType, colorDataType } from '../../css-data-types/index.js';
2
+ import { edgesShorthandOpener, unorderedListShorthandOpener, createShorthandOpener, createShorthandOpenerFromPart, getOpenedNodeValue, edgesShorthandCloser, shorthandCloserTemplate, createShorthandCloser, } from '../shorthand-parser-utils.js';
3
+ import { CannotCloseBorderError } from '../shorthand-parser-errors.js';
4
+ const borderShorthandPart = (prop, dataType, openedProps) => ({
5
+ prop,
6
+ dataType,
7
+ partOpener: openedProps ? edgesShorthandOpener(prop) : undefined,
8
+ openedProps,
9
+ });
10
+ const getBorderStyleShorthandPart = () => borderShorthandPart('border-style', lineStyleDataType, [
11
+ 'border-top-style',
12
+ 'border-right-style',
13
+ 'border-bottom-style',
14
+ 'border-left-style',
15
+ ]);
16
+ const getBorderWidthShorthandPart = () => borderShorthandPart('border-width', lineWidthDataType, [
17
+ 'border-top-width',
18
+ 'border-right-width',
19
+ 'border-bottom-width',
20
+ 'border-left-width',
21
+ ]);
22
+ const getBorderColorShorthandPart = () => borderShorthandPart('border-color', colorDataType, [
23
+ 'border-top-color',
24
+ 'border-right-color',
25
+ 'border-bottom-color',
26
+ 'border-left-color',
27
+ ]);
28
+ // border
29
+ export const openBorderShorthand = () => createShorthandOpener({
30
+ prop: 'border',
31
+ parts: [
32
+ getBorderStyleShorthandPart(),
33
+ getBorderWidthShorthandPart(),
34
+ getBorderColorShorthandPart(),
35
+ ],
36
+ shorthandOpener: (astNodes, api, parts, shallow) => unorderedListShorthandOpener(parts, { shallow })(astNodes, api),
37
+ });
38
+ export const openBorderShorthandShallow = () => {
39
+ const borderShallowOpener = (shortHand, api) => openBorderShorthand()(shortHand, api, true);
40
+ return borderShallowOpener;
41
+ };
42
+ export const closeBorderShorthand = () => (opened, api, detachExpression, shallow) => {
43
+ if (shallow) {
44
+ const borderShallowCloser = createShorthandCloser(shorthandCloserTemplate `${'border-style'} ${'border-width'} ${'border-color'}`);
45
+ return borderShallowCloser(opened, api, detachExpression);
46
+ }
47
+ const borderClosedTop = closeBorderTopShorthand()(opened, api, detachExpression);
48
+ const borderClosedTopValue = getOpenedNodeValue(borderClosedTop, api);
49
+ if (getOpenedNodeValue(closeBorderRightShorthand()(opened, api, detachExpression), api) !==
50
+ borderClosedTopValue ||
51
+ getOpenedNodeValue(closeBorderBottomShorthand()(opened, api, detachExpression), api) !==
52
+ borderClosedTopValue ||
53
+ getOpenedNodeValue(closeBorderLeftShorthand()(opened, api, detachExpression), api) !==
54
+ borderClosedTopValue) {
55
+ throw new CannotCloseBorderError();
56
+ }
57
+ return borderClosedTop;
58
+ };
59
+ const borderEdgeProp = (edge, item) => `border-${edge}-${item}`;
60
+ const borderEdgeShorthandOpener = (edge) => createShorthandOpener({
61
+ prop: `border-${edge}`,
62
+ parts: [
63
+ borderShorthandPart(borderEdgeProp(edge, 'style'), lineStyleDataType),
64
+ borderShorthandPart(borderEdgeProp(edge, 'width'), lineWidthDataType),
65
+ borderShorthandPart(borderEdgeProp(edge, 'color'), colorDataType),
66
+ ],
67
+ shorthandOpener: (astNodes, api, parts) => unorderedListShorthandOpener(parts, { shallow: true })(astNodes, api),
68
+ });
69
+ // border-top
70
+ export const openBorderTopShorthand = () => borderEdgeShorthandOpener('top');
71
+ export const closeBorderTopShorthand = () => createShorthandCloser(shorthandCloserTemplate `${borderEdgeProp('top', 'style')} ${borderEdgeProp('top', 'width')} ${borderEdgeProp('top', 'color')}`);
72
+ // border-right
73
+ export const openBorderRightShorthand = () => borderEdgeShorthandOpener('right');
74
+ export const closeBorderRightShorthand = () => createShorthandCloser(shorthandCloserTemplate `${borderEdgeProp('right', 'style')} ${borderEdgeProp('right', 'width')} ${borderEdgeProp('right', 'color')}`);
75
+ // border-bottom
76
+ export const openBorderBottomShorthand = () => borderEdgeShorthandOpener('bottom');
77
+ export const closeBorderBottomShorthand = () => createShorthandCloser(shorthandCloserTemplate `${borderEdgeProp('bottom', 'style')} ${borderEdgeProp('bottom', 'width')} ${borderEdgeProp('bottom', 'color')}`);
78
+ // border-left
79
+ export const openBorderLeftShorthand = () => borderEdgeShorthandOpener('left');
80
+ export const closeBorderLeftShorthand = () => createShorthandCloser(shorthandCloserTemplate `${borderEdgeProp('left', 'style')} ${borderEdgeProp('left', 'width')} ${borderEdgeProp('left', 'color')}`);
81
+ // border-style
82
+ export const openBorderStyleShorthand = () => createShorthandOpenerFromPart(getBorderStyleShorthandPart());
83
+ export const closeBorderStyleShorthand = () => edgesShorthandCloser('border-style');
84
+ // border-width
85
+ export const openBorderWidthShorthand = () => createShorthandOpenerFromPart(getBorderWidthShorthandPart());
86
+ export const closeBorderWidthShorthand = () => edgesShorthandCloser('border-width');
87
+ // border-color
88
+ export const openBorderColorShorthand = () => createShorthandOpenerFromPart(getBorderColorShorthandPart());
89
+ export const closeBorderColorShorthand = () => edgesShorthandCloser('border-color');
90
+ //# sourceMappingURL=border-shorthand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"border-shorthand.js","sourceRoot":"","sources":["../../../src/shorthands/openers/border-shorthand.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAiB,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnH,OAAO,EACH,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,MAAM,mBAAmB,GAAG,CACxB,IAAY,EACZ,QAAkB,EAClB,WAAiB,EACE,EAAE,CAAC,CAAC;IACvB,IAAI;IACJ,QAAQ;IACR,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;IAChE,WAAW;CACd,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,GAAM,EAAE,CACxC,mBAAmB,CAAkB,cAAc,EAAE,iBAAiB,EAAE;IACpE,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;CACtB,CAAC,CAAC;AACP,MAAM,2BAA2B,GAAG,GAAM,EAAE,CACxC,mBAAmB,CAAkB,cAAc,EAAE,iBAAiB,EAAE;IACpE,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;CACtB,CAAC,CAAC;AAEP,MAAM,2BAA2B,GAAG,GAAM,EAAE,CACxC,mBAAmB,CAAkB,cAAc,EAAE,aAAa,EAAE;IAChE,k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F,6BAA6B,CAAC,2BAA2B,EAAK,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,yBAAyB,GAAqC,GAAM,EAAE,CAC/E,oBAAoB,CAAkB,cAAc,CAAC,CAAC;AAE1D,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB,GAA2C,GAAM,EAAE,CACpF,6BAA6B,CAAC,2BAA2B,EAAK,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,yBAAyB,GAAqC,GAAM,EAAE,CAC/E,oBAAoB,CAAkB,cAAc,CAAC,CAAC;AAE1D,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB,GAA2C,GAAM,EAAE,CACpF,6BAA6B,CAAC,2BAA2B,EAAK,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,yBAAyB,GAAqC,GAAM,EAAE,CAC/E,oBAAoB,CAAkB,cAAc,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { FlexFlows } from '../shorthand-css-data.js';
2
+ import type { GetSimpleShorthandOpener, GetShorthandCloser } from '../shorthand-types.js';
3
+ export declare const openFlexFlowShorthand: GetSimpleShorthandOpener<FlexFlows>;
4
+ export declare const closeFlexFlowShorthand: GetShorthandCloser<FlexFlows>;
5
+ //# sourceMappingURL=flex-flow-shorthand.d.ts.map