@tamagui/web 3.0.0-beta.924.1 → 3.0.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 (636) hide show
  1. package/dist/cjs/_withNativeStyle.cjs +3 -0
  2. package/dist/cjs/_withNativeStyle.native.cjs +3 -0
  3. package/dist/cjs/_withNativeStyle.native.js +3 -0
  4. package/dist/cjs/_withNativeStyle.native.js.map +1 -1
  5. package/dist/cjs/_withStableStyle.native.cjs +1 -5
  6. package/dist/cjs/_withStableStyle.native.js +1 -5
  7. package/dist/cjs/_withStableStyle.native.js.map +1 -1
  8. package/dist/cjs/config.cjs +6 -3
  9. package/dist/cjs/config.native.cjs +7 -5
  10. package/dist/cjs/config.native.js +7 -5
  11. package/dist/cjs/config.native.js.map +1 -1
  12. package/dist/cjs/contexts/ComponentContext.cjs +1 -0
  13. package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
  14. package/dist/cjs/contexts/ComponentContext.native.js +8 -0
  15. package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
  16. package/dist/cjs/createComponent.cjs +46 -32
  17. package/dist/cjs/createComponent.native.cjs +92 -72
  18. package/dist/cjs/createComponent.native.js +92 -72
  19. package/dist/cjs/createComponent.native.js.map +1 -1
  20. package/dist/cjs/createTamagui.cjs +32 -14
  21. package/dist/cjs/createTamagui.native.cjs +33 -19
  22. package/dist/cjs/createTamagui.native.js +33 -19
  23. package/dist/cjs/createTamagui.native.js.map +1 -1
  24. package/dist/cjs/createTokens.native.cjs +1 -5
  25. package/dist/cjs/createTokens.native.js +1 -5
  26. package/dist/cjs/createTokens.native.js.map +1 -1
  27. package/dist/cjs/createVariable.native.cjs +1 -5
  28. package/dist/cjs/createVariable.native.js +1 -5
  29. package/dist/cjs/createVariable.native.js.map +1 -1
  30. package/dist/cjs/createVariables.native.cjs +2 -6
  31. package/dist/cjs/createVariables.native.js +2 -6
  32. package/dist/cjs/createVariables.native.js.map +1 -1
  33. package/dist/cjs/dom/html.cjs +87 -329
  34. package/dist/cjs/dom/html.native.cjs +53 -2
  35. package/dist/cjs/dom/html.native.js +53 -2
  36. package/dist/cjs/dom/html.native.js.map +1 -1
  37. package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
  38. package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
  39. package/dist/cjs/dom/htmlReset.native.js +30 -0
  40. package/dist/cjs/dom/htmlReset.native.js.map +1 -0
  41. package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
  42. package/dist/cjs/dom/htmlRuntime.native.js +4 -0
  43. package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
  44. package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
  45. package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
  46. package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
  47. package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
  48. package/dist/cjs/dom/primitives.native.cjs +81 -34
  49. package/dist/cjs/dom/primitives.native.js +81 -34
  50. package/dist/cjs/dom/primitives.native.js.map +1 -1
  51. package/dist/cjs/eventHandling.cjs +10 -4
  52. package/dist/cjs/eventHandling.native.cjs +52 -16
  53. package/dist/cjs/eventHandling.native.js +52 -16
  54. package/dist/cjs/eventHandling.native.js.map +1 -1
  55. package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
  56. package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
  57. package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
  58. package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
  59. package/dist/cjs/helpers/configVariables.native.cjs +2 -6
  60. package/dist/cjs/helpers/configVariables.native.js +2 -6
  61. package/dist/cjs/helpers/configVariables.native.js.map +1 -1
  62. package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
  63. package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
  64. package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
  65. package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
  66. package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
  67. package/dist/cjs/helpers/createStyledContext.native.js +1 -5
  68. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  69. package/dist/cjs/helpers/expandStyle.cjs +45 -1
  70. package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
  71. package/dist/cjs/helpers/expandStyle.native.js +38 -2
  72. package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
  73. package/dist/cjs/helpers/expandStyles.cjs +15 -3
  74. package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
  75. package/dist/cjs/helpers/expandStyles.native.js +14 -8
  76. package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
  77. package/dist/cjs/helpers/fluid.cjs +56 -0
  78. package/dist/cjs/helpers/fluid.native.cjs +58 -0
  79. package/dist/cjs/helpers/fluid.native.js +60 -0
  80. package/dist/cjs/helpers/fluid.native.js.map +1 -0
  81. package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
  82. package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
  83. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  84. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
  85. package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
  86. package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
  87. package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
  88. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  89. package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
  90. package/dist/cjs/helpers/grammarConfig.cjs +6 -14
  91. package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
  92. package/dist/cjs/helpers/grammarConfig.native.js +32 -22
  93. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  94. package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
  95. package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
  96. package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
  97. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  98. package/dist/cjs/helpers/isObj.native.cjs +1 -5
  99. package/dist/cjs/helpers/isObj.native.js +1 -5
  100. package/dist/cjs/helpers/isObj.native.js.map +1 -1
  101. package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
  102. package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
  103. package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
  104. package/dist/cjs/helpers/mergeProps.cjs +18 -21
  105. package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
  106. package/dist/cjs/helpers/mergeProps.native.js +20 -23
  107. package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
  108. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  109. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  110. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  111. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  112. package/dist/cjs/helpers/nativeTextMetrics.cjs +74 -0
  113. package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
  114. package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
  115. package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
  116. package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
  117. package/dist/cjs/helpers/normalizeColor.native.js +17 -2
  118. package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
  119. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
  120. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
  121. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
  122. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  123. package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
  124. package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
  125. package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
  126. package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
  127. package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
  128. package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
  129. package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
  130. package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
  131. package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
  132. package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
  133. package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
  134. package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
  135. package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
  136. package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
  137. package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
  138. package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
  139. package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
  140. package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
  141. package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
  142. package/dist/cjs/helpers/resolveRem.native.js +18 -21
  143. package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
  144. package/dist/cjs/helpers/resolveSizing.cjs +124 -0
  145. package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
  146. package/dist/cjs/helpers/resolveSizing.native.js +135 -0
  147. package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
  148. package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
  149. package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
  150. package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
  151. package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
  152. package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
  153. package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
  154. package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
  155. package/dist/cjs/helpers/skipProps.cjs +0 -1
  156. package/dist/cjs/helpers/skipProps.native.cjs +0 -1
  157. package/dist/cjs/helpers/skipProps.native.js +0 -1
  158. package/dist/cjs/helpers/skipProps.native.js.map +1 -1
  159. package/dist/cjs/helpers/styleFrontend.cjs +23 -1
  160. package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
  161. package/dist/cjs/helpers/styleFrontend.native.js +23 -1
  162. package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
  163. package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
  164. package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
  165. package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
  166. package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
  167. package/dist/cjs/helpers/styledDynamic.cjs +5 -0
  168. package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
  169. package/dist/cjs/helpers/styledDynamic.native.js +8 -7
  170. package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
  171. package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
  172. package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
  173. package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
  174. package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
  175. package/dist/cjs/helpers/themeRef.native.cjs +1 -5
  176. package/dist/cjs/helpers/themeRef.native.js +1 -5
  177. package/dist/cjs/helpers/themeRef.native.js.map +1 -1
  178. package/dist/cjs/helpers/themes.cjs +26 -11
  179. package/dist/cjs/helpers/themes.native.cjs +26 -11
  180. package/dist/cjs/helpers/themes.native.js +26 -11
  181. package/dist/cjs/helpers/themes.native.js.map +1 -1
  182. package/dist/cjs/helpers/tokenCategories.cjs +2 -2
  183. package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
  184. package/dist/cjs/helpers/tokenCategories.native.js +2 -2
  185. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  186. package/dist/cjs/helpers/variables.cjs +1 -1
  187. package/dist/cjs/helpers/variables.native.cjs +4 -8
  188. package/dist/cjs/helpers/variables.native.js +4 -8
  189. package/dist/cjs/helpers/variables.native.js.map +1 -1
  190. package/dist/cjs/helpers/warnOnce.cjs +6 -0
  191. package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
  192. package/dist/cjs/helpers/warnOnce.native.js +6 -0
  193. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  194. package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
  195. package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
  196. package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
  197. package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
  198. package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
  199. package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
  200. package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
  201. package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
  202. package/dist/cjs/hooks/useComponentState.native.js +1 -5
  203. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  204. package/dist/cjs/hooks/useMedia.cjs +27 -34
  205. package/dist/cjs/hooks/useMedia.native.cjs +45 -51
  206. package/dist/cjs/hooks/useMedia.native.js +45 -51
  207. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  208. package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
  209. package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
  210. package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
  211. package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
  212. package/dist/cjs/hooks/useThemeState.cjs +37 -47
  213. package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
  214. package/dist/cjs/hooks/useThemeState.native.js +44 -50
  215. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  216. package/dist/cjs/index.cjs +7 -0
  217. package/dist/cjs/index.native.cjs +7 -0
  218. package/dist/cjs/index.native.js +7 -0
  219. package/dist/cjs/index.native.js.map +1 -1
  220. package/dist/cjs/internal-runtime.cjs +22 -0
  221. package/dist/cjs/internal-runtime.native.cjs +22 -0
  222. package/dist/cjs/internal-runtime.native.js +22 -0
  223. package/dist/cjs/internal-runtime.native.js.map +1 -1
  224. package/dist/cjs/static-resolve.native.cjs +2 -9
  225. package/dist/cjs/static-resolve.native.js +2 -9
  226. package/dist/cjs/static-resolve.native.js.map +1 -1
  227. package/dist/cjs/style.cjs +1 -1
  228. package/dist/cjs/style.native.cjs +4 -7
  229. package/dist/cjs/style.native.js +4 -7
  230. package/dist/cjs/style.native.js.map +1 -1
  231. package/dist/cjs/views/Theme.cjs +10 -17
  232. package/dist/cjs/views/Theme.native.cjs +9 -11
  233. package/dist/cjs/views/Theme.native.js +9 -11
  234. package/dist/cjs/views/Theme.native.js.map +1 -1
  235. package/dist/cjs/views/ThemeDebug.cjs +1 -1
  236. package/dist/cjs/views/ThemeUpdate.cjs +1 -1
  237. package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
  238. package/dist/cjs/views/ThemeUpdate.native.js +1 -1
  239. package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
  240. package/dist/esm/_withNativeStyle.mjs +4 -1
  241. package/dist/esm/_withNativeStyle.mjs.map +1 -1
  242. package/dist/esm/_withNativeStyle.native.js +4 -1
  243. package/dist/esm/_withNativeStyle.native.js.map +1 -1
  244. package/dist/esm/_withStableStyle.native.js +1 -5
  245. package/dist/esm/_withStableStyle.native.js.map +1 -1
  246. package/dist/esm/config.mjs +6 -3
  247. package/dist/esm/config.mjs.map +1 -1
  248. package/dist/esm/config.native.js +7 -5
  249. package/dist/esm/config.native.js.map +1 -1
  250. package/dist/esm/contexts/ComponentContext.mjs +9 -9
  251. package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
  252. package/dist/esm/contexts/ComponentContext.native.js +16 -9
  253. package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
  254. package/dist/esm/createComponent.mjs +45 -42
  255. package/dist/esm/createComponent.mjs.map +1 -1
  256. package/dist/esm/createComponent.native.js +93 -82
  257. package/dist/esm/createComponent.native.js.map +1 -1
  258. package/dist/esm/createTamagui.mjs +33 -15
  259. package/dist/esm/createTamagui.mjs.map +1 -1
  260. package/dist/esm/createTamagui.native.js +34 -20
  261. package/dist/esm/createTamagui.native.js.map +1 -1
  262. package/dist/esm/createTokens.native.js +1 -5
  263. package/dist/esm/createTokens.native.js.map +1 -1
  264. package/dist/esm/createVariable.native.js +1 -5
  265. package/dist/esm/createVariable.native.js.map +1 -1
  266. package/dist/esm/createVariables.native.js +2 -6
  267. package/dist/esm/createVariables.native.js.map +1 -1
  268. package/dist/esm/dom/html.mjs +87 -329
  269. package/dist/esm/dom/html.mjs.map +1 -1
  270. package/dist/esm/dom/html.native.js +53 -2
  271. package/dist/esm/dom/html.native.js.map +1 -1
  272. package/dist/esm/dom/htmlReset.mjs +6 -0
  273. package/dist/esm/dom/htmlReset.mjs.map +1 -0
  274. package/dist/esm/dom/htmlReset.native.js +6 -0
  275. package/dist/esm/dom/htmlReset.native.js.map +1 -0
  276. package/dist/esm/dom/htmlRuntime.native.js +4 -0
  277. package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
  278. package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
  279. package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
  280. package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
  281. package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
  282. package/dist/esm/dom/primitives.native.js +81 -34
  283. package/dist/esm/dom/primitives.native.js.map +1 -1
  284. package/dist/esm/eventHandling.mjs +10 -4
  285. package/dist/esm/eventHandling.mjs.map +1 -1
  286. package/dist/esm/eventHandling.native.js +52 -16
  287. package/dist/esm/eventHandling.native.js.map +1 -1
  288. package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
  289. package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
  290. package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
  291. package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
  292. package/dist/esm/helpers/configVariables.native.js +2 -6
  293. package/dist/esm/helpers/configVariables.native.js.map +1 -1
  294. package/dist/esm/helpers/createDesignSystem.mjs +14 -10
  295. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  296. package/dist/esm/helpers/createDesignSystem.native.js +4 -4
  297. package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
  298. package/dist/esm/helpers/createStyledContext.native.js +1 -5
  299. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  300. package/dist/esm/helpers/expandStyle.mjs +41 -1
  301. package/dist/esm/helpers/expandStyle.mjs.map +1 -1
  302. package/dist/esm/helpers/expandStyle.native.js +36 -3
  303. package/dist/esm/helpers/expandStyle.native.js.map +1 -1
  304. package/dist/esm/helpers/expandStyles.mjs +15 -3
  305. package/dist/esm/helpers/expandStyles.mjs.map +1 -1
  306. package/dist/esm/helpers/expandStyles.native.js +14 -8
  307. package/dist/esm/helpers/expandStyles.native.js.map +1 -1
  308. package/dist/esm/helpers/fluid.mjs +36 -0
  309. package/dist/esm/helpers/fluid.mjs.map +1 -0
  310. package/dist/esm/helpers/fluid.native.js +36 -0
  311. package/dist/esm/helpers/fluid.native.js.map +1 -0
  312. package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
  313. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  314. package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
  315. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  316. package/dist/esm/helpers/getSplitStyles.mjs +364 -150
  317. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  318. package/dist/esm/helpers/getSplitStyles.native.js +588 -188
  319. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  320. package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
  321. package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
  322. package/dist/esm/helpers/grammarConfig.mjs +6 -14
  323. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  324. package/dist/esm/helpers/grammarConfig.native.js +32 -22
  325. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  326. package/dist/esm/helpers/insertStyleRule.mjs +11 -4
  327. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  328. package/dist/esm/helpers/insertStyleRule.native.js +4 -4
  329. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  330. package/dist/esm/helpers/isObj.native.js +1 -5
  331. package/dist/esm/helpers/isObj.native.js.map +1 -1
  332. package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
  333. package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
  334. package/dist/esm/helpers/mergeProps.mjs +18 -21
  335. package/dist/esm/helpers/mergeProps.mjs.map +1 -1
  336. package/dist/esm/helpers/mergeProps.native.js +20 -23
  337. package/dist/esm/helpers/mergeProps.native.js.map +1 -1
  338. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  339. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  340. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  341. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  342. package/dist/esm/helpers/nativeTextMetrics.mjs +55 -0
  343. package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
  344. package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
  345. package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
  346. package/dist/esm/helpers/normalizeColor.native.js +17 -2
  347. package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
  348. package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
  349. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  350. package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
  351. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  352. package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
  353. package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
  354. package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
  355. package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
  356. package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
  357. package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
  358. package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
  359. package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
  360. package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
  361. package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
  362. package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
  363. package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
  364. package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
  365. package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
  366. package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
  367. package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
  368. package/dist/esm/helpers/resolveRem.native.js +18 -21
  369. package/dist/esm/helpers/resolveRem.native.js.map +1 -1
  370. package/dist/esm/helpers/resolveSizing.mjs +102 -0
  371. package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
  372. package/dist/esm/helpers/resolveSizing.native.js +109 -0
  373. package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
  374. package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
  375. package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
  376. package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
  377. package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
  378. package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
  379. package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
  380. package/dist/esm/helpers/skipProps.mjs +0 -1
  381. package/dist/esm/helpers/skipProps.mjs.map +1 -1
  382. package/dist/esm/helpers/skipProps.native.js +0 -1
  383. package/dist/esm/helpers/skipProps.native.js.map +1 -1
  384. package/dist/esm/helpers/styleFrontend.mjs +20 -1
  385. package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
  386. package/dist/esm/helpers/styleFrontend.native.js +20 -1
  387. package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
  388. package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
  389. package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
  390. package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
  391. package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
  392. package/dist/esm/helpers/styledDynamic.mjs +5 -0
  393. package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
  394. package/dist/esm/helpers/styledDynamic.native.js +8 -7
  395. package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
  396. package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
  397. package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
  398. package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
  399. package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
  400. package/dist/esm/helpers/themeRef.native.js +1 -5
  401. package/dist/esm/helpers/themeRef.native.js.map +1 -1
  402. package/dist/esm/helpers/themes.mjs +20 -11
  403. package/dist/esm/helpers/themes.mjs.map +1 -1
  404. package/dist/esm/helpers/themes.native.js +20 -11
  405. package/dist/esm/helpers/themes.native.js.map +1 -1
  406. package/dist/esm/helpers/tokenCategories.mjs +2 -2
  407. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  408. package/dist/esm/helpers/tokenCategories.native.js +2 -2
  409. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  410. package/dist/esm/helpers/variables.mjs +1 -1
  411. package/dist/esm/helpers/variables.mjs.map +1 -1
  412. package/dist/esm/helpers/variables.native.js +4 -8
  413. package/dist/esm/helpers/variables.native.js.map +1 -1
  414. package/dist/esm/helpers/warnOnce.mjs +6 -1
  415. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  416. package/dist/esm/helpers/warnOnce.native.js +6 -1
  417. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  418. package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
  419. package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
  420. package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
  421. package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
  422. package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
  423. package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
  424. package/dist/esm/hooks/useComponentState.native.js +1 -5
  425. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  426. package/dist/esm/hooks/useMedia.mjs +27 -34
  427. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  428. package/dist/esm/hooks/useMedia.native.js +45 -51
  429. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  430. package/dist/esm/hooks/useSplitStyles.mjs +1 -1
  431. package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
  432. package/dist/esm/hooks/useSplitStyles.native.js +1 -1
  433. package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
  434. package/dist/esm/hooks/useThemeState.mjs +36 -48
  435. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  436. package/dist/esm/hooks/useThemeState.native.js +44 -50
  437. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  438. package/dist/esm/index.js +4 -1
  439. package/dist/esm/index.mjs +4 -1
  440. package/dist/esm/index.native.js +4 -1
  441. package/dist/esm/internal-runtime.mjs +22 -3
  442. package/dist/esm/internal-runtime.mjs.map +1 -1
  443. package/dist/esm/internal-runtime.native.js +22 -3
  444. package/dist/esm/internal-runtime.native.js.map +1 -1
  445. package/dist/esm/static-resolve.native.js +2 -9
  446. package/dist/esm/static-resolve.native.js.map +1 -1
  447. package/dist/esm/style.mjs +1 -1
  448. package/dist/esm/style.mjs.map +1 -1
  449. package/dist/esm/style.native.js +4 -7
  450. package/dist/esm/style.native.js.map +1 -1
  451. package/dist/esm/views/Theme.mjs +15 -14
  452. package/dist/esm/views/Theme.mjs.map +1 -1
  453. package/dist/esm/views/Theme.native.js +15 -15
  454. package/dist/esm/views/Theme.native.js.map +1 -1
  455. package/dist/esm/views/ThemeDebug.mjs +1 -1
  456. package/dist/esm/views/ThemeDebug.mjs.map +1 -1
  457. package/dist/esm/views/ThemeUpdate.mjs +1 -1
  458. package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
  459. package/dist/esm/views/ThemeUpdate.native.js +1 -1
  460. package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
  461. package/package.json +20 -18
  462. package/reset.css +11 -0
  463. package/src/_withNativeStyle.tsx +6 -1
  464. package/src/config.ts +6 -6
  465. package/src/contexts/ComponentContext.tsx +8 -0
  466. package/src/createComponent.tsx +177 -57
  467. package/src/createStyledHOC.tsx +25 -26
  468. package/src/createTamagui.ts +47 -28
  469. package/src/dom/contract.ts +4 -1
  470. package/src/dom/html.native.tsx +55 -2
  471. package/src/dom/html.tsx +189 -388
  472. package/src/dom/htmlReset.ts +15 -0
  473. package/src/dom/htmlRuntime.native.tsx +5 -0
  474. package/src/dom/htmlStaticConfig.ts +40 -0
  475. package/src/dom/primitives.native.tsx +138 -33
  476. package/src/dom/standalone.ts +2 -1
  477. package/src/dom/styleTypes.ts +82 -92
  478. package/src/eventHandling.native.ts +61 -11
  479. package/src/eventHandling.ts +19 -4
  480. package/src/helpers/NativeTextBinding.tsx +26 -0
  481. package/src/helpers/createDesignSystem.ts +24 -8
  482. package/src/helpers/expandStyle.ts +88 -4
  483. package/src/helpers/expandStyles.ts +6 -11
  484. package/src/helpers/fluid.ts +66 -0
  485. package/src/helpers/getCSSStylesAtomic.ts +11 -6
  486. package/src/helpers/getSplitStyles.tsx +1032 -296
  487. package/src/helpers/getThemeCSSRules.ts +73 -35
  488. package/src/helpers/grammarConfig.ts +23 -8
  489. package/src/helpers/insertStyleRule.tsx +14 -8
  490. package/src/helpers/mainThreadPressEvents.native.ts +65 -141
  491. package/src/helpers/mergeProps.ts +29 -62
  492. package/src/helpers/nativeOnlyProps.ts +0 -1
  493. package/src/helpers/nativeTextMetrics.ts +77 -0
  494. package/src/helpers/normalizeColor.native.ts +29 -4
  495. package/src/helpers/normalizeValueWithProperty.ts +2 -1
  496. package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
  497. package/src/helpers/proxyThemeToParents.ts +13 -2
  498. package/src/helpers/resolveNativeUnits.native.ts +247 -0
  499. package/src/helpers/resolveNativeUnits.ts +10 -0
  500. package/src/helpers/resolveRem.native.ts +25 -26
  501. package/src/helpers/resolveSizing.ts +167 -0
  502. package/src/helpers/resolveVariableValue.ts +21 -17
  503. package/src/helpers/skipProps.ts +0 -1
  504. package/src/helpers/styleFrontend.ts +39 -0
  505. package/src/helpers/styleProvenance.ts +1 -1
  506. package/src/helpers/styleStaticConfigCore.ts +15 -4
  507. package/src/helpers/styledDynamic.ts +3 -1
  508. package/src/helpers/subscribeToContextGroup.tsx +16 -7
  509. package/src/helpers/themes.ts +27 -11
  510. package/src/helpers/tokenCategories.ts +15 -3
  511. package/src/helpers/variables.ts +2 -2
  512. package/src/helpers/warnOnce.ts +6 -0
  513. package/src/helpers/webPropsToSkip.native.ts +9 -3
  514. package/src/helpers/wrapStyleTags.tsx +4 -1
  515. package/src/hooks/useMedia.tsx +36 -47
  516. package/src/hooks/useSplitStyles.tsx +4 -1
  517. package/src/hooks/useThemeState.ts +69 -74
  518. package/src/index.ts +13 -0
  519. package/src/interfaces/RNExclusiveTypes.ts +1 -3
  520. package/src/internal-runtime.ts +43 -2
  521. package/src/style.ts +4 -1
  522. package/src/styled.tsx +34 -3
  523. package/src/types.tsx +412 -132
  524. package/src/views/Theme.tsx +18 -21
  525. package/src/views/ThemeDebug.tsx +1 -1
  526. package/src/views/ThemeUpdate.tsx +1 -1
  527. package/types/_withNativeStyle.d.ts.map +1 -1
  528. package/types/config.d.ts.map +1 -1
  529. package/types/contexts/ComponentContext.d.ts +1 -1
  530. package/types/contexts/ComponentContext.d.ts.map +1 -1
  531. package/types/createComponent.d.ts.map +1 -1
  532. package/types/createStyledHOC.d.ts +5 -2
  533. package/types/createStyledHOC.d.ts.map +1 -1
  534. package/types/createTamagui.d.ts.map +1 -1
  535. package/types/dom/contract.d.ts +4 -1
  536. package/types/dom/contract.d.ts.map +1 -1
  537. package/types/dom/html.d.ts +60 -51
  538. package/types/dom/html.d.ts.map +1 -1
  539. package/types/dom/html.native.d.ts.map +1 -1
  540. package/types/dom/htmlReset.d.ts +10 -0
  541. package/types/dom/htmlReset.d.ts.map +1 -0
  542. package/types/dom/htmlRuntime.native.d.ts.map +1 -1
  543. package/types/dom/htmlStaticConfig.d.ts +22 -0
  544. package/types/dom/htmlStaticConfig.d.ts.map +1 -0
  545. package/types/dom/primitives.native.d.ts.map +1 -1
  546. package/types/dom/standalone.d.ts +2 -1
  547. package/types/dom/standalone.d.ts.map +1 -1
  548. package/types/dom/styleTypes.d.ts +63 -84
  549. package/types/dom/styleTypes.d.ts.map +1 -1
  550. package/types/eventHandling.d.ts +12 -4
  551. package/types/eventHandling.d.ts.map +1 -1
  552. package/types/eventHandling.native.d.ts.map +1 -1
  553. package/types/helpers/NativeTextBinding.d.ts +11 -0
  554. package/types/helpers/NativeTextBinding.d.ts.map +1 -0
  555. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  556. package/types/helpers/expandStyle.d.ts +1 -0
  557. package/types/helpers/expandStyle.d.ts.map +1 -1
  558. package/types/helpers/expandStyles.d.ts.map +1 -1
  559. package/types/helpers/fluid.d.ts +21 -0
  560. package/types/helpers/fluid.d.ts.map +1 -0
  561. package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
  562. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  563. package/types/helpers/getSplitStyles.d.ts +2 -1
  564. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  565. package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
  566. package/types/helpers/grammarConfig.d.ts.map +1 -1
  567. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  568. package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
  569. package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
  570. package/types/helpers/mergeProps.d.ts +1 -15
  571. package/types/helpers/mergeProps.d.ts.map +1 -1
  572. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  573. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  574. package/types/helpers/nativeTextMetrics.d.ts +16 -0
  575. package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
  576. package/types/helpers/normalizeColor.native.d.ts +4 -1
  577. package/types/helpers/normalizeColor.native.d.ts.map +1 -1
  578. package/types/helpers/normalizeShadow.native.d.ts +3 -1
  579. package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
  580. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  581. package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
  582. package/types/helpers/parseNativeStyle.d.ts.map +1 -0
  583. package/types/helpers/proxyThemeToParents.d.ts +1 -1
  584. package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
  585. package/types/helpers/resolveNativeUnits.d.ts +6 -0
  586. package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
  587. package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
  588. package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
  589. package/types/helpers/resolveRem.native.d.ts +6 -4
  590. package/types/helpers/resolveRem.native.d.ts.map +1 -1
  591. package/types/helpers/resolveSizing.d.ts +90 -0
  592. package/types/helpers/resolveSizing.d.ts.map +1 -0
  593. package/types/helpers/resolveVariableValue.d.ts.map +1 -1
  594. package/types/helpers/skipProps.d.ts +0 -1
  595. package/types/helpers/skipProps.d.ts.map +1 -1
  596. package/types/helpers/styleFrontend.d.ts +21 -0
  597. package/types/helpers/styleFrontend.d.ts.map +1 -1
  598. package/types/helpers/styleProvenance.d.ts +1 -1
  599. package/types/helpers/styleProvenance.d.ts.map +1 -1
  600. package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
  601. package/types/helpers/styledDynamic.d.ts +1 -1
  602. package/types/helpers/styledDynamic.d.ts.map +1 -1
  603. package/types/helpers/themes.d.ts +4 -0
  604. package/types/helpers/themes.d.ts.map +1 -1
  605. package/types/helpers/tokenCategories.d.ts +1 -1
  606. package/types/helpers/tokenCategories.d.ts.map +1 -1
  607. package/types/helpers/warnOnce.d.ts +1 -0
  608. package/types/helpers/warnOnce.d.ts.map +1 -1
  609. package/types/helpers/webPropsToSkip.native.d.ts +6 -2
  610. package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
  611. package/types/helpers/wrapStyleTags.d.ts.map +1 -1
  612. package/types/hooks/useMedia.d.ts +5 -2
  613. package/types/hooks/useMedia.d.ts.map +1 -1
  614. package/types/hooks/useSplitStyles.d.ts.map +1 -1
  615. package/types/hooks/useThemeState.d.ts.map +1 -1
  616. package/types/index.d.ts +4 -1
  617. package/types/index.d.ts.map +1 -1
  618. package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
  619. package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
  620. package/types/internal-runtime.d.ts +12 -1
  621. package/types/internal-runtime.d.ts.map +1 -1
  622. package/types/style.d.ts.map +1 -1
  623. package/types/styled.d.ts +7 -4
  624. package/types/styled.d.ts.map +1 -1
  625. package/types/types.d.ts +258 -102
  626. package/types/types.d.ts.map +1 -1
  627. package/types/views/Theme.d.ts.map +1 -1
  628. package/dist/cjs/helpers/timer.native.js.map +0 -1
  629. package/dist/esm/helpers/timer.mjs +0 -13
  630. package/dist/esm/helpers/timer.mjs.map +0 -1
  631. package/dist/esm/helpers/timer.native.js +0 -13
  632. package/dist/esm/helpers/timer.native.js.map +0 -1
  633. package/src/helpers/timer.ts +0 -9
  634. package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
  635. package/types/helpers/timer.d.ts +0 -2
  636. package/types/helpers/timer.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeState.js","names":[],"sources":["esm/hooks/useThemeState.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nconst ThemeStateContext = createContext(\"\");\nconst allListeners = /* @__PURE__ */ new Map();\nconst listenersByParent = {};\nconst HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nconst HadTheme = /* @__PURE__ */ new WeakMap();\nconst PendingUpdate = /* @__PURE__ */ new Map();\nconst states = /* @__PURE__ */ new Map();\nconst localStates = /* @__PURE__ */ new Map();\nlet shouldForce = false;\nconst forceUpdateThemes = () => {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach((cb) => cb());\n\tshouldForce = false;\n};\nconst getThemeState = (id) => states.get(id);\nconst themeUpdateLayers = /* @__PURE__ */ new Map();\nconst themeProviderParents = /* @__PURE__ */ new Map();\nconst getThemeUpdateLayer = (id) => themeUpdateLayers.get(id);\nconst getThemeProviderParent = (id) => themeProviderParents.get(id);\nconst getThemeProviderChainSizes = () => ({\n\tlayers: themeUpdateLayers.size,\n\tparents: themeProviderParents.size\n});\nconst registerThemeProviderChain = (id, parentId, props) => {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.delete(id);\n};\nlet cacheVersion = 0;\nconst themeNameCache = /* @__PURE__ */ new Map();\nlet themeNameCacheVer = -1;\nlet themes = null;\nlet rootThemeState = null;\nconst getRootThemeState = () => rootThemeState;\nconst incReducer = (c) => c + 1;\nconst useThemeState = (props, isRoot = false, keys, schemeKeys, cascadeOnChange = false, optimizeForFirstRender = false) => {\n\t\"use no memo\";\n\tconst { disable } = props;\n\tconst parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tconst id = useId();\n\tconst propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tconst ref = useRef(null);\n\tconst r = ref.current ||= {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.schemeKeys = schemeKeys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tconst [, forceUpdate] = useReducer(incReducer, 0);\n\tconst state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\tuseEffect(() => {\n\t\tconst renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tconst pid = r.parentId;\n\t\t\t\tconst sid = r.id;\n\t\t\t\tconst cb = (forced) => {\n\t\t\t\t\tconst next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && r.props.nativeUpdate?.(next)) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t(listenersByParent[pid] ||= /* @__PURE__ */ new Set()).add(sid);\n\t\t\t\tallListeners.set(sid, () => {\n\t\t\t\t\tconst forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = () => {\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\tlistenersByParent[pid]?.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn () => {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(() => {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nconst shouldSubscribeToTheme = (r, cascadeOnChange) => Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || r.keys.current?.size || r.props.needsUpdate?.());\nfunction cleanupThemeSubscription(r) {\n\tr.unsubscribe?.();\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nconst getSnapshotImpl = (r) => {\n\tconst { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tlet local = localStates.get(id);\n\tconst parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tconst isSchemeOnlyChange = !optimizeForFirstRender && false;\n\tconst allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(keys.current?.size && schemeKeys?.current?.size === keys.current.size);\n\tconst canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);\n\tconst needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : keys?.current?.size ? true : props.needsUpdate?.();\n\tconst [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tlet next = nextRaw;\n\tif (props._themeUpdate && nextRaw?.theme) {\n\t\tconst parentTheme = states.get(parentId)?.theme || nextRaw.theme;\n\t\tconst merged = props._themeUpdate.getTheme(parentTheme, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState?.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nconst getNextState = (lastState, props, propsKey, isRoot = false, id, parentId, needsUpdate, pendingUpdate) => {\n\tconst parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tthemes ||= getConfig().themes;\n\tconst name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState?.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tconst isSameAsParent = Boolean(parentState && (!name || name === parentState.name));\n\tconst shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || lastState?.name !== parentState?.name));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tconst next = lastState ?? parentState ?? rootThemeState ?? {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tconst scheme = getScheme(name);\n\tconst parentInverses = parentState?.inverses ?? 0;\n\tconst isInverse = Boolean(parentState && scheme !== parentState.scheme);\n\tconst inverses = parentInverses + (isInverse ? 1 : 0);\n\tconst nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState?.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\treturn [!(pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name), nextState];\n};\nfunction scheduleUpdate(id) {\n\tconst queue = [id];\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tconst children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tfor (const childId of children) if (!visited.has(childId)) {\n\t\t\t\tvisited.add(childId);\n\t\t\t\tqueue.push(childId);\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach((childId) => {\n\t\tallListeners.get(childId)?.();\n\t});\n}\nconst validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName(parentName = \"\", props, forceUpdate = false) {\n\tconst { name } = props;\n\tconst cacheKey = `${parentName}|${name || \"\"}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tconst cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tconst result = resolveThemeName(parentName, name ?? void 0, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nconst getThemeNameCacheSize = () => themeNameCache.size;\nfunction resolveThemeName(parentName, name, themes2, forceUpdate = false) {\n\tconst parentParts = parentName ? parentName.split(\"_\") : [];\n\tlet found = null;\n\tif (name) {\n\t\tconst nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (let i = parentParts.length; i >= 0; i--) {\n\t\t\tconst base = parentParts.slice(0, i).join(\"_\");\n\t\t\tconst potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nconst getPropsKey = ({ name, forceClassName, _themeUpdate }) => `${name || \"\"}${forceClassName || \"\"}${_themeUpdate?.key || \"\"}`;\nconst hasThemeUpdatingProps = (props) => \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" in props;\n\nexport { ThemeStateContext, forceUpdateThemes, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderPar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K,GAAG,UAAU,CAAC,CAAC,QAAQ,WAAW;CAC3F,IAAI,eAAe,QAAQ,KAAK,eAAe,MAAM;CACrD,eAAe,IAAI,UAAU,MAAM;CACnC,OAAO;AACR;AACA,MAAM,8BAA8B,eAAe;AACnD,SAAS,iBAAiB,YAAY,MAAM,SAAS,cAAc,OAAO;CACzE,MAAM,cAAc,aAAa,WAAW,MAAM,GAAG,IAAI,CAAC;CAC1D,IAAI,QAAQ;CACZ,IAAI,MAAM;EACT,MAAM,gBAAgB,UAAU,IAAI;EACpC,IAAI,iBAAiB,QAAQ,SAAS,QAAQ;EAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,KAAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,MAAM,OAAO,YAAY,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;GAC7C,MAAM,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC7C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,CAAC,aAAa,QAAQ,OAAO;CACzE,OAAO;AACR;AACA,MAAM,eAAe,EAAE,MAAM,gBAAgB,mBAAmB,GAAG,QAAQ,KAAK,kBAAkB,KAAK,cAAc,OAAO;AAC5H,MAAM,yBAAyB,UAAU,UAAU,SAAS,oBAAoB,SAAS,kBAAkB"}
1
+ {"version":3,"file":"useThemeState.js","names":[],"sources":["esm/hooks/useThemeState.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getThemeScheme } from \"@tamagui/helpers\";\nimport { getConfig } from \"../config\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\nimport { getAuthoredThemeScheme } from \"../helpers/themes\";\n\nconst ThemeStateContext = createContext(\"\");\nconst allListeners = /* @__PURE__ */ new Map();\nconst listenersByParent = {};\nconst HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nconst HadTheme = /* @__PURE__ */ new WeakMap();\nconst PendingUpdate = /* @__PURE__ */ new Map();\nconst states = /* @__PURE__ */ new Map();\nlet shouldForce = false;\nconst forceUpdateThemes = () => {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach((cb) => cb());\n\tshouldForce = false;\n};\nconst getThemeState = (id) => states.get(id);\nconst themeUpdateLayers = /* @__PURE__ */ new Map();\nconst themeProviderParents = /* @__PURE__ */ new Map();\nconst getThemeUpdateLayer = (id) => themeUpdateLayers.get(id);\nconst getThemeProviderParent = (id) => themeProviderParents.get(id);\nconst getThemeProviderChainSizes = () => ({\n\tlayers: themeUpdateLayers.size,\n\tparents: themeProviderParents.size\n});\nconst registerThemeProviderChain = (id, parentId, props) => {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.delete(id);\n};\nlet cacheVersion = 0;\nconst themeNameCache = /* @__PURE__ */ new Map();\nlet themeNameCacheVer = -1;\nlet themes = null;\nlet rootThemeState = null;\nconst getRootThemeState = () => rootThemeState;\nconst incReducer = (c) => c + 1;\nconst useThemeState = (props, isRoot = false, keys, schemeKeys, cascadeOnChange = false, optimizeForFirstRender = false) => {\n\t\"use no memo\";\n\tconst { disable } = props;\n\tconst parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tconst id = useId();\n\tconst propsKey = `${props.name || \"\"}${props.forceClassName || \"\"}${props._themeUpdate?.key || \"\"}`;\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tconst ref = useRef(null);\n\tconst r = ref.current ||= {\n\t\tid,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tconst [, forceUpdate] = useReducer(incReducer, 0);\n\tconst state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\tuseEffect(() => {\n\t\tconst renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tr.state = r.lastSnap;\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedTo !== r.parentId) r.unsubscribe?.();\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tconst pid = r.parentId;\n\t\t\t\tconst sid = r.id;\n\t\t\t\tconst cb = (forced) => {\n\t\t\t\t\tconst next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && r.props.nativeUpdate?.(next)) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t(listenersByParent[pid] ||= /* @__PURE__ */ new Set()).add(sid);\n\t\t\t\tallListeners.set(sid, () => {\n\t\t\t\t\tconst forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedTo = pid;\n\t\t\t\tr.unsubscribe = () => {\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\tlistenersByParent[pid]?.delete(sid);\n\t\t\t\t\tr.state = void 0;\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedTo = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) r.unsubscribe?.();\n\t\treturn () => {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(() => {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nconst shouldSubscribeToTheme = (r, cascadeOnChange) => Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || r.keys.current?.size || r.props.needsUpdate?.());\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) r.unsubscribe();\n\telse {\n\t\tr.state = void 0;\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nconst getSnapshotImpl = (r) => {\n\tconst { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r;\n\tlet local = r.state;\n\tconst parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._parentSchemeAuthored === parentState.schemeAuthored && local._propsKey === propsKey) return local;\n\t}\n\tconst canSkipForSchemeChange = Boolean(!optimizeForFirstRender && false);\n\tconst needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : keys?.current?.size ? true : props.needsUpdate?.();\n\tconst [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tlet next = nextRaw;\n\tif (props._themeUpdate && nextRaw?.theme) {\n\t\tconst parentTheme = states.get(parentId)?.theme || nextRaw.theme;\n\t\tconst merged = props._themeUpdate.getTheme(parentTheme, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tr.state = local;\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState?.name;\n\tlocal._parentSchemeAuthored = parentState?.schemeAuthored;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nconst getNextState = (lastState, props, propsKey, isRoot = false, id, parentId, needsUpdate, pendingUpdate) => {\n\tconst parentState = states.get(parentId);\n\tif (props.passThrough) return [false, parentState || lastState || { name: \"\" }];\n\tthemes ||= getConfig().themes;\n\tconst name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState?.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tconst authoredName = props.name;\n\tconst parentSchemeAuthored = !!parentState?.schemeAuthored;\n\tconst schemeAuthored = isRoot ? !!props.forceClassName : parentSchemeAuthored || !!(authoredName && getThemeScheme(authoredName) && authoredName in themes);\n\tconst intentChanged = schemeAuthored !== parentSchemeAuthored;\n\tconst resolvedName = name || parentState?.name;\n\tconst sameAsLast = lastState && lastState.name === resolvedName && !!lastState.schemeAuthored === schemeAuthored;\n\tconst isSameAsParent = Boolean(parentState && resolvedName === parentState.name && !intentChanged);\n\tconst shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || lastState?.name !== parentState?.name || !!lastState?.schemeAuthored !== schemeAuthored));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && sameAsLast) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!resolvedName) {\n\t\tconst next = lastState ?? parentState ?? rootThemeState ?? {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tconst scheme = getAuthoredThemeScheme(themes[resolvedName]) || getThemeScheme(resolvedName);\n\tconst parentInverses = parentState?.inverses ?? 0;\n\tconst isInverse = Boolean(parentState && scheme !== parentState.scheme);\n\tconst inverses = parentInverses + (isInverse ? 1 : 0);\n\tconst nextState = {\n\t\tid,\n\t\tname: resolvedName,\n\t\ttheme: themes[resolvedName],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState?.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tschemeAuthored,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\treturn [pendingUpdate === \"force\" || !sameAsLast, nextState];\n};\nfunction scheduleUpdate(id) {\n\tconst queue = [id];\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tconst children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tfor (const childId of children) if (!visited.has(childId)) {\n\t\t\t\tvisited.add(childId);\n\t\t\t\tqueue.push(childId);\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach((childId) => {\n\t\tallListeners.get(childId)?.();\n\t});\n}\nfunction getNewThemeName(parentName = \"\", props, forceUpdate = false) {\n\tconst { name } = props;\n\tconst cacheKey = `${parentName}|${name || \"\"}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tconst cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tconst result = resolveThemeName(parentName, name ?? void 0, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nconst getThemeNameCacheSize = () => themeNameCache.size;\nfunction resolveThemeName(parentName, name, themes2, forceUpdate = false) {\n\tconst parentParts = parentName ? parentName.split(\"_\") : [];\n\tlet found = null;\n\tif (name) {\n\t\tconst nameHasScheme = getThemeScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (let i = parentParts.length; i >= 0; i--) {\n\t\t\tconst base = parentParts.slice(0, i).join(\"_\");\n\t\t\tconst potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && found !== \"light\" && found !== \"dark\") return null;\n\treturn found;\n}\nconst hasThemeUpdatingProps = (props) => \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" in props;\n\nexport { ThemeStateContext, forceUpdateThemes, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, getThemeUpdateLayer, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";;;;;;;;AAOA,MAAM,oBAAoB,cAAc,EAAE;AAC1C,MAAM,+BAA+B,IAAI,IAAI;AAC7C,MAAM,oBAAoB,CAAC;AAC3B,MAAM,kCAAkC,IAAI,QAAQ;AACpD,MAAM,2BAA2B,IAAI,QAAQ;AAC7C,MAAM,gCAAgC,IAAI,IAAI;AAC9C,MAAM,yBAAyB,IAAI,IAAI;AACvC,IAAI,cAAc;AAClB,MAAM,0BAA0B;CAC/B;CACA,cAAc;CACd,aAAa,SAAS,OAAO,GAAG,CAAC;CACjC,cAAc;AACf;AACA,MAAM,iBAAiB,OAAO,OAAO,IAAI,EAAE;AAC3C,MAAM,oCAAoC,IAAI,IAAI;AAClD,MAAM,uCA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AI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,UAAU,WAAW,UAAU,QAAQ,OAAO;CAC1F,OAAO;AACR;AACA,MAAM,yBAAyB,UAAU,UAAU,SAAS,oBAAoB,SAAS,kBAAkB"}
@@ -1,7 +1,9 @@
1
1
  import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from "@tamagui/constants";
2
2
  import { createContext, useContext, useEffect, useId, useReducer, useRef } from "react";
3
+ import { getThemeScheme } from "@tamagui/helpers";
3
4
  import { getConfig, getSetting } from "../config.native.js";
4
5
  import { MISSING_THEME_MESSAGE } from "../constants/constants.native.js";
6
+ import { getAuthoredThemeScheme } from "../helpers/themes.native.js";
5
7
 
6
8
  var ThemeStateContext = createContext("");
7
9
  var allListeners = /* @__PURE__ */ new Map();
@@ -10,7 +12,6 @@ var HasRenderedOnce = /* @__PURE__ */ new WeakMap();
10
12
  var HadTheme = /* @__PURE__ */ new WeakMap();
11
13
  var PendingUpdate = /* @__PURE__ */ new Map();
12
14
  var states = /* @__PURE__ */ new Map();
13
- var localStates = /* @__PURE__ */ new Map();
14
15
  var shouldForce = false;
15
16
  var forceUpdateThemes = function() {
16
17
  cacheVersion++;
@@ -59,6 +60,7 @@ var incReducer = function(c) {
59
60
  var useThemeState = function(props) {
60
61
  "use no memo";
61
62
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
63
+ var _props__themeUpdate;
62
64
  var _ref;
63
65
  var { disable } = props;
64
66
  var parentId = useContext(ThemeStateContext);
@@ -71,16 +73,10 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
71
73
  theme: getConfig().themes.light
72
74
  };
73
75
  var id = useId();
74
- var propsKey = getPropsKey(props);
76
+ var propsKey = `${props.name || ""}${props.forceClassName || ""}${((_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.key) || ""}`;
75
77
  if (cascadeOnChange) registerThemeProviderChain(id, parentId, props);
76
78
  var r = (_ref = useRef(null)).current || (_ref.current = {
77
79
  id,
78
- parentId,
79
- props,
80
- propsKey,
81
- isRoot,
82
- keys,
83
- schemeKeys,
84
80
  optimizeForFirstRender,
85
81
  renderVersion: 0
86
82
  });
@@ -98,10 +94,13 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
98
94
  var renderVersion = r.renderVersion;
99
95
  if (r.lastSnap && !states.has(r.id)) {
100
96
  states.set(r.id, r.lastSnap);
101
- localStates.set(r.id, r.lastSnap);
97
+ r.state = r.lastSnap;
102
98
  }
103
99
  if (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);
104
- if (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);
100
+ if (r.unsubscribe && r.subscribedTo !== r.parentId) {
101
+ var _r_unsubscribe;
102
+ (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
103
+ }
105
104
  if (shouldSubscribeToTheme(r, cascadeOnChange)) {
106
105
  if (!r.unsubscribe) {
107
106
  var _listenersByParent, _pid;
@@ -122,19 +121,22 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
122
121
  PendingUpdate.set(sid, forced ? "force" : true);
123
122
  cb(forced);
124
123
  });
125
- r.subscribedParentId = pid;
124
+ r.subscribedTo = pid;
126
125
  r.unsubscribe = function() {
127
126
  var _listenersByParent_pid;
128
127
  allListeners.delete(sid);
129
128
  (_listenersByParent_pid = listenersByParent[pid]) === null || _listenersByParent_pid === void 0 || _listenersByParent_pid.delete(sid);
130
- localStates.delete(sid);
129
+ r.state = void 0;
131
130
  states.delete(sid);
132
131
  PendingUpdate.delete(sid);
133
132
  r.unsubscribe = void 0;
134
- r.subscribedParentId = void 0;
133
+ r.subscribedTo = void 0;
135
134
  };
136
135
  }
137
- } else if (r.unsubscribe) cleanupThemeSubscription(r);
136
+ } else if (r.unsubscribe) {
137
+ var _r_unsubscribe1;
138
+ (_r_unsubscribe1 = r.unsubscribe) === null || _r_unsubscribe1 === void 0 || _r_unsubscribe1.call(r);
139
+ }
138
140
  return function() {
139
141
  if (r.renderVersion === renderVersion) cleanupThemeState(r);
140
142
  };
@@ -158,14 +160,10 @@ var shouldSubscribeToTheme = function(r, cascadeOnChange) {
158
160
  var _r_keys_current, _r_props_needsUpdate, _r_props;
159
161
  return Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || ((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || ((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props)));
160
162
  };
161
- function cleanupThemeSubscription(r) {
162
- var _r_unsubscribe;
163
- (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
164
- }
165
163
  function cleanupThemeState(r) {
166
- if (r.unsubscribe) cleanupThemeSubscription(r);
164
+ if (r.unsubscribe) r.unsubscribe();
167
165
  else {
168
- localStates.delete(r.id);
166
+ r.state = void 0;
169
167
  states.delete(r.id);
170
168
  PendingUpdate.delete(r.id);
171
169
  }
@@ -174,16 +172,16 @@ function cleanupThemeState(r) {
174
172
  }
175
173
  var getSnapshotImpl = function(r) {
176
174
  var _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate;
177
- var { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;
178
- var local = localStates.get(id);
175
+ var { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r;
176
+ var schemeKeys = r.schemeKeys;
177
+ var local = r.state;
179
178
  var parentState = states.get(parentId);
180
179
  if (local && !PendingUpdate.has(id)) {
181
- if (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;
180
+ if (parentState && local._parentName === parentState.name && local._parentSchemeAuthored === parentState.schemeAuthored && local._propsKey === propsKey) return local;
182
181
  }
183
182
  var isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
184
- var allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
185
- var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);
186
- var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
183
+ var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && ((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
184
+ var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
187
185
  var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
188
186
  var next = nextRaw;
189
187
  if (props._themeUpdate && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {
@@ -198,13 +196,14 @@ var getSnapshotImpl = function(r) {
198
196
  PendingUpdate.delete(id);
199
197
  if (!local || rerender) {
200
198
  local = { ...next };
201
- localStates.set(id, local);
199
+ r.state = local;
202
200
  }
203
201
  if (next !== local) {
204
202
  Object.assign(local, next);
205
203
  local.id = id;
206
204
  }
207
205
  local._parentName = parentState === null || parentState === void 0 ? void 0 : parentState.name;
206
+ local._parentSchemeAuthored = parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored;
208
207
  local._propsKey = propsKey;
209
208
  states.set(id, next);
210
209
  return local;
@@ -212,19 +211,25 @@ var getSnapshotImpl = function(r) {
212
211
  var getNextState = function(lastState, props, propsKey) {
213
212
  var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;
214
213
  var parentState = states.get(parentId);
215
- if (props.passThrough) return [false, lastState || parentState || { name: "" }];
214
+ if (props.passThrough) return [false, parentState || lastState || { name: "" }];
216
215
  themes || (themes = getConfig().themes);
217
216
  var name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate);
218
- var isSameAsParent = Boolean(parentState && (!name || name === parentState.name));
219
- var shouldRerender = Boolean(pendingUpdate === "force" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name)));
217
+ var authoredName = props.name;
218
+ var parentSchemeAuthored = !!(parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored);
219
+ var schemeAuthored = isRoot ? !!props.forceClassName : parentSchemeAuthored || !!(authoredName && getThemeScheme(authoredName) && authoredName in themes);
220
+ var intentChanged = schemeAuthored !== parentSchemeAuthored;
221
+ var resolvedName = name || (parentState === null || parentState === void 0 ? void 0 : parentState.name);
222
+ var sameAsLast = lastState && lastState.name === resolvedName && !!lastState.schemeAuthored === schemeAuthored;
223
+ var isSameAsParent = Boolean(parentState && resolvedName === parentState.name && !intentChanged);
224
+ var shouldRerender = Boolean(pendingUpdate === "force" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name) || !!(lastState === null || lastState === void 0 ? void 0 : lastState.schemeAuthored) !== schemeAuthored));
220
225
  if (isSameAsParent) {
221
- if (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];
226
+ if (!shouldRerender && sameAsLast) return [false, lastState];
222
227
  return [shouldRerender, {
223
228
  ...parentState,
224
229
  isNew: false
225
230
  }];
226
231
  }
227
- if (!name) {
232
+ if (!resolvedName) {
228
233
  var _ref, _ref1;
229
234
  var next = (_ref1 = (_ref = lastState !== null && lastState !== void 0 ? lastState : parentState) !== null && _ref !== void 0 ? _ref : rootThemeState) !== null && _ref1 !== void 0 ? _ref1 : {
230
235
  id,
@@ -234,25 +239,25 @@ var getNextState = function(lastState, props, propsKey) {
234
239
  if (shouldRerender) return [true, { ...parentState || lastState || next }];
235
240
  return [false, next];
236
241
  }
237
- var scheme = getScheme(name);
242
+ var scheme = getAuthoredThemeScheme(themes[resolvedName]) || getThemeScheme(resolvedName);
238
243
  var _parentState_inverses;
239
244
  var parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;
240
245
  var isInverse = Boolean(parentState && scheme !== parentState.scheme);
241
246
  var inverses = parentInverses + (isInverse ? 1 : 0);
242
247
  var nextState = {
243
248
  id,
244
- name,
245
- theme: themes[name],
249
+ name: resolvedName,
250
+ theme: themes[resolvedName],
246
251
  scheme,
247
252
  parentId,
248
253
  parentName: parentState === null || parentState === void 0 ? void 0 : parentState.name,
249
254
  inverses,
250
255
  isInverse,
256
+ schemeAuthored,
251
257
  isNew: true
252
258
  };
253
259
  if (isRoot) rootThemeState = nextState;
254
- if (pendingUpdate !== "force" && lastState && lastState.name === name) return [false, nextState];
255
- return [!(pendingUpdate !== "force" && lastState && !needsUpdate && nextState.name === lastState.name), nextState];
260
+ return [pendingUpdate === "force" || !sameAsLast, nextState];
256
261
  };
257
262
  function scheduleUpdate(id) {
258
263
  var queue = [id];
@@ -286,13 +291,6 @@ function scheduleUpdate(id) {
286
291
  (_allListeners_get = allListeners.get(childId2)) === null || _allListeners_get === void 0 || _allListeners_get();
287
292
  });
288
293
  }
289
- var validSchemes = {
290
- light: "light",
291
- dark: "dark"
292
- };
293
- function getScheme(name) {
294
- return validSchemes[name.split("_")[0]];
295
- }
296
294
  function getNewThemeName() {
297
295
  var parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", props = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
298
296
  var { name } = props;
@@ -317,7 +315,7 @@ function resolveThemeName(parentName, name, themes2) {
317
315
  var parentParts = parentName ? parentName.split("_") : [];
318
316
  var found = null;
319
317
  if (name) {
320
- var nameHasScheme = getScheme(name);
318
+ var nameHasScheme = getThemeScheme(name);
321
319
  if (nameHasScheme && name in themes2) found = name;
322
320
  if (!found && !nameHasScheme) for (var i = parentParts.length; i >= 0; i--) {
323
321
  var base = parentParts.slice(0, i).join("_");
@@ -328,13 +326,9 @@ function resolveThemeName(parentName, name, themes2) {
328
326
  }
329
327
  }
330
328
  }
331
- if (!forceUpdate && found === parentName && !validSchemes[found]) return null;
329
+ if (!forceUpdate && found === parentName && found !== "light" && found !== "dark") return null;
332
330
  return found;
333
331
  }
334
- var getPropsKey = function(param) {
335
- var { name, forceClassName, _themeUpdate } = param;
336
- return `${name || ""}${forceClassName || ""}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || ""}`;
337
- };
338
332
  var hasThemeUpdatingProps = function(props) {
339
333
  return "name" in props || "forceClassName" in props || "_themeUpdate" in props;
340
334
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeState.native.js","names":[],"sources":["esm/hooks/useThemeState.native.js"],"sourcesContent":["import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig, getSetting } from \"../config\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nvar ThemeStateContext = createContext(\"\");\nvar allListeners = /* @__PURE__ */ new Map();\nvar listenersByParent = {};\nvar HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nvar HadTheme = /* @__PURE__ */ new WeakMap();\nvar PendingUpdate = /* @__PURE__ */ new Map();\nvar states = /* @__PURE__ */ new Map();\nvar localStates = /* @__PURE__ */ new Map();\nvar shouldForce = false;\nvar forceUpdateThemes = function() {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach(function(cb) {\n\t\treturn cb();\n\t});\n\tshouldForce = false;\n};\nvar getThemeState = function(id) {\n\treturn states.get(id);\n};\nvar themeUpdateLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getThemeUpdateLayer = function(id) {\n\treturn themeUpdateLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: themeUpdateLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.delete(id);\n};\nvar cacheVersion = 0;\nvar themeNameCache = /* @__PURE__ */ new Map();\nvar themeNameCacheVer = -1;\nvar themes = null;\nvar rootThemeState = null;\nvar getRootThemeState = function() {\n\treturn rootThemeState;\n};\nvar getThemeBaseName = function(name) {\n\treturn name.replace(/^(light|dark)_/, \"\");\n};\nvar incReducer = function(c) {\n\treturn c + 1;\n};\nvar useThemeState = function(props) {\n\t\"use no memo\";\n\tvar isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar _ref;\n\tvar { disable } = props;\n\tvar parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tvar id = useId();\n\tvar propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar r = (_ref = useRef(null)).current || (_ref.current = {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t});\n\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.schemeKeys = schemeKeys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tvar [, forceUpdate] = useReducer(incReducer, 0);\n\tvar state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\tuseEffect(function() {\n\t\tvar renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tvar _listenersByParent, _pid;\n\t\t\t\tvar pid = r.parentId;\n\t\t\t\tvar sid = r.id;\n\t\t\t\tvar cb = function(forced) {\n\t\t\t\t\tvar next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tvar _r_props_nativeUpdate, _r_props;\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && ((_r_props_nativeUpdate = (_r_props = r.props).nativeUpdate) === null || _r_props_nativeUpdate === void 0 ? void 0 : _r_props_nativeUpdate.call(_r_props, next))) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t((_listenersByParent = listenersByParent)[_pid = pid] || (_listenersByParent[_pid] = /* @__PURE__ */ new Set())).add(sid);\n\t\t\t\tallListeners.set(sid, function() {\n\t\t\t\t\tvar forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = function() {\n\t\t\t\t\tvar _listenersByParent_pid;\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\t(_listenersByParent_pid = listenersByParent[pid]) === null || _listenersByParent_pid === void 0 || _listenersByParent_pid.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn function() {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(function() {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nvar shouldSubscribeToTheme = function(r, cascadeOnChange) {\n\tvar _r_keys_current, _r_props_needsUpdate, _r_props;\n\treturn Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || ((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || ((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props)));\n};\nfunction cleanupThemeSubscription(r) {\n\tvar _r_unsubscribe;\n\t(_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate;\n\tvar { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tvar local = localStates.get(id);\n\tvar parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tvar isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting(\"fastSchemeChange\") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);\n\tvar allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);\n\tvar canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);\n\tvar needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);\n\tvar [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tvar next = nextRaw;\n\tif (props._themeUpdate && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {\n\t\tvar _states_get;\n\t\tvar parentTheme = ((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme;\n\t\tvar merged = props._themeUpdate.getTheme(parentTheme, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState === null || parentState === void 0 ? void 0 : parentState.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nvar getNextState = function(lastState, props, propsKey) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;\n\tvar parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tthemes || (themes = getConfig().themes);\n\tvar name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar isSameAsParent = Boolean(parentState && (!name || name === parentState.name));\n\tvar shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name)));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tvar _ref, _ref1;\n\t\tvar next = (_ref1 = (_ref = lastState !== null && lastState !== void 0 ? lastState : parentState) !== null && _ref !== void 0 ? _ref : rootThemeState) !== null && _ref1 !== void 0 ? _ref1 : {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tvar scheme = getScheme(name);\n\tvar _parentState_inverses;\n\tvar parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;\n\tvar isInverse = Boolean(parentState && scheme !== parentState.scheme);\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState === null || parentState === void 0 ? void 0 : parentState.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\treturn [!(pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name), nextState];\n};\nfunction scheduleUpdate(id) {\n\tvar queue = [id];\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tvar children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childId = _step.value;\n\t\t\t\t\tif (!visited.has(childId)) {\n\t\t\t\t\t\tvisited.add(childId);\n\t\t\t\t\t\tqueue.push(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach(function(childId2) {\n\t\tvar _allListeners_get;\n\t\t(_allListeners_get = allListeners.get(childId2)) === null || _allListeners_get === void 0 || _allListeners_get();\n\t});\n}\nvar validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName() {\n\tvar parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\", props = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tvar { name } = props;\n\tvar cacheKey = `${parentName}|${name || \"\"}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tvar cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tvar result = resolveThemeName(parentName, name !== null && name !== void 0 ? name : void 0, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nvar getThemeNameCacheSize = function() {\n\treturn themeNameCache.size;\n};\nfunction resolveThemeName(parentName, name, themes2) {\n\tvar forceUpdate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (var i = parentParts.length; i >= 0; i--) {\n\t\t\tvar base = parentParts.slice(0, i).join(\"_\");\n\t\t\tvar potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nvar getPropsKey = function(param) {\n\tvar { name, forceClassName, _themeUpdate } = param;\n\treturn `${name || \"\"}${forceClassName || \"\"}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" in props;\n};\n\nexport { ThemeStateContext, forceUpdateThemes, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, getThemeUpdateLayer, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";;;;;;AAKA,IAAI,oBAAoB,cAAc,EAAE;AACxC,IAAI,+BAA+B,IAAI,IAAI;AAC3C,IAAI,oBAAoB,CAAC;AACzB,IAAI,kCAAkC,IAAI,QAAQ;AAClD,IAAI,2BAA2B,IAAI,QAAQ;AAC3C,IAAI,gCAAgC,IAAI,IAAI;AAC5C,IAAI,yBAAyB,IAAI,IAAI;AACrC,IAAI,8BAA8B,IAAI,IAAI;AAC1C,IAAI,cAAc;AAClB,IAAI,oBAAoB,WAAW;CAClC;CACA,cAAc;CACd,aAAa,QAAQ,SAAS,IAAI;EACjC,OAAO,GAAG;CACX,CAAC;CACD,cAAc;AACf;AACA,IAAI,gBAAgB,SAAS,IAAI;CAChC,OAAO,OAAO,IAAI,EAAE;AACrB;AACA,IAAI,oCAAoC,IAAI,IAAI;AAChD,IAAI,uCAAuC,IAAI,IAAI;AACnD,IAAI,sBAAsB,SAAS,IAAI;CACtC,OAAO,kBAAkB,IAAI,EAAE;AAChC;AACA,IAAI,yBAAyB,SAAS,IAAI;CACzC,OAAO,qBAAqB,IAAI,EAAE;AACnC;AACA,IAAI,6BAA6B,WAAW;CAC3C,OAAO;EACN,QAAQ,kBAAkB;EAC1B,SAAS,qBAAqB;CAC/B;AACD;AACA,IAAI,6BAA6B,SAAS,IAAI,UA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gBAAgB,UAAU,IAAI;EAClC,IAAI,iBAAiB,QAAQ,SAAS,QAAQ;EAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,KAAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,IAAI,OAAO,YAAY,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;GAC3C,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC3C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,CAAC,aAAa,QAAQ,OAAO;CACzE,OAAO;AACR;AACA,IAAI,cAAc,SAAS,OAAO;CACjC,IAAI,EAAE,MAAM,gBAAgB,iBAAiB;CAC7C,OAAO,GAAG,QAAQ,KAAK,kBAAkB,MAAM,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ;AACjI;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,oBAAoB,SAAS,kBAAkB;AAC1E"}
1
+ {"version":3,"file":"useThemeState.native.js","names":[],"sources":["esm/hooks/useThemeState.native.js"],"sourcesContent":["import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getThemeScheme } from \"@tamagui/helpers\";\nimport { getConfig, getSetting } from \"../config\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\nimport { getAuthoredThemeScheme } from \"../helpers/themes\";\n\nvar ThemeStateContext = createContext(\"\");\nvar allListeners = /* @__PURE__ */ new Map();\nvar listenersByParent = {};\nvar HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nvar HadTheme = /* @__PURE__ */ new WeakMap();\nvar PendingUpdate = /* @__PURE__ */ new Map();\nvar states = /* @__PURE__ */ new Map();\nvar shouldForce = false;\nvar forceUpdateThemes = function() {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach(function(cb) {\n\t\treturn cb();\n\t});\n\tshouldForce = false;\n};\nvar getThemeState = function(id) {\n\treturn states.get(id);\n};\nvar themeUpdateLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getThemeUpdateLayer = function(id) {\n\treturn themeUpdateLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: themeUpdateLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.delete(id);\n};\nvar cacheVersion = 0;\nvar themeNameCache = /* @__PURE__ */ new Map();\nvar themeNameCacheVer = -1;\nvar themes = null;\nvar rootThemeState = null;\nvar getRootThemeState = function() {\n\treturn rootThemeState;\n};\nvar getThemeBaseName = function(name) {\n\treturn name.replace(/^(light|dark)_/, \"\");\n};\nvar incReducer = function(c) {\n\treturn c + 1;\n};\nvar useThemeState = function(props) {\n\t\"use no memo\";\n\tvar isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar _props__themeUpdate;\n\tvar _ref;\n\tvar { disable } = props;\n\tvar parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tvar id = useId();\n\tvar propsKey = `${props.name || \"\"}${props.forceClassName || \"\"}${((_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.key) || \"\"}`;\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar r = (_ref = useRef(null)).current || (_ref.current = {\n\t\tid,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t});\n\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.schemeKeys = schemeKeys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tvar [, forceUpdate] = useReducer(incReducer, 0);\n\tvar state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\tuseEffect(function() {\n\t\tvar renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tr.state = r.lastSnap;\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedTo !== r.parentId) {\n\t\t\tvar _r_unsubscribe;\n\t\t\t(_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);\n\t\t}\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tvar _listenersByParent, _pid;\n\t\t\t\tvar pid = r.parentId;\n\t\t\t\tvar sid = r.id;\n\t\t\t\tvar cb = function(forced) {\n\t\t\t\t\tvar next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tvar _r_props_nativeUpdate, _r_props;\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && ((_r_props_nativeUpdate = (_r_props = r.props).nativeUpdate) === null || _r_props_nativeUpdate === void 0 ? void 0 : _r_props_nativeUpdate.call(_r_props, next))) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t((_listenersByParent = listenersByParent)[_pid = pid] || (_listenersByParent[_pid] = /* @__PURE__ */ new Set())).add(sid);\n\t\t\t\tallListeners.set(sid, function() {\n\t\t\t\t\tvar forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedTo = pid;\n\t\t\t\tr.unsubscribe = function() {\n\t\t\t\t\tvar _listenersByParent_pid;\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\t(_listenersByParent_pid = listenersByParent[pid]) === null || _listenersByParent_pid === void 0 || _listenersByParent_pid.delete(sid);\n\t\t\t\t\tr.state = void 0;\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedTo = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) {\n\t\t\tvar _r_unsubscribe1;\n\t\t\t(_r_unsubscribe1 = r.unsubscribe) === null || _r_unsubscribe1 === void 0 || _r_unsubscribe1.call(r);\n\t\t}\n\t\treturn function() {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(function() {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nvar shouldSubscribeToTheme = function(r, cascadeOnChange) {\n\tvar _r_keys_current, _r_props_needsUpdate, _r_props;\n\treturn Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || ((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || ((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props)));\n};\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) r.unsubscribe();\n\telse {\n\t\tr.state = void 0;\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate;\n\tvar { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r;\n\tvar schemeKeys = r.schemeKeys;\n\tvar local = r.state;\n\tvar parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._parentSchemeAuthored === parentState.schemeAuthored && local._propsKey === propsKey) return local;\n\t}\n\tvar isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting(\"fastSchemeChange\") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);\n\tvar canSkipForSchemeChange = Boolean(isSchemeOnlyChange && ((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);\n\tvar needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);\n\tvar [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tvar next = nextRaw;\n\tif (props._themeUpdate && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {\n\t\tvar _states_get;\n\t\tvar parentTheme = ((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme;\n\t\tvar merged = props._themeUpdate.getTheme(parentTheme, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tr.state = local;\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState === null || parentState === void 0 ? void 0 : parentState.name;\n\tlocal._parentSchemeAuthored = parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nvar getNextState = function(lastState, props, propsKey) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;\n\tvar parentState = states.get(parentId);\n\tif (props.passThrough) return [false, parentState || lastState || { name: \"\" }];\n\tthemes || (themes = getConfig().themes);\n\tvar name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar authoredName = props.name;\n\tvar parentSchemeAuthored = !!(parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored);\n\tvar schemeAuthored = isRoot ? !!props.forceClassName : parentSchemeAuthored || !!(authoredName && getThemeScheme(authoredName) && authoredName in themes);\n\tvar intentChanged = schemeAuthored !== parentSchemeAuthored;\n\tvar resolvedName = name || (parentState === null || parentState === void 0 ? void 0 : parentState.name);\n\tvar sameAsLast = lastState && lastState.name === resolvedName && !!lastState.schemeAuthored === schemeAuthored;\n\tvar isSameAsParent = Boolean(parentState && resolvedName === parentState.name && !intentChanged);\n\tvar shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name) || !!(lastState === null || lastState === void 0 ? void 0 : lastState.schemeAuthored) !== schemeAuthored));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && sameAsLast) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!resolvedName) {\n\t\tvar _ref, _ref1;\n\t\tvar next = (_ref1 = (_ref = lastState !== null && lastState !== void 0 ? lastState : parentState) !== null && _ref !== void 0 ? _ref : rootThemeState) !== null && _ref1 !== void 0 ? _ref1 : {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tvar scheme = getAuthoredThemeScheme(themes[resolvedName]) || getThemeScheme(resolvedName);\n\tvar _parentState_inverses;\n\tvar parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;\n\tvar isInverse = Boolean(parentState && scheme !== parentState.scheme);\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname: resolvedName,\n\t\ttheme: themes[resolvedName],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState === null || parentState === void 0 ? void 0 : parentState.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tschemeAuthored,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\treturn [pendingUpdate === \"force\" || !sameAsLast, nextState];\n};\nfunction scheduleUpdate(id) {\n\tvar queue = [id];\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tvar children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childId = _step.value;\n\t\t\t\t\tif (!visited.has(childId)) {\n\t\t\t\t\t\tvisited.add(childId);\n\t\t\t\t\t\tqueue.push(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach(function(childId2) {\n\t\tvar _allListeners_get;\n\t\t(_allListeners_get = allListeners.get(childId2)) === null || _allListeners_get === void 0 || _allListeners_get();\n\t});\n}\nfunction getNewThemeName() {\n\tvar parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\", props = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tvar { name } = props;\n\tvar cacheKey = `${parentName}|${name || \"\"}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tvar cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tvar result = resolveThemeName(parentName, name !== null && name !== void 0 ? name : void 0, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nvar getThemeNameCacheSize = function() {\n\treturn themeNameCache.size;\n};\nfunction resolveThemeName(parentName, name, themes2) {\n\tvar forceUpdate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = getThemeScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (var i = parentParts.length; i >= 0; i--) {\n\t\t\tvar base = parentParts.slice(0, i).join(\"_\");\n\t\t\tvar potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && found !== \"light\" && found !== \"dark\") return null;\n\treturn found;\n}\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" in props;\n};\n\nexport { ThemeStateContext, forceUpdateThemes, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, getThemeUpdateLayer, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";;;;;;;;AAOA,IAAI,oBAAoB,cAAc,EAAE;AACxC,IAAI,+BAA+B,IAAI,IAAI;AAC3C,IAAI,oBAAoB,CAAC;AACzB,IAAI,kCAAkC,IAAI,QAAQ;AAClD,IAAI,2BAA2B,IAAI,QAAQ;AAC3C,IAAI,g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C3C,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC3C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,UAAU,WAAW,UAAU,QAAQ,OAAO;CAC1F,OAAO;AACR;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,oBAAoB,SAAS,kBAAkB;AAC1E"}
package/dist/esm/index.js CHANGED
@@ -20,9 +20,12 @@ import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.mjs";
20
20
  import { splitStyleProps } from "./helpers/splitStyleProps.mjs";
21
21
  import { normalizeColor } from "./helpers/normalizeColor.mjs";
22
22
  import { normalizeStyle } from "./helpers/normalizeStyle.mjs";
23
+ import { resolveTextMetrics } from "./helpers/nativeTextMetrics.mjs";
24
+ import { defaultSizing, resolveSizing } from "./helpers/resolveSizing.mjs";
23
25
  import { containsThemeRef, themeRefKey } from "./helpers/themeRef.mjs";
24
26
  import { getStyleTags } from "./helpers/wrapStyleTags.mjs";
25
27
  import { createFont } from "./createFont.mjs";
28
+ import { fluid } from "./helpers/fluid.mjs";
26
29
  import { createChangeEventDetails } from "./eventDetails.mjs";
27
30
  import { createStyledHOC } from "./createStyledHOC.mjs";
28
31
  import { createShorthands } from "./createShorthands.mjs";
@@ -62,4 +65,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
62
65
  import { useEvent, useGet } from "@tamagui/use-event";
63
66
  import { hooks, setupHooks } from "./setupHooks.mjs";
64
67
 
65
- export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
68
+ export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, defaultSizing, fluid, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveSizing, resolveTextMetrics, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
@@ -20,9 +20,12 @@ import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.mjs";
20
20
  import { splitStyleProps } from "./helpers/splitStyleProps.mjs";
21
21
  import { normalizeColor } from "./helpers/normalizeColor.mjs";
22
22
  import { normalizeStyle } from "./helpers/normalizeStyle.mjs";
23
+ import { resolveTextMetrics } from "./helpers/nativeTextMetrics.mjs";
24
+ import { defaultSizing, resolveSizing } from "./helpers/resolveSizing.mjs";
23
25
  import { containsThemeRef, themeRefKey } from "./helpers/themeRef.mjs";
24
26
  import { getStyleTags } from "./helpers/wrapStyleTags.mjs";
25
27
  import { createFont } from "./createFont.mjs";
28
+ import { fluid } from "./helpers/fluid.mjs";
26
29
  import { createChangeEventDetails } from "./eventDetails.mjs";
27
30
  import { createStyledHOC } from "./createStyledHOC.mjs";
28
31
  import { createShorthands } from "./createShorthands.mjs";
@@ -62,4 +65,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
62
65
  import { useEvent, useGet } from "@tamagui/use-event";
63
66
  import { hooks, setupHooks } from "./setupHooks.mjs";
64
67
 
65
- export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
68
+ export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, defaultSizing, fluid, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveSizing, resolveTextMetrics, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
@@ -20,9 +20,12 @@ import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.native.js";
20
20
  import { splitStyleProps } from "./helpers/splitStyleProps.native.js";
21
21
  import { normalizeColor } from "./helpers/normalizeColor.native.js";
22
22
  import { normalizeStyle } from "./helpers/normalizeStyle.native.js";
23
+ import { resolveTextMetrics } from "./helpers/nativeTextMetrics.native.js";
24
+ import { defaultSizing, resolveSizing } from "./helpers/resolveSizing.native.js";
23
25
  import { containsThemeRef, themeRefKey } from "./helpers/themeRef.native.js";
24
26
  import { getStyleTags } from "./helpers/wrapStyleTags.native.js";
25
27
  import { createFont } from "./createFont.native.js";
28
+ import { fluid } from "./helpers/fluid.native.js";
26
29
  import { createChangeEventDetails } from "./eventDetails.native.js";
27
30
  import { createStyledHOC } from "./createStyledHOC.native.js";
28
31
  import { createShorthands } from "./createShorthands.native.js";
@@ -62,4 +65,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
62
65
  import { useEvent, useGet } from "@tamagui/use-event";
63
66
  import { hooks, setupHooks } from "./setupHooks.native.js";
64
67
 
65
- export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
68
+ export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, defaultSizing, fluid, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveSizing, resolveTextMetrics, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
@@ -1,12 +1,13 @@
1
1
  import { stylePropsUnitless } from "@tamagui/helpers";
2
2
  import { createComponent } from "./createComponent.mjs";
3
3
  import { createVariables as createVariables$1 } from "./createVariables.mjs";
4
+ import { html } from "./dom/html.mjs";
4
5
  import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.mjs";
5
6
  import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.mjs";
6
7
  import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.mjs";
7
8
  import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.mjs";
8
9
  import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.mjs";
9
- import { ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.mjs";
10
+ import { copyAuthoredThemeScheme as copyAuthoredThemeScheme$1, ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.mjs";
10
11
  import { transformsToString as transformsToString$1 } from "./helpers/transformsToString.mjs";
11
12
  import { parseFont as parseFont$1, registerFontVariables as registerFontVariables$1 } from "./insertFont.mjs";
12
13
  import { createTamagui as createTamagui$1 } from "./createTamagui.mjs";
@@ -16,7 +17,7 @@ import { useThemeWithState as useThemeWithState$1 } from "./hooks/useTheme.mjs";
16
17
  import { TamaguiProvider as TamaguiProvider$1 } from "./views/TamaguiProvider.mjs";
17
18
  import { textStaticConfig } from "./views/Text.mjs";
18
19
  import { viewStaticConfig } from "./views/View.mjs";
19
- import { regularStyleFrontend } from "./helpers/styleFrontend.mjs";
20
+ import { mergeFrontendCondition, regularStyleFrontend } from "./helpers/styleFrontend.mjs";
20
21
 
21
22
  const createVariables = createVariables$1;
22
23
  const parseFont = parseFont$1;
@@ -26,6 +27,7 @@ const getThemeCSSRules = getThemeCSSRules$1;
26
27
  const normalizeValueWithProperty = normalizeValueWithProperty$1;
27
28
  const proxyThemeToParents = proxyThemeToParents$1;
28
29
  const ensureThemeVariable = ensureThemeVariable$1;
30
+ const copyAuthoredThemeScheme = copyAuthoredThemeScheme$1;
29
31
  const transformsToString = transformsToString$1;
30
32
  const styleToCSS = styleToCSS$1;
31
33
  const useThemeWithState = useThemeWithState$1;
@@ -60,6 +62,23 @@ function createFrontendViews(frontend) {
60
62
  })
61
63
  };
62
64
  }
65
+ function createFrontendHTML(frontend) {
66
+ const out = {};
67
+ for (const tag in html) {
68
+ const source = html[tag];
69
+ if (!source.staticConfig) {
70
+ out[tag] = source;
71
+ continue;
72
+ }
73
+ const rebuilt = createComponent({
74
+ ...source.staticConfig,
75
+ styleFrontend: frontend,
76
+ displayName: tag
77
+ });
78
+ out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;
79
+ }
80
+ return out;
81
+ }
63
82
 
64
- export { TamaguiProvider, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
83
+ export { TamaguiProvider, copyAuthoredThemeScheme, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
65
84
  //# sourceMappingURL=internal-runtime.mjs.map