@tamagui/style-grammar 0.0.0-bootstrap.0 → 3.0.0-beta.1093.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 (576) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -1
  3. package/dist/cjs/ast/payloadShape.cjs +68 -0
  4. package/dist/cjs/ast/payloadShape.native.cjs +70 -0
  5. package/dist/cjs/ast/payloadShape.native.js +72 -0
  6. package/dist/cjs/ast/payloadShape.native.js.map +1 -0
  7. package/dist/cjs/ast/resolvePayload.cjs +275 -0
  8. package/dist/cjs/ast/resolvePayload.native.cjs +281 -0
  9. package/dist/cjs/ast/resolvePayload.native.js +283 -0
  10. package/dist/cjs/ast/resolvePayload.native.js.map +1 -0
  11. package/dist/cjs/ast/serializePayload.cjs +148 -0
  12. package/dist/cjs/ast/serializePayload.native.cjs +186 -0
  13. package/dist/cjs/ast/serializePayload.native.js +188 -0
  14. package/dist/cjs/ast/serializePayload.native.js.map +1 -0
  15. package/dist/cjs/ast/valueParser.cjs +151 -0
  16. package/dist/cjs/ast/valueParser.native.cjs +158 -0
  17. package/dist/cjs/ast/valueParser.native.js +160 -0
  18. package/dist/cjs/ast/valueParser.native.js.map +1 -0
  19. package/dist/cjs/ast/valueTypes.cjs +37 -0
  20. package/dist/cjs/ast/valueTypes.native.cjs +39 -0
  21. package/dist/cjs/ast/valueTypes.native.js +41 -0
  22. package/dist/cjs/ast/valueTypes.native.js.map +1 -0
  23. package/dist/cjs/index.cjs +16 -0
  24. package/dist/cjs/index.native.cjs +18 -0
  25. package/dist/cjs/index.native.js +20 -0
  26. package/dist/cjs/index.native.js.map +1 -0
  27. package/dist/cjs/programs/clauseCapability.cjs +129 -0
  28. package/dist/cjs/programs/clauseCapability.native.cjs +151 -0
  29. package/dist/cjs/programs/clauseCapability.native.js +153 -0
  30. package/dist/cjs/programs/clauseCapability.native.js.map +1 -0
  31. package/dist/cjs/programs/clauseSources.cjs +46 -0
  32. package/dist/cjs/programs/clauseSources.native.cjs +48 -0
  33. package/dist/cjs/programs/clauseSources.native.js +50 -0
  34. package/dist/cjs/programs/clauseSources.native.js.map +1 -0
  35. package/dist/cjs/programs/evaluateProgram.cjs +62 -0
  36. package/dist/cjs/programs/evaluateProgram.native.cjs +67 -0
  37. package/dist/cjs/programs/evaluateProgram.native.js +69 -0
  38. package/dist/cjs/programs/evaluateProgram.native.js.map +1 -0
  39. package/dist/cjs/programs/lowerProgram.cjs +203 -0
  40. package/dist/cjs/programs/lowerProgram.native.cjs +252 -0
  41. package/dist/cjs/programs/lowerProgram.native.js +254 -0
  42. package/dist/cjs/programs/lowerProgram.native.js.map +1 -0
  43. package/dist/cjs/programs/modifierRegistry.cjs +176 -0
  44. package/dist/cjs/programs/modifierRegistry.native.cjs +303 -0
  45. package/dist/cjs/programs/modifierRegistry.native.js +305 -0
  46. package/dist/cjs/programs/modifierRegistry.native.js.map +1 -0
  47. package/dist/cjs/programs/programEligibility.cjs +45 -0
  48. package/dist/cjs/programs/programEligibility.native.cjs +47 -0
  49. package/dist/cjs/programs/programEligibility.native.js +49 -0
  50. package/dist/cjs/programs/programEligibility.native.js.map +1 -0
  51. package/dist/cjs/programs/programHash.cjs +84 -0
  52. package/dist/cjs/programs/programHash.native.cjs +104 -0
  53. package/dist/cjs/programs/programHash.native.js +106 -0
  54. package/dist/cjs/programs/programHash.native.js.map +1 -0
  55. package/dist/cjs/programs/programs.cjs +127 -0
  56. package/dist/cjs/programs/programs.native.cjs +219 -0
  57. package/dist/cjs/programs/programs.native.js +221 -0
  58. package/dist/cjs/programs/programs.native.js.map +1 -0
  59. package/dist/cjs/runtime/clauseIdentity.cjs +166 -0
  60. package/dist/cjs/runtime/clauseIdentity.native.cjs +195 -0
  61. package/dist/cjs/runtime/clauseIdentity.native.js +197 -0
  62. package/dist/cjs/runtime/clauseIdentity.native.js.map +1 -0
  63. package/dist/cjs/runtime/clausePrecedence.cjs +133 -0
  64. package/dist/cjs/runtime/clausePrecedence.native.cjs +179 -0
  65. package/dist/cjs/runtime/clausePrecedence.native.js +181 -0
  66. package/dist/cjs/runtime/clausePrecedence.native.js.map +1 -0
  67. package/dist/cjs/runtime/colorOpacity.cjs +44 -0
  68. package/dist/cjs/runtime/colorOpacity.native.cjs +46 -0
  69. package/dist/cjs/runtime/colorOpacity.native.js +48 -0
  70. package/dist/cjs/runtime/colorOpacity.native.js.map +1 -0
  71. package/dist/cjs/runtime/mergeFlatValues.cjs +90 -0
  72. package/dist/cjs/runtime/mergeFlatValues.native.cjs +163 -0
  73. package/dist/cjs/runtime/mergeFlatValues.native.js +165 -0
  74. package/dist/cjs/runtime/mergeFlatValues.native.js.map +1 -0
  75. package/dist/cjs/runtime/modifierVocabulary.cjs +97 -0
  76. package/dist/cjs/runtime/modifierVocabulary.native.cjs +159 -0
  77. package/dist/cjs/runtime/modifierVocabulary.native.js +161 -0
  78. package/dist/cjs/runtime/modifierVocabulary.native.js.map +1 -0
  79. package/dist/cjs/runtime/namedCssColors.cjs +24 -0
  80. package/dist/cjs/runtime/namedCssColors.native.cjs +26 -0
  81. package/dist/cjs/runtime/namedCssColors.native.js +28 -0
  82. package/dist/cjs/runtime/namedCssColors.native.js.map +1 -0
  83. package/dist/cjs/runtime/safeAreaVariables.cjs +41 -0
  84. package/dist/cjs/runtime/safeAreaVariables.native.cjs +43 -0
  85. package/dist/cjs/runtime/safeAreaVariables.native.js +45 -0
  86. package/dist/cjs/runtime/safeAreaVariables.native.js.map +1 -0
  87. package/dist/cjs/runtime/scanFlatValue.cjs +348 -0
  88. package/dist/cjs/runtime/scanFlatValue.native.cjs +354 -0
  89. package/dist/cjs/runtime/scanFlatValue.native.js +356 -0
  90. package/dist/cjs/runtime/scanFlatValue.native.js.map +1 -0
  91. package/dist/cjs/runtime/spring.cjs +123 -0
  92. package/dist/cjs/runtime/spring.native.cjs +131 -0
  93. package/dist/cjs/runtime/spring.native.js +133 -0
  94. package/dist/cjs/runtime/spring.native.js.map +1 -0
  95. package/dist/cjs/runtime/stateModifiers.cjs +64 -0
  96. package/dist/cjs/runtime/stateModifiers.native.cjs +66 -0
  97. package/dist/cjs/runtime/stateModifiers.native.js +68 -0
  98. package/dist/cjs/runtime/stateModifiers.native.js.map +1 -0
  99. package/dist/cjs/runtime/states.cjs +96 -0
  100. package/dist/cjs/runtime/states.native.cjs +130 -0
  101. package/dist/cjs/runtime/states.native.js +132 -0
  102. package/dist/cjs/runtime/states.native.js.map +1 -0
  103. package/dist/cjs/runtime/tokenCategories.cjs +181 -0
  104. package/dist/cjs/runtime/tokenCategories.native.cjs +182 -0
  105. package/dist/cjs/runtime/tokenCategories.native.js +184 -0
  106. package/dist/cjs/runtime/tokenCategories.native.js.map +1 -0
  107. package/dist/cjs/runtime/transformAccumulator.cjs +79 -0
  108. package/dist/cjs/runtime/transformAccumulator.native.cjs +98 -0
  109. package/dist/cjs/runtime/transformAccumulator.native.js +100 -0
  110. package/dist/cjs/runtime/transformAccumulator.native.js.map +1 -0
  111. package/dist/cjs/runtime/unitlessNumbers.cjs +85 -0
  112. package/dist/cjs/runtime/unitlessNumbers.native.cjs +105 -0
  113. package/dist/cjs/runtime/unitlessNumbers.native.js +107 -0
  114. package/dist/cjs/runtime/unitlessNumbers.native.js.map +1 -0
  115. package/dist/cjs/runtime.cjs +95 -0
  116. package/dist/cjs/runtime.native.cjs +97 -0
  117. package/dist/cjs/runtime.native.js +99 -0
  118. package/dist/cjs/runtime.native.js.map +1 -0
  119. package/dist/cjs/shorthands/backgroundFamily.cjs +174 -0
  120. package/dist/cjs/shorthands/backgroundFamily.native.cjs +193 -0
  121. package/dist/cjs/shorthands/backgroundFamily.native.js +195 -0
  122. package/dist/cjs/shorthands/backgroundFamily.native.js.map +1 -0
  123. package/dist/cjs/shorthands/borderFamily.cjs +168 -0
  124. package/dist/cjs/shorthands/borderFamily.native.cjs +246 -0
  125. package/dist/cjs/shorthands/borderFamily.native.js +248 -0
  126. package/dist/cjs/shorthands/borderFamily.native.js.map +1 -0
  127. package/dist/cjs/shorthands/fontShorthand.cjs +206 -0
  128. package/dist/cjs/shorthands/fontShorthand.native.cjs +259 -0
  129. package/dist/cjs/shorthands/fontShorthand.native.js +261 -0
  130. package/dist/cjs/shorthands/fontShorthand.native.js.map +1 -0
  131. package/dist/cjs/shorthands/geometricShorthand.cjs +121 -0
  132. package/dist/cjs/shorthands/geometricShorthand.native.cjs +127 -0
  133. package/dist/cjs/shorthands/geometricShorthand.native.js +129 -0
  134. package/dist/cjs/shorthands/geometricShorthand.native.js.map +1 -0
  135. package/dist/cjs/shorthands/textDecorationFamily.cjs +128 -0
  136. package/dist/cjs/shorthands/textDecorationFamily.native.cjs +198 -0
  137. package/dist/cjs/shorthands/textDecorationFamily.native.js +200 -0
  138. package/dist/cjs/shorthands/textDecorationFamily.native.js.map +1 -0
  139. package/dist/cjs/shorthands/transformFamily.cjs +421 -0
  140. package/dist/cjs/shorthands/transformFamily.native.cjs +474 -0
  141. package/dist/cjs/shorthands/transformFamily.native.js +476 -0
  142. package/dist/cjs/shorthands/transformFamily.native.js.map +1 -0
  143. package/dist/cjs/shorthands/transition.cjs +533 -0
  144. package/dist/cjs/shorthands/transition.native.cjs +575 -0
  145. package/dist/cjs/shorthands/transition.native.js +577 -0
  146. package/dist/cjs/shorthands/transition.native.js.map +1 -0
  147. package/dist/cjs/shorthands/transitionAlign.cjs +117 -0
  148. package/dist/cjs/shorthands/transitionAlign.native.cjs +156 -0
  149. package/dist/cjs/shorthands/transitionAlign.native.js +158 -0
  150. package/dist/cjs/shorthands/transitionAlign.native.js.map +1 -0
  151. package/dist/cjs/shorthands/transitionLegacy.cjs +353 -0
  152. package/dist/cjs/shorthands/transitionLegacy.native.cjs +437 -0
  153. package/dist/cjs/shorthands/transitionLegacy.native.js +439 -0
  154. package/dist/cjs/shorthands/transitionLegacy.native.js.map +1 -0
  155. package/dist/cjs/shorthands/transitionNative.cjs +279 -0
  156. package/dist/cjs/shorthands/transitionNative.native.cjs +284 -0
  157. package/dist/cjs/shorthands/transitionNative.native.js +286 -0
  158. package/dist/cjs/shorthands/transitionNative.native.js.map +1 -0
  159. package/dist/cjs/shorthands/transitionObject.cjs +302 -0
  160. package/dist/cjs/shorthands/transitionObject.native.cjs +347 -0
  161. package/dist/cjs/shorthands/transitionObject.native.js +349 -0
  162. package/dist/cjs/shorthands/transitionObject.native.js.map +1 -0
  163. package/dist/cjs/tokenCategories.cjs +18 -0
  164. package/dist/cjs/tokenCategories.native.cjs +20 -0
  165. package/dist/cjs/tokenCategories.native.js +22 -0
  166. package/dist/cjs/tokenCategories.native.js.map +1 -0
  167. package/dist/cjs/tooling/candidate.cjs +878 -0
  168. package/dist/cjs/tooling/candidate.native.cjs +1114 -0
  169. package/dist/cjs/tooling/candidate.native.js +1116 -0
  170. package/dist/cjs/tooling/candidate.native.js.map +1 -0
  171. package/dist/cjs/tooling/candidateTarget.cjs +49 -0
  172. package/dist/cjs/tooling/candidateTarget.native.cjs +87 -0
  173. package/dist/cjs/tooling/candidateTarget.native.js +89 -0
  174. package/dist/cjs/tooling/candidateTarget.native.js.map +1 -0
  175. package/dist/cjs/tooling/config.cjs +137 -0
  176. package/dist/cjs/tooling/config.native.cjs +181 -0
  177. package/dist/cjs/tooling/config.native.js +183 -0
  178. package/dist/cjs/tooling/config.native.js.map +1 -0
  179. package/dist/cjs/tooling/registry.cjs +1087 -0
  180. package/dist/cjs/tooling/registry.native.cjs +1092 -0
  181. package/dist/cjs/tooling/registry.native.js +1094 -0
  182. package/dist/cjs/tooling/registry.native.js.map +1 -0
  183. package/dist/cjs/tooling/table.cjs +53 -0
  184. package/dist/cjs/tooling/table.native.cjs +134 -0
  185. package/dist/cjs/tooling/table.native.js +136 -0
  186. package/dist/cjs/tooling/table.native.js.map +1 -0
  187. package/dist/cjs/tooling/toolingAnnotations.cjs +104 -0
  188. package/dist/cjs/tooling/toolingAnnotations.native.cjs +132 -0
  189. package/dist/cjs/tooling/toolingAnnotations.native.js +134 -0
  190. package/dist/cjs/tooling/toolingAnnotations.native.js.map +1 -0
  191. package/dist/cjs/tooling/toolingDiagnostics.cjs +458 -0
  192. package/dist/cjs/tooling/toolingDiagnostics.native.cjs +776 -0
  193. package/dist/cjs/tooling/toolingDiagnostics.native.js +778 -0
  194. package/dist/cjs/tooling/toolingDiagnostics.native.js.map +1 -0
  195. package/dist/cjs/tooling/toolingFormat.cjs +31 -0
  196. package/dist/cjs/tooling/toolingFormat.native.cjs +50 -0
  197. package/dist/cjs/tooling/toolingFormat.native.js +52 -0
  198. package/dist/cjs/tooling/toolingFormat.native.js.map +1 -0
  199. package/dist/cjs/tooling/toolingRegistry.cjs +178 -0
  200. package/dist/cjs/tooling/toolingRegistry.native.cjs +186 -0
  201. package/dist/cjs/tooling/toolingRegistry.native.js +188 -0
  202. package/dist/cjs/tooling/toolingRegistry.native.js.map +1 -0
  203. package/dist/cjs/tooling.cjs +61 -0
  204. package/dist/cjs/tooling.native.cjs +63 -0
  205. package/dist/cjs/tooling.native.js +65 -0
  206. package/dist/cjs/tooling.native.js.map +1 -0
  207. package/dist/cjs/transitions.cjs +38 -0
  208. package/dist/cjs/transitions.native.cjs +40 -0
  209. package/dist/cjs/transitions.native.js +42 -0
  210. package/dist/cjs/transitions.native.js.map +1 -0
  211. package/dist/cjs/v6ThemeNames.cjs +46 -0
  212. package/dist/cjs/v6ThemeNames.native.cjs +52 -0
  213. package/dist/cjs/v6ThemeNames.native.js +54 -0
  214. package/dist/cjs/v6ThemeNames.native.js.map +1 -0
  215. package/dist/esm/ast/payloadShape.mjs +49 -0
  216. package/dist/esm/ast/payloadShape.mjs.map +1 -0
  217. package/dist/esm/ast/payloadShape.native.js +49 -0
  218. package/dist/esm/ast/payloadShape.native.js.map +1 -0
  219. package/dist/esm/ast/resolvePayload.mjs +253 -0
  220. package/dist/esm/ast/resolvePayload.mjs.map +1 -0
  221. package/dist/esm/ast/resolvePayload.native.js +257 -0
  222. package/dist/esm/ast/resolvePayload.native.js.map +1 -0
  223. package/dist/esm/ast/serializePayload.mjs +125 -0
  224. package/dist/esm/ast/serializePayload.mjs.map +1 -0
  225. package/dist/esm/ast/serializePayload.native.js +161 -0
  226. package/dist/esm/ast/serializePayload.native.js.map +1 -0
  227. package/dist/esm/ast/valueParser.mjs +129 -0
  228. package/dist/esm/ast/valueParser.mjs.map +1 -0
  229. package/dist/esm/ast/valueParser.native.js +134 -0
  230. package/dist/esm/ast/valueParser.native.js.map +1 -0
  231. package/dist/esm/ast/valueTypes.mjs +14 -0
  232. package/dist/esm/ast/valueTypes.mjs.map +1 -0
  233. package/dist/esm/ast/valueTypes.native.js +14 -0
  234. package/dist/esm/ast/valueTypes.native.js.map +1 -0
  235. package/dist/esm/index.mjs +0 -0
  236. package/dist/esm/index.native.js +0 -0
  237. package/dist/esm/programs/clauseCapability.mjs +107 -0
  238. package/dist/esm/programs/clauseCapability.mjs.map +1 -0
  239. package/dist/esm/programs/clauseCapability.native.js +127 -0
  240. package/dist/esm/programs/clauseCapability.native.js.map +1 -0
  241. package/dist/esm/programs/clauseSources.mjs +23 -0
  242. package/dist/esm/programs/clauseSources.mjs.map +1 -0
  243. package/dist/esm/programs/clauseSources.native.js +23 -0
  244. package/dist/esm/programs/clauseSources.native.js.map +1 -0
  245. package/dist/esm/programs/evaluateProgram.mjs +43 -0
  246. package/dist/esm/programs/evaluateProgram.mjs.map +1 -0
  247. package/dist/esm/programs/evaluateProgram.native.js +46 -0
  248. package/dist/esm/programs/evaluateProgram.native.js.map +1 -0
  249. package/dist/esm/programs/lowerProgram.mjs +181 -0
  250. package/dist/esm/programs/lowerProgram.mjs.map +1 -0
  251. package/dist/esm/programs/lowerProgram.native.js +228 -0
  252. package/dist/esm/programs/lowerProgram.native.js.map +1 -0
  253. package/dist/esm/programs/modifierRegistry.mjs +152 -0
  254. package/dist/esm/programs/modifierRegistry.mjs.map +1 -0
  255. package/dist/esm/programs/modifierRegistry.native.js +277 -0
  256. package/dist/esm/programs/modifierRegistry.native.js.map +1 -0
  257. package/dist/esm/programs/programEligibility.mjs +22 -0
  258. package/dist/esm/programs/programEligibility.mjs.map +1 -0
  259. package/dist/esm/programs/programEligibility.native.js +22 -0
  260. package/dist/esm/programs/programEligibility.native.js.map +1 -0
  261. package/dist/esm/programs/programHash.mjs +61 -0
  262. package/dist/esm/programs/programHash.mjs.map +1 -0
  263. package/dist/esm/programs/programHash.native.js +79 -0
  264. package/dist/esm/programs/programHash.native.js.map +1 -0
  265. package/dist/esm/programs/programs.mjs +103 -0
  266. package/dist/esm/programs/programs.mjs.map +1 -0
  267. package/dist/esm/programs/programs.native.js +193 -0
  268. package/dist/esm/programs/programs.native.js.map +1 -0
  269. package/dist/esm/runtime/clauseIdentity.mjs +139 -0
  270. package/dist/esm/runtime/clauseIdentity.mjs.map +1 -0
  271. package/dist/esm/runtime/clauseIdentity.native.js +166 -0
  272. package/dist/esm/runtime/clauseIdentity.native.js.map +1 -0
  273. package/dist/esm/runtime/clausePrecedence.mjs +102 -0
  274. package/dist/esm/runtime/clausePrecedence.mjs.map +1 -0
  275. package/dist/esm/runtime/clausePrecedence.native.js +146 -0
  276. package/dist/esm/runtime/clausePrecedence.native.js.map +1 -0
  277. package/dist/esm/runtime/colorOpacity.mjs +24 -0
  278. package/dist/esm/runtime/colorOpacity.mjs.map +1 -0
  279. package/dist/esm/runtime/colorOpacity.native.js +24 -0
  280. package/dist/esm/runtime/colorOpacity.native.js.map +1 -0
  281. package/dist/esm/runtime/mergeFlatValues.mjs +71 -0
  282. package/dist/esm/runtime/mergeFlatValues.mjs.map +1 -0
  283. package/dist/esm/runtime/mergeFlatValues.native.js +142 -0
  284. package/dist/esm/runtime/mergeFlatValues.native.js.map +1 -0
  285. package/dist/esm/runtime/modifierVocabulary.mjs +66 -0
  286. package/dist/esm/runtime/modifierVocabulary.mjs.map +1 -0
  287. package/dist/esm/runtime/modifierVocabulary.native.js +126 -0
  288. package/dist/esm/runtime/modifierVocabulary.native.js.map +1 -0
  289. package/dist/esm/runtime/namedCssColors.mjs +4 -0
  290. package/dist/esm/runtime/namedCssColors.mjs.map +1 -0
  291. package/dist/esm/runtime/namedCssColors.native.js +4 -0
  292. package/dist/esm/runtime/namedCssColors.native.js.map +1 -0
  293. package/dist/esm/runtime/safeAreaVariables.mjs +18 -0
  294. package/dist/esm/runtime/safeAreaVariables.mjs.map +1 -0
  295. package/dist/esm/runtime/safeAreaVariables.native.js +18 -0
  296. package/dist/esm/runtime/safeAreaVariables.native.js.map +1 -0
  297. package/dist/esm/runtime/scanFlatValue.mjs +323 -0
  298. package/dist/esm/runtime/scanFlatValue.mjs.map +1 -0
  299. package/dist/esm/runtime/scanFlatValue.native.js +327 -0
  300. package/dist/esm/runtime/scanFlatValue.native.js.map +1 -0
  301. package/dist/esm/runtime/spring.mjs +93 -0
  302. package/dist/esm/runtime/spring.mjs.map +1 -0
  303. package/dist/esm/runtime/spring.native.js +99 -0
  304. package/dist/esm/runtime/spring.native.js.map +1 -0
  305. package/dist/esm/runtime/stateModifiers.mjs +39 -0
  306. package/dist/esm/runtime/stateModifiers.mjs.map +1 -0
  307. package/dist/esm/runtime/stateModifiers.native.js +39 -0
  308. package/dist/esm/runtime/stateModifiers.native.js.map +1 -0
  309. package/dist/esm/runtime/states.mjs +69 -0
  310. package/dist/esm/runtime/states.mjs.map +1 -0
  311. package/dist/esm/runtime/states.native.js +101 -0
  312. package/dist/esm/runtime/states.native.js.map +1 -0
  313. package/dist/esm/runtime/tokenCategories.mjs +147 -0
  314. package/dist/esm/runtime/tokenCategories.mjs.map +1 -0
  315. package/dist/esm/runtime/tokenCategories.native.js +146 -0
  316. package/dist/esm/runtime/tokenCategories.native.js.map +1 -0
  317. package/dist/esm/runtime/transformAccumulator.mjs +52 -0
  318. package/dist/esm/runtime/transformAccumulator.mjs.map +1 -0
  319. package/dist/esm/runtime/transformAccumulator.native.js +69 -0
  320. package/dist/esm/runtime/transformAccumulator.native.js.map +1 -0
  321. package/dist/esm/runtime/unitlessNumbers.mjs +65 -0
  322. package/dist/esm/runtime/unitlessNumbers.mjs.map +1 -0
  323. package/dist/esm/runtime/unitlessNumbers.native.js +83 -0
  324. package/dist/esm/runtime/unitlessNumbers.native.js.map +1 -0
  325. package/dist/esm/runtime.mjs +16 -0
  326. package/dist/esm/runtime.native.js +16 -0
  327. package/dist/esm/shorthands/backgroundFamily.mjs +151 -0
  328. package/dist/esm/shorthands/backgroundFamily.mjs.map +1 -0
  329. package/dist/esm/shorthands/backgroundFamily.native.js +168 -0
  330. package/dist/esm/shorthands/backgroundFamily.native.js.map +1 -0
  331. package/dist/esm/shorthands/borderFamily.mjs +146 -0
  332. package/dist/esm/shorthands/borderFamily.mjs.map +1 -0
  333. package/dist/esm/shorthands/borderFamily.native.js +222 -0
  334. package/dist/esm/shorthands/borderFamily.native.js.map +1 -0
  335. package/dist/esm/shorthands/fontShorthand.mjs +184 -0
  336. package/dist/esm/shorthands/fontShorthand.mjs.map +1 -0
  337. package/dist/esm/shorthands/fontShorthand.native.js +235 -0
  338. package/dist/esm/shorthands/fontShorthand.native.js.map +1 -0
  339. package/dist/esm/shorthands/geometricShorthand.mjs +102 -0
  340. package/dist/esm/shorthands/geometricShorthand.mjs.map +1 -0
  341. package/dist/esm/shorthands/geometricShorthand.native.js +106 -0
  342. package/dist/esm/shorthands/geometricShorthand.native.js.map +1 -0
  343. package/dist/esm/shorthands/textDecorationFamily.mjs +106 -0
  344. package/dist/esm/shorthands/textDecorationFamily.mjs.map +1 -0
  345. package/dist/esm/shorthands/textDecorationFamily.native.js +174 -0
  346. package/dist/esm/shorthands/textDecorationFamily.native.js.map +1 -0
  347. package/dist/esm/shorthands/transformFamily.mjs +390 -0
  348. package/dist/esm/shorthands/transformFamily.mjs.map +1 -0
  349. package/dist/esm/shorthands/transformFamily.native.js +441 -0
  350. package/dist/esm/shorthands/transformFamily.native.js.map +1 -0
  351. package/dist/esm/shorthands/transition.mjs +509 -0
  352. package/dist/esm/shorthands/transition.mjs.map +1 -0
  353. package/dist/esm/shorthands/transition.native.js +549 -0
  354. package/dist/esm/shorthands/transition.native.js.map +1 -0
  355. package/dist/esm/shorthands/transitionAlign.mjs +98 -0
  356. package/dist/esm/shorthands/transitionAlign.mjs.map +1 -0
  357. package/dist/esm/shorthands/transitionAlign.native.js +135 -0
  358. package/dist/esm/shorthands/transitionAlign.native.js.map +1 -0
  359. package/dist/esm/shorthands/transitionLegacy.mjs +331 -0
  360. package/dist/esm/shorthands/transitionLegacy.mjs.map +1 -0
  361. package/dist/esm/shorthands/transitionLegacy.native.js +413 -0
  362. package/dist/esm/shorthands/transitionLegacy.native.js.map +1 -0
  363. package/dist/esm/shorthands/transitionNative.mjs +256 -0
  364. package/dist/esm/shorthands/transitionNative.mjs.map +1 -0
  365. package/dist/esm/shorthands/transitionNative.native.js +259 -0
  366. package/dist/esm/shorthands/transitionNative.native.js.map +1 -0
  367. package/dist/esm/shorthands/transitionObject.mjs +280 -0
  368. package/dist/esm/shorthands/transitionObject.mjs.map +1 -0
  369. package/dist/esm/shorthands/transitionObject.native.js +323 -0
  370. package/dist/esm/shorthands/transitionObject.native.js.map +1 -0
  371. package/dist/esm/tokenCategories.mjs +1 -0
  372. package/dist/esm/tokenCategories.native.js +1 -0
  373. package/dist/esm/tooling/candidate.mjs +849 -0
  374. package/dist/esm/tooling/candidate.mjs.map +1 -0
  375. package/dist/esm/tooling/candidate.native.js +1083 -0
  376. package/dist/esm/tooling/candidate.native.js.map +1 -0
  377. package/dist/esm/tooling/candidateTarget.mjs +29 -0
  378. package/dist/esm/tooling/candidateTarget.mjs.map +1 -0
  379. package/dist/esm/tooling/candidateTarget.native.js +65 -0
  380. package/dist/esm/tooling/candidateTarget.native.js.map +1 -0
  381. package/dist/esm/tooling/config.mjs +110 -0
  382. package/dist/esm/tooling/config.mjs.map +1 -0
  383. package/dist/esm/tooling/config.native.js +152 -0
  384. package/dist/esm/tooling/config.native.js.map +1 -0
  385. package/dist/esm/tooling/registry.mjs +1052 -0
  386. package/dist/esm/tooling/registry.mjs.map +1 -0
  387. package/dist/esm/tooling/registry.native.js +1055 -0
  388. package/dist/esm/tooling/registry.native.js.map +1 -0
  389. package/dist/esm/tooling/table.mjs +31 -0
  390. package/dist/esm/tooling/table.mjs.map +1 -0
  391. package/dist/esm/tooling/table.native.js +110 -0
  392. package/dist/esm/tooling/table.native.js.map +1 -0
  393. package/dist/esm/tooling/toolingAnnotations.mjs +85 -0
  394. package/dist/esm/tooling/toolingAnnotations.mjs.map +1 -0
  395. package/dist/esm/tooling/toolingAnnotations.native.js +111 -0
  396. package/dist/esm/tooling/toolingAnnotations.native.js.map +1 -0
  397. package/dist/esm/tooling/toolingDiagnostics.mjs +428 -0
  398. package/dist/esm/tooling/toolingDiagnostics.mjs.map +1 -0
  399. package/dist/esm/tooling/toolingDiagnostics.native.js +744 -0
  400. package/dist/esm/tooling/toolingDiagnostics.native.js.map +1 -0
  401. package/dist/esm/tooling/toolingFormat.mjs +11 -0
  402. package/dist/esm/tooling/toolingFormat.mjs.map +1 -0
  403. package/dist/esm/tooling/toolingFormat.native.js +28 -0
  404. package/dist/esm/tooling/toolingFormat.native.js.map +1 -0
  405. package/dist/esm/tooling/toolingRegistry.mjs +155 -0
  406. package/dist/esm/tooling/toolingRegistry.mjs.map +1 -0
  407. package/dist/esm/tooling/toolingRegistry.native.js +161 -0
  408. package/dist/esm/tooling/toolingRegistry.native.js.map +1 -0
  409. package/dist/esm/tooling.mjs +87 -0
  410. package/dist/esm/tooling.native.js +87 -0
  411. package/dist/esm/transitions.mjs +5 -0
  412. package/dist/esm/transitions.native.js +5 -0
  413. package/dist/esm/v6ThemeNames.mjs +23 -0
  414. package/dist/esm/v6ThemeNames.mjs.map +1 -0
  415. package/dist/esm/v6ThemeNames.native.js +27 -0
  416. package/dist/esm/v6ThemeNames.native.js.map +1 -0
  417. package/package.json +86 -4
  418. package/src/ast/payloadShape.ts +92 -0
  419. package/src/ast/resolvePayload.ts +451 -0
  420. package/src/ast/serializePayload.ts +199 -0
  421. package/src/ast/valueParser.ts +213 -0
  422. package/src/ast/valueTypes.ts +136 -0
  423. package/src/index.ts +1 -0
  424. package/src/programs/clauseCapability.ts +210 -0
  425. package/src/programs/clauseSources.ts +25 -0
  426. package/src/programs/evaluateProgram.ts +87 -0
  427. package/src/programs/lowerProgram.ts +386 -0
  428. package/src/programs/modifierRegistry.ts +273 -0
  429. package/src/programs/programEligibility.ts +46 -0
  430. package/src/programs/programHash.ts +123 -0
  431. package/src/programs/programs.ts +95 -0
  432. package/src/runtime/clauseIdentity.ts +228 -0
  433. package/src/runtime/clausePrecedence.ts +172 -0
  434. package/src/runtime/colorOpacity.ts +28 -0
  435. package/src/runtime/mergeFlatValues.ts +99 -0
  436. package/src/runtime/modifierVocabulary.ts +103 -0
  437. package/src/runtime/namedCssColors.ts +7 -0
  438. package/src/runtime/safeAreaVariables.ts +19 -0
  439. package/src/runtime/scanFlatValue.ts +530 -0
  440. package/src/runtime/spring.ts +208 -0
  441. package/src/runtime/stateModifiers.ts +63 -0
  442. package/src/runtime/states.ts +125 -0
  443. package/src/runtime/tokenCategories.ts +151 -0
  444. package/src/runtime/transformAccumulator.ts +70 -0
  445. package/src/runtime/unitlessNumbers.ts +61 -0
  446. package/src/runtime.ts +94 -0
  447. package/src/shorthands/backgroundFamily.ts +177 -0
  448. package/src/shorthands/borderFamily.ts +172 -0
  449. package/src/shorthands/fontShorthand.ts +177 -0
  450. package/src/shorthands/geometricShorthand.ts +105 -0
  451. package/src/shorthands/textDecorationFamily.ts +119 -0
  452. package/src/shorthands/transformFamily.ts +579 -0
  453. package/src/shorthands/transition.ts +668 -0
  454. package/src/shorthands/transitionAlign.ts +175 -0
  455. package/src/shorthands/transitionLegacy.ts +457 -0
  456. package/src/shorthands/transitionNative.ts +353 -0
  457. package/src/shorthands/transitionObject.ts +369 -0
  458. package/src/tokenCategories.ts +1 -0
  459. package/src/tooling/candidate.ts +968 -0
  460. package/src/tooling/candidateTarget.ts +67 -0
  461. package/src/tooling/config.ts +177 -0
  462. package/src/tooling/registry.ts +661 -0
  463. package/src/tooling/table.ts +47 -0
  464. package/src/tooling/toolingAnnotations.ts +151 -0
  465. package/src/tooling/toolingDiagnostics.ts +735 -0
  466. package/src/tooling/toolingFormat.ts +11 -0
  467. package/src/tooling/toolingRegistry.ts +150 -0
  468. package/src/tooling.ts +44 -0
  469. package/src/transitions.ts +42 -0
  470. package/src/v6ThemeNames.ts +40 -0
  471. package/types/ast/payloadShape.d.ts +15 -0
  472. package/types/ast/payloadShape.d.ts.map +11 -0
  473. package/types/ast/resolvePayload.d.ts +56 -0
  474. package/types/ast/resolvePayload.d.ts.map +11 -0
  475. package/types/ast/serializePayload.d.ts +13 -0
  476. package/types/ast/serializePayload.d.ts.map +11 -0
  477. package/types/ast/valueParser.d.ts +37 -0
  478. package/types/ast/valueParser.d.ts.map +11 -0
  479. package/types/ast/valueTypes.d.ts +67 -0
  480. package/types/ast/valueTypes.d.ts.map +11 -0
  481. package/types/index.d.ts +3 -0
  482. package/types/index.d.ts.map +11 -0
  483. package/types/programs/clauseCapability.d.ts +69 -0
  484. package/types/programs/clauseCapability.d.ts.map +11 -0
  485. package/types/programs/clauseSources.d.ts +8 -0
  486. package/types/programs/clauseSources.d.ts.map +11 -0
  487. package/types/programs/evaluateProgram.d.ts +27 -0
  488. package/types/programs/evaluateProgram.d.ts.map +11 -0
  489. package/types/programs/lowerProgram.d.ts +73 -0
  490. package/types/programs/lowerProgram.d.ts.map +11 -0
  491. package/types/programs/modifierRegistry.d.ts +47 -0
  492. package/types/programs/modifierRegistry.d.ts.map +11 -0
  493. package/types/programs/programEligibility.d.ts +23 -0
  494. package/types/programs/programEligibility.d.ts.map +11 -0
  495. package/types/programs/programHash.d.ts +20 -0
  496. package/types/programs/programHash.d.ts.map +11 -0
  497. package/types/programs/programs.d.ts +18 -0
  498. package/types/programs/programs.d.ts.map +11 -0
  499. package/types/runtime/clauseIdentity.d.ts +33 -0
  500. package/types/runtime/clauseIdentity.d.ts.map +11 -0
  501. package/types/runtime/clausePrecedence.d.ts +21 -0
  502. package/types/runtime/clausePrecedence.d.ts.map +11 -0
  503. package/types/runtime/colorOpacity.d.ts +21 -0
  504. package/types/runtime/colorOpacity.d.ts.map +11 -0
  505. package/types/runtime/mergeFlatValues.d.ts +11 -0
  506. package/types/runtime/mergeFlatValues.d.ts.map +11 -0
  507. package/types/runtime/modifierVocabulary.d.ts +20 -0
  508. package/types/runtime/modifierVocabulary.d.ts.map +11 -0
  509. package/types/runtime/namedCssColors.d.ts +3 -0
  510. package/types/runtime/namedCssColors.d.ts.map +11 -0
  511. package/types/runtime/safeAreaVariables.d.ts +5 -0
  512. package/types/runtime/safeAreaVariables.d.ts.map +11 -0
  513. package/types/runtime/scanFlatValue.d.ts +17 -0
  514. package/types/runtime/scanFlatValue.d.ts.map +11 -0
  515. package/types/runtime/spring.d.ts +61 -0
  516. package/types/runtime/spring.d.ts.map +11 -0
  517. package/types/runtime/stateModifiers.d.ts +16 -0
  518. package/types/runtime/stateModifiers.d.ts.map +11 -0
  519. package/types/runtime/states.d.ts +22 -0
  520. package/types/runtime/states.d.ts.map +11 -0
  521. package/types/runtime/tokenCategories.d.ts +17 -0
  522. package/types/runtime/tokenCategories.d.ts.map +11 -0
  523. package/types/runtime/transformAccumulator.d.ts +9 -0
  524. package/types/runtime/transformAccumulator.d.ts.map +11 -0
  525. package/types/runtime/unitlessNumbers.d.ts +3 -0
  526. package/types/runtime/unitlessNumbers.d.ts.map +11 -0
  527. package/types/runtime.d.ts +18 -0
  528. package/types/runtime.d.ts.map +11 -0
  529. package/types/shorthands/backgroundFamily.d.ts +16 -0
  530. package/types/shorthands/backgroundFamily.d.ts.map +11 -0
  531. package/types/shorthands/borderFamily.d.ts +23 -0
  532. package/types/shorthands/borderFamily.d.ts.map +11 -0
  533. package/types/shorthands/fontShorthand.d.ts +25 -0
  534. package/types/shorthands/fontShorthand.d.ts.map +11 -0
  535. package/types/shorthands/geometricShorthand.d.ts +21 -0
  536. package/types/shorthands/geometricShorthand.d.ts.map +11 -0
  537. package/types/shorthands/textDecorationFamily.d.ts +23 -0
  538. package/types/shorthands/textDecorationFamily.d.ts.map +11 -0
  539. package/types/shorthands/transformFamily.d.ts +82 -0
  540. package/types/shorthands/transformFamily.d.ts.map +11 -0
  541. package/types/shorthands/transition.d.ts +86 -0
  542. package/types/shorthands/transition.d.ts.map +11 -0
  543. package/types/shorthands/transitionAlign.d.ts +15 -0
  544. package/types/shorthands/transitionAlign.d.ts.map +11 -0
  545. package/types/shorthands/transitionLegacy.d.ts +24 -0
  546. package/types/shorthands/transitionLegacy.d.ts.map +11 -0
  547. package/types/shorthands/transitionNative.d.ts +41 -0
  548. package/types/shorthands/transitionNative.d.ts.map +11 -0
  549. package/types/shorthands/transitionObject.d.ts +49 -0
  550. package/types/shorthands/transitionObject.d.ts.map +11 -0
  551. package/types/tokenCategories.d.ts +3 -0
  552. package/types/tokenCategories.d.ts.map +11 -0
  553. package/types/tooling/candidate.d.ts +63 -0
  554. package/types/tooling/candidate.d.ts.map +11 -0
  555. package/types/tooling/candidateTarget.d.ts +32 -0
  556. package/types/tooling/candidateTarget.d.ts.map +11 -0
  557. package/types/tooling/config.d.ts +45 -0
  558. package/types/tooling/config.d.ts.map +11 -0
  559. package/types/tooling/registry.d.ts +28 -0
  560. package/types/tooling/registry.d.ts.map +11 -0
  561. package/types/tooling/table.d.ts +4 -0
  562. package/types/tooling/table.d.ts.map +11 -0
  563. package/types/tooling/toolingAnnotations.d.ts +29 -0
  564. package/types/tooling/toolingAnnotations.d.ts.map +11 -0
  565. package/types/tooling/toolingDiagnostics.d.ts +114 -0
  566. package/types/tooling/toolingDiagnostics.d.ts.map +11 -0
  567. package/types/tooling/toolingFormat.d.ts +5 -0
  568. package/types/tooling/toolingFormat.d.ts.map +11 -0
  569. package/types/tooling/toolingRegistry.d.ts +10 -0
  570. package/types/tooling/toolingRegistry.d.ts.map +11 -0
  571. package/types/tooling.d.ts +46 -0
  572. package/types/tooling.d.ts.map +11 -0
  573. package/types/transitions.d.ts +5 -0
  574. package/types/transitions.d.ts.map +11 -0
  575. package/types/v6ThemeNames.d.ts +7 -0
  576. package/types/v6ThemeNames.d.ts.map +11 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1 +1,33 @@
1
- # @tamagui/style-grammar
1
+ # `@tamagui/style-grammar`
2
+
3
+ This package owns the shared parser and intermediate representation for
4
+ Tamagui style value strings.
5
+
6
+ Runtime consumers must follow the repository's
7
+ [one-parse-per-unique-value constraint](../../../CONTRIBUTING.md#style-value-parsing-one-parse-per-unique-value).
8
+ Cache the parsed representation and extend it with structural predicates when
9
+ a new consumer needs more information. Do not add a second string scanner
10
+ beside the grammar.
11
+
12
+ ## The one scanner
13
+
14
+ `scanFlatValue.ts` is the split: one left-to-right pass that hands a handler
15
+ index ranges and never allocates a slice. `parseValue` is built on it, and so
16
+ are the three scanners in `@tamagui/web` (`contributeStyleString`,
17
+ `resolveVariants`, `hasFlatModifier`). A consumer that needs a different answer
18
+ writes a different handler, never a second pass.
19
+
20
+ ## The Rust LSP's tables are generated from here
21
+
22
+ `code/lsp/crates/tamagui-grammar` is an editor transport for this grammar and
23
+ never a second owner of what a modifier means, so its modifier tables and its
24
+ conformance vectors are generated:
25
+
26
+ ```sh
27
+ bun run generate:rust # write src/generated.rs and tests/vectors.json
28
+ bun run check:rust # fail if what is on disk differs
29
+ ```
30
+
31
+ `checks.yaml` runs `check:rust` and `cargo test --workspace` on every push. When
32
+ you change a modifier name, an alias, a platform, or anything the parser
33
+ decides, regenerate and commit both files with the change.
@@ -0,0 +1,68 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var payloadShape_exports = {};
22
+ __export(payloadShape_exports, { validatePayloadShape: () => validatePayloadShape });
23
+ module.exports = __toCommonJS(payloadShape_exports);
24
+ var import_backgroundFamily = require("../shorthands/backgroundFamily.cjs");
25
+ const listValuedLonghands = /* @__PURE__ */ new Set([
26
+ "boxShadow",
27
+ "textShadow",
28
+ "transform",
29
+ "transition",
30
+ "transitionProperty",
31
+ "animation",
32
+ "animationName",
33
+ "backgroundImage",
34
+ "backgroundPosition",
35
+ "backgroundSize",
36
+ "backgroundRepeat",
37
+ "fontFamily",
38
+ "fontVariant",
39
+ "filter",
40
+ "backdropFilter",
41
+ "willChange",
42
+ "quotes",
43
+ "textDecorationLine",
44
+ "containIntrinsicSize",
45
+ "strokeDasharray",
46
+ "gridTemplateColumns",
47
+ "gridTemplateRows",
48
+ "gridTemplateAreas",
49
+ "gridArea",
50
+ "gridColumn",
51
+ "gridRow",
52
+ "inset",
53
+ "mask",
54
+ "maskImage",
55
+ "maskPosition",
56
+ "maskSize"
57
+ ]);
58
+ function validatePayloadShape(property, payload, hasBase) {
59
+ if (listValuedLonghands.has(property)) return null;
60
+ const components = (0, import_backgroundFamily.splitTopLevelComponents)(payload);
61
+ if (components.length <= 1) return null;
62
+ return {
63
+ code: "multi-component-single-value",
64
+ property,
65
+ payload,
66
+ message: `"${payload}" holds ${components.length} values but "${property}" takes one.` + (hasBase ? "" : ` A value written after a conditional joins that conditional's payload \u2014 write the base value before the first conditional.`)
67
+ };
68
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var payloadShape_exports = {};
24
+ __export(payloadShape_exports, { validatePayloadShape: () => validatePayloadShape });
25
+ module.exports = __toCommonJS(payloadShape_exports);
26
+ var import_backgroundFamily = require("../shorthands/backgroundFamily.native.js");
27
+ var listValuedLonghands = /* @__PURE__ */ new Set([
28
+ "boxShadow",
29
+ "textShadow",
30
+ "transform",
31
+ "transition",
32
+ "transitionProperty",
33
+ "animation",
34
+ "animationName",
35
+ "backgroundImage",
36
+ "backgroundPosition",
37
+ "backgroundSize",
38
+ "backgroundRepeat",
39
+ "fontFamily",
40
+ "fontVariant",
41
+ "filter",
42
+ "backdropFilter",
43
+ "willChange",
44
+ "quotes",
45
+ "textDecorationLine",
46
+ "containIntrinsicSize",
47
+ "strokeDasharray",
48
+ "gridTemplateColumns",
49
+ "gridTemplateRows",
50
+ "gridTemplateAreas",
51
+ "gridArea",
52
+ "gridColumn",
53
+ "gridRow",
54
+ "inset",
55
+ "mask",
56
+ "maskImage",
57
+ "maskPosition",
58
+ "maskSize"
59
+ ]);
60
+ function validatePayloadShape(property, payload, hasBase) {
61
+ if (listValuedLonghands.has(property)) return null;
62
+ var components = (0, import_backgroundFamily.splitTopLevelComponents)(payload);
63
+ if (components.length <= 1) return null;
64
+ return {
65
+ code: "multi-component-single-value",
66
+ property,
67
+ payload,
68
+ message: `"${payload}" holds ${components.length} values but "${property}" takes one.` + (hasBase ? "" : ` A value written after a conditional joins that conditional's payload \u2014 write the base value before the first conditional.`)
69
+ };
70
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var payloadShape_exports = {};
24
+ __export(payloadShape_exports, { validatePayloadShape: () => validatePayloadShape });
25
+ module.exports = __toCommonJS(payloadShape_exports);
26
+ var import_backgroundFamily = require("../shorthands/backgroundFamily.native.js");
27
+ var listValuedLonghands = /* @__PURE__ */ new Set([
28
+ "boxShadow",
29
+ "textShadow",
30
+ "transform",
31
+ "transition",
32
+ "transitionProperty",
33
+ "animation",
34
+ "animationName",
35
+ "backgroundImage",
36
+ "backgroundPosition",
37
+ "backgroundSize",
38
+ "backgroundRepeat",
39
+ "fontFamily",
40
+ "fontVariant",
41
+ "filter",
42
+ "backdropFilter",
43
+ "willChange",
44
+ "quotes",
45
+ "textDecorationLine",
46
+ "containIntrinsicSize",
47
+ "strokeDasharray",
48
+ "gridTemplateColumns",
49
+ "gridTemplateRows",
50
+ "gridTemplateAreas",
51
+ "gridArea",
52
+ "gridColumn",
53
+ "gridRow",
54
+ "inset",
55
+ "mask",
56
+ "maskImage",
57
+ "maskPosition",
58
+ "maskSize"
59
+ ]);
60
+ function validatePayloadShape(property, payload, hasBase) {
61
+ if (listValuedLonghands.has(property)) return null;
62
+ var components = (0, import_backgroundFamily.splitTopLevelComponents)(payload);
63
+ if (components.length <= 1) return null;
64
+ return {
65
+ code: "multi-component-single-value",
66
+ property,
67
+ payload,
68
+ message: `"${payload}" holds ${components.length} values but "${property}" takes one.` + (hasBase ? "" : ` A value written after a conditional joins that conditional's payload \u2014 write the base value before the first conditional.`)
69
+ };
70
+ }
71
+
72
+ //# sourceMappingURL=payloadShape.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payloadShape.native.js","names":[],"sources":["cjs/ast/payloadShape.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar payloadShape_exports = {};\n__export(payloadShape_exports, {\n validatePayloadShape: () => validatePayloadShape\n});\nmodule.exports = __toCommonJS(payloadShape_exports);\nvar import_backgroundFamily = require(\"../shorthands/backgroundFamily\");\nvar listValuedLonghands = /* @__PURE__ */ new Set([\n \"boxShadow\",\n \"textShadow\",\n \"transform\",\n \"transition\",\n \"transitionProperty\",\n \"animation\",\n \"animationName\",\n \"backgroundImage\",\n \"backgroundPosition\",\n \"backgroundSize\",\n \"backgroundRepeat\",\n \"fontFamily\",\n \"fontVariant\",\n \"filter\",\n \"backdropFilter\",\n \"willChange\",\n \"quotes\",\n \"textDecorationLine\",\n \"containIntrinsicSize\",\n \"strokeDasharray\",\n \"gridTemplateColumns\",\n \"gridTemplateRows\",\n \"gridTemplateAreas\",\n \"gridArea\",\n \"gridColumn\",\n \"gridRow\",\n \"inset\",\n \"mask\",\n \"maskImage\",\n \"maskPosition\",\n \"maskSize\"\n]);\nfunction validatePayloadShape(property, payload, hasBase) {\n if (listValuedLonghands.has(property)) return null;\n var components = (0, import_backgroundFamily.splitTopLevelComponents)(payload);\n if (components.length <= 1) return null;\n return {\n code: \"multi-component-single-value\",\n property,\n payload,\n message: `\"${payload}\" holds ${components.length} values but \"${property}\" takes one.` + (hasBase ? \"\" : ` A value written after a conditional joins that conditional's payload \\u2014 write the base value before the first conditional.`)\n };\n}\n//# sourceMappingURL=payloadShape.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB,EAC7B,4BAA4B,qBAC9B,CAAC;AACD,OAAO,UAAU,aAAa,oBAAoB;AAClD,IAAI,0BAA0B,QAAQ,0CAAgC;AACtE,IAAI,sCAAsC,IAAI,IAAI;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,qBAAqB,UAAU,SAAS,SAAS;CACxD,IAAI,oBAAoB,IAAI,QAAQ,GAAG,OAAO;CAC9C,IAAI,cAAc,GAAG,wBAAwB,wBAAuB,CAAE,OAAO;CAC7E,IAAI,WAAW,UAAU,GAAG,OAAO;CACnC,OAAO;EACL,MAAM;EACN;EACA;EACA,SAAS,IAAI,QAAQ,UAAU,WAAW,OAAO,eAAe,SAAS,iBAAiB,UAAU,KAAK;CAC3G;AACF"}
@@ -0,0 +1,275 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var resolvePayload_exports = {};
22
+ __export(resolvePayload_exports, {
23
+ resolvePayload: () => resolvePayload,
24
+ splitColorOpacitySuffix: () => import_colorOpacity.splitColorOpacitySuffix
25
+ });
26
+ module.exports = __toCommonJS(resolvePayload_exports);
27
+ var import_valueTypes = require("./valueTypes.cjs");
28
+ var import_colorOpacity = require("../runtime/colorOpacity.cjs");
29
+ const reservedFolded = new Set(Array.from(import_valueTypes.reservedCssIdents, (ident) => ident.toLowerCase()));
30
+ const noReferences = Object.freeze([]);
31
+ const noErrors = Object.freeze([]);
32
+ const CHAR_TAB = 9;
33
+ const CHAR_LF = 10;
34
+ const CHAR_FF = 12;
35
+ const CHAR_CR = 13;
36
+ const CHAR_SPACE = 32;
37
+ const CHAR_PERCENT = 37;
38
+ const CHAR_HASH = 35;
39
+ const CHAR_DOUBLE_QUOTE = 34;
40
+ const CHAR_SINGLE_QUOTE = 39;
41
+ const CHAR_PAREN_OPEN = 40;
42
+ const CHAR_PAREN_CLOSE = 41;
43
+ const CHAR_PLUS = 43;
44
+ const CHAR_COMMA = 44;
45
+ const CHAR_MINUS = 45;
46
+ const CHAR_DOT = 46;
47
+ const CHAR_SLASH = 47;
48
+ const CHAR_UNDERSCORE = 95;
49
+ const CHAR_BACKSLASH = 92;
50
+ const CHAR_E_LOWER = 101;
51
+ const CHAR_E_UPPER = 69;
52
+ function isWhitespace(code) {
53
+ return code === CHAR_SPACE || code === CHAR_TAB || code === CHAR_LF || code === CHAR_CR || code === CHAR_FF;
54
+ }
55
+ function isDigit(code) {
56
+ return code >= 48 && code <= 57;
57
+ }
58
+ function isLetter(code) {
59
+ return code >= 97 && code <= 122 || code >= 65 && code <= 90;
60
+ }
61
+ function isIdentStart(code) {
62
+ return isLetter(code) || code === CHAR_UNDERSCORE || code === CHAR_MINUS || code === CHAR_BACKSLASH || code > 127;
63
+ }
64
+ function isIdentPart(code) {
65
+ return isIdentStart(code) || isDigit(code);
66
+ }
67
+ function isBoundary(code) {
68
+ return code === -1 || isWhitespace(code) || code === CHAR_COMMA || code === CHAR_PAREN_OPEN || code === CHAR_PAREN_CLOSE;
69
+ }
70
+ function resolvePayload(payload, options) {
71
+ const { lookup, resolveNumbers = false, onCandidate } = options;
72
+ const length = payload.length;
73
+ const segments = [];
74
+ let references = null;
75
+ let errors = null;
76
+ let staticStart = 0;
77
+ const codeAt = (index2) => index2 >= 0 && index2 < length ? payload.charCodeAt(index2) : -1;
78
+ const pushReference = (start, end, reference) => {
79
+ if (start > staticStart) segments.push(payload.slice(staticStart, start));
80
+ segments.push(reference);
81
+ (references ||= []).push(reference);
82
+ staticStart = end;
83
+ };
84
+ let index = 0;
85
+ while (index < length) {
86
+ const code = payload.charCodeAt(index);
87
+ if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {
88
+ index++;
89
+ while (index < length) {
90
+ const inner = payload.charCodeAt(index);
91
+ if (inner === CHAR_BACKSLASH) index += 2;
92
+ else if (inner === code) {
93
+ index++;
94
+ break;
95
+ } else index++;
96
+ }
97
+ continue;
98
+ }
99
+ if (code === CHAR_HASH) {
100
+ const start = index;
101
+ index++;
102
+ while (index < length && isIdentPart(payload.charCodeAt(index))) index++;
103
+ onCandidate?.(start, index, payload.slice(start, index), void 0);
104
+ continue;
105
+ }
106
+ if (isIdentStart(code) && !(code === CHAR_MINUS && isDigit(codeAt(index + 1)))) {
107
+ const start = index;
108
+ let end = index;
109
+ while (end < length && isIdentPart(payload.charCodeAt(end))) {
110
+ end += payload.charCodeAt(end) === CHAR_BACKSLASH ? 2 : 1;
111
+ }
112
+ const name = payload.slice(start, Math.min(end, length));
113
+ if (codeAt(end) === CHAR_PAREN_OPEN) {
114
+ index = name.toLowerCase() === "url" ? skipParens(payload, end) : end + 1;
115
+ continue;
116
+ }
117
+ if (name.startsWith("--")) {
118
+ index = end;
119
+ continue;
120
+ }
121
+ const resolved = reservedFolded.has(name.toLowerCase()) ? void 0 : lookup(name);
122
+ const suffix = readOpacitySuffix(payload, end, codeAt);
123
+ if (suffix !== null && resolved?.kind === "color") {
124
+ if (suffix.percentage === null) {
125
+ ;
126
+ (errors ||= []).push({
127
+ code: "opacity-out-of-range",
128
+ index: start,
129
+ message: `"${name}${payload.slice(end, suffix.end)}" is not an opacity suffix: it must be an integer percentage from 0 through 100`,
130
+ name,
131
+ opacity: Number(payload.slice(end + 1, suffix.end))
132
+ });
133
+ onCandidate?.(start, suffix.end, name, { ...resolved });
134
+ index = suffix.end;
135
+ continue;
136
+ }
137
+ const reference2 = suffix.percentage === 100 ? { ...resolved } : {
138
+ ...resolved,
139
+ opacity: suffix.percentage
140
+ };
141
+ pushReference(start, suffix.end, reference2);
142
+ onCandidate?.(start, suffix.end, name, reference2);
143
+ index = suffix.end;
144
+ continue;
145
+ }
146
+ if (suffix !== null && suffix.percentage !== null) {
147
+ ;
148
+ (errors ||= []).push({
149
+ code: "opacity-on-non-color",
150
+ index: start,
151
+ message: resolved ? `"${name}" is not a color token (kind: ${resolved.kind}), so the /${suffix.percentage} opacity suffix does not apply` : `"${name}" is not a resolved color token, so the /${suffix.percentage} opacity suffix does not apply`,
152
+ name,
153
+ opacity: suffix.percentage
154
+ });
155
+ onCandidate?.(start, end, name, resolved ? { ...resolved } : void 0);
156
+ index = suffix.end;
157
+ continue;
158
+ }
159
+ if (!resolved) {
160
+ onCandidate?.(start, end, name, void 0);
161
+ index = end;
162
+ continue;
163
+ }
164
+ const reference = { ...resolved };
165
+ pushReference(start, end, reference);
166
+ onCandidate?.(start, end, name, reference);
167
+ index = end;
168
+ continue;
169
+ }
170
+ if (isDigit(code) || code === CHAR_DOT || (code === CHAR_PLUS || code === CHAR_MINUS) && isDigit(codeAt(index + 1))) {
171
+ const start = index;
172
+ let end = index;
173
+ if (code === CHAR_PLUS || code === CHAR_MINUS) end++;
174
+ while (end < length) {
175
+ const digit = payload.charCodeAt(end);
176
+ if (isDigit(digit) || digit === CHAR_DOT) end++;
177
+ else break;
178
+ }
179
+ if (codeAt(end) === CHAR_E_LOWER || codeAt(end) === CHAR_E_UPPER) {
180
+ let exponent = end + 1;
181
+ if (codeAt(exponent) === CHAR_PLUS || codeAt(exponent) === CHAR_MINUS) exponent++;
182
+ if (isDigit(codeAt(exponent))) {
183
+ exponent++;
184
+ while (exponent < length && isDigit(payload.charCodeAt(exponent))) exponent++;
185
+ end = exponent;
186
+ }
187
+ }
188
+ const numberEnd = end;
189
+ let unitEnd = numberEnd;
190
+ if (codeAt(unitEnd) === CHAR_PERCENT) unitEnd++;
191
+ else while (unitEnd < length && isIdentPart(payload.charCodeAt(unitEnd))) unitEnd++;
192
+ if (unitEnd > numberEnd) {
193
+ index = unitEnd;
194
+ continue;
195
+ }
196
+ if (!resolveNumbers || !isBoundary(codeAt(start - 1)) || !isBoundary(codeAt(numberEnd))) {
197
+ index = numberEnd;
198
+ continue;
199
+ }
200
+ const name = payload.slice(start, numberEnd);
201
+ const resolved = lookup(name);
202
+ if (resolved) {
203
+ const reference = { ...resolved };
204
+ pushReference(start, numberEnd, reference);
205
+ onCandidate?.(start, numberEnd, name, reference);
206
+ } else {
207
+ onCandidate?.(start, numberEnd, name, void 0);
208
+ }
209
+ index = numberEnd;
210
+ continue;
211
+ }
212
+ index++;
213
+ }
214
+ if (staticStart < length) segments.push(payload.slice(staticStart));
215
+ return {
216
+ segments,
217
+ references: references ?? noReferences,
218
+ errors: errors ?? noErrors
219
+ };
220
+ }
221
+ function readOpacitySuffix(payload, identEnd, codeAt) {
222
+ if (codeAt(identEnd) !== CHAR_SLASH) return null;
223
+ let cursor = identEnd + 1;
224
+ let signed = false;
225
+ if (codeAt(cursor) === CHAR_MINUS || codeAt(cursor) === CHAR_PLUS) {
226
+ signed = true;
227
+ cursor++;
228
+ }
229
+ const digitsStart = cursor;
230
+ while (isDigit(codeAt(cursor))) cursor++;
231
+ if (cursor === digitsStart) return null;
232
+ let fractional = false;
233
+ if (codeAt(cursor) === CHAR_DOT && isDigit(codeAt(cursor + 1))) {
234
+ fractional = true;
235
+ cursor++;
236
+ while (isDigit(codeAt(cursor))) cursor++;
237
+ }
238
+ if (!isBoundary(codeAt(cursor))) return null;
239
+ const value = Number(payload.slice(identEnd + 1, cursor));
240
+ const valid = !signed && !fractional && value >= 0 && value <= 100;
241
+ return {
242
+ end: cursor,
243
+ percentage: valid ? value : null
244
+ };
245
+ }
246
+ function skipParens(payload, open) {
247
+ let depth = 0;
248
+ let index = open;
249
+ while (index < payload.length) {
250
+ const code = payload.charCodeAt(index);
251
+ if (code === CHAR_BACKSLASH) {
252
+ index += 2;
253
+ continue;
254
+ }
255
+ if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {
256
+ index++;
257
+ while (index < payload.length) {
258
+ const inner = payload.charCodeAt(index);
259
+ if (inner === CHAR_BACKSLASH) index += 2;
260
+ else if (inner === code) {
261
+ index++;
262
+ break;
263
+ } else index++;
264
+ }
265
+ continue;
266
+ }
267
+ if (code === CHAR_PAREN_OPEN) depth++;
268
+ else if (code === CHAR_PAREN_CLOSE) {
269
+ depth--;
270
+ if (depth === 0) return index + 1;
271
+ }
272
+ index++;
273
+ }
274
+ return payload.length;
275
+ }