@tamagui/web 3.0.0-beta.669.1 → 3.0.0-beta.719.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 (841) hide show
  1. package/dist/cjs/Tamagui.cjs +0 -1
  2. package/dist/cjs/Tamagui.native.cjs +0 -1
  3. package/dist/cjs/Tamagui.native.js +0 -1
  4. package/dist/cjs/Tamagui.native.js.map +1 -1
  5. package/dist/cjs/_withNativeStyle.cjs +0 -1
  6. package/dist/cjs/_withNativeStyle.native.cjs +0 -1
  7. package/dist/cjs/_withNativeStyle.native.js +0 -1
  8. package/dist/cjs/_withNativeStyle.native.js.map +1 -1
  9. package/dist/cjs/_withStableStyle.cjs +0 -1
  10. package/dist/cjs/_withStableStyle.native.cjs +0 -1
  11. package/dist/cjs/_withStableStyle.native.js +0 -1
  12. package/dist/cjs/_withStableStyle.native.js.map +1 -1
  13. package/dist/cjs/config.cjs +7 -1
  14. package/dist/cjs/config.native.cjs +7 -1
  15. package/dist/cjs/config.native.js +7 -1
  16. package/dist/cjs/config.native.js.map +1 -1
  17. package/dist/cjs/constants/accessibilityDirectMap.cjs +0 -1
  18. package/dist/cjs/constants/accessibilityDirectMap.native.cjs +0 -1
  19. package/dist/cjs/constants/accessibilityDirectMap.native.js +0 -1
  20. package/dist/cjs/constants/accessibilityDirectMap.native.js.map +1 -1
  21. package/dist/cjs/constants/constants.cjs +0 -1
  22. package/dist/cjs/constants/constants.native.cjs +0 -1
  23. package/dist/cjs/constants/constants.native.js +0 -1
  24. package/dist/cjs/constants/constants.native.js.map +1 -1
  25. package/dist/cjs/constants/isDevTools.cjs +0 -1
  26. package/dist/cjs/constants/isDevTools.native.cjs +0 -1
  27. package/dist/cjs/constants/isDevTools.native.js +0 -1
  28. package/dist/cjs/constants/isDevTools.native.js.map +1 -1
  29. package/dist/cjs/contexts/ComponentContext.cjs +0 -1
  30. package/dist/cjs/contexts/ComponentContext.native.cjs +0 -1
  31. package/dist/cjs/contexts/ComponentContext.native.js +0 -1
  32. package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
  33. package/dist/cjs/contexts/GroupContext.cjs +0 -1
  34. package/dist/cjs/contexts/GroupContext.native.cjs +0 -1
  35. package/dist/cjs/contexts/GroupContext.native.js +0 -1
  36. package/dist/cjs/contexts/GroupContext.native.js.map +1 -1
  37. package/dist/cjs/createComponent.cjs +1 -2
  38. package/dist/cjs/createComponent.native.cjs +1 -2
  39. package/dist/cjs/createComponent.native.js +1 -2
  40. package/dist/cjs/createComponent.native.js.map +1 -1
  41. package/dist/cjs/createFont.cjs +0 -1
  42. package/dist/cjs/createFont.native.cjs +0 -1
  43. package/dist/cjs/createFont.native.js +0 -1
  44. package/dist/cjs/createFont.native.js.map +1 -1
  45. package/dist/cjs/createShorthands.cjs +0 -1
  46. package/dist/cjs/createShorthands.native.cjs +0 -1
  47. package/dist/cjs/createShorthands.native.js +0 -1
  48. package/dist/cjs/createShorthands.native.js.map +1 -1
  49. package/dist/cjs/createStyledHOC.cjs +0 -1
  50. package/dist/cjs/createStyledHOC.native.cjs +0 -1
  51. package/dist/cjs/createStyledHOC.native.js +0 -1
  52. package/dist/cjs/createStyledHOC.native.js.map +1 -1
  53. package/dist/cjs/createTamagui.cjs +3 -4
  54. package/dist/cjs/createTamagui.native.cjs +3 -4
  55. package/dist/cjs/createTamagui.native.js +3 -4
  56. package/dist/cjs/createTamagui.native.js.map +1 -1
  57. package/dist/cjs/createTokens.cjs +0 -1
  58. package/dist/cjs/createTokens.native.cjs +0 -1
  59. package/dist/cjs/createTokens.native.js +0 -1
  60. package/dist/cjs/createTokens.native.js.map +1 -1
  61. package/dist/cjs/createVariable.cjs +0 -1
  62. package/dist/cjs/createVariable.native.cjs +0 -1
  63. package/dist/cjs/createVariable.native.js +0 -1
  64. package/dist/cjs/createVariable.native.js.map +1 -1
  65. package/dist/cjs/createVariables.cjs +0 -1
  66. package/dist/cjs/createVariables.native.cjs +0 -1
  67. package/dist/cjs/createVariables.native.js +0 -1
  68. package/dist/cjs/createVariables.native.js.map +1 -1
  69. package/dist/cjs/defaultComponentState.cjs +0 -1
  70. package/dist/cjs/defaultComponentState.native.cjs +0 -1
  71. package/dist/cjs/defaultComponentState.native.js +0 -1
  72. package/dist/cjs/defaultComponentState.native.js.map +1 -1
  73. package/dist/cjs/dom/adapters.cjs +0 -1
  74. package/dist/cjs/dom/adapters.native.cjs +0 -1
  75. package/dist/cjs/dom/adapters.native.js +0 -1
  76. package/dist/cjs/dom/adapters.native.js.map +1 -1
  77. package/dist/cjs/dom/contract.cjs +0 -1
  78. package/dist/cjs/dom/contract.native.cjs +0 -1
  79. package/dist/cjs/dom/contract.native.js +0 -1
  80. package/dist/cjs/dom/contract.native.js.map +1 -1
  81. package/dist/cjs/dom/domEventProps.native.cjs +0 -1
  82. package/dist/cjs/dom/domEventProps.native.js +0 -1
  83. package/dist/cjs/dom/domEventProps.native.js.map +1 -1
  84. package/dist/cjs/dom/html.cjs +0 -1
  85. package/dist/cjs/dom/html.native.cjs +0 -1
  86. package/dist/cjs/dom/html.native.js +0 -1
  87. package/dist/cjs/dom/html.native.js.map +1 -1
  88. package/dist/cjs/dom/htmlRuntime.native.cjs +0 -1
  89. package/dist/cjs/dom/htmlRuntime.native.js +0 -1
  90. package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
  91. package/dist/cjs/dom/index.cjs +0 -1
  92. package/dist/cjs/dom/index.native.cjs +0 -1
  93. package/dist/cjs/dom/index.native.js +0 -1
  94. package/dist/cjs/dom/index.native.js.map +1 -1
  95. package/dist/cjs/dom/primitives.native.cjs +2 -3
  96. package/dist/cjs/dom/primitives.native.js +2 -3
  97. package/dist/cjs/dom/primitives.native.js.map +1 -1
  98. package/dist/cjs/dom/standalone.cjs +0 -1
  99. package/dist/cjs/dom/standalone.native.cjs +0 -1
  100. package/dist/cjs/dom/standalone.native.js +0 -1
  101. package/dist/cjs/dom/standalone.native.js.map +1 -1
  102. package/dist/cjs/dom/standaloneHtml.cjs +0 -1
  103. package/dist/cjs/dom/standaloneHtml.native.cjs +0 -1
  104. package/dist/cjs/dom/standaloneHtml.native.js +0 -1
  105. package/dist/cjs/dom/standaloneHtml.native.js.map +1 -1
  106. package/dist/cjs/dom/styleTypes.cjs +0 -1
  107. package/dist/cjs/dom/styleTypes.native.cjs +0 -1
  108. package/dist/cjs/dom/styleTypes.native.js +0 -1
  109. package/dist/cjs/dom/styleTypes.native.js.map +1 -1
  110. package/dist/cjs/eventDetails.cjs +0 -1
  111. package/dist/cjs/eventDetails.native.cjs +0 -1
  112. package/dist/cjs/eventDetails.native.js +0 -1
  113. package/dist/cjs/eventDetails.native.js.map +1 -1
  114. package/dist/cjs/eventHandling.cjs +0 -1
  115. package/dist/cjs/eventHandling.native.cjs +0 -1
  116. package/dist/cjs/eventHandling.native.js +0 -1
  117. package/dist/cjs/eventHandling.native.js.map +1 -1
  118. package/dist/cjs/helpers/componentDisplayName.cjs +0 -1
  119. package/dist/cjs/helpers/componentDisplayName.native.cjs +0 -1
  120. package/dist/cjs/helpers/componentDisplayName.native.js +0 -1
  121. package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
  122. package/dist/cjs/helpers/configVariables.cjs +79 -0
  123. package/dist/cjs/helpers/configVariables.native.cjs +86 -0
  124. package/dist/cjs/helpers/configVariables.native.js +88 -0
  125. package/dist/cjs/helpers/configVariables.native.js.map +1 -0
  126. package/dist/cjs/helpers/consoleLog.native.cjs +0 -1
  127. package/dist/cjs/helpers/consoleLog.native.js +0 -1
  128. package/dist/cjs/helpers/consoleLog.native.js.map +1 -1
  129. package/dist/cjs/helpers/createDesignSystem.cjs +0 -1
  130. package/dist/cjs/helpers/createDesignSystem.native.cjs +0 -1
  131. package/dist/cjs/helpers/createDesignSystem.native.js +0 -1
  132. package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
  133. package/dist/cjs/helpers/createStyledContext.cjs +0 -1
  134. package/dist/cjs/helpers/createStyledContext.native.cjs +0 -1
  135. package/dist/cjs/helpers/createStyledContext.native.js +0 -1
  136. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  137. package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -6
  138. package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +0 -13
  139. package/dist/cjs/helpers/defaultAnimationDriver.native.js +0 -13
  140. package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
  141. package/dist/cjs/helpers/defaultOffset.cjs +0 -1
  142. package/dist/cjs/helpers/defaultOffset.native.cjs +0 -1
  143. package/dist/cjs/helpers/defaultOffset.native.js +0 -1
  144. package/dist/cjs/helpers/defaultOffset.native.js.map +1 -1
  145. package/dist/cjs/helpers/directStyle.cjs +258 -284
  146. package/dist/cjs/helpers/directStyle.native.cjs +274 -306
  147. package/dist/cjs/helpers/directStyle.native.js +274 -306
  148. package/dist/cjs/helpers/directStyle.native.js.map +1 -1
  149. package/dist/cjs/helpers/expandStyle.cjs +0 -1
  150. package/dist/cjs/helpers/expandStyle.native.cjs +0 -1
  151. package/dist/cjs/helpers/expandStyle.native.js +0 -1
  152. package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
  153. package/dist/cjs/helpers/expandStyles.cjs +0 -1
  154. package/dist/cjs/helpers/expandStyles.native.cjs +0 -1
  155. package/dist/cjs/helpers/expandStyles.native.js +0 -1
  156. package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
  157. package/dist/cjs/helpers/extractPseudoState.cjs +0 -1
  158. package/dist/cjs/helpers/extractPseudoState.native.cjs +0 -1
  159. package/dist/cjs/helpers/extractPseudoState.native.js +0 -1
  160. package/dist/cjs/helpers/extractPseudoState.native.js.map +1 -1
  161. package/dist/cjs/helpers/formatDiagnostic.cjs +0 -1
  162. package/dist/cjs/helpers/formatDiagnostic.native.cjs +0 -1
  163. package/dist/cjs/helpers/formatDiagnostic.native.js +0 -1
  164. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  165. package/dist/cjs/helpers/frontendProgram.cjs +0 -1
  166. package/dist/cjs/helpers/frontendProgram.native.cjs +0 -1
  167. package/dist/cjs/helpers/frontendProgram.native.js +0 -1
  168. package/dist/cjs/helpers/frontendProgram.native.js.map +1 -1
  169. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +5 -2
  170. package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +0 -1
  171. package/dist/cjs/helpers/getCSSStylesAtomic.native.js +0 -1
  172. package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
  173. package/dist/cjs/helpers/getDefaultProps.cjs +0 -1
  174. package/dist/cjs/helpers/getDefaultProps.native.cjs +0 -1
  175. package/dist/cjs/helpers/getDefaultProps.native.js +0 -1
  176. package/dist/cjs/helpers/getDefaultProps.native.js.map +1 -1
  177. package/dist/cjs/helpers/getDynamicVal.cjs +0 -1
  178. package/dist/cjs/helpers/getDynamicVal.native.cjs +0 -1
  179. package/dist/cjs/helpers/getDynamicVal.native.js +0 -1
  180. package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
  181. package/dist/cjs/helpers/getExpandedShorthands.cjs +0 -1
  182. package/dist/cjs/helpers/getExpandedShorthands.native.cjs +0 -1
  183. package/dist/cjs/helpers/getExpandedShorthands.native.js +0 -1
  184. package/dist/cjs/helpers/getExpandedShorthands.native.js.map +1 -1
  185. package/dist/cjs/helpers/getFontLanguage.cjs +0 -1
  186. package/dist/cjs/helpers/getFontLanguage.native.cjs +0 -1
  187. package/dist/cjs/helpers/getFontLanguage.native.js +0 -1
  188. package/dist/cjs/helpers/getFontLanguage.native.js.map +1 -1
  189. package/dist/cjs/helpers/getShorthandValue.cjs +0 -1
  190. package/dist/cjs/helpers/getShorthandValue.native.cjs +0 -1
  191. package/dist/cjs/helpers/getShorthandValue.native.js +0 -1
  192. package/dist/cjs/helpers/getShorthandValue.native.js.map +1 -1
  193. package/dist/cjs/helpers/getSplitStyles.cjs +2 -10
  194. package/dist/cjs/helpers/getSplitStyles.native.cjs +2 -10
  195. package/dist/cjs/helpers/getSplitStyles.native.js +2 -10
  196. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  197. package/dist/cjs/helpers/getThemeCSSRules.cjs +0 -1
  198. package/dist/cjs/helpers/getThemeCSSRules.native.cjs +0 -1
  199. package/dist/cjs/helpers/getThemeCSSRules.native.js +0 -1
  200. package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
  201. package/dist/cjs/helpers/getVariantExtras.cjs +0 -1
  202. package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -1
  203. package/dist/cjs/helpers/getVariantExtras.native.js +0 -1
  204. package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
  205. package/dist/cjs/helpers/grammarConfig.cjs +63 -14
  206. package/dist/cjs/helpers/grammarConfig.native.cjs +84 -18
  207. package/dist/cjs/helpers/grammarConfig.native.js +84 -18
  208. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  209. package/dist/cjs/helpers/insertStyleRule.cjs +0 -1
  210. package/dist/cjs/helpers/insertStyleRule.native.cjs +0 -1
  211. package/dist/cjs/helpers/insertStyleRule.native.js +0 -1
  212. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  213. package/dist/cjs/helpers/isObj.cjs +0 -1
  214. package/dist/cjs/helpers/isObj.native.cjs +0 -1
  215. package/dist/cjs/helpers/isObj.native.js +0 -1
  216. package/dist/cjs/helpers/isObj.native.js.map +1 -1
  217. package/dist/cjs/helpers/isTamaguiComponent.cjs +0 -1
  218. package/dist/cjs/helpers/isTamaguiComponent.native.cjs +0 -1
  219. package/dist/cjs/helpers/isTamaguiComponent.native.js +0 -1
  220. package/dist/cjs/helpers/isTamaguiComponent.native.js.map +1 -1
  221. package/dist/cjs/helpers/isTamaguiElement.cjs +0 -1
  222. package/dist/cjs/helpers/isTamaguiElement.native.cjs +0 -1
  223. package/dist/cjs/helpers/isTamaguiElement.native.js +0 -1
  224. package/dist/cjs/helpers/isTamaguiElement.native.js.map +1 -1
  225. package/dist/cjs/helpers/log.cjs +0 -1
  226. package/dist/cjs/helpers/log.native.cjs +0 -1
  227. package/dist/cjs/helpers/log.native.js +0 -1
  228. package/dist/cjs/helpers/log.native.js.map +1 -1
  229. package/dist/cjs/helpers/mainThreadPressEvents.cjs +0 -1
  230. package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +0 -1
  231. package/dist/cjs/helpers/mainThreadPressEvents.native.js +0 -1
  232. package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
  233. package/dist/cjs/helpers/matchMedia.cjs +0 -1
  234. package/dist/cjs/helpers/matchMedia.native.cjs +0 -1
  235. package/dist/cjs/helpers/matchMedia.native.js +0 -1
  236. package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
  237. package/dist/cjs/helpers/mediaObjectToString.cjs +0 -1
  238. package/dist/cjs/helpers/mediaObjectToString.native.cjs +0 -1
  239. package/dist/cjs/helpers/mediaObjectToString.native.js +0 -1
  240. package/dist/cjs/helpers/mediaObjectToString.native.js.map +1 -1
  241. package/dist/cjs/helpers/mediaState.cjs +0 -1
  242. package/dist/cjs/helpers/mediaState.native.cjs +0 -1
  243. package/dist/cjs/helpers/mediaState.native.js +0 -1
  244. package/dist/cjs/helpers/mediaState.native.js.map +1 -1
  245. package/dist/cjs/helpers/mergeProps.cjs +0 -1
  246. package/dist/cjs/helpers/mergeProps.native.cjs +0 -1
  247. package/dist/cjs/helpers/mergeProps.native.js +0 -1
  248. package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
  249. package/dist/cjs/helpers/mergeRenderElementProps.cjs +0 -1
  250. package/dist/cjs/helpers/mergeRenderElementProps.native.cjs +0 -1
  251. package/dist/cjs/helpers/mergeRenderElementProps.native.js +0 -1
  252. package/dist/cjs/helpers/mergeRenderElementProps.native.js.map +1 -1
  253. package/dist/cjs/helpers/mergeSlotStyleProps.cjs +0 -1
  254. package/dist/cjs/helpers/mergeSlotStyleProps.native.cjs +0 -1
  255. package/dist/cjs/helpers/mergeSlotStyleProps.native.js +0 -1
  256. package/dist/cjs/helpers/mergeSlotStyleProps.native.js.map +1 -1
  257. package/dist/cjs/helpers/mergeVariants.cjs +1 -2
  258. package/dist/cjs/helpers/mergeVariants.native.cjs +1 -2
  259. package/dist/cjs/helpers/mergeVariants.native.js +1 -2
  260. package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
  261. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  262. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  263. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  264. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  265. package/dist/cjs/helpers/nativeStyleEngine.cjs +0 -1
  266. package/dist/cjs/helpers/nativeStyleEngine.native.cjs +0 -1
  267. package/dist/cjs/helpers/nativeStyleEngine.native.js +0 -1
  268. package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
  269. package/dist/cjs/helpers/nativeTransitionTarget.cjs +0 -1
  270. package/dist/cjs/helpers/nativeTransitionTarget.native.cjs +0 -1
  271. package/dist/cjs/helpers/nativeTransitionTarget.native.js +0 -1
  272. package/dist/cjs/helpers/nativeTransitionTarget.native.js.map +1 -1
  273. package/dist/cjs/helpers/normalizeColor.cjs +0 -1
  274. package/dist/cjs/helpers/normalizeColor.native.cjs +0 -1
  275. package/dist/cjs/helpers/normalizeColor.native.js +0 -1
  276. package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
  277. package/dist/cjs/helpers/normalizeShadow.cjs +0 -1
  278. package/dist/cjs/helpers/normalizeShadow.native.cjs +0 -1
  279. package/dist/cjs/helpers/normalizeShadow.native.js +0 -1
  280. package/dist/cjs/helpers/normalizeShadow.native.js.map +1 -1
  281. package/dist/cjs/helpers/normalizeStyle.cjs +0 -1
  282. package/dist/cjs/helpers/normalizeStyle.native.cjs +0 -1
  283. package/dist/cjs/helpers/normalizeStyle.native.js +0 -1
  284. package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
  285. package/dist/cjs/helpers/normalizeStylePropKeys.cjs +0 -1
  286. package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +0 -1
  287. package/dist/cjs/helpers/normalizeStylePropKeys.native.js +0 -1
  288. package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +1 -1
  289. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +0 -1
  290. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +0 -1
  291. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +0 -1
  292. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  293. package/dist/cjs/helpers/noteOnce.cjs +0 -1
  294. package/dist/cjs/helpers/noteOnce.native.cjs +0 -1
  295. package/dist/cjs/helpers/noteOnce.native.js +0 -1
  296. package/dist/cjs/helpers/noteOnce.native.js.map +1 -1
  297. package/dist/cjs/helpers/objectIdentityKey.cjs +0 -1
  298. package/dist/cjs/helpers/objectIdentityKey.native.cjs +0 -1
  299. package/dist/cjs/helpers/objectIdentityKey.native.js +0 -1
  300. package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
  301. package/dist/cjs/helpers/parseBorderShorthand.cjs +0 -1
  302. package/dist/cjs/helpers/parseBorderShorthand.native.cjs +0 -1
  303. package/dist/cjs/helpers/parseBorderShorthand.native.js +0 -1
  304. package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
  305. package/dist/cjs/helpers/parseNativeStyle.native.cjs +0 -1
  306. package/dist/cjs/helpers/parseNativeStyle.native.js +0 -1
  307. package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
  308. package/dist/cjs/helpers/parseNativeTransform.native.cjs +0 -1
  309. package/dist/cjs/helpers/parseNativeTransform.native.js +0 -1
  310. package/dist/cjs/helpers/parseNativeTransform.native.js.map +1 -1
  311. package/dist/cjs/helpers/parseOutlineShorthand.cjs +0 -1
  312. package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +0 -1
  313. package/dist/cjs/helpers/parseOutlineShorthand.native.js +0 -1
  314. package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
  315. package/dist/cjs/helpers/pointerEvents.cjs +0 -1
  316. package/dist/cjs/helpers/pointerEvents.native.cjs +0 -1
  317. package/dist/cjs/helpers/pointerEvents.native.js +0 -1
  318. package/dist/cjs/helpers/pointerEvents.native.js.map +1 -1
  319. package/dist/cjs/helpers/propMapper.cjs +30 -39
  320. package/dist/cjs/helpers/propMapper.native.cjs +30 -39
  321. package/dist/cjs/helpers/propMapper.native.js +30 -39
  322. package/dist/cjs/helpers/propMapper.native.js.map +1 -1
  323. package/dist/cjs/helpers/proxyThemeToParents.cjs +0 -1
  324. package/dist/cjs/helpers/proxyThemeToParents.native.cjs +0 -1
  325. package/dist/cjs/helpers/proxyThemeToParents.native.js +0 -1
  326. package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
  327. package/dist/cjs/helpers/registerCSSVariable.cjs +0 -1
  328. package/dist/cjs/helpers/registerCSSVariable.native.cjs +0 -1
  329. package/dist/cjs/helpers/registerCSSVariable.native.js +0 -1
  330. package/dist/cjs/helpers/registerCSSVariable.native.js.map +1 -1
  331. package/dist/cjs/helpers/resolveAnimationDriver.cjs +0 -1
  332. package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +0 -1
  333. package/dist/cjs/helpers/resolveAnimationDriver.native.js +0 -1
  334. package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
  335. package/dist/cjs/helpers/resolveRem.cjs +0 -1
  336. package/dist/cjs/helpers/resolveRem.native.cjs +0 -1
  337. package/dist/cjs/helpers/resolveRem.native.js +0 -1
  338. package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
  339. package/dist/cjs/helpers/resolveSafeArea.cjs +0 -1
  340. package/dist/cjs/helpers/resolveSafeArea.native.cjs +0 -1
  341. package/dist/cjs/helpers/resolveSafeArea.native.js +0 -1
  342. package/dist/cjs/helpers/resolveSafeArea.native.js.map +1 -1
  343. package/dist/cjs/helpers/resolveSafeAreaVariable.cjs +0 -1
  344. package/dist/cjs/helpers/resolveSafeAreaVariable.native.cjs +0 -1
  345. package/dist/cjs/helpers/resolveSafeAreaVariable.native.js +0 -1
  346. package/dist/cjs/helpers/resolveSafeAreaVariable.native.js.map +1 -1
  347. package/dist/cjs/helpers/resolveVariableValue.cjs +0 -1
  348. package/dist/cjs/helpers/resolveVariableValue.native.cjs +0 -1
  349. package/dist/cjs/helpers/resolveVariableValue.native.js +0 -1
  350. package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
  351. package/dist/cjs/helpers/setElementProps.cjs +0 -1
  352. package/dist/cjs/helpers/setElementProps.native.cjs +0 -1
  353. package/dist/cjs/helpers/setElementProps.native.js +0 -1
  354. package/dist/cjs/helpers/setElementProps.native.js.map +1 -1
  355. package/dist/cjs/helpers/skipProps.cjs +0 -1
  356. package/dist/cjs/helpers/skipProps.native.cjs +0 -1
  357. package/dist/cjs/helpers/skipProps.native.js +0 -1
  358. package/dist/cjs/helpers/skipProps.native.js.map +1 -1
  359. package/dist/cjs/helpers/sortString.cjs +0 -1
  360. package/dist/cjs/helpers/sortString.native.cjs +0 -1
  361. package/dist/cjs/helpers/sortString.native.js +0 -1
  362. package/dist/cjs/helpers/sortString.native.js.map +1 -1
  363. package/dist/cjs/helpers/styleFrontend.cjs +0 -1
  364. package/dist/cjs/helpers/styleFrontend.native.cjs +0 -1
  365. package/dist/cjs/helpers/styleFrontend.native.js +0 -1
  366. package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
  367. package/dist/cjs/helpers/styleOriginalValues.cjs +0 -1
  368. package/dist/cjs/helpers/styleOriginalValues.native.cjs +0 -1
  369. package/dist/cjs/helpers/styleOriginalValues.native.js +0 -1
  370. package/dist/cjs/helpers/styleOriginalValues.native.js.map +1 -1
  371. package/dist/cjs/helpers/styleProvenance.cjs +0 -1
  372. package/dist/cjs/helpers/styleProvenance.native.cjs +0 -1
  373. package/dist/cjs/helpers/styleProvenance.native.js +0 -1
  374. package/dist/cjs/helpers/styleProvenance.native.js.map +1 -1
  375. package/dist/cjs/helpers/subscribeToContextGroup.cjs +0 -1
  376. package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +0 -1
  377. package/dist/cjs/helpers/subscribeToContextGroup.native.js +0 -1
  378. package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
  379. package/dist/cjs/helpers/themeRef.cjs +0 -1
  380. package/dist/cjs/helpers/themeRef.native.cjs +0 -1
  381. package/dist/cjs/helpers/themeRef.native.js +0 -1
  382. package/dist/cjs/helpers/themeRef.native.js.map +1 -1
  383. package/dist/cjs/helpers/themeUpdateState.cjs +24 -0
  384. package/dist/cjs/helpers/themeUpdateState.native.cjs +26 -0
  385. package/dist/cjs/helpers/themeUpdateState.native.js +28 -0
  386. package/dist/cjs/helpers/themeUpdateState.native.js.map +1 -0
  387. package/dist/cjs/helpers/themeable.cjs +0 -1
  388. package/dist/cjs/helpers/themeable.native.cjs +0 -1
  389. package/dist/cjs/helpers/themeable.native.js +0 -1
  390. package/dist/cjs/helpers/themeable.native.js.map +1 -1
  391. package/dist/cjs/helpers/themes.cjs +0 -1
  392. package/dist/cjs/helpers/themes.native.cjs +0 -1
  393. package/dist/cjs/helpers/themes.native.js +0 -1
  394. package/dist/cjs/helpers/themes.native.js.map +1 -1
  395. package/dist/cjs/helpers/timer.cjs +0 -1
  396. package/dist/cjs/helpers/timer.native.cjs +0 -1
  397. package/dist/cjs/helpers/timer.native.js +0 -1
  398. package/dist/cjs/helpers/timer.native.js.map +1 -1
  399. package/dist/cjs/helpers/tokenCategories.cjs +0 -1
  400. package/dist/cjs/helpers/tokenCategories.native.cjs +0 -1
  401. package/dist/cjs/helpers/tokenCategories.native.js +0 -1
  402. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  403. package/dist/cjs/helpers/transformsToString.cjs +0 -1
  404. package/dist/cjs/helpers/transformsToString.native.cjs +0 -1
  405. package/dist/cjs/helpers/transformsToString.native.js +0 -1
  406. package/dist/cjs/helpers/transformsToString.native.js.map +1 -1
  407. package/dist/cjs/helpers/useRenderElement.cjs +0 -1
  408. package/dist/cjs/helpers/useRenderElement.native.cjs +0 -1
  409. package/dist/cjs/helpers/useRenderElement.native.js +0 -1
  410. package/dist/cjs/helpers/useRenderElement.native.js.map +1 -1
  411. package/dist/cjs/helpers/variableValue.cjs +66 -0
  412. package/dist/cjs/helpers/variableValue.native.cjs +88 -0
  413. package/dist/cjs/helpers/variableValue.native.js +90 -0
  414. package/dist/cjs/helpers/variableValue.native.js.map +1 -0
  415. package/dist/cjs/helpers/variables.cjs +95 -139
  416. package/dist/cjs/helpers/variables.native.cjs +97 -161
  417. package/dist/cjs/helpers/variables.native.js +97 -161
  418. package/dist/cjs/helpers/variables.native.js.map +1 -1
  419. package/dist/cjs/helpers/warnOnce.cjs +1 -2
  420. package/dist/cjs/helpers/warnOnce.native.cjs +1 -2
  421. package/dist/cjs/helpers/warnOnce.native.js +1 -2
  422. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  423. package/dist/cjs/helpers/webPropsToSkip.cjs +0 -1
  424. package/dist/cjs/helpers/webPropsToSkip.native.cjs +0 -1
  425. package/dist/cjs/helpers/webPropsToSkip.native.js +0 -1
  426. package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
  427. package/dist/cjs/helpers/wrapStyleTags.cjs +0 -1
  428. package/dist/cjs/helpers/wrapStyleTags.native.cjs +0 -1
  429. package/dist/cjs/helpers/wrapStyleTags.native.js +0 -1
  430. package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
  431. package/dist/cjs/hooks/doesRootSchemeMatchSystem.cjs +0 -1
  432. package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.cjs +0 -1
  433. package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js +0 -1
  434. package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js.map +1 -1
  435. package/dist/cjs/hooks/getThemeProxied.cjs +1 -2
  436. package/dist/cjs/hooks/getThemeProxied.native.cjs +2 -3
  437. package/dist/cjs/hooks/getThemeProxied.native.js +2 -3
  438. package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
  439. package/dist/cjs/hooks/isOptimizedForFirstRender.cjs +0 -1
  440. package/dist/cjs/hooks/isOptimizedForFirstRender.native.cjs +0 -1
  441. package/dist/cjs/hooks/isOptimizedForFirstRender.native.js +0 -1
  442. package/dist/cjs/hooks/isOptimizedForFirstRender.native.js.map +1 -1
  443. package/dist/cjs/hooks/useAnimationDriver.cjs +14 -9
  444. package/dist/cjs/hooks/useAnimationDriver.native.cjs +14 -9
  445. package/dist/cjs/hooks/useAnimationDriver.native.js +14 -9
  446. package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
  447. package/dist/cjs/hooks/useComponentState.cjs +27 -25
  448. package/dist/cjs/hooks/useComponentState.native.cjs +28 -25
  449. package/dist/cjs/hooks/useComponentState.native.js +28 -25
  450. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  451. package/dist/cjs/hooks/useDisableSSR.cjs +0 -1
  452. package/dist/cjs/hooks/useDisableSSR.native.cjs +0 -1
  453. package/dist/cjs/hooks/useDisableSSR.native.js +0 -1
  454. package/dist/cjs/hooks/useDisableSSR.native.js.map +1 -1
  455. package/dist/cjs/hooks/useIsTouchDevice.cjs +0 -1
  456. package/dist/cjs/hooks/useIsTouchDevice.native.cjs +0 -1
  457. package/dist/cjs/hooks/useIsTouchDevice.native.js +0 -1
  458. package/dist/cjs/hooks/useIsTouchDevice.native.js.map +1 -1
  459. package/dist/cjs/hooks/useMedia.cjs +0 -1
  460. package/dist/cjs/hooks/useMedia.native.cjs +0 -1
  461. package/dist/cjs/hooks/useMedia.native.js +0 -1
  462. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  463. package/dist/cjs/hooks/usePortalThemeState.cjs +1 -2
  464. package/dist/cjs/hooks/usePortalThemeState.native.cjs +1 -2
  465. package/dist/cjs/hooks/usePortalThemeState.native.js +1 -2
  466. package/dist/cjs/hooks/usePortalThemeState.native.js.map +1 -1
  467. package/dist/cjs/hooks/useProps.cjs +1 -2
  468. package/dist/cjs/hooks/useProps.native.cjs +1 -2
  469. package/dist/cjs/hooks/useProps.native.js +1 -2
  470. package/dist/cjs/hooks/useProps.native.js.map +1 -1
  471. package/dist/cjs/hooks/useTheme.cjs +0 -1
  472. package/dist/cjs/hooks/useTheme.native.cjs +0 -1
  473. package/dist/cjs/hooks/useTheme.native.js +0 -1
  474. package/dist/cjs/hooks/useTheme.native.js.map +1 -1
  475. package/dist/cjs/hooks/useThemeName.cjs +0 -1
  476. package/dist/cjs/hooks/useThemeName.native.cjs +0 -1
  477. package/dist/cjs/hooks/useThemeName.native.js +0 -1
  478. package/dist/cjs/hooks/useThemeName.native.js.map +1 -1
  479. package/dist/cjs/hooks/useThemeState.cjs +11 -16
  480. package/dist/cjs/hooks/useThemeState.native.cjs +13 -18
  481. package/dist/cjs/hooks/useThemeState.native.js +13 -18
  482. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  483. package/dist/cjs/index.cjs +0 -2
  484. package/dist/cjs/index.native.cjs +0 -2
  485. package/dist/cjs/index.native.js +0 -2
  486. package/dist/cjs/index.native.js.map +1 -1
  487. package/dist/cjs/inject-styles.cjs +0 -1
  488. package/dist/cjs/inject-styles.native.cjs +0 -1
  489. package/dist/cjs/inject-styles.native.js +0 -1
  490. package/dist/cjs/inject-styles.native.js.map +1 -1
  491. package/dist/cjs/insertFont.cjs +0 -1
  492. package/dist/cjs/insertFont.native.cjs +0 -1
  493. package/dist/cjs/insertFont.native.js +0 -1
  494. package/dist/cjs/insertFont.native.js.map +1 -1
  495. package/dist/cjs/interfaces/CSSColorNames.cjs +0 -1
  496. package/dist/cjs/interfaces/CSSColorNames.native.cjs +0 -1
  497. package/dist/cjs/interfaces/CSSColorNames.native.js +0 -1
  498. package/dist/cjs/interfaces/CSSColorNames.native.js.map +1 -1
  499. package/dist/cjs/interfaces/GetRef.cjs +0 -1
  500. package/dist/cjs/interfaces/GetRef.native.cjs +0 -1
  501. package/dist/cjs/interfaces/GetRef.native.js +0 -1
  502. package/dist/cjs/interfaces/GetRef.native.js.map +1 -1
  503. package/dist/cjs/interfaces/RNExclusiveTypes.cjs +0 -1
  504. package/dist/cjs/interfaces/RNExclusiveTypes.native.cjs +0 -1
  505. package/dist/cjs/interfaces/RNExclusiveTypes.native.js +0 -1
  506. package/dist/cjs/interfaces/RNExclusiveTypes.native.js.map +1 -1
  507. package/dist/cjs/interfaces/TamaguiComponentEvents.cjs +0 -1
  508. package/dist/cjs/interfaces/TamaguiComponentEvents.native.cjs +0 -1
  509. package/dist/cjs/interfaces/TamaguiComponentEvents.native.js +0 -1
  510. package/dist/cjs/interfaces/TamaguiComponentEvents.native.js.map +1 -1
  511. package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.cjs +0 -1
  512. package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.cjs +0 -1
  513. package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js +0 -1
  514. package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js.map +1 -1
  515. package/dist/cjs/internal-runtime.cjs +1 -4
  516. package/dist/cjs/internal-runtime.native.cjs +1 -4
  517. package/dist/cjs/internal-runtime.native.js +1 -4
  518. package/dist/cjs/internal-runtime.native.js.map +1 -1
  519. package/dist/cjs/internalRuntimeTypes.cjs +0 -1
  520. package/dist/cjs/internalRuntimeTypes.native.cjs +0 -1
  521. package/dist/cjs/internalRuntimeTypes.native.js +0 -1
  522. package/dist/cjs/internalRuntimeTypes.native.js.map +1 -1
  523. package/dist/cjs/setupHooks.cjs +0 -1
  524. package/dist/cjs/setupHooks.native.cjs +0 -1
  525. package/dist/cjs/setupHooks.native.js +0 -1
  526. package/dist/cjs/setupHooks.native.js.map +1 -1
  527. package/dist/cjs/setupReactNative.cjs +0 -1
  528. package/dist/cjs/setupReactNative.native.cjs +0 -1
  529. package/dist/cjs/setupReactNative.native.js +0 -1
  530. package/dist/cjs/setupReactNative.native.js.map +1 -1
  531. package/dist/cjs/styled.cjs +0 -1
  532. package/dist/cjs/styled.native.cjs +0 -1
  533. package/dist/cjs/styled.native.js +0 -1
  534. package/dist/cjs/styled.native.js.map +1 -1
  535. package/dist/cjs/theme-update.cjs +19 -0
  536. package/dist/cjs/theme-update.native.cjs +21 -0
  537. package/dist/cjs/theme-update.native.js +23 -0
  538. package/dist/cjs/theme-update.native.js.map +1 -0
  539. package/dist/cjs/type-utils.cjs +0 -1
  540. package/dist/cjs/type-utils.native.cjs +0 -1
  541. package/dist/cjs/type-utils.native.js +0 -1
  542. package/dist/cjs/type-utils.native.js.map +1 -1
  543. package/dist/cjs/types.cjs +0 -1
  544. package/dist/cjs/types.native.cjs +0 -1
  545. package/dist/cjs/types.native.js +0 -1
  546. package/dist/cjs/types.native.js.map +1 -1
  547. package/dist/cjs/views/ConfigRevisionCheck.cjs +0 -1
  548. package/dist/cjs/views/ConfigRevisionCheck.native.cjs +0 -1
  549. package/dist/cjs/views/ConfigRevisionCheck.native.js +0 -1
  550. package/dist/cjs/views/ConfigRevisionCheck.native.js.map +1 -1
  551. package/dist/cjs/views/Configuration.cjs +0 -1
  552. package/dist/cjs/views/Configuration.native.cjs +0 -1
  553. package/dist/cjs/views/Configuration.native.js +0 -1
  554. package/dist/cjs/views/Configuration.native.js.map +1 -1
  555. package/dist/cjs/views/FontLanguage.cjs +0 -1
  556. package/dist/cjs/views/FontLanguage.native.cjs +0 -1
  557. package/dist/cjs/views/FontLanguage.native.js +0 -1
  558. package/dist/cjs/views/FontLanguage.native.js.map +1 -1
  559. package/dist/cjs/views/SafeAreaTracker.cjs +0 -1
  560. package/dist/cjs/views/SafeAreaTracker.native.cjs +0 -1
  561. package/dist/cjs/views/SafeAreaTracker.native.js +0 -1
  562. package/dist/cjs/views/SafeAreaTracker.native.js.map +1 -1
  563. package/dist/cjs/views/Slot.cjs +0 -1
  564. package/dist/cjs/views/Slot.native.cjs +0 -1
  565. package/dist/cjs/views/Slot.native.js +0 -1
  566. package/dist/cjs/views/Slot.native.js.map +1 -1
  567. package/dist/cjs/views/TamaguiProvider.cjs +0 -1
  568. package/dist/cjs/views/TamaguiProvider.native.cjs +0 -1
  569. package/dist/cjs/views/TamaguiProvider.native.js +0 -1
  570. package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
  571. package/dist/cjs/views/TamaguiRoot.cjs +0 -1
  572. package/dist/cjs/views/TamaguiRoot.native.cjs +0 -1
  573. package/dist/cjs/views/TamaguiRoot.native.js +0 -1
  574. package/dist/cjs/views/TamaguiRoot.native.js.map +1 -1
  575. package/dist/cjs/views/Text.cjs +0 -1
  576. package/dist/cjs/views/Text.native.cjs +0 -1
  577. package/dist/cjs/views/Text.native.js +0 -1
  578. package/dist/cjs/views/Text.native.js.map +1 -1
  579. package/dist/cjs/views/Theme.cjs +7 -33
  580. package/dist/cjs/views/Theme.native.cjs +8 -20
  581. package/dist/cjs/views/Theme.native.js +8 -20
  582. package/dist/cjs/views/Theme.native.js.map +1 -1
  583. package/dist/cjs/views/ThemeDebug.cjs +0 -1
  584. package/dist/cjs/views/ThemeDebug.native.cjs +0 -1
  585. package/dist/cjs/views/ThemeDebug.native.js +0 -1
  586. package/dist/cjs/views/ThemeDebug.native.js.map +1 -1
  587. package/dist/cjs/views/ThemeProvider.cjs +0 -1
  588. package/dist/cjs/views/ThemeProvider.native.cjs +0 -1
  589. package/dist/cjs/views/ThemeProvider.native.js +0 -1
  590. package/dist/cjs/views/ThemeProvider.native.js.map +1 -1
  591. package/dist/cjs/views/ThemeUpdate.cjs +82 -0
  592. package/dist/cjs/views/ThemeUpdate.native.cjs +84 -0
  593. package/dist/cjs/views/ThemeUpdate.native.js +86 -0
  594. package/dist/cjs/views/ThemeUpdate.native.js.map +1 -0
  595. package/dist/cjs/views/View.cjs +0 -1
  596. package/dist/cjs/views/View.native.cjs +0 -1
  597. package/dist/cjs/views/View.native.js +0 -1
  598. package/dist/cjs/views/View.native.js.map +1 -1
  599. package/dist/esm/Tamagui.mjs.map +1 -1
  600. package/dist/esm/Tamagui.native.js.map +1 -1
  601. package/dist/esm/_withNativeStyle.mjs.map +1 -1
  602. package/dist/esm/config.mjs +7 -0
  603. package/dist/esm/config.mjs.map +1 -1
  604. package/dist/esm/config.native.js +7 -0
  605. package/dist/esm/config.native.js.map +1 -1
  606. package/dist/esm/constants/isDevTools.mjs.map +1 -1
  607. package/dist/esm/constants/isDevTools.native.js.map +1 -1
  608. package/dist/esm/createComponent.mjs +1 -1
  609. package/dist/esm/createComponent.mjs.map +1 -1
  610. package/dist/esm/createComponent.native.js +1 -1
  611. package/dist/esm/createComponent.native.js.map +1 -1
  612. package/dist/esm/createFont.mjs.map +1 -1
  613. package/dist/esm/createFont.native.js.map +1 -1
  614. package/dist/esm/createTamagui.mjs +2 -2
  615. package/dist/esm/createTamagui.mjs.map +1 -1
  616. package/dist/esm/createTamagui.native.js +2 -2
  617. package/dist/esm/createTamagui.native.js.map +1 -1
  618. package/dist/esm/createVariable.mjs.map +1 -1
  619. package/dist/esm/createVariable.native.js.map +1 -1
  620. package/dist/esm/dom/primitives.native.js +1 -1
  621. package/dist/esm/dom/primitives.native.js.map +1 -1
  622. package/dist/esm/eventHandling.native.js.map +1 -1
  623. package/dist/esm/helpers/configVariables.mjs +60 -0
  624. package/dist/esm/helpers/configVariables.mjs.map +1 -0
  625. package/dist/esm/helpers/configVariables.native.js +65 -0
  626. package/dist/esm/helpers/configVariables.native.js.map +1 -0
  627. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  628. package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
  629. package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
  630. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  631. package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -5
  632. package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
  633. package/dist/esm/helpers/defaultAnimationDriver.native.js +0 -12
  634. package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
  635. package/dist/esm/helpers/directStyle.mjs +258 -283
  636. package/dist/esm/helpers/directStyle.mjs.map +1 -1
  637. package/dist/esm/helpers/directStyle.native.js +274 -305
  638. package/dist/esm/helpers/directStyle.native.js.map +1 -1
  639. package/dist/esm/helpers/expandStyle.mjs.map +1 -1
  640. package/dist/esm/helpers/expandStyle.native.js.map +1 -1
  641. package/dist/esm/helpers/expandStyles.native.js.map +1 -1
  642. package/dist/esm/helpers/extractPseudoState.mjs.map +1 -1
  643. package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
  644. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  645. package/dist/esm/helpers/getCSSStylesAtomic.mjs +5 -1
  646. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  647. package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
  648. package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
  649. package/dist/esm/helpers/getExpandedShorthands.mjs.map +1 -1
  650. package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
  651. package/dist/esm/helpers/getFontLanguage.mjs.map +1 -1
  652. package/dist/esm/helpers/getFontLanguage.native.js.map +1 -1
  653. package/dist/esm/helpers/getShorthandValue.mjs.map +1 -1
  654. package/dist/esm/helpers/getShorthandValue.native.js.map +1 -1
  655. package/dist/esm/helpers/getSplitStyles.mjs +2 -9
  656. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  657. package/dist/esm/helpers/getSplitStyles.native.js +2 -9
  658. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  659. package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
  660. package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
  661. package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
  662. package/dist/esm/helpers/grammarConfig.mjs +59 -13
  663. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  664. package/dist/esm/helpers/grammarConfig.native.js +80 -17
  665. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  666. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  667. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  668. package/dist/esm/helpers/matchMedia.native.js.map +1 -1
  669. package/dist/esm/helpers/mediaObjectToString.mjs.map +1 -1
  670. package/dist/esm/helpers/mediaObjectToString.native.js.map +1 -1
  671. package/dist/esm/helpers/mergeVariants.mjs +1 -1
  672. package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
  673. package/dist/esm/helpers/mergeVariants.native.js +1 -1
  674. package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
  675. package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
  676. package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
  677. package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
  678. package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
  679. package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
  680. package/dist/esm/helpers/parseNativeTransform.native.js.map +1 -1
  681. package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
  682. package/dist/esm/helpers/propMapper.mjs +31 -39
  683. package/dist/esm/helpers/propMapper.mjs.map +1 -1
  684. package/dist/esm/helpers/propMapper.native.js +31 -39
  685. package/dist/esm/helpers/propMapper.native.js.map +1 -1
  686. package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
  687. package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
  688. package/dist/esm/helpers/registerCSSVariable.mjs.map +1 -1
  689. package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
  690. package/dist/esm/helpers/resolveSafeAreaVariable.native.js.map +1 -1
  691. package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
  692. package/dist/esm/helpers/themeRef.mjs.map +1 -1
  693. package/dist/esm/helpers/themeRef.native.js.map +1 -1
  694. package/dist/esm/helpers/themeUpdateState.mjs +4 -0
  695. package/dist/esm/helpers/themeUpdateState.mjs.map +1 -0
  696. package/dist/esm/helpers/themeUpdateState.native.js +4 -0
  697. package/dist/esm/helpers/themeUpdateState.native.js.map +1 -0
  698. package/dist/esm/helpers/timer.mjs.map +1 -1
  699. package/dist/esm/helpers/timer.native.js.map +1 -1
  700. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  701. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  702. package/dist/esm/helpers/transformsToString.native.js.map +1 -1
  703. package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
  704. package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
  705. package/dist/esm/helpers/variableValue.mjs +44 -0
  706. package/dist/esm/helpers/variableValue.mjs.map +1 -0
  707. package/dist/esm/helpers/variableValue.native.js +64 -0
  708. package/dist/esm/helpers/variableValue.native.js.map +1 -0
  709. package/dist/esm/helpers/variables.mjs +96 -136
  710. package/dist/esm/helpers/variables.mjs.map +1 -1
  711. package/dist/esm/helpers/variables.native.js +98 -158
  712. package/dist/esm/helpers/variables.native.js.map +1 -1
  713. package/dist/esm/helpers/warnOnce.mjs +1 -1
  714. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  715. package/dist/esm/helpers/warnOnce.native.js +1 -1
  716. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  717. package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
  718. package/dist/esm/hooks/getThemeProxied.native.js +2 -2
  719. package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
  720. package/dist/esm/hooks/useAnimationDriver.mjs +14 -8
  721. package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
  722. package/dist/esm/hooks/useAnimationDriver.native.js +14 -8
  723. package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
  724. package/dist/esm/hooks/useComponentState.mjs +27 -24
  725. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  726. package/dist/esm/hooks/useComponentState.native.js +28 -24
  727. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  728. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  729. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  730. package/dist/esm/hooks/usePortalThemeState.mjs +2 -2
  731. package/dist/esm/hooks/usePortalThemeState.mjs.map +1 -1
  732. package/dist/esm/hooks/usePortalThemeState.native.js +2 -2
  733. package/dist/esm/hooks/usePortalThemeState.native.js.map +1 -1
  734. package/dist/esm/hooks/useProps.mjs +1 -1
  735. package/dist/esm/hooks/useProps.mjs.map +1 -1
  736. package/dist/esm/hooks/useProps.native.js +1 -1
  737. package/dist/esm/hooks/useProps.native.js.map +1 -1
  738. package/dist/esm/hooks/useThemeName.mjs.map +1 -1
  739. package/dist/esm/hooks/useThemeState.mjs +12 -15
  740. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  741. package/dist/esm/hooks/useThemeState.native.js +14 -17
  742. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  743. package/dist/esm/index.js +0 -2
  744. package/dist/esm/index.mjs +0 -2
  745. package/dist/esm/index.native.js +0 -2
  746. package/dist/esm/insertFont.mjs.map +1 -1
  747. package/dist/esm/insertFont.native.js.map +1 -1
  748. package/dist/esm/internal-runtime.mjs +1 -3
  749. package/dist/esm/internal-runtime.mjs.map +1 -1
  750. package/dist/esm/internal-runtime.native.js +1 -3
  751. package/dist/esm/internal-runtime.native.js.map +1 -1
  752. package/dist/esm/styled.mjs.map +1 -1
  753. package/dist/esm/styled.native.js.map +1 -1
  754. package/dist/esm/theme-update.mjs +3 -0
  755. package/dist/esm/theme-update.native.js +3 -0
  756. package/dist/esm/views/FontLanguage.mjs.map +1 -1
  757. package/dist/esm/views/SafeAreaTracker.native.js.map +1 -1
  758. package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
  759. package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
  760. package/dist/esm/views/Theme.mjs +8 -33
  761. package/dist/esm/views/Theme.mjs.map +1 -1
  762. package/dist/esm/views/Theme.native.js +9 -20
  763. package/dist/esm/views/Theme.native.js.map +1 -1
  764. package/dist/esm/views/ThemeUpdate.mjs +54 -0
  765. package/dist/esm/views/ThemeUpdate.mjs.map +1 -0
  766. package/dist/esm/views/ThemeUpdate.native.js +53 -0
  767. package/dist/esm/views/ThemeUpdate.native.js.map +1 -0
  768. package/package.json +26 -17
  769. package/src/config.ts +7 -0
  770. package/src/createComponent.tsx +1 -4
  771. package/src/createTamagui.ts +3 -8
  772. package/src/dom/primitives.native.tsx +1 -1
  773. package/src/helpers/configVariables.ts +64 -0
  774. package/src/helpers/defaultAnimationDriver.tsx +0 -4
  775. package/src/helpers/directStyle.ts +876 -477
  776. package/src/helpers/getCSSStylesAtomic.ts +5 -1
  777. package/src/helpers/getSplitStyles.tsx +2 -23
  778. package/src/helpers/grammarConfig.ts +82 -12
  779. package/src/helpers/mergeVariants.ts +1 -3
  780. package/src/helpers/nativeTransitionTarget.native.ts +1 -1
  781. package/src/helpers/nativeTransitionTarget.ts +1 -1
  782. package/src/helpers/propMapper.ts +42 -49
  783. package/src/helpers/themeUpdateState.ts +27 -0
  784. package/src/helpers/variableValue.ts +45 -0
  785. package/src/helpers/variables.ts +149 -195
  786. package/src/helpers/warnOnce.ts +2 -2
  787. package/src/hooks/getThemeProxied.ts +9 -7
  788. package/src/hooks/useAnimationDriver.ts +26 -11
  789. package/src/hooks/useComponentState.ts +44 -34
  790. package/src/hooks/usePortalThemeState.ts +8 -8
  791. package/src/hooks/useProps.tsx +1 -4
  792. package/src/hooks/useThemeState.ts +16 -37
  793. package/src/index.ts +0 -1
  794. package/src/internal-runtime.ts +1 -8
  795. package/src/theme-update.ts +2 -0
  796. package/src/types.tsx +13 -21
  797. package/src/views/Theme.tsx +18 -80
  798. package/src/views/ThemeUpdate.tsx +88 -0
  799. package/types/config.d.ts.map +1 -1
  800. package/types/createComponent.d.ts.map +1 -1
  801. package/types/helpers/configVariables.d.ts +3 -0
  802. package/types/helpers/configVariables.d.ts.map +1 -0
  803. package/types/helpers/defaultAnimationDriver.d.ts.map +1 -1
  804. package/types/helpers/directStyle.d.ts +2 -23
  805. package/types/helpers/directStyle.d.ts.map +1 -1
  806. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  807. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  808. package/types/helpers/grammarConfig.d.ts +9 -0
  809. package/types/helpers/grammarConfig.d.ts.map +1 -1
  810. package/types/helpers/mergeVariants.d.ts.map +1 -1
  811. package/types/helpers/nativeTransitionTarget.d.ts +1 -1
  812. package/types/helpers/nativeTransitionTarget.d.ts.map +1 -1
  813. package/types/helpers/nativeTransitionTarget.native.d.ts +1 -1
  814. package/types/helpers/nativeTransitionTarget.native.d.ts.map +1 -1
  815. package/types/helpers/propMapper.d.ts.map +1 -1
  816. package/types/helpers/themeUpdateState.d.ts +23 -0
  817. package/types/helpers/themeUpdateState.d.ts.map +1 -0
  818. package/types/helpers/variableValue.d.ts +4 -0
  819. package/types/helpers/variableValue.d.ts.map +1 -0
  820. package/types/helpers/variables.d.ts +7 -24
  821. package/types/helpers/variables.d.ts.map +1 -1
  822. package/types/helpers/warnOnce.d.ts +1 -1
  823. package/types/hooks/getThemeProxied.d.ts.map +1 -1
  824. package/types/hooks/useAnimationDriver.d.ts.map +1 -1
  825. package/types/hooks/useComponentState.d.ts.map +1 -1
  826. package/types/hooks/usePortalThemeState.d.ts +5 -5
  827. package/types/hooks/usePortalThemeState.d.ts.map +1 -1
  828. package/types/hooks/useProps.d.ts.map +1 -1
  829. package/types/hooks/useThemeState.d.ts +2 -5
  830. package/types/hooks/useThemeState.d.ts.map +1 -1
  831. package/types/index.d.ts +0 -1
  832. package/types/index.d.ts.map +1 -1
  833. package/types/internal-runtime.d.ts.map +1 -1
  834. package/types/theme-update.d.ts +3 -0
  835. package/types/theme-update.d.ts.map +1 -0
  836. package/types/types.d.ts +6 -17
  837. package/types/types.d.ts.map +1 -1
  838. package/types/views/Theme.d.ts +2 -15
  839. package/types/views/Theme.d.ts.map +1 -1
  840. package/types/views/ThemeUpdate.d.ts +15 -0
  841. package/types/views/ThemeUpdate.d.ts.map +1 -0
@@ -13,16 +13,17 @@ import {
13
13
  type StyleObject,
14
14
  } from '@tamagui/helpers'
15
15
  import {
16
- canonicalClauseModifier,
17
- clauseConditionSetKey,
18
- clauseSubjectClassRepetitions,
19
- createClausePrecedenceOrder,
20
- getClausePrecedenceKeyFromKinds,
21
- isRootThemeName,
16
+ canonicalStateModifierNames,
17
+ isContainerSizeQueryText,
18
+ isModifierName,
19
+ modifierKindMedia,
20
+ modifierKindPlatform,
21
+ modifierKindState,
22
+ modifierKindTheme,
22
23
  scanFlatValue,
24
+ stateModifierSelectors,
23
25
  type ClausePrecedenceKey,
24
- type ClausePrecedenceOrder,
25
- type ModifierKind,
26
+ type FlatValueHandler,
26
27
  type ParsedValue,
27
28
  } from '@tamagui/style-grammar/runtime'
28
29
 
@@ -32,9 +33,9 @@ import type { GetStyleState } from '../types'
32
33
  import { warnOnce, warnRefusedValue } from './warnOnce'
33
34
  import { expandStyle } from './expandStyle'
34
35
  import { getCSSStyleAtomic } from './getCSSStylesAtomic'
36
+ import { getConfigRevisionState } from './grammarConfig'
35
37
  import { isColorStyleKey } from './getDynamicVal'
36
38
  import { shouldInsertStyleRules, updateRules } from './insertStyleRule'
37
- import { mediaObjectToString } from './mediaObjectToString'
38
39
  import { normalizeColor } from './normalizeColor'
39
40
  import { parseNativeStyle } from './parseNativeStyle.native'
40
41
  import { parseNativeTransform } from './parseNativeTransform.native'
@@ -54,20 +55,6 @@ export type MergeStyle = (
54
55
  originalValue?: any
55
56
  ) => void
56
57
 
57
- type Condition = {
58
- key: string
59
- active: boolean
60
- emit: boolean
61
- selector: string
62
- wrappers?: string[]
63
- enter?: true
64
- exit?: true
65
- theme?: string
66
- precedence: ClausePrecedenceKey
67
- classRepetitions: number
68
- unsupportedState?: string
69
- }
70
-
71
58
  type DirectAtomic = {
72
59
  baseRules: number
73
60
  conditions?: Record<
@@ -94,21 +81,204 @@ type DirectState = GetStyleState & {
94
81
  flatWebShadow?: Record<string, any>
95
82
  }
96
83
 
97
- // keyed by the CANONICAL modifier spelling: `canonicalClauseModifier` has
98
- // already folded `active`, `pressed`, `starting` and `ending` into their one
99
- // spelling before anything looks in here
100
- const stateSelectors: Record<string, string> = {
101
- hover: ':hover',
102
- press: ':active',
103
- focus: ':focus',
104
- 'focus-visible': ':focus-visible',
105
- 'focus-within': ':focus-within',
106
- disabled: '[aria-disabled]',
107
- open: '[data-state="open"]',
108
- checked: '[data-state="checked"]',
109
- highlighted: '[data-highlighted]',
110
- selected: '[data-state="active"]',
111
- invalid: '[aria-invalid="true"]',
84
+ const directStyleHandler: FlatValueHandler<GetStyleState> = {
85
+ segment(
86
+ state,
87
+ start,
88
+ end,
89
+ isBase,
90
+ valid,
91
+ source,
92
+ chainStart,
93
+ chainEnd,
94
+ chainValid,
95
+ chainCount,
96
+ _result,
97
+ failure,
98
+ failureIndex,
99
+ property,
100
+ merge,
101
+ originalValue,
102
+ contextOnly
103
+ ) {
104
+ if (isBase) {
105
+ if (start === end) return
106
+ if (!valid) {
107
+ if (process.env.NODE_ENV === 'development') {
108
+ warnRefusedValue(
109
+ property,
110
+ source,
111
+ failure === 'invalid-character'
112
+ ? `"${source[failureIndex]}" would end the declaration or rule`
113
+ : failure === 'unterminated-string'
114
+ ? 'an unterminated string'
115
+ : failure === 'unterminated-comment'
116
+ ? 'an unterminated "/*" comment'
117
+ : failure === 'stray-comment-close'
118
+ ? 'a stray "*/"'
119
+ : 'an unterminated "("'
120
+ )
121
+ }
122
+ return
123
+ }
124
+ const value = source.slice(start, end)
125
+ emitValue(
126
+ state,
127
+ property,
128
+ value,
129
+ 0,
130
+ '',
131
+ undefined,
132
+ '',
133
+ '',
134
+ merge,
135
+ value,
136
+ contextOnly
137
+ )
138
+ return 5
139
+ }
140
+ if (!chainValid) {
141
+ if (process.env.NODE_ENV === 'development') {
142
+ warnRefusedValue(
143
+ property,
144
+ source,
145
+ failure === 'invalid-character'
146
+ ? `"${source[failureIndex]}" would end the declaration or rule`
147
+ : failure === 'unterminated-string'
148
+ ? 'an unterminated string'
149
+ : failure === 'unterminated-comment'
150
+ ? 'an unterminated "/*" comment'
151
+ : failure === 'stray-comment-close'
152
+ ? 'a stray "*/"'
153
+ : 'an unterminated "("'
154
+ )
155
+ }
156
+ return
157
+ }
158
+ if (start === end) {
159
+ if (process.env.NODE_ENV === 'development') {
160
+ warnRefusedValue(property, source, 'a conditional clause has no value')
161
+ }
162
+ return
163
+ }
164
+ if (property === 'aspectRatio' && chainCount === 1) {
165
+ const left = Number(source.slice(chainStart, chainEnd))
166
+ const right = Number(source.slice(start, end))
167
+ if (
168
+ chainStart < chainEnd &&
169
+ Number.isFinite(left) &&
170
+ left > 0 &&
171
+ Number.isFinite(right) &&
172
+ right > 0
173
+ ) {
174
+ return 12
175
+ }
176
+ }
177
+ const condition = resolveClauseChain(
178
+ state,
179
+ source,
180
+ chainStart,
181
+ chainEnd,
182
+ property,
183
+ undefined,
184
+ valid ? merge : undefined,
185
+ undefined,
186
+ contextOnly,
187
+ start,
188
+ end,
189
+ 1
190
+ )
191
+ if (!condition) return
192
+ if (!valid) {
193
+ if (process.env.NODE_ENV === 'development') {
194
+ warnRefusedValue(
195
+ property,
196
+ source,
197
+ failure === 'invalid-character'
198
+ ? `"${source[failureIndex]}" would end the declaration or rule`
199
+ : failure === 'unterminated-string'
200
+ ? 'an unterminated string'
201
+ : failure === 'unterminated-comment'
202
+ ? 'an unterminated "/*" comment'
203
+ : failure === 'stray-comment-close'
204
+ ? 'a stray "*/"'
205
+ : 'an unterminated "("'
206
+ )
207
+ }
208
+ return
209
+ }
210
+ return 4 | (condition & 12 ? 2 : 0)
211
+ },
212
+ chain() {
213
+ return true
214
+ },
215
+ end(
216
+ state,
217
+ source,
218
+ result,
219
+ lastPayloadStart,
220
+ chainCount,
221
+ property,
222
+ merge,
223
+ originalValue,
224
+ contextOnly
225
+ ) {
226
+ let hasBase = !!(result & 1)
227
+ if (result & 8 && chainCount === 1) {
228
+ emitValue(
229
+ state,
230
+ property,
231
+ source,
232
+ 0,
233
+ '',
234
+ undefined,
235
+ '',
236
+ '',
237
+ merge,
238
+ originalValue ?? source,
239
+ contextOnly
240
+ )
241
+ hasBase = true
242
+ }
243
+ if (
244
+ process.env.NODE_ENV === 'development' &&
245
+ !hasBase &&
246
+ result & 4 &&
247
+ (property in tokenCategories.color || property in tokenCategoryByProperty) &&
248
+ splitComponents(source.slice(lastPayloadStart)).length > 1
249
+ ) {
250
+ warnOnce(
251
+ `${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`
252
+ )
253
+ }
254
+ if ((!isWeb || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
255
+ const value =
256
+ property === 'opacity'
257
+ ? 1
258
+ : property === 'scale' || property === 'scaleX' || property === 'scaleY'
259
+ ? 1
260
+ : property === 'rotate'
261
+ ? '0deg'
262
+ : property === 'x' || property === 'y'
263
+ ? 0
264
+ : null
265
+ if (value !== null) {
266
+ emitValue(
267
+ state,
268
+ property,
269
+ value,
270
+ 0,
271
+ '',
272
+ undefined,
273
+ '',
274
+ '',
275
+ merge,
276
+ value,
277
+ contextOnly
278
+ )
279
+ }
280
+ }
281
+ },
112
282
  }
113
283
 
114
284
  const legacyTransformParts = new Set([
@@ -202,41 +372,6 @@ const borderStyleDefaults: Record<string, string> = {
202
372
  borderLeftWidth: 'borderLeftStyle',
203
373
  }
204
374
 
205
- const mediaQueries = new WeakMap<object, Record<string, string>>()
206
- const clausePrecedenceOrders = new WeakMap<object, ClausePrecedenceOrder>()
207
- function queryFor(state: GetStyleState, name: string): string | undefined {
208
- let queries = mediaQueries.get(state.conf)
209
- if (!queries) {
210
- queries = {}
211
- const media = state.conf.media || {}
212
- for (const key in media) queries[key] = mediaObjectToString(media[key])
213
- mediaQueries.set(state.conf, queries)
214
- }
215
- return queries[name]
216
- }
217
-
218
- function precedenceOrderFor(state: GetStyleState): ClausePrecedenceOrder {
219
- let order = clausePrecedenceOrders.get(state.conf)
220
- if (!order) {
221
- order = createClausePrecedenceOrder(state.conf.media)
222
- clausePrecedenceOrders.set(state.conf, order)
223
- }
224
- return order
225
- }
226
-
227
- function stateIsActive(state: GetStyleState, name: string): boolean {
228
- const component = state.componentState
229
- if (name === 'hover') return !!component.hover
230
- if (name === 'press') return !!(component.press || component.pressIn)
231
- if (name === 'focus') return !!component.focus
232
- if (name === 'focus-visible') return !!component.focusVisible
233
- if (name === 'focus-within') return !!component.focusWithin
234
- if (name === 'disabled') return !!(component.disabled || state.props.disabled)
235
- if (name === 'enter') return !!component.unmounted
236
- if (name === 'exit') return !!state.styleProps.isExiting
237
- return false
238
- }
239
-
240
375
  export function platformMatches(name: string): boolean {
241
376
  if (name === 'web') return isWeb
242
377
  if (name === 'native') return !isWeb
@@ -247,164 +382,278 @@ export function platformMatches(name: string): boolean {
247
382
  return name === 'tv' && isTV
248
383
  }
249
384
 
250
- function groupCondition(state: GetStyleState, modifier: string, out: Condition) {
251
- const slash = modifier.indexOf('/')
252
- const stateName = modifier.slice(6, slash === -1 ? undefined : slash)
253
- const groupName = slash === -1 ? 'true' : modifier.slice(slash + 1)
254
- const selector = stateSelectors[stateName]
255
- if (!selector || !groupName) return false
256
- out.selector += `:where(.t_group_${groupName}${selector} *)`
257
- if (stateName === 'hover') (out.wrappers ||= []).push('@media (hover: hover)')
258
- const component = state.componentState.group?.[groupName]
259
- const context = state.flatGroupContext?.[groupName]
260
- out.active &&= !!(component?.pseudo ?? context?.state.pseudo)?.[stateName]
261
- ;(state.flatGroupKeys ||= new Set()).add(groupName)
262
- return true
263
- }
264
-
265
- function containerCondition(state: GetStyleState, modifier: string, out: Condition) {
266
- const slash = modifier.indexOf('/')
267
- const size = modifier.slice(1, slash === -1 ? undefined : slash)
268
- const name = slash === -1 ? null : modifier.slice(slash + 1)
269
- const query = queryFor(state, size)
270
- if (!query || (name !== null && !name)) return false
271
- const key = name === null ? '@' : `@${name}`
272
- ;(out.wrappers ||= []).push(
273
- name === null ? `@container ${query}` : `@container ${name} ${query}`
274
- )
275
- const component = state.componentState.group?.[key]
276
- const context = state.flatGroupContext?.[key]
277
- const active = component?.media?.[size]
278
- out.active &&=
279
- active === undefined
280
- ? !!(context?.state.layout && mediaKeyMatch(size, context.state.layout))
281
- : !!active
282
- ;(state.flatGroupKeys ||= new Set()).add(key)
283
- ;(state.flatGroupMedia ||= new Set()).add(size)
284
- return true
285
- }
286
-
287
- /**
288
- * Resolve one modifier chain against the live state, or null when the runtime
289
- * has no such modifier. Exported because the variant scanner in `propMapper`
290
- * has to refuse exactly the chains this one refuses; two answers to "is this a
291
- * modifier" is how the prop and variant paths came to disagree about how much
292
- * of a bad value survives.
293
- */
294
- export function getCondition(state: GetStyleState, source: string): Condition | null {
295
- const out = { key: '', active: true, emit: true, selector: '' } as Condition
296
- const canonical: string[] = []
297
- const kinds: ModifierKind[] = []
298
- const seenModifiers = new Set<string>()
385
+ export function resolveClauseChain(
386
+ state: GetStyleState,
387
+ source: string,
388
+ start: number,
389
+ end: number,
390
+ property?: string,
391
+ raw?: any,
392
+ merge?: MergeStyle,
393
+ originalValue?: any,
394
+ contextOnly = false,
395
+ payloadStart = -1,
396
+ payloadEnd = -1,
397
+ warning = 0
398
+ ): number {
399
+ const compiled = getConfigRevisionState(state.conf)
400
+ const sourceStart = start
401
+ let key = ''
402
+ let active = true
403
+ let emit = true
404
+ let selector = ''
405
+ let wrappers: string[] | undefined
406
+ let theme = ''
407
+ let enter = false
408
+ let exit = false
409
+ let unsupportedState = ''
410
+ let platformRank = 0
411
+ let depth = 0
412
+ let categoryRank = 0
413
+ let withinRank = 0
299
414
  let selfStateSpecificity = 0
300
- let start = 0
301
- for (let index = 0; index <= source.length; index++) {
302
- if (index !== source.length && source.charCodeAt(index) !== 58) continue
303
- let modifier = canonicalClauseModifier(source.slice(start, index))
415
+ for (let index = start; index <= end; index++) {
416
+ if (index !== end && source.charCodeAt(index) !== 58) continue
417
+ let modifier = source.slice(start, index)
304
418
  start = index + 1
305
- if (!modifier) return null
306
- if (seenModifiers.has(modifier)) continue
307
- seenModifiers.add(modifier)
308
-
309
- if (modifier.startsWith('group-')) {
310
- if (!groupCondition(state, modifier, out)) return null
311
- canonical.push(modifier)
312
- kinds.push('group')
313
- continue
314
- }
315
- if (modifier.charCodeAt(0) === 64) {
316
- if (!containerCondition(state, modifier, out)) return null
317
- canonical.push(modifier)
318
- kinds.push('container')
319
- continue
320
- }
321
- if (modifier in stateSelectors || modifier === 'enter' || modifier === 'exit') {
322
- canonical.push(modifier)
323
- kinds.push('state')
324
- selfStateSpecificity++
325
- const selector = stateSelectors[modifier]
419
+ let code = compiled.modifiers[modifier]
420
+ let kind = code & 7
421
+ let rank = code >> 3
422
+ let stateSelector = ''
423
+ let conditionStateName = ''
424
+ let groupName = ''
425
+ let containerSize = ''
426
+ let containerName = ''
427
+ let containerQuery = ''
428
+ if (kind === modifierKindState) {
429
+ modifier = canonicalStateModifierNames[rank]
430
+ stateSelector = stateModifierSelectors[rank]
431
+ } else if (!kind && modifier.startsWith('group-')) {
432
+ const slash = modifier.indexOf('/')
433
+ const authoredState = modifier.slice(6, slash === -1 ? undefined : slash)
434
+ code = compiled.modifiers[authoredState]
435
+ if ((code & 7) !== modifierKindState) kind = 0
436
+ else {
437
+ rank = code >> 3
438
+ groupName = slash === -1 ? 'true' : modifier.slice(slash + 1)
439
+ if (
440
+ rank === 6 ||
441
+ rank === 7 ||
442
+ (slash !== -1 && !isModifierName(groupName, 0, groupName.length))
443
+ ) {
444
+ kind = 0
445
+ } else {
446
+ kind = 5
447
+ const stateName = canonicalStateModifierNames[rank]
448
+ conditionStateName = stateName
449
+ stateSelector = stateModifierSelectors[rank]
450
+ modifier = `group-${stateName}${slash === -1 ? '' : modifier.slice(slash)}`
451
+ }
452
+ }
453
+ } else if (!kind && modifier.charCodeAt(0) === 64) {
454
+ const slash = modifier.indexOf('/')
455
+ containerSize = modifier.slice(1, slash === -1 ? undefined : slash)
456
+ containerName = slash === -1 ? '' : modifier.slice(slash + 1)
326
457
  if (
327
- !isWeb &&
328
- modifier !== 'hover' &&
329
- modifier !== 'press' &&
330
- modifier !== 'focus' &&
331
- modifier !== 'focus-visible' &&
332
- modifier !== 'focus-within' &&
333
- modifier !== 'disabled' &&
334
- modifier !== 'enter' &&
335
- modifier !== 'exit'
458
+ isModifierName(containerSize, 0, containerSize.length) &&
459
+ (slash === -1 || isModifierName(containerName, 0, containerName.length)) &&
460
+ ((code = compiled.modifiers[containerSize]) & 7) === modifierKindMedia &&
461
+ (containerQuery = compiled.mediaQueries[containerSize]) &&
462
+ isContainerSizeQueryText(containerQuery)
336
463
  ) {
337
- out.unsupportedState = modifier
464
+ kind = 6
465
+ rank = code >> 3
338
466
  }
339
- if (modifier === 'enter' || modifier === 'exit') {
340
- const cls = modifier === 'enter' ? '.t_unmounted' : '.t_exiting'
341
- out.selector += `:is(${cls}, ${cls} *)`
342
- out[modifier] = true
343
- } else if (selector) {
344
- out.selector += selector
467
+ }
468
+ if (!kind) {
469
+ if (warning && process.env.NODE_ENV === 'development') {
470
+ warnRefusedValue(
471
+ property!,
472
+ warning === 1 ? source : raw,
473
+ `unknown modifier "${source.slice(sourceStart, end)}"`
474
+ )
345
475
  }
346
- if (modifier === 'hover') (out.wrappers ||= []).push('@media (hover: hover)')
347
- out.active &&= stateIsActive(state, modifier)
348
- if (
349
- modifier === 'hover' ||
350
- modifier === 'press' ||
351
- modifier === 'focus' ||
352
- modifier === 'focus-visible' ||
353
- modifier === 'focus-within'
354
- ) {
355
- ;(state.flatStateKeys ||= new Set()).add(modifier)
476
+ return 0
477
+ }
478
+
479
+ let slotStart = 0
480
+ let duplicate = false
481
+ let inserted = !key
482
+ if (!key) key = modifier
483
+ else {
484
+ while (slotStart <= key.length) {
485
+ let slotEnd = key.indexOf(':', slotStart)
486
+ if (slotEnd === -1) slotEnd = key.length
487
+ let order = 0
488
+ const compareLength = Math.min(modifier.length, slotEnd - slotStart)
489
+ for (let offset = 0; offset < compareLength; offset++) {
490
+ order = modifier.charCodeAt(offset) - key.charCodeAt(slotStart + offset)
491
+ if (order) break
492
+ }
493
+ order ||= modifier.length - (slotEnd - slotStart)
494
+ if (!order) {
495
+ duplicate = true
496
+ break
497
+ }
498
+ if (order < 0) {
499
+ key = `${key.slice(0, slotStart)}${modifier}:${key.slice(slotStart)}`
500
+ inserted = true
501
+ break
502
+ }
503
+ if (slotEnd === key.length) break
504
+ slotStart = slotEnd + 1
356
505
  }
357
- continue
506
+ if (!duplicate && !inserted) key += `:${modifier}`
358
507
  }
359
- if (modifier in (state.conf.media || {})) {
360
- const query = queryFor(state, modifier)
361
- if (!query) return null
362
- canonical.push(modifier)
363
- kinds.push('media')
364
- ;(out.wrappers ||= []).push(`@media ${query}`)
365
- out.active &&= !!state.flatMediaState?.[modifier]
366
- ;(state.flatMediaKeys ||= new Set()).add(modifier)
508
+ if (duplicate) continue
509
+
510
+ if (kind === modifierKindPlatform) {
511
+ if (rank > platformRank) platformRank = rank
512
+ const matches = platformMatches(modifier)
513
+ active &&= matches
514
+ emit &&= matches
367
515
  continue
368
516
  }
369
- if (isRootThemeName(modifier) && modifier in (state.conf.themes || {})) {
370
- canonical.push(modifier)
371
- kinds.push('theme')
372
- out.theme = modifier
373
- out.selector += `:where(.t_${modifier}, .t_${modifier} *)`
374
- out.active &&=
517
+ depth++
518
+ const nextCategory =
519
+ kind === modifierKindMedia
520
+ ? 0
521
+ : kind === 6
522
+ ? 1
523
+ : kind === modifierKindTheme
524
+ ? 2
525
+ : kind === 5
526
+ ? 3
527
+ : 4
528
+ if (nextCategory > categoryRank) {
529
+ categoryRank = nextCategory
530
+ withinRank = rank
531
+ } else if (nextCategory === categoryRank && rank > withinRank) {
532
+ withinRank = rank
533
+ }
534
+
535
+ if (kind === modifierKindMedia) {
536
+ const query = compiled.mediaQueries[modifier]
537
+ if (!query) return 0
538
+ ;(wrappers ||= []).push(`@media ${query}`)
539
+ active &&= !!state.flatMediaState?.[modifier]
540
+ ;(state.flatMediaKeys ||= new Set()).add(modifier)
541
+ } else if (kind === modifierKindTheme) {
542
+ theme = modifier
543
+ selector += `:where(.t_${modifier}, .t_${modifier} *)`
544
+ active &&=
375
545
  state.flatThemeName === modifier ||
376
546
  state.flatThemeName?.startsWith(`${modifier}_`) === true
377
- continue
378
- }
379
- if (
380
- modifier === 'web' ||
381
- modifier === 'native' ||
382
- modifier === 'ios' ||
383
- modifier === 'android' ||
384
- modifier === 'tv' ||
385
- modifier === 'tvos' ||
386
- modifier === 'androidtv'
387
- ) {
388
- canonical.push(modifier)
389
- kinds.push('platform')
390
- const matches = platformMatches(modifier)
391
- out.active &&= matches
392
- out.emit &&= matches
393
- continue
547
+ } else if (kind === 5) {
548
+ selector += `:where(.t_group_${groupName}${stateSelector} *)`
549
+ if (rank === 0) (wrappers ||= []).push('@media (hover: hover)')
550
+ const component = state.componentState.group?.[groupName]
551
+ const context = state.flatGroupContext?.[groupName]
552
+ active &&= !!(component?.pseudo ?? context?.state.pseudo)?.[conditionStateName]
553
+ ;(state.flatGroupKeys ||= new Set()).add(groupName)
554
+ } else if (kind === 6) {
555
+ const groupKey = `@${containerName}`
556
+ ;(wrappers ||= []).push(
557
+ containerName
558
+ ? `@container ${containerName} ${containerQuery}`
559
+ : `@container ${containerQuery}`
560
+ )
561
+ const component = state.componentState.group?.[groupKey]
562
+ const context = state.flatGroupContext?.[groupKey]
563
+ const match = component?.media?.[containerSize]
564
+ active &&=
565
+ match === undefined
566
+ ? !!(
567
+ context?.state.layout && mediaKeyMatch(containerSize, context.state.layout)
568
+ )
569
+ : !!match
570
+ ;(state.flatGroupKeys ||= new Set()).add(groupKey)
571
+ ;(state.flatGroupMedia ||= new Set()).add(containerSize)
572
+ } else {
573
+ selfStateSpecificity++
574
+ if (!isWeb && stateSelector[0] === '[' && modifier !== 'disabled') {
575
+ unsupportedState = modifier
576
+ }
577
+ if (stateSelector[0] === '.') {
578
+ selector += `:is(${stateSelector}, ${stateSelector} *)`
579
+ if (rank === 6) enter = true
580
+ else exit = true
581
+ } else {
582
+ selector += stateSelector
583
+ }
584
+ if (rank === 0) (wrappers ||= []).push('@media (hover: hover)')
585
+ const component = state.componentState
586
+ active &&=
587
+ rank === 0
588
+ ? !!component.hover
589
+ : rank === 4
590
+ ? !!(component.press || component.pressIn)
591
+ : rank === 2
592
+ ? !!component.focus
593
+ : rank === 3
594
+ ? !!component.focusVisible
595
+ : rank === 1
596
+ ? !!component.focusWithin
597
+ : rank === 5
598
+ ? !!(component.disabled || state.props.disabled)
599
+ : rank === 6
600
+ ? !!component.unmounted
601
+ : rank === 7
602
+ ? !!state.styleProps.isExiting
603
+ : false
604
+ if (stateSelector[0] === ':') {
605
+ ;(state.flatStateKeys ||= new Set()).add(modifier)
606
+ }
394
607
  }
395
- return null
396
608
  }
397
- out.key = clauseConditionSetKey(canonical)
398
- out.precedence = getClausePrecedenceKeyFromKinds(
399
- canonical,
400
- kinds,
401
- precedenceOrderFor(state)
402
- )
403
- out.classRepetitions = clauseSubjectClassRepetitions(
404
- out.precedence,
405
- selfStateSpecificity
406
- )
407
- return out
609
+ if (depth > 5) {
610
+ throw new Error(
611
+ `a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${source.slice(sourceStart, end)}:"`
612
+ )
613
+ }
614
+ const precedence =
615
+ (platformRank << 26) | (depth << 23) | (categoryRank << 20) | withinRank
616
+ const condition =
617
+ precedence * 256 +
618
+ selfStateSpecificity * 32 +
619
+ 16 +
620
+ (active ? 1 : 0) +
621
+ (emit ? 2 : 0) +
622
+ (enter ? 4 : 0) +
623
+ (exit ? 8 : 0)
624
+ if (warning && unsupportedState && process.env.NODE_ENV === 'development') {
625
+ warnOnce(
626
+ `${property}: "${unsupportedState}:" has no native component-state source; dropping the clause`
627
+ )
628
+ }
629
+ if (
630
+ merge &&
631
+ property &&
632
+ condition & 2 &&
633
+ (condition & 1 ||
634
+ (isWeb && state.flatShouldDoClasses) ||
635
+ (warning === 1 &&
636
+ !isWeb &&
637
+ theme &&
638
+ supportsDynamicColorIOS &&
639
+ isColorStyleKey(property)))
640
+ ) {
641
+ const value = payloadStart === -1 ? raw : source.slice(payloadStart, payloadEnd)
642
+ emitValue(
643
+ state,
644
+ property,
645
+ value,
646
+ condition,
647
+ key,
648
+ wrappers,
649
+ selector,
650
+ theme,
651
+ merge,
652
+ warning === 2 ? originalValue : (originalValue ?? value),
653
+ contextOnly
654
+ )
655
+ }
656
+ return condition
408
657
  }
409
658
 
410
659
  interface TokenLookup {
@@ -499,10 +748,7 @@ function configuredValue(state: GetStyleState, property: string, raw: string): a
499
748
  }
500
749
  }
501
750
 
502
- const safeArea =
503
- process.env.TAMAGUI_RUNTIME_SAFE_AREA === 'disabled'
504
- ? undefined
505
- : resolveSafeAreaVariable(name)
751
+ const safeArea = resolveSafeAreaVariable(name)
506
752
  if (safeArea !== undefined) {
507
753
  state.flatUsesSafeArea = true
508
754
  return safeArea
@@ -639,23 +885,31 @@ function directAtomic(
639
885
  state: DirectState,
640
886
  property: string,
641
887
  value: any,
642
- condition: Condition | null,
888
+ condition: number,
889
+ conditionKey: string,
890
+ conditionWrappers: string[] | undefined,
891
+ conditionSelector: string,
643
892
  isDefault = false
644
893
  ) {
645
894
  const atomics = (state.flatAtomics ||= {})
646
895
  const atomicKey = property.startsWith('transition') ? 'transition' : property
647
896
  const existing = atomics[atomicKey]
648
- const contribution = directStyleSignature(property, value, condition?.key || '')
897
+ const contribution = directStyleSignature(property, value, conditionKey)
649
898
  const signature = existing ? existing.signature + contribution : contribution
650
899
  const next = getCSSStyleAtomic(
651
900
  property,
652
901
  value,
653
- condition?.selector,
654
- condition?.wrappers,
902
+ conditionSelector,
903
+ conditionWrappers,
655
904
  signature,
656
905
  true,
657
906
  atomicKey,
658
- condition?.classRepetitions
907
+ condition
908
+ ? 1 +
909
+ ((Math.floor(condition / 256) >>> 23) & 7) +
910
+ (Math.floor(condition / 256) >>> 26) * 6 -
911
+ ((condition >>> 5) & 7)
912
+ : undefined
659
913
  )
660
914
  if (!next) return
661
915
  const identifier = next[StyleObjectIdentifier]
@@ -675,12 +929,10 @@ function directAtomic(
675
929
  }
676
930
  if (slotted) {
677
931
  atomic.conditions = {
678
- [atomicKey === 'transition'
679
- ? `${condition?.key || ''}\0${property}`
680
- : condition!.key]: {
932
+ [atomicKey === 'transition' ? `${conditionKey}\0${property}` : conditionKey]: {
681
933
  count: nextRules.length,
682
934
  index: 0,
683
- precedence: condition?.precedence ?? 0,
935
+ precedence: condition ? Math.floor(condition / 256) : 0,
684
936
  default: isDefault,
685
937
  },
686
938
  }
@@ -710,9 +962,7 @@ function directAtomic(
710
962
  }
711
963
  if (slotted) {
712
964
  const slot =
713
- atomicKey === 'transition'
714
- ? `${condition?.key || ''}\0${property}`
715
- : condition!.key
965
+ atomicKey === 'transition' ? `${conditionKey}\0${property}` : conditionKey
716
966
  const previous = existing.conditions?.[slot]
717
967
  if (previous) {
718
968
  rules.splice(previous.index, previous.count)
@@ -726,7 +976,7 @@ function directAtomic(
726
976
  }
727
977
  delete existing.conditions![slot]
728
978
  }
729
- const precedence = condition?.precedence ?? 0
979
+ const precedence = condition ? Math.floor(condition / 256) : 0
730
980
  let insertionIndex = rules.length
731
981
  if (existing.conditions) {
732
982
  for (const key in existing.conditions) {
@@ -766,7 +1016,10 @@ function directAtomic(
766
1016
  function emitBorderStyleDefault(
767
1017
  state: GetStyleState,
768
1018
  property: string,
769
- condition: Condition | null
1019
+ condition: number,
1020
+ conditionKey: string,
1021
+ conditionWrappers: string[] | undefined,
1022
+ conditionSelector: string
770
1023
  ) {
771
1024
  if (!isWeb || !state.flatShouldDoClasses || state.styleProps.noNormalize === false) {
772
1025
  return
@@ -777,11 +1030,20 @@ function emitBorderStyleDefault(
777
1030
  if (
778
1031
  atomic?.baseRules ||
779
1032
  (state.classNames[target] && !atomic) ||
780
- (condition && atomic?.conditions?.[condition.key])
1033
+ (condition && atomic?.conditions?.[conditionKey])
781
1034
  ) {
782
1035
  return
783
1036
  }
784
- directAtomic(state as DirectState, target, 'solid', condition, true)
1037
+ directAtomic(
1038
+ state as DirectState,
1039
+ target,
1040
+ 'solid',
1041
+ condition,
1042
+ conditionKey,
1043
+ conditionWrappers,
1044
+ conditionSelector,
1045
+ true
1046
+ )
785
1047
  }
786
1048
 
787
1049
  export function flushDirectStyles(state: GetStyleState, clear = false) {
@@ -807,19 +1069,23 @@ function emitProperty(
807
1069
  state: GetStyleState,
808
1070
  property: string,
809
1071
  value: any,
810
- condition: Condition | null,
1072
+ condition: number,
1073
+ conditionKey: string,
1074
+ conditionWrappers: string[] | undefined,
1075
+ conditionSelector: string,
1076
+ conditionTheme: string,
811
1077
  merge: MergeStyle,
812
1078
  originalValue: any,
813
1079
  contextOnly: boolean
814
1080
  ) {
815
1081
  const direct = state as DirectState
816
- if (condition?.enter) (state.flatEnterKeys ||= new Set()).add(property)
817
- if (condition?.exit) (state.flatExitKeys ||= new Set()).add(property)
1082
+ if (condition & 4) (state.flatEnterKeys ||= new Set()).add(property)
1083
+ if (condition & 8) (state.flatExitKeys ||= new Set()).add(property)
818
1084
 
819
- if (!isWeb && condition?.theme) {
1085
+ if (!isWeb && conditionTheme) {
820
1086
  if (supportsDynamicColorIOS && isColorStyleKey(property)) {
821
1087
  const schemes = ((direct.flatDynamicColors ||= {})[property] ||= {})
822
- schemes[condition.theme] =
1088
+ schemes[conditionTheme] =
823
1089
  typeof originalValue === 'string' && /^[a-z]+$/i.test(originalValue)
824
1090
  ? originalValue
825
1091
  : value
@@ -830,7 +1096,7 @@ function emitProperty(
830
1096
  }
831
1097
 
832
1098
  if (contextOnly) {
833
- if (!condition || condition.active) {
1099
+ if (!condition || condition & 1) {
834
1100
  ;(state.overriddenContextProps ||= {})[property] = originalValue
835
1101
  }
836
1102
  return
@@ -849,15 +1115,24 @@ function emitProperty(
849
1115
  if (!condition) {
850
1116
  if (state.style) delete state.style[property]
851
1117
  }
852
- directAtomic(state as DirectState, property, value, condition)
1118
+ directAtomic(
1119
+ state as DirectState,
1120
+ property,
1121
+ value,
1122
+ condition,
1123
+ conditionKey,
1124
+ conditionWrappers,
1125
+ conditionSelector
1126
+ )
853
1127
  return
854
1128
  }
855
1129
 
856
1130
  if (condition) {
857
- if (!condition.active) return
1131
+ if (!(condition & 1)) return
1132
+ const precedence = Math.floor(condition / 256)
858
1133
  const previous = direct.flatPrecedence?.[property]
859
- if (previous !== undefined && condition.precedence < previous) return
860
- ;(direct.flatPrecedence ||= {})[property] = condition.precedence
1134
+ if (previous !== undefined && precedence < previous) return
1135
+ ;(direct.flatPrecedence ||= {})[property] = precedence
861
1136
  ;(state.flatActiveConditions ||= {})[property] = true
862
1137
  } else if (state.flatActiveConditions?.[property]) {
863
1138
  return
@@ -892,7 +1167,11 @@ function emitBorder(
892
1167
  state: GetStyleState,
893
1168
  property: string,
894
1169
  raw: string,
895
- condition: Condition | null,
1170
+ condition: number,
1171
+ conditionKey: string,
1172
+ conditionWrappers: string[] | undefined,
1173
+ conditionSelector: string,
1174
+ conditionTheme: string,
896
1175
  merge: MergeStyle,
897
1176
  originalValue: any,
898
1177
  contextOnly: boolean
@@ -926,18 +1205,54 @@ function emitBorder(
926
1205
  if (style === 'none' && width === undefined) width = '0'
927
1206
  if (width !== undefined) {
928
1207
  for (const target of targets.width) {
929
- emitResolved(state, target, width, condition, merge, originalValue, contextOnly)
1208
+ emitResolved(
1209
+ state,
1210
+ target,
1211
+ width,
1212
+ condition,
1213
+ conditionKey,
1214
+ conditionWrappers,
1215
+ conditionSelector,
1216
+ conditionTheme,
1217
+ merge,
1218
+ originalValue,
1219
+ contextOnly
1220
+ )
930
1221
  }
931
1222
  }
932
1223
  if (style !== undefined) {
933
1224
  const styleTargets = !isWeb && property === 'border' ? ['borderStyle'] : targets.style
934
1225
  for (const target of styleTargets) {
935
- emitProperty(state, target, style, condition, merge, originalValue, contextOnly)
1226
+ emitProperty(
1227
+ state,
1228
+ target,
1229
+ style,
1230
+ condition,
1231
+ conditionKey,
1232
+ conditionWrappers,
1233
+ conditionSelector,
1234
+ conditionTheme,
1235
+ merge,
1236
+ originalValue,
1237
+ contextOnly
1238
+ )
936
1239
  }
937
1240
  }
938
1241
  if (color !== undefined) {
939
1242
  for (const target of targets.color) {
940
- emitResolved(state, target, color, condition, merge, originalValue, contextOnly)
1243
+ emitResolved(
1244
+ state,
1245
+ target,
1246
+ color,
1247
+ condition,
1248
+ conditionKey,
1249
+ conditionWrappers,
1250
+ conditionSelector,
1251
+ conditionTheme,
1252
+ merge,
1253
+ originalValue,
1254
+ contextOnly
1255
+ )
941
1256
  }
942
1257
  }
943
1258
  }
@@ -945,7 +1260,11 @@ function emitBorder(
945
1260
  function emitTextDecoration(
946
1261
  state: GetStyleState,
947
1262
  raw: string,
948
- condition: Condition | null,
1263
+ condition: number,
1264
+ conditionKey: string,
1265
+ conditionWrappers: string[] | undefined,
1266
+ conditionSelector: string,
1267
+ conditionTheme: string,
949
1268
  merge: MergeStyle,
950
1269
  originalValue: any,
951
1270
  contextOnly: boolean
@@ -964,7 +1283,19 @@ function emitTextDecoration(
964
1283
  part === 'none'
965
1284
  ? 'textDecorationLine'
966
1285
  : 'textDecorationColor'
967
- emitResolved(state, property, part, condition, merge, originalValue, contextOnly)
1286
+ emitResolved(
1287
+ state,
1288
+ property,
1289
+ part,
1290
+ condition,
1291
+ conditionKey,
1292
+ conditionWrappers,
1293
+ conditionSelector,
1294
+ conditionTheme,
1295
+ merge,
1296
+ originalValue,
1297
+ contextOnly
1298
+ )
968
1299
  }
969
1300
  }
970
1301
 
@@ -990,17 +1321,57 @@ function emitTransform(
990
1321
  state: GetStyleState,
991
1322
  property: string,
992
1323
  value: any,
993
- condition: Condition | null,
1324
+ condition: number,
1325
+ conditionKey: string,
1326
+ conditionWrappers: string[] | undefined,
1327
+ conditionSelector: string,
1328
+ conditionTheme: string,
994
1329
  merge: MergeStyle,
995
1330
  originalValue: any,
996
1331
  contextOnly: boolean
997
1332
  ) {
998
1333
  if (!isWeb || !state.flatShouldDoClasses) {
999
1334
  if (!isWeb && property === 'scale') {
1000
- emitProperty(state, 'scaleX', value, condition, merge, originalValue, contextOnly)
1001
- emitProperty(state, 'scaleY', value, condition, merge, originalValue, contextOnly)
1335
+ emitProperty(
1336
+ state,
1337
+ 'scaleX',
1338
+ value,
1339
+ condition,
1340
+ conditionKey,
1341
+ conditionWrappers,
1342
+ conditionSelector,
1343
+ conditionTheme,
1344
+ merge,
1345
+ originalValue,
1346
+ contextOnly
1347
+ )
1348
+ emitProperty(
1349
+ state,
1350
+ 'scaleY',
1351
+ value,
1352
+ condition,
1353
+ conditionKey,
1354
+ conditionWrappers,
1355
+ conditionSelector,
1356
+ conditionTheme,
1357
+ merge,
1358
+ originalValue,
1359
+ contextOnly
1360
+ )
1002
1361
  } else {
1003
- emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
1362
+ emitProperty(
1363
+ state,
1364
+ property,
1365
+ value,
1366
+ condition,
1367
+ conditionKey,
1368
+ conditionWrappers,
1369
+ conditionSelector,
1370
+ conditionTheme,
1371
+ merge,
1372
+ originalValue,
1373
+ contextOnly
1374
+ )
1004
1375
  }
1005
1376
  return
1006
1377
  }
@@ -1025,7 +1396,19 @@ function emitTransform(
1025
1396
  if (target === '--t-x' || target === '--t-y') targetValue = `${targetValue}px`
1026
1397
  else if (target === 'rotate') targetValue = `${targetValue}deg`
1027
1398
  }
1028
- emitProperty(state, target, targetValue, condition, merge, originalValue, contextOnly)
1399
+ emitProperty(
1400
+ state,
1401
+ target,
1402
+ targetValue,
1403
+ condition,
1404
+ conditionKey,
1405
+ conditionWrappers,
1406
+ conditionSelector,
1407
+ conditionTheme,
1408
+ merge,
1409
+ originalValue,
1410
+ contextOnly
1411
+ )
1029
1412
  if (target === '--t-x' || target === '--t-y') addComposition(state, 'translate')
1030
1413
  else if (target.startsWith('--t-scale')) addComposition(state, 'scale')
1031
1414
  }
@@ -1035,7 +1418,11 @@ function emitResolved(
1035
1418
  state: GetStyleState,
1036
1419
  property: string,
1037
1420
  raw: string,
1038
- condition: Condition | null,
1421
+ condition: number,
1422
+ conditionKey: string,
1423
+ conditionWrappers: string[] | undefined,
1424
+ conditionSelector: string,
1425
+ conditionTheme: string,
1039
1426
  merge: MergeStyle,
1040
1427
  originalValue: any,
1041
1428
  contextOnly: boolean
@@ -1051,7 +1438,19 @@ function emitResolved(
1051
1438
  value = Number(value)
1052
1439
  }
1053
1440
  }
1054
- emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
1441
+ emitProperty(
1442
+ state,
1443
+ property,
1444
+ value,
1445
+ condition,
1446
+ conditionKey,
1447
+ conditionWrappers,
1448
+ conditionSelector,
1449
+ conditionTheme,
1450
+ merge,
1451
+ originalValue,
1452
+ contextOnly
1453
+ )
1055
1454
  }
1056
1455
 
1057
1456
  function shadowUnit(part: any) {
@@ -1076,7 +1475,11 @@ function emitWebShadow(
1076
1475
  state,
1077
1476
  'boxShadow',
1078
1477
  state.flatBoxShadow ? `${state.flatBoxShadow}, ${next}` : next,
1079
- null,
1478
+ 0,
1479
+ '',
1480
+ undefined,
1481
+ '',
1482
+ '',
1080
1483
  merge,
1081
1484
  originalValue,
1082
1485
  contextOnly
@@ -1099,7 +1502,11 @@ function emitWebTextShadow(
1099
1502
  state,
1100
1503
  'textShadow',
1101
1504
  `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow.textShadowRadius)} ${shadow.textShadowColor}`,
1102
- null,
1505
+ 0,
1506
+ '',
1507
+ undefined,
1508
+ '',
1509
+ '',
1103
1510
  merge,
1104
1511
  originalValue,
1105
1512
  contextOnly
@@ -1110,7 +1517,11 @@ function emitValue(
1110
1517
  state: GetStyleState,
1111
1518
  property: string,
1112
1519
  raw: any,
1113
- condition: Condition | null,
1520
+ condition: number,
1521
+ conditionKey: string,
1522
+ conditionWrappers: string[] | undefined,
1523
+ conditionSelector: string,
1524
+ conditionTheme: string,
1114
1525
  merge: MergeStyle,
1115
1526
  originalValue: any,
1116
1527
  contextOnly: boolean
@@ -1129,7 +1540,14 @@ function emitValue(
1129
1540
  )
1130
1541
  }
1131
1542
 
1132
- emitBorderStyleDefault(state, property, condition)
1543
+ emitBorderStyleDefault(
1544
+ state,
1545
+ property,
1546
+ condition,
1547
+ conditionKey,
1548
+ conditionWrappers,
1549
+ conditionSelector
1550
+ )
1133
1551
 
1134
1552
  if (
1135
1553
  typeof raw === 'string' &&
@@ -1159,7 +1577,11 @@ function emitValue(
1159
1577
  .sort()
1160
1578
  .map((key) => ({ [key]: direct.flatLegacyTransforms![key] }))
1161
1579
  ),
1162
- null,
1580
+ 0,
1581
+ '',
1582
+ undefined,
1583
+ '',
1584
+ '',
1163
1585
  merge,
1164
1586
  originalValue,
1165
1587
  contextOnly
@@ -1170,6 +1592,10 @@ function emitValue(
1170
1592
  'transform',
1171
1593
  `${property}(${value})`,
1172
1594
  condition,
1595
+ conditionKey,
1596
+ conditionWrappers,
1597
+ conditionSelector,
1598
+ conditionTheme,
1173
1599
  merge,
1174
1600
  originalValue,
1175
1601
  contextOnly
@@ -1248,11 +1674,34 @@ function emitValue(
1248
1674
  }
1249
1675
 
1250
1676
  if (typeof raw === 'string' && property in borderTargets) {
1251
- emitBorder(state, property, raw, condition, merge, originalValue, contextOnly)
1677
+ emitBorder(
1678
+ state,
1679
+ property,
1680
+ raw,
1681
+ condition,
1682
+ conditionKey,
1683
+ conditionWrappers,
1684
+ conditionSelector,
1685
+ conditionTheme,
1686
+ merge,
1687
+ originalValue,
1688
+ contextOnly
1689
+ )
1252
1690
  return
1253
1691
  }
1254
1692
  if (typeof raw === 'string' && property === 'textDecoration') {
1255
- emitTextDecoration(state, raw, condition, merge, originalValue, contextOnly)
1693
+ emitTextDecoration(
1694
+ state,
1695
+ raw,
1696
+ condition,
1697
+ conditionKey,
1698
+ conditionWrappers,
1699
+ conditionSelector,
1700
+ conditionTheme,
1701
+ merge,
1702
+ originalValue,
1703
+ contextOnly
1704
+ )
1256
1705
  return
1257
1706
  }
1258
1707
  if (typeof raw === 'string' && property === 'background') {
@@ -1263,6 +1712,10 @@ function emitValue(
1263
1712
  'backgroundColor',
1264
1713
  parts[0],
1265
1714
  condition,
1715
+ conditionKey,
1716
+ conditionWrappers,
1717
+ conditionSelector,
1718
+ conditionTheme,
1266
1719
  merge,
1267
1720
  originalValue,
1268
1721
  contextOnly
@@ -1301,7 +1754,7 @@ function emitValue(
1301
1754
  `native transform "${property}" cannot represent "${value}"; dropping it`
1302
1755
  )
1303
1756
  }
1304
- if (condition?.active && state.flatTransforms) {
1757
+ if (condition & 1 && state.flatTransforms) {
1305
1758
  delete state.flatTransforms[property]
1306
1759
  }
1307
1760
  return
@@ -1312,7 +1765,19 @@ function emitValue(
1312
1765
  value = Number(value)
1313
1766
  }
1314
1767
  }
1315
- emitTransform(state, property, value, condition, merge, originalValue, contextOnly)
1768
+ emitTransform(
1769
+ state,
1770
+ property,
1771
+ value,
1772
+ condition,
1773
+ conditionKey,
1774
+ conditionWrappers,
1775
+ conditionSelector,
1776
+ conditionTheme,
1777
+ merge,
1778
+ originalValue,
1779
+ contextOnly
1780
+ )
1316
1781
  return
1317
1782
  }
1318
1783
 
@@ -1320,9 +1785,33 @@ function emitValue(
1320
1785
  // css reads the shorthand, so skip the four-corner expansion here. a string
1321
1786
  // value still needs its token resolved, which is what emitResolved does.
1322
1787
  if (typeof raw === 'string') {
1323
- emitResolved(state, property, raw, condition, merge, originalValue, contextOnly)
1788
+ emitResolved(
1789
+ state,
1790
+ property,
1791
+ raw,
1792
+ condition,
1793
+ conditionKey,
1794
+ conditionWrappers,
1795
+ conditionSelector,
1796
+ conditionTheme,
1797
+ merge,
1798
+ originalValue,
1799
+ contextOnly
1800
+ )
1324
1801
  } else {
1325
- emitProperty(state, property, raw, condition, merge, originalValue, contextOnly)
1802
+ emitProperty(
1803
+ state,
1804
+ property,
1805
+ raw,
1806
+ condition,
1807
+ conditionKey,
1808
+ conditionWrappers,
1809
+ conditionSelector,
1810
+ conditionTheme,
1811
+ merge,
1812
+ originalValue,
1813
+ contextOnly
1814
+ )
1326
1815
  }
1327
1816
  return
1328
1817
  }
@@ -1339,6 +1828,10 @@ function emitValue(
1339
1828
  property,
1340
1829
  transform,
1341
1830
  condition,
1831
+ conditionKey,
1832
+ conditionWrappers,
1833
+ conditionSelector,
1834
+ conditionTheme,
1342
1835
  merge,
1343
1836
  originalValue,
1344
1837
  contextOnly
@@ -1382,6 +1875,10 @@ function emitValue(
1382
1875
  key,
1383
1876
  parsedValue,
1384
1877
  condition,
1878
+ conditionKey,
1879
+ conditionWrappers,
1880
+ conditionSelector,
1881
+ conditionTheme,
1385
1882
  merge,
1386
1883
  originalValue,
1387
1884
  contextOnly
@@ -1393,6 +1890,10 @@ function emitValue(
1393
1890
  property === 'backgroundImage' ? 'experimental_backgroundImage' : property,
1394
1891
  parsed,
1395
1892
  condition,
1893
+ conditionKey,
1894
+ conditionWrappers,
1895
+ conditionSelector,
1896
+ conditionTheme,
1396
1897
  merge,
1397
1898
  originalValue,
1398
1899
  contextOnly
@@ -1410,7 +1911,19 @@ function emitValue(
1410
1911
  ? null
1411
1912
  : expandStyle(property, value, state.conf.settings.styleCompat || 'web')
1412
1913
  if (!expanded) {
1413
- emitProperty(state, property, value, condition, merge, originalValue, contextOnly)
1914
+ emitProperty(
1915
+ state,
1916
+ property,
1917
+ value,
1918
+ condition,
1919
+ conditionKey,
1920
+ conditionWrappers,
1921
+ conditionSelector,
1922
+ conditionTheme,
1923
+ merge,
1924
+ originalValue,
1925
+ contextOnly
1926
+ )
1414
1927
  return
1415
1928
  }
1416
1929
 
@@ -1431,6 +1944,10 @@ function emitValue(
1431
1944
  expanded[index][0],
1432
1945
  parts[partIndex],
1433
1946
  condition,
1947
+ conditionKey,
1948
+ conditionWrappers,
1949
+ conditionSelector,
1950
+ conditionTheme,
1434
1951
  merge,
1435
1952
  originalValue,
1436
1953
  contextOnly
@@ -1445,6 +1962,10 @@ function emitValue(
1445
1962
  expanded[index][0],
1446
1963
  expanded[index][1],
1447
1964
  condition,
1965
+ conditionKey,
1966
+ conditionWrappers,
1967
+ conditionSelector,
1968
+ conditionTheme,
1448
1969
  merge,
1449
1970
  originalValue,
1450
1971
  contextOnly
@@ -1452,36 +1973,6 @@ function emitValue(
1452
1973
  }
1453
1974
  }
1454
1975
 
1455
- function emitSegment(
1456
- state: GetStyleState,
1457
- property: string,
1458
- source: string,
1459
- start: number,
1460
- end: number,
1461
- condition: Condition | null,
1462
- merge: MergeStyle,
1463
- originalValue: any,
1464
- contextOnly: boolean
1465
- ) {
1466
- while (start < end && source.charCodeAt(start) <= 32) start++
1467
- while (end > start && source.charCodeAt(end - 1) <= 32) end--
1468
- if (start === end) return false
1469
- if (
1470
- !condition ||
1471
- (condition.emit &&
1472
- (condition.active ||
1473
- (isWeb && state.flatShouldDoClasses) ||
1474
- (!isWeb &&
1475
- condition.theme &&
1476
- supportsDynamicColorIOS &&
1477
- isColorStyleKey(property))))
1478
- ) {
1479
- const value = source.slice(start, end)
1480
- emitValue(state, property, value, condition, merge, value, contextOnly)
1481
- }
1482
- return true
1483
- }
1484
-
1485
1976
  export function contributeStyleString(
1486
1977
  state: GetStyleState,
1487
1978
  property: string,
@@ -1490,10 +1981,6 @@ export function contributeStyleString(
1490
1981
  originalValue?: any,
1491
1982
  contextOnly = false
1492
1983
  ) {
1493
- if (process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === 'disabled') {
1494
- emitValue(state, property, source, null, merge, originalValue ?? source, contextOnly)
1495
- return true
1496
- }
1497
1984
  if (
1498
1985
  isWeb &&
1499
1986
  source.indexOf(':') !== -1 &&
@@ -1510,140 +1997,31 @@ export function contributeStyleString(
1510
1997
  // with no colon is emitted verbatim by contract. Keep the two paths in mind
1511
1998
  // together when reading a bug report about one of them.
1512
1999
  if (source.indexOf(':') === -1) {
1513
- emitValue(state, property, source, null, merge, originalValue ?? source, contextOnly)
1514
- return true
1515
- }
1516
-
1517
- // The scan collects and the emit happens after it, because `parseValue`
1518
- // reports a refused modifier or a rule-breaking character as one failure over
1519
- // the WHOLE value: there is no such thing as the good half of a value the
1520
- // grammar rejects. Emitting as the scan went is what used to make this path
1521
- // lose the base it had already read while the variant path kept it.
1522
- const conditions: (Condition | null)[] = []
1523
- const starts: number[] = []
1524
- const ends: number[] = []
1525
- let pending: Condition | null = null
1526
- // the first thing that made the value unusable, and the whole refusal test
1527
- let refused = ''
1528
- let lifecycle = false
1529
-
1530
- scanFlatValue(source, {
1531
- segment(start, end, isBase) {
1532
- if (start === end) {
1533
- // an empty base is simply no base; an empty clause payload is a clause
1534
- // with nothing in it, which parseValue reports as `empty-payload`
1535
- if (!isBase && !refused) refused = 'a conditional clause has no value'
1536
- return
1537
- }
1538
- conditions.push(pending)
1539
- starts.push(start)
1540
- ends.push(end)
1541
- },
1542
- chain(start, end) {
1543
- if (refused) return false
1544
- const next = getCondition(state, source.slice(start, end))
1545
- if (!next) {
1546
- refused = `unknown modifier "${source.slice(start, end)}"`
1547
- return false
1548
- }
1549
- if (process.env.NODE_ENV === 'development' && next.unsupportedState) {
1550
- warnOnce(
1551
- `${property}: "${next.unsupportedState}:" has no native component-state source; dropping the clause`
1552
- )
1553
- }
1554
- pending = next
1555
- lifecycle ||= !!(next.enter || next.exit)
1556
- return true
1557
- },
1558
- error(code, index) {
1559
- if (refused) return
1560
- refused =
1561
- code === 'invalid-character'
1562
- ? `"${source[index]}" would end the declaration or rule`
1563
- : code === 'unterminated-string'
1564
- ? 'an unterminated string'
1565
- : code === 'unterminated-comment'
1566
- ? 'an unterminated "/*" comment'
1567
- : code === 'stray-comment-close'
1568
- ? 'a stray "*/"'
1569
- : 'an unterminated "("'
1570
- },
1571
- })
1572
-
1573
- if (refused) {
1574
- // `16:9` is the one value whose top-level colon is content rather than a
1575
- // clause, and only this property can hold it
1576
- if (property === 'aspectRatio') {
1577
- emitValue(
1578
- state,
1579
- property,
1580
- source,
1581
- null,
1582
- merge,
1583
- originalValue ?? source,
1584
- contextOnly
1585
- )
1586
- return true
1587
- }
1588
- if (process.env.NODE_ENV === 'development') {
1589
- warnRefusedValue(property, source, refused)
1590
- }
1591
- return true
1592
- }
1593
-
1594
- let hasBase = false
1595
- let lastPayloadStart = 0
1596
- for (let index = 0; index < conditions.length; index++) {
1597
- const condition = conditions[index]
1598
- lastPayloadStart = starts[index]
1599
- const emitted = emitSegment(
2000
+ emitValue(
1600
2001
  state,
1601
2002
  property,
1602
2003
  source,
1603
- starts[index],
1604
- ends[index],
1605
- condition,
2004
+ 0,
2005
+ '',
2006
+ undefined,
2007
+ '',
2008
+ '',
1606
2009
  merge,
1607
- originalValue,
2010
+ originalValue ?? source,
1608
2011
  contextOnly
1609
2012
  )
1610
- if (!condition && emitted) hasBase = true
1611
- }
1612
-
1613
- if (
1614
- process.env.NODE_ENV === 'development' &&
1615
- !hasBase &&
1616
- conditions.length > 0 &&
1617
- (property in tokenCategories.color || property in tokenCategoryByProperty) &&
1618
- splitComponents(source.slice(lastPayloadStart)).length > 1
1619
- ) {
1620
- warnOnce(
1621
- `${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`
1622
- )
2013
+ return true
1623
2014
  }
1624
2015
 
1625
- // a lifecycle-only value (`opacity="enter:0 exit:0"`) has no resting value to
1626
- // return to. CSS does not need one: the property is simply absent and the
1627
- // browser's own default applies. A style object does need one, because an
1628
- // animation driver can only animate between values it can see, and that is
1629
- // every native render plus every web render a driver drives inline. Without
1630
- // this the enter style lands and then the target style has no such key at
1631
- // all, so the driver has nothing to animate toward and the element snaps.
1632
- if ((!isWeb || !state.flatShouldDoClasses) && lifecycle && !hasBase) {
1633
- const value =
1634
- property === 'opacity'
1635
- ? 1
1636
- : property === 'scale' || property === 'scaleX' || property === 'scaleY'
1637
- ? 1
1638
- : property === 'rotate'
1639
- ? '0deg'
1640
- : property === 'x' || property === 'y'
1641
- ? 0
1642
- : null
1643
- if (value !== null) {
1644
- emitValue(state, property, value, null, merge, value, contextOnly)
1645
- }
1646
- }
2016
+ scanFlatValue(
2017
+ source,
2018
+ directStyleHandler,
2019
+ state,
2020
+ property,
2021
+ merge,
2022
+ originalValue,
2023
+ contextOnly
2024
+ )
1647
2025
  return true
1648
2026
  }
1649
2027
 
@@ -1654,29 +2032,34 @@ export function contributeFrontendValue(
1654
2032
  merge: MergeStyle,
1655
2033
  contextOnly = false
1656
2034
  ) {
1657
- if (process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === 'disabled') {
1658
- return false
1659
- }
1660
2035
  if (value.base !== null) {
1661
- emitValue(state, property, value.base, null, merge, value.base, contextOnly)
2036
+ emitValue(
2037
+ state,
2038
+ property,
2039
+ value.base,
2040
+ 0,
2041
+ '',
2042
+ undefined,
2043
+ '',
2044
+ '',
2045
+ merge,
2046
+ value.base,
2047
+ contextOnly
2048
+ )
1662
2049
  }
1663
2050
  for (const clause of value.clauses) {
1664
- const condition = getCondition(state, clause.modifiers.join(':'))
1665
- if (
1666
- condition &&
1667
- condition.emit &&
1668
- (condition.active || (isWeb && state.flatShouldDoClasses))
1669
- ) {
1670
- emitValue(
1671
- state,
1672
- property,
1673
- clause.payload,
1674
- condition,
1675
- merge,
1676
- clause.payload,
1677
- contextOnly
1678
- )
1679
- }
2051
+ const source = clause.modifiers.join(':')
2052
+ resolveClauseChain(
2053
+ state,
2054
+ source,
2055
+ 0,
2056
+ source.length,
2057
+ property,
2058
+ clause.payload,
2059
+ merge,
2060
+ clause.payload,
2061
+ contextOnly
2062
+ )
1680
2063
  }
1681
2064
  return true
1682
2065
  }
@@ -1690,24 +2073,20 @@ export function contributeVariantClauseValue(
1690
2073
  originalValue?: any,
1691
2074
  contextOnly = false
1692
2075
  ) {
1693
- if (process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === 'disabled') {
1694
- return
1695
- }
1696
- const condition = getCondition(state, conditionSource)
1697
- if (!condition) {
1698
- if (process.env.NODE_ENV === 'development') {
1699
- warnRefusedValue(property, value, `unknown modifier "${conditionSource}"`)
1700
- }
1701
- return
1702
- }
1703
- if (process.env.NODE_ENV === 'development' && condition.unsupportedState) {
1704
- warnOnce(
1705
- `${property}: "${condition.unsupportedState}:" has no native component-state source; dropping the clause`
1706
- )
1707
- }
1708
- if (condition.emit && (condition.active || (isWeb && state.flatShouldDoClasses))) {
1709
- emitValue(state, property, value, condition, merge, originalValue, contextOnly)
1710
- }
2076
+ resolveClauseChain(
2077
+ state,
2078
+ conditionSource,
2079
+ 0,
2080
+ conditionSource.length,
2081
+ property,
2082
+ value,
2083
+ merge,
2084
+ originalValue,
2085
+ contextOnly,
2086
+ -1,
2087
+ -1,
2088
+ 2
2089
+ )
1711
2090
  }
1712
2091
 
1713
2092
  export function contributeStyleValue(
@@ -1718,16 +2097,24 @@ export function contributeStyleValue(
1718
2097
  originalValue?: any,
1719
2098
  contextOnly = false
1720
2099
  ) {
1721
- if (
1722
- process.env.TAMAGUI_RUNTIME_SAFE_AREA !== 'disabled' &&
1723
- value === 'safe' &&
1724
- isSafeAreaKey(property)
1725
- ) {
2100
+ if (value === 'safe' && isSafeAreaKey(property)) {
1726
2101
  const expanded = expandSafeAreaValue(property)
1727
2102
  if (expanded) {
1728
2103
  state.flatUsesSafeArea = true
1729
2104
  for (const [key, resolved] of expanded) {
1730
- emitValue(state, key, resolved, null, merge, originalValue ?? value, contextOnly)
2105
+ emitValue(
2106
+ state,
2107
+ key,
2108
+ resolved,
2109
+ 0,
2110
+ '',
2111
+ undefined,
2112
+ '',
2113
+ '',
2114
+ merge,
2115
+ originalValue ?? value,
2116
+ contextOnly
2117
+ )
1731
2118
  }
1732
2119
  return true
1733
2120
  }
@@ -1743,7 +2130,19 @@ export function contributeStyleValue(
1743
2130
  )
1744
2131
  }
1745
2132
  if (value != null) {
1746
- emitValue(state, property, value, null, merge, originalValue ?? value, contextOnly)
2133
+ emitValue(
2134
+ state,
2135
+ property,
2136
+ value,
2137
+ 0,
2138
+ '',
2139
+ undefined,
2140
+ '',
2141
+ '',
2142
+ merge,
2143
+ originalValue ?? value,
2144
+ contextOnly
2145
+ )
1747
2146
  return true
1748
2147
  }
1749
2148
  return false