@tamagui/react-native-web-internals 2.7.7 → 3.0.0-beta.1097.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 (296) hide show
  1. package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +150 -136
  2. package/dist/cjs/StyleSheet/compiler/hash.cjs +14 -18
  3. package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +20 -24
  4. package/dist/cjs/StyleSheet/compiler/index.cjs +294 -321
  5. package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +19 -23
  6. package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +31 -35
  7. package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +26 -38
  8. package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +36 -40
  9. package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +107 -111
  10. package/dist/cjs/StyleSheet/dom/index.cjs +69 -72
  11. package/dist/cjs/StyleSheet/index.cjs +32 -34
  12. package/dist/cjs/StyleSheet/preprocess.cjs +73 -94
  13. package/dist/cjs/StyleSheet/validate.cjs +71 -75
  14. package/dist/cjs/TextAncestorContext.cjs +14 -18
  15. package/dist/cjs/colorProps.cjs +24 -28
  16. package/dist/cjs/index.cjs +48 -50
  17. package/dist/cjs/modules/AccessibilityUtil/index.cjs +17 -21
  18. package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +14 -18
  19. package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +45 -49
  20. package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +33 -39
  21. package/dist/cjs/modules/AssetRegistry/index.cjs +17 -19
  22. package/dist/cjs/modules/ImageLoader/index.cjs +134 -141
  23. package/dist/cjs/modules/InteractionManager.cjs +211 -219
  24. package/dist/cjs/modules/Platform/index.cjs +17 -21
  25. package/dist/cjs/modules/TextInputState/index.cjs +54 -58
  26. package/dist/cjs/modules/UIManager/index.cjs +45 -51
  27. package/dist/cjs/modules/canUseDOM.cjs +14 -18
  28. package/dist/cjs/modules/createDOMProps/index.cjs +284 -359
  29. package/dist/cjs/modules/createEventHandle/index.cjs +56 -62
  30. package/dist/cjs/modules/dismissKeyboard/index.cjs +15 -19
  31. package/dist/cjs/modules/forwardedProps/index.cjs +127 -130
  32. package/dist/cjs/modules/getBoundingClientRect/index.cjs +21 -25
  33. package/dist/cjs/modules/invariant.cjs +25 -27
  34. package/dist/cjs/modules/isSelectionValid/index.cjs +21 -25
  35. package/dist/cjs/modules/isWebColor/index.cjs +14 -18
  36. package/dist/cjs/modules/mergeRefs/index.cjs +30 -34
  37. package/dist/cjs/modules/modality/index.cjs +130 -134
  38. package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +24 -28
  39. package/dist/cjs/modules/normalizeColor/index.cjs +27 -31
  40. package/dist/cjs/modules/pick/index.cjs +21 -27
  41. package/dist/cjs/modules/processColor/index.cjs +27 -36
  42. package/dist/cjs/modules/requestIdleCallback/index.cjs +27 -29
  43. package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +38 -42
  44. package/dist/cjs/modules/setValueForStyles/index.cjs +27 -34
  45. package/dist/cjs/modules/unitlessNumbers/index.cjs +73 -75
  46. package/dist/cjs/modules/useElementLayout/index.cjs +23 -31
  47. package/dist/cjs/modules/useEvent/index.cjs +39 -43
  48. package/dist/cjs/modules/useHover/index.cjs +112 -118
  49. package/dist/cjs/modules/useLayoutEffect/index.cjs +17 -26
  50. package/dist/cjs/modules/useLocale/index.cjs +32 -43
  51. package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +65 -76
  52. package/dist/cjs/modules/useMergeRefs/index.cjs +18 -29
  53. package/dist/cjs/modules/usePlatformMethods/index.cjs +23 -30
  54. package/dist/cjs/modules/useStable/index.cjs +23 -32
  55. package/dist/cjs/styleTypes.cjs +9 -11
  56. package/dist/cjs/types.cjs +9 -11
  57. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +137 -119
  58. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -1
  59. package/dist/esm/StyleSheet/compiler/hash.mjs +2 -2
  60. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +7 -6
  61. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -1
  62. package/dist/esm/StyleSheet/compiler/index.mjs +279 -302
  63. package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -1
  64. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +7 -5
  65. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -1
  66. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +19 -17
  67. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -1
  68. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +14 -20
  69. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -1
  70. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +24 -22
  71. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -1
  72. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +94 -93
  73. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -1
  74. package/dist/esm/StyleSheet/dom/index.mjs +57 -54
  75. package/dist/esm/StyleSheet/dom/index.mjs.map +1 -1
  76. package/dist/esm/StyleSheet/index.mjs +18 -17
  77. package/dist/esm/StyleSheet/index.mjs.map +1 -1
  78. package/dist/esm/StyleSheet/preprocess.mjs +58 -75
  79. package/dist/esm/StyleSheet/preprocess.mjs.map +1 -1
  80. package/dist/esm/StyleSheet/validate.mjs +58 -57
  81. package/dist/esm/StyleSheet/validate.mjs.map +1 -1
  82. package/dist/esm/TextAncestorContext.mjs +2 -0
  83. package/dist/esm/TextAncestorContext.mjs.map +1 -1
  84. package/dist/esm/colorProps.mjs +11 -10
  85. package/dist/esm/colorProps.mjs.map +1 -1
  86. package/dist/esm/index.js +22 -15
  87. package/dist/esm/index.mjs +22 -15
  88. package/dist/esm/modules/AccessibilityUtil/index.mjs +5 -3
  89. package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -1
  90. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +2 -1
  91. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -1
  92. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +33 -31
  93. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -1
  94. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +20 -21
  95. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -1
  96. package/dist/esm/modules/AssetRegistry/index.mjs +3 -2
  97. package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -1
  98. package/dist/esm/modules/ImageLoader/index.mjs +120 -124
  99. package/dist/esm/modules/ImageLoader/index.mjs.map +1 -1
  100. package/dist/esm/modules/InteractionManager.mjs +199 -201
  101. package/dist/esm/modules/InteractionManager.mjs.map +1 -1
  102. package/dist/esm/modules/Platform/index.mjs +4 -3
  103. package/dist/esm/modules/Platform/index.mjs.map +1 -1
  104. package/dist/esm/modules/TextInputState/index.mjs +42 -40
  105. package/dist/esm/modules/TextInputState/index.mjs.map +1 -1
  106. package/dist/esm/modules/UIManager/index.mjs +33 -33
  107. package/dist/esm/modules/UIManager/index.mjs.map +1 -1
  108. package/dist/esm/modules/canUseDOM.mjs +1 -0
  109. package/dist/esm/modules/canUseDOM.mjs.map +1 -1
  110. package/dist/esm/modules/createDOMProps/index.mjs +271 -342
  111. package/dist/esm/modules/createDOMProps/index.mjs.map +1 -1
  112. package/dist/esm/modules/createEventHandle/index.mjs +44 -44
  113. package/dist/esm/modules/createEventHandle/index.mjs.map +1 -1
  114. package/dist/esm/modules/dismissKeyboard/index.mjs +3 -1
  115. package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -1
  116. package/dist/esm/modules/forwardedProps/index.mjs +104 -104
  117. package/dist/esm/modules/forwardedProps/index.mjs.map +1 -1
  118. package/dist/esm/modules/getBoundingClientRect/index.mjs +8 -7
  119. package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -1
  120. package/dist/esm/modules/invariant.mjs +11 -10
  121. package/dist/esm/modules/invariant.mjs.map +1 -1
  122. package/dist/esm/modules/isSelectionValid/index.mjs +8 -7
  123. package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -1
  124. package/dist/esm/modules/isWebColor/index.mjs +2 -1
  125. package/dist/esm/modules/isWebColor/index.mjs.map +1 -1
  126. package/dist/esm/modules/mergeRefs/index.mjs +17 -16
  127. package/dist/esm/modules/mergeRefs/index.mjs.map +1 -1
  128. package/dist/esm/modules/modality/index.mjs +115 -115
  129. package/dist/esm/modules/modality/index.mjs.map +1 -1
  130. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +11 -10
  131. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -1
  132. package/dist/esm/modules/normalizeColor/index.mjs +15 -13
  133. package/dist/esm/modules/normalizeColor/index.mjs.map +1 -1
  134. package/dist/esm/modules/pick/index.mjs +8 -9
  135. package/dist/esm/modules/pick/index.mjs.map +1 -1
  136. package/dist/esm/modules/processColor/index.mjs +12 -10
  137. package/dist/esm/modules/processColor/index.mjs.map +1 -1
  138. package/dist/esm/modules/requestIdleCallback/index.mjs +14 -12
  139. package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -1
  140. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +27 -25
  141. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -1
  142. package/dist/esm/modules/setValueForStyles/index.mjs +15 -16
  143. package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -1
  144. package/dist/esm/modules/unitlessNumbers/index.mjs +60 -57
  145. package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -1
  146. package/dist/esm/modules/useElementLayout/index.mjs +12 -14
  147. package/dist/esm/modules/useElementLayout/index.mjs.map +1 -1
  148. package/dist/esm/modules/useEvent/index.mjs +28 -26
  149. package/dist/esm/modules/useEvent/index.mjs.map +1 -1
  150. package/dist/esm/modules/useHover/index.mjs +101 -101
  151. package/dist/esm/modules/useHover/index.mjs.map +1 -1
  152. package/dist/esm/modules/useLayoutEffect/index.mjs +2 -0
  153. package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -1
  154. package/dist/esm/modules/useLocale/index.mjs +15 -17
  155. package/dist/esm/modules/useLocale/index.mjs.map +1 -1
  156. package/dist/esm/modules/useLocale/isLocaleRTL.mjs +52 -58
  157. package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -1
  158. package/dist/esm/modules/useMergeRefs/index.mjs +3 -3
  159. package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -1
  160. package/dist/esm/modules/usePlatformMethods/index.mjs +11 -12
  161. package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
  162. package/dist/esm/modules/useStable/index.mjs +8 -6
  163. package/dist/esm/modules/useStable/index.mjs.map +1 -1
  164. package/dist/esm/styleTypes.mjs +0 -2
  165. package/dist/esm/types.mjs +0 -2
  166. package/package.json +10 -10
  167. package/src/StyleSheet/compiler/index.tsx +2 -5
  168. package/src/StyleSheet/preprocess.tsx +1 -4
  169. package/src/modules/createDOMProps/index.tsx +8 -22
  170. package/src/modules/forwardedProps/index.tsx +0 -1
  171. package/src/modules/mergeRefs/index.tsx +1 -1
  172. package/src/modules/pick/index.tsx +2 -4
  173. package/src/modules/setValueForStyles/dangerousStyleValue.tsx +1 -1
  174. package/src/modules/setValueForStyles/index.tsx +0 -3
  175. package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -1
  176. package/types/StyleSheet/compiler/index.d.ts.map +1 -1
  177. package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -1
  178. package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -1
  179. package/types/StyleSheet/index.d.ts +15 -16
  180. package/types/StyleSheet/index.d.ts.map +1 -1
  181. package/types/StyleSheet/preprocess.d.ts +1 -1
  182. package/types/StyleSheet/preprocess.d.ts.map +1 -1
  183. package/types/colorProps.d.ts.map +1 -1
  184. package/types/modules/AccessibilityUtil/index.d.ts +6 -5
  185. package/types/modules/AccessibilityUtil/index.d.ts.map +1 -1
  186. package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -1
  187. package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -1
  188. package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -1
  189. package/types/modules/ImageLoader/index.d.ts +1 -1
  190. package/types/modules/ImageLoader/index.d.ts.map +1 -1
  191. package/types/modules/InteractionManager.d.ts +3 -3
  192. package/types/modules/InteractionManager.d.ts.map +1 -1
  193. package/types/modules/Platform/index.d.ts.map +1 -1
  194. package/types/modules/TextInputState/index.d.ts.map +1 -1
  195. package/types/modules/UIManager/index.d.ts +1 -6
  196. package/types/modules/UIManager/index.d.ts.map +1 -1
  197. package/types/modules/createDOMProps/index.d.ts.map +1 -1
  198. package/types/modules/forwardedProps/index.d.ts +70 -74
  199. package/types/modules/forwardedProps/index.d.ts.map +1 -1
  200. package/types/modules/getBoundingClientRect/index.d.ts.map +1 -1
  201. package/types/modules/isWebColor/index.d.ts.map +1 -1
  202. package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -1
  203. package/types/modules/normalizeColor/index.d.ts.map +1 -1
  204. package/types/modules/pick/index.d.ts.map +1 -1
  205. package/types/modules/processColor/index.d.ts.map +1 -1
  206. package/types/modules/requestIdleCallback/index.d.ts +3 -1
  207. package/types/modules/requestIdleCallback/index.d.ts.map +1 -1
  208. package/types/modules/setValueForStyles/index.d.ts.map +1 -1
  209. package/types/modules/unitlessNumbers/index.d.ts.map +1 -1
  210. package/types/modules/useLayoutEffect/index.d.ts +1 -1
  211. package/types/modules/useLayoutEffect/index.d.ts.map +1 -1
  212. package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +0 -265
  213. package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +0 -419
  214. package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +0 -160
  215. package/dist/cjs/StyleSheet/__tests__/index-test.cjs +0 -436
  216. package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +0 -121
  217. package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +0 -51
  218. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +0 -57
  219. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +0 -46
  220. package/dist/cjs/modules/Platform/__tests__/index-test.cjs +0 -56
  221. package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +0 -111
  222. package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +0 -177
  223. package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +0 -422
  224. package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +0 -48
  225. package/dist/cjs/modules/modality/__tests__/index-test.cjs +0 -59
  226. package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +0 -38
  227. package/dist/cjs/modules/processColor/__tests__/index-test.cjs +0 -85
  228. package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +0 -490
  229. package/dist/cjs/modules/useHover/__tests__/index-test.cjs +0 -382
  230. package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +0 -125
  231. package/dist/cjs/modules/useStable/__tests__/index-test.cjs +0 -122
  232. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +0 -242
  233. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +0 -1
  234. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +0 -420
  235. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +0 -1
  236. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +0 -137
  237. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +0 -1
  238. package/dist/esm/StyleSheet/__tests__/index-test.mjs +0 -413
  239. package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +0 -1
  240. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +0 -122
  241. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +0 -1
  242. package/dist/esm/StyleSheet/__tests__/validate-test.mjs +0 -52
  243. package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +0 -1
  244. package/dist/esm/StyleSheet/compiler/hash.mjs.map +0 -1
  245. package/dist/esm/index.js.map +0 -1
  246. package/dist/esm/index.mjs.map +0 -1
  247. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +0 -34
  248. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +0 -1
  249. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +0 -23
  250. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +0 -1
  251. package/dist/esm/modules/Platform/__tests__/index-test.mjs +0 -33
  252. package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +0 -1
  253. package/dist/esm/modules/UIManager/__tests__/index-test.mjs +0 -88
  254. package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +0 -1
  255. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +0 -154
  256. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +0 -1
  257. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +0 -399
  258. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +0 -1
  259. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +0 -25
  260. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +0 -1
  261. package/dist/esm/modules/modality/__tests__/index-test.mjs +0 -60
  262. package/dist/esm/modules/modality/__tests__/index-test.mjs.map +0 -1
  263. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +0 -15
  264. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +0 -1
  265. package/dist/esm/modules/processColor/__tests__/index-test.mjs +0 -62
  266. package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +0 -1
  267. package/dist/esm/modules/useEvent/__tests__/index-test.mjs +0 -467
  268. package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +0 -1
  269. package/dist/esm/modules/useHover/__tests__/index-test.mjs +0 -359
  270. package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +0 -1
  271. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +0 -102
  272. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +0 -1
  273. package/dist/esm/modules/useStable/__tests__/index-test.mjs +0 -99
  274. package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +0 -1
  275. package/dist/esm/styleTypes.mjs.map +0 -1
  276. package/dist/esm/types.mjs.map +0 -1
  277. package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +0 -236
  278. package/src/StyleSheet/__tests__/compiler-test.tsx +0 -426
  279. package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +0 -169
  280. package/src/StyleSheet/__tests__/index-test.tsx +0 -406
  281. package/src/StyleSheet/__tests__/preprocess-test.tsx +0 -107
  282. package/src/StyleSheet/__tests__/validate-test.tsx +0 -42
  283. package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +0 -44
  284. package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +0 -25
  285. package/src/modules/Platform/__tests__/index-test.tsx +0 -45
  286. package/src/modules/UIManager/__tests__/index-test.tsx +0 -87
  287. package/src/modules/createDOMProps/__tests__/index-test.tsx +0 -138
  288. package/src/modules/createEventHandle/__tests__/index-test.tsx +0 -459
  289. package/src/modules/mergeRefs/__tests__/index-test.tsx +0 -32
  290. package/src/modules/modality/__tests__/index-test.tsx +0 -66
  291. package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +0 -23
  292. package/src/modules/processColor/__tests__/index-test.tsx +0 -78
  293. package/src/modules/useEvent/__tests__/index-test.tsx +0 -511
  294. package/src/modules/useHover/__tests__/index-test.tsx +0 -342
  295. package/src/modules/useMergeRefs/__tests__/index-test.tsx +0 -91
  296. package/src/modules/useStable/__tests__/index-test.tsx +0 -101
@@ -1,30 +1,32 @@
1
- import { unitlessNumbers as isUnitlessNumber } from "../unitlessNumbers/index.mjs";
1
+ import { unitlessNumbers } from "../unitlessNumbers/index.mjs";
2
2
  import { normalizeValueWithProperty } from "../../StyleSheet/compiler/normalizeValueWithProperty.mjs";
3
+
3
4
  function dangerousStyleValue(name, value, isCustomProperty) {
4
- var isEmpty = value == null || typeof value === "boolean" || value === "";
5
- if (isEmpty) {
6
- return "";
7
- }
8
- if (typeof value === "object" && typeof value.__getValue === "function") {
9
- value = value.__getValue();
10
- }
11
- if (name === "transform" && Array.isArray(value)) {
12
- return value.map(t => {
13
- const key = Object.keys(t)[0];
14
- let val = t[key];
15
- if (typeof val === "object" && typeof val.__getValue === "function") {
16
- val = val.__getValue();
17
- }
18
- if (key === "matrix" || key === "matrix3d") {
19
- return `${key}(${val.join(",")})`;
20
- }
21
- return `${key}(${normalizeValueWithProperty(val, key)})`;
22
- }).join(" ");
23
- }
24
- if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
25
- return value + "px";
26
- }
27
- return ("" + value).trim();
5
+ var isEmpty = value == null || typeof value === "boolean" || value === "";
6
+ if (isEmpty) {
7
+ return "";
8
+ }
9
+ if (typeof value === "object" && typeof value.__getValue === "function") {
10
+ value = value.__getValue();
11
+ }
12
+ if (name === "transform" && Array.isArray(value)) {
13
+ return value.map((t) => {
14
+ const key = Object.keys(t)[0];
15
+ let val = t[key];
16
+ if (typeof val === "object" && typeof val.__getValue === "function") {
17
+ val = val.__getValue();
18
+ }
19
+ if (key === "matrix" || key === "matrix3d") {
20
+ return `${key}(${val.join(",")})`;
21
+ }
22
+ return `${key}(${normalizeValueWithProperty(val, key)})`;
23
+ }).join(" ");
24
+ }
25
+ if (!isCustomProperty && typeof value === "number" && value !== 0 && !unitlessNumbers[name]) {
26
+ return value + "px";
27
+ }
28
+ return ("" + value).trim();
28
29
  }
30
+
29
31
  export { dangerousStyleValue };
30
32
  //# sourceMappingURL=dangerousStyleValue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["unitlessNumbers","isUnitlessNumber","normalizeValueWithProperty","dangerousStyleValue","name","value","isCustomProperty","isEmpty","__getValue","Array","isArray","map","t","key","Object","keys","val","join","hasOwnProperty","trim"],"sources":["../../../../src/modules/setValueForStyles/dangerousStyleValue.tsx"],"sourcesContent":[null],"mappings":"AAYA,SAASA,eAAA,IAAmBC,gBAAA,QAAwB;AACpD,SAASC,0BAAA,QAAkC;AAWpC,SAASC,oBAAoBC,IAAA,EAAMC,KAAA,EAAOC,gBAAA,EAAkB;EAWjE,IAAIC,OAAA,GAAUF,KAAA,IAAS,QAAQ,OAAOA,KAAA,KAAU,aAAaA,KAAA,KAAU;EACvE,IAAIE,OAAA,EAAS;IACX,OAAO;EACT;EAGA,IAAI,OAAOF,KAAA,KAAU,YAAY,OAAOA,KAAA,CAAMG,UAAA,KAAe,YAAY;IACvEH,KAAA,GAAQA,KAAA,CAAMG,UAAA,CAAW;EAC3B;EAGA,IAAIJ,IAAA,KAAS,eAAeK,KAAA,CAAMC,OAAA,CAAQL,KAAK,GAAG;IAChD,OAAOA,KAAA,CACJM,GAAA,CAAKC,CAAA,IAAM;MACV,MAAMC,GAAA,GAAMC,MAAA,CAAOC,IAAA,CAAKH,CAAC,EAAE,CAAC;MAC5B,IAAII,GAAA,GAAMJ,CAAA,CAAEC,GAAG;MAEf,IAAI,OAAOG,GAAA,KAAQ,YAAY,OAAOA,GAAA,CAAIR,UAAA,KAAe,YAAY;QACnEQ,GAAA,GAAMA,GAAA,CAAIR,UAAA,CAAW;MACvB;MACA,IAAIK,GAAA,KAAQ,YAAYA,GAAA,KAAQ,YAAY;QAC1C,OAAO,GAAGA,GAAG,IAAIG,GAAA,CAAIC,IAAA,CAAK,GAAG,CAAC;MAChC;MACA,OAAO,GAAGJ,GAAG,IAAIX,0BAAA,CAA2Bc,GAAA,EAAKH,GAAG,CAAC;IACvD,CAAC,EACAI,IAAA,CAAK,GAAG;EACb;EAEA,IACE,CAACX,gBAAA,IACD,OAAOD,KAAA,KAAU,YACjBA,KAAA,KAAU,KACV,EAAEJ,gBAAA,CAAiBiB,cAAA,CAAed,IAAI,KAAKH,gBAAA,CAAiBG,IAAI,IAChE;IACA,OAAOC,KAAA,GAAQ;EACjB;EAEA,QAAQ,KAAKA,KAAA,EAAOc,IAAA,CAAK;AAC3B","ignoreList":[]}
1
+ {"version":3,"file":"dangerousStyleValue.js","names":["isUnitlessNumber"],"sources":["esm/modules/setValueForStyles/dangerousStyleValue.js"],"sourcesContent":["import { unitlessNumbers as isUnitlessNumber } from \"../unitlessNumbers/index\";\nimport { normalizeValueWithProperty } from \"../../StyleSheet/compiler/normalizeValueWithProperty\";\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n var isEmpty = value == null || typeof value === \"boolean\" || value === \"\";\n if (isEmpty) {\n return \"\";\n }\n if (typeof value === \"object\" && typeof value.__getValue === \"function\") {\n value = value.__getValue();\n }\n if (name === \"transform\" && Array.isArray(value)) {\n return value.map((t) => {\n const key = Object.keys(t)[0];\n let val = t[key];\n if (typeof val === \"object\" && typeof val.__getValue === \"function\") {\n val = val.__getValue();\n }\n if (key === \"matrix\" || key === \"matrix3d\") {\n return `${key}(${val.join(\",\")})`;\n }\n return `${key}(${normalizeValueWithProperty(val, key)})`;\n }).join(\" \");\n }\n if (!isCustomProperty && typeof value === \"number\" && value !== 0 && !isUnitlessNumber[name]) {\n return value + \"px\";\n }\n return (\"\" + value).trim();\n}\nexport {\n dangerousStyleValue\n};\n//# sourceMappingURL=dangerousStyleValue.js.map\n"],"mappings":";;;;AAEA,SAAS,oBAAoB,MAAM,OAAO,kBAAkB;CAC1D,IAAI,UAAU,SAAS,QAAQ,OAAO,UAAU,aAAa,UAAU;CACvE,IAAI,SAAS;EACX,OAAO;CACT;CACA,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,eAAe,YAAY;EACvE,QAAQ,MAAM,WAAW;CAC3B;CACA,IAAI,SAAS,eAAe,MAAM,QAAQ,KAAK,GAAG;EAChD,OAAO,MAAM,KAAK,MAAM;GACtB,MAAM,MAAM,OAAO,KAAK,CAAC,CAAC,CAAC;GAC3B,IAAI,MAAM,EAAE;GACZ,IAAI,OAAO,QAAQ,YAAY,OAAO,IAAI,eAAe,YAAY;IACnE,MAAM,IAAI,WAAW;GACvB;GACA,IAAI,QAAQ,YAAY,QAAQ,YAAY;IAC1C,OAAO,GAAG,IAAI,GAAG,IAAI,KAAK,GAAG,EAAE;GACjC;GACA,OAAO,GAAG,IAAI,GAAG,2BAA2B,KAAK,GAAG,EAAE;EACxD,CAAC,CAAC,CAAC,KAAK,GAAG;CACb;CACA,IAAI,CAAC,oBAAoB,OAAO,UAAU,YAAY,UAAU,KAAK,CAACA,gBAAiB,OAAO;EAC5F,OAAO,QAAQ;CACjB;CACA,QAAQ,KAAK,MAAK,CAAE,KAAK;AAC3B"}
@@ -1,21 +1,20 @@
1
1
  import { dangerousStyleValue } from "./dangerousStyleValue.mjs";
2
+
2
3
  function setValueForStyles(node, styles) {
3
- const style = node.style;
4
- for (let styleName in styles) {
5
- if (!styles.hasOwnProperty(styleName)) {
6
- continue;
7
- }
8
- const isCustomProperty = styleName.indexOf("--") === 0;
9
- const styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
10
- if (styleName === "float") {
11
- styleName = "cssFloat";
12
- }
13
- if (isCustomProperty) {
14
- style.setProperty(styleName, styleValue);
15
- } else {
16
- style[styleName] = styleValue;
17
- }
18
- }
4
+ const style = node.style;
5
+ for (let styleName in styles) {
6
+ const isCustomProperty = styleName.indexOf("--") === 0;
7
+ const styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
8
+ if (styleName === "float") {
9
+ styleName = "cssFloat";
10
+ }
11
+ if (isCustomProperty) {
12
+ style.setProperty(styleName, styleValue);
13
+ } else {
14
+ style[styleName] = styleValue;
15
+ }
16
+ }
19
17
  }
18
+
20
19
  export { setValueForStyles };
21
20
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["dangerousStyleValue","setValueForStyles","node","styles","style","styleName","hasOwnProperty","isCustomProperty","indexOf","styleValue","setProperty"],"sources":["../../../../src/modules/setValueForStyles/index.tsx"],"sourcesContent":[null],"mappings":"AAYA,SAASA,mBAAA,QAA2B;AAS7B,SAASC,kBAAkBC,IAAA,EAAMC,MAAA,EAAQ;EAC9C,MAAMC,KAAA,GAAQF,IAAA,CAAKE,KAAA;EACnB,SAASC,SAAA,IAAaF,MAAA,EAAQ;IAC5B,IAAI,CAACA,MAAA,CAAOG,cAAA,CAAeD,SAAS,GAAG;MACrC;IACF;IACA,MAAME,gBAAA,GAAmBF,SAAA,CAAUG,OAAA,CAAQ,IAAI,MAAM;IACrD,MAAMC,UAAA,GAAaT,mBAAA,CAAoBK,SAAA,EAAWF,MAAA,CAAOE,SAAS,GAAGE,gBAAgB;IACrF,IAAIF,SAAA,KAAc,SAAS;MACzBA,SAAA,GAAY;IACd;IACA,IAAIE,gBAAA,EAAkB;MACpBH,KAAA,CAAMM,WAAA,CAAYL,SAAA,EAAWI,UAAU;IACzC,OAAO;MACLL,KAAA,CAAMC,SAAS,IAAII,UAAA;IACrB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/modules/setValueForStyles/index.js"],"sourcesContent":["import { dangerousStyleValue } from \"./dangerousStyleValue\";\nfunction setValueForStyles(node, styles) {\n const style = node.style;\n for (let styleName in styles) {\n const isCustomProperty = styleName.indexOf(\"--\") === 0;\n const styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n if (styleName === \"float\") {\n styleName = \"cssFloat\";\n }\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\nexport {\n setValueForStyles\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,SAAS,kBAAkB,MAAM,QAAQ;CACvC,MAAM,QAAQ,KAAK;CACnB,KAAK,IAAI,aAAa,QAAQ;EAC5B,MAAM,mBAAmB,UAAU,QAAQ,IAAI,MAAM;EACrD,MAAM,aAAa,oBAAoB,WAAW,OAAO,YAAY,gBAAgB;EACrF,IAAI,cAAc,SAAS;GACzB,YAAY;EACd;EACA,IAAI,kBAAkB;GACpB,MAAM,YAAY,WAAW,UAAU;EACzC,OAAO;GACL,MAAM,aAAa;EACrB;CACF;AACF"}
@@ -1,64 +1,67 @@
1
1
  const unitlessNumbers = {
2
- animationIterationCount: true,
3
- aspectRatio: true,
4
- borderImageOutset: true,
5
- borderImageSlice: true,
6
- borderImageWidth: true,
7
- boxFlex: true,
8
- boxFlexGroup: true,
9
- boxOrdinalGroup: true,
10
- columnCount: true,
11
- flex: true,
12
- flexGrow: true,
13
- flexOrder: true,
14
- flexPositive: true,
15
- flexShrink: true,
16
- flexNegative: true,
17
- fontWeight: true,
18
- gap: true,
19
- columnGap: true,
20
- rowGap: true,
21
- gridRow: true,
22
- gridRowEnd: true,
23
- gridRowGap: true,
24
- gridRowStart: true,
25
- gridColumn: true,
26
- gridColumnEnd: true,
27
- gridColumnGap: true,
28
- gridColumnStart: true,
29
- lineClamp: true,
30
- opacity: true,
31
- order: true,
32
- orphans: true,
33
- tabSize: true,
34
- widows: true,
35
- zIndex: true,
36
- zoom: true,
37
- // SVG-related
38
- fillOpacity: true,
39
- floodOpacity: true,
40
- stopOpacity: true,
41
- strokeDasharray: true,
42
- strokeDashoffset: true,
43
- strokeMiterlimit: true,
44
- strokeOpacity: true,
45
- strokeWidth: true,
46
- // transform types
47
- scale: true,
48
- scaleX: true,
49
- scaleY: true,
50
- scaleZ: true,
51
- // RN properties
52
- shadowOpacity: true
2
+ animationIterationCount: true,
3
+ aspectRatio: true,
4
+ borderImageOutset: true,
5
+ borderImageSlice: true,
6
+ borderImageWidth: true,
7
+ boxFlex: true,
8
+ boxFlexGroup: true,
9
+ boxOrdinalGroup: true,
10
+ columnCount: true,
11
+ flex: true,
12
+ flexGrow: true,
13
+ flexOrder: true,
14
+ flexPositive: true,
15
+ flexShrink: true,
16
+ flexNegative: true,
17
+ fontWeight: true,
18
+ gap: true,
19
+ columnGap: true,
20
+ rowGap: true,
21
+ gridRow: true,
22
+ gridRowEnd: true,
23
+ gridRowGap: true,
24
+ gridRowStart: true,
25
+ gridColumn: true,
26
+ gridColumnEnd: true,
27
+ gridColumnGap: true,
28
+ gridColumnStart: true,
29
+ lineClamp: true,
30
+ opacity: true,
31
+ order: true,
32
+ orphans: true,
33
+ tabSize: true,
34
+ widows: true,
35
+ zIndex: true,
36
+ zoom: true,
37
+ fillOpacity: true,
38
+ floodOpacity: true,
39
+ stopOpacity: true,
40
+ strokeDasharray: true,
41
+ strokeDashoffset: true,
42
+ strokeMiterlimit: true,
43
+ strokeOpacity: true,
44
+ strokeWidth: true,
45
+ scale: true,
46
+ scaleX: true,
47
+ scaleY: true,
48
+ scaleZ: true,
49
+ shadowOpacity: true
53
50
  };
54
- const prefixes = ["ms", "Moz", "O", "Webkit"];
51
+ const prefixes = [
52
+ "ms",
53
+ "Moz",
54
+ "O",
55
+ "Webkit"
56
+ ];
55
57
  const prefixKey = (prefix, key) => {
56
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
58
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
57
59
  };
58
- Object.keys(unitlessNumbers).forEach(prop => {
59
- prefixes.forEach(prefix => {
60
- unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
61
- });
60
+ Object.keys(unitlessNumbers).forEach((prop) => {
61
+ prefixes.forEach((prefix) => {
62
+ unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
63
+ });
62
64
  });
65
+
63
66
  export { unitlessNumbers };
64
67
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["unitlessNumbers","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexOrder","flexPositive","flexShrink","flexNegative","fontWeight","gap","columnGap","rowGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","lineClamp","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","scale","scaleX","scaleY","scaleZ","shadowOpacity","prefixes","prefixKey","prefix","key","charAt","toUpperCase","substring","Object","keys","forEach","prop"],"sources":["../../../../src/modules/unitlessNumbers/index.tsx"],"sourcesContent":[null],"mappings":"AAUO,MAAMA,eAAA,GAAkB;EAC7BC,uBAAA,EAAyB;EACzBC,WAAA,EAAa;EACbC,iBAAA,EAAmB;EACnBC,gBAAA,EAAkB;EAClBC,gBAAA,EAAkB;EAClBC,OAAA,EAAS;EACTC,YAAA,EAAc;EACdC,eAAA,EAAiB;EACjBC,WAAA,EAAa;EACbC,IAAA,EAAM;EACNC,QAAA,EAAU;EACVC,SAAA,EAAW;EACXC,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,GAAA,EAAK;EACLC,SAAA,EAAW;EACXC,MAAA,EAAQ;EACRC,OAAA,EAAS;EACTC,UAAA,EAAY;EACZC,UAAA,EAAY;EACZC,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,aAAA,EAAe;EACfC,aAAA,EAAe;EACfC,eAAA,EAAiB;EACjBC,SAAA,EAAW;EACXC,OAAA,EAAS;EACTC,KAAA,EAAO;EACPC,OAAA,EAAS;EACTC,OAAA,EAAS;EACTC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,IAAA,EAAM;EAAA;EAENC,WAAA,EAAa;EACbC,YAAA,EAAc;EACdC,WAAA,EAAa;EACbC,eAAA,EAAiB;EACjBC,gBAAA,EAAkB;EAClBC,gBAAA,EAAkB;EAClBC,aAAA,EAAe;EACfC,WAAA,EAAa;EAAA;EAEbC,KAAA,EAAO;EACPC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EACRC,MAAA,EAAQ;EAAA;EAERC,aAAA,EAAe;AACjB;AAMA,MAAMC,QAAA,GAAW,CAAC,MAAM,OAAO,KAAK,QAAQ;AAC5C,MAAMC,SAAA,GAAYA,CAACC,MAAA,EAAgBC,GAAA,KAAgB;EACjD,OAAOD,MAAA,GAASC,GAAA,CAAIC,MAAA,CAAO,CAAC,EAAEC,WAAA,CAAY,IAAIF,GAAA,CAAIG,SAAA,CAAU,CAAC;AAC/D;AACAC,MAAA,CAAOC,IAAA,CAAKzD,eAAe,EAAE0D,OAAA,CAASC,IAAA,IAAS;EAC7CV,QAAA,CAASS,OAAA,CAASP,MAAA,IAAW;IAC3BnD,eAAA,CAAgBkD,SAAA,CAAUC,MAAA,EAAQQ,IAAI,CAAC,IAAI3D,eAAA,CAAgB2D,IAAI;EACjE,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/modules/unitlessNumbers/index.js"],"sourcesContent":["const unitlessNumbers = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gap: true,\n columnGap: true,\n rowGap: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowGap: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnGap: true,\n gridColumnStart: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true,\n // transform types\n scale: true,\n scaleX: true,\n scaleY: true,\n scaleZ: true,\n // RN properties\n shadowOpacity: true\n};\nconst prefixes = [\"ms\", \"Moz\", \"O\", \"Webkit\"];\nconst prefixKey = (prefix, key) => {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n};\nObject.keys(unitlessNumbers).forEach((prop) => {\n prefixes.forEach((prefix) => {\n unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];\n });\n});\nexport {\n unitlessNumbers\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,MAAM,kBAAkB;CACtB,yBAAyB;CACzB,aAAa;CACb,mBAAmB;CACnB,kBAAkB;CAClB,kBAAkB;CAClB,SAAS;CACT,cAAc;CACd,iBAAiB;CACjB,aAAa;CACb,MAAM;CACN,UAAU;CACV,WAAW;CACX,cAAc;CACd,YAAY;CACZ,cAAc;CACd,YAAY;CACZ,KAAK;CACL,WAAW;CACX,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,YAAY;CACZ,cAAc;CACd,YAAY;CACZ,eAAe;CACf,eAAe;CACf,iBAAiB;CACjB,WAAW;CACX,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,MAAM;CAEN,aAAa;CACb,cAAc;CACd,aAAa;CACb,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,eAAe;CACf,aAAa;CAEb,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,QAAQ;CAER,eAAe;AACjB;AACA,MAAM,WAAW;CAAC;CAAM;CAAO;CAAK;AAAQ;AAC5C,MAAM,aAAa,QAAQ,QAAQ;CACjC,OAAO,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,UAAU,CAAC;AAC/D;AACA,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS,SAAS;CAC7C,SAAS,SAAS,WAAW;EAC3B,gBAAgB,UAAU,QAAQ,IAAI,KAAK,gBAAgB;CAC7D,CAAC;AACH,CAAC"}
@@ -1,19 +1,17 @@
1
- import { enable, useElementLayout as useTamaguiElementLayout } from "@tamagui/use-element-layout";
1
+ import { enable, useElementLayout as useElementLayout$1 } from "@tamagui/use-element-layout";
2
2
  import { useEffect, useMemo } from "react";
3
+
3
4
  function useElementLayout(ref, onLayout) {
4
- const wrappedRef = useMemo(() => {
5
- return {
6
- current: {
7
- get host() {
8
- return ref.current;
9
- }
10
- }
11
- };
12
- }, [ref]);
13
- useEffect(() => {
14
- enable();
15
- }, []);
16
- return useTamaguiElementLayout(wrappedRef, onLayout);
5
+ const wrappedRef = useMemo(() => {
6
+ return { current: { get host() {
7
+ return ref.current;
8
+ } } };
9
+ }, [ref]);
10
+ useEffect(() => {
11
+ enable();
12
+ }, []);
13
+ return useElementLayout$1(wrappedRef, onLayout);
17
14
  }
15
+
18
16
  export { useElementLayout };
19
17
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["enable","useElementLayout","useTamaguiElementLayout","useEffect","useMemo","ref","onLayout","wrappedRef","current","host"],"sources":["../../../../src/modules/useElementLayout/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,SACEA,MAAA,EACAC,gBAAA,IAAoBC,uBAAA,QACf;AACP,SAAyBC,SAAA,EAAWC,OAAA,QAAe;AAG5C,SAASH,iBACdI,GAAA,EACAC,QAAA,EACA;EAEA,MAAMC,UAAA,GAAaH,OAAA,CAAQ,MAAM;IAC/B,OAAO;MACLI,OAAA,EAAS;QACP,IAAIC,KAAA,EAAO;UACT,OAAOJ,GAAA,CAAIG,OAAA;QACb;MACF;IACF;EACF,GAAG,CAACH,GAAG,CAAC;EAERF,SAAA,CAAU,MAAM;IACdH,MAAA,CAAO;EACT,GAAG,EAAE;EAEL,OAAOE,uBAAA,CAAwBK,UAAA,EAAYD,QAAQ;AACrD","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useTamaguiElementLayout"],"sources":["esm/modules/useElementLayout/index.js"],"sourcesContent":["import {\n enable,\n useElementLayout as useTamaguiElementLayout\n} from \"@tamagui/use-element-layout\";\nimport { useEffect, useMemo } from \"react\";\nfunction useElementLayout(ref, onLayout) {\n const wrappedRef = useMemo(() => {\n return {\n current: {\n get host() {\n return ref.current;\n }\n }\n };\n }, [ref]);\n useEffect(() => {\n enable();\n }, []);\n return useTamaguiElementLayout(wrappedRef, onLayout);\n}\nexport {\n useElementLayout\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAKA,SAAS,iBAAiB,KAAK,UAAU;CACvC,MAAM,aAAa,cAAc;EAC/B,OAAO,EACL,SAAS,EACP,IAAI,OAAO;GACT,OAAO,IAAI;EACb,EACF,EACF;CACF,GAAG,CAAC,GAAG,CAAC;CACR,gBAAgB;EACd,OAAO;CACT,GAAG,CAAC,CAAC;CACL,OAAOA,mBAAwB,YAAY,QAAQ;AACrD"}
@@ -1,32 +1,34 @@
1
1
  import { createEventHandle } from "../createEventHandle/index.mjs";
2
- import { useLayoutEffectImpl as useLayoutEffect } from "../useLayoutEffect/index.mjs";
2
+ import { useLayoutEffectImpl } from "../useLayoutEffect/index.mjs";
3
3
  import { useStable } from "../useStable/index.mjs";
4
+
4
5
  function useEvent(event, options) {
5
- const targetListeners = useStable(() => /* @__PURE__ */new Map());
6
- const addListener = useStable(() => {
7
- const addEventListener = createEventHandle(event, options);
8
- return (target, callback) => {
9
- const removeTargetListener = targetListeners.get(target);
10
- if (removeTargetListener != null) {
11
- removeTargetListener();
12
- }
13
- if (callback == null) {
14
- targetListeners.delete(target);
15
- }
16
- const removeEventListener = addEventListener(target, callback);
17
- targetListeners.set(target, removeEventListener);
18
- return removeEventListener;
19
- };
20
- });
21
- useLayoutEffect(() => {
22
- return () => {
23
- targetListeners.forEach(removeListener => {
24
- removeListener();
25
- });
26
- targetListeners.clear();
27
- };
28
- }, [targetListeners]);
29
- return addListener;
6
+ const targetListeners = useStable(() => /* @__PURE__ */ new Map());
7
+ const addListener = useStable(() => {
8
+ const addEventListener = createEventHandle(event, options);
9
+ return (target, callback) => {
10
+ const removeTargetListener = targetListeners.get(target);
11
+ if (removeTargetListener != null) {
12
+ removeTargetListener();
13
+ }
14
+ if (callback == null) {
15
+ targetListeners.delete(target);
16
+ }
17
+ const removeEventListener = addEventListener(target, callback);
18
+ targetListeners.set(target, removeEventListener);
19
+ return removeEventListener;
20
+ };
21
+ });
22
+ useLayoutEffectImpl(() => {
23
+ return () => {
24
+ targetListeners.forEach((removeListener) => {
25
+ removeListener();
26
+ });
27
+ targetListeners.clear();
28
+ };
29
+ }, [targetListeners]);
30
+ return addListener;
30
31
  }
32
+
31
33
  export { useEvent };
32
34
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEventHandle","useLayoutEffectImpl","useLayoutEffect","useStable","useEvent","event","options","targetListeners","Map","addListener","addEventListener","target","callback","removeTargetListener","get","delete","removeEventListener","set","forEach","removeListener","clear"],"sources":["../../../../src/modules/useEvent/index.tsx"],"sourcesContent":[null],"mappings":"AASA,SAASA,iBAAA,QAAyB;AAClC,SAASC,mBAAA,IAAuBC,eAAA,QAAuB;AACvD,SAASC,SAAA,QAAiB;AAiBnB,SAASC,SACdC,KAAA,EACAC,OAAA,EAIa;EACb,MAAMC,eAAA,GAAkBJ,SAAA,CAAU,MAAM,mBAAIK,GAAA,CAAI,CAAC;EAEjD,MAAMC,WAAA,GAAcN,SAAA,CAAU,MAAM;IAClC,MAAMO,gBAAA,GAAmBV,iBAAA,CAAkBK,KAAA,EAAOC,OAAO;IACzD,OAAO,CAACK,MAAA,EAAqBC,QAAA,KAAuB;MAClD,MAAMC,oBAAA,GAAuBN,eAAA,CAAgBO,GAAA,CAAIH,MAAM;MACvD,IAAIE,oBAAA,IAAwB,MAAM;QAChCA,oBAAA,CAAqB;MACvB;MACA,IAAID,QAAA,IAAY,MAAM;QACpBL,eAAA,CAAgBQ,MAAA,CAAOJ,MAAM;MAC/B;MACA,MAAMK,mBAAA,GAAsBN,gBAAA,CAAiBC,MAAA,EAAQC,QAAQ;MAC7DL,eAAA,CAAgBU,GAAA,CAAIN,MAAA,EAAQK,mBAAmB;MAC/C,OAAOA,mBAAA;IACT;EACF,CAAC;EAEDd,eAAA,CAAgB,MAAM;IACpB,OAAO,MAAM;MACXK,eAAA,CAAgBW,OAAA,CAASC,cAAA,IAAmB;QAC1CA,cAAA,CAAe;MACjB,CAAC;MACDZ,eAAA,CAAgBa,KAAA,CAAM;IACxB;EACF,GAAG,CAACb,eAAe,CAAC;EAEpB,OAAOE,WAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/modules/useEvent/index.js"],"sourcesContent":["import { createEventHandle } from \"../createEventHandle/index\";\nimport { useLayoutEffectImpl as useLayoutEffect } from \"../useLayoutEffect/index\";\nimport { useStable } from \"../useStable/index\";\nfunction useEvent(event, options) {\n const targetListeners = useStable(() => /* @__PURE__ */ new Map());\n const addListener = useStable(() => {\n const addEventListener = createEventHandle(event, options);\n return (target, callback) => {\n const removeTargetListener = targetListeners.get(target);\n if (removeTargetListener != null) {\n removeTargetListener();\n }\n if (callback == null) {\n targetListeners.delete(target);\n }\n const removeEventListener = addEventListener(target, callback);\n targetListeners.set(target, removeEventListener);\n return removeEventListener;\n };\n });\n useLayoutEffect(() => {\n return () => {\n targetListeners.forEach((removeListener) => {\n removeListener();\n });\n targetListeners.clear();\n };\n }, [targetListeners]);\n return addListener;\n}\nexport {\n useEvent\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;AAGA,SAAS,SAAS,OAAO,SAAS;CAChC,MAAM,kBAAkB,gCAAgC,IAAI,IAAI,CAAC;CACjE,MAAM,cAAc,gBAAgB;EAClC,MAAM,mBAAmB,kBAAkB,OAAO,OAAO;EACzD,QAAQ,QAAQ,aAAa;GAC3B,MAAM,uBAAuB,gBAAgB,IAAI,MAAM;GACvD,IAAI,wBAAwB,MAAM;IAChC,qBAAqB;GACvB;GACA,IAAI,YAAY,MAAM;IACpB,gBAAgB,OAAO,MAAM;GAC/B;GACA,MAAM,sBAAsB,iBAAiB,QAAQ,QAAQ;GAC7D,gBAAgB,IAAI,QAAQ,mBAAmB;GAC/C,OAAO;EACT;CACF,CAAC;CACD,0BAAsB;EACpB,aAAa;GACX,gBAAgB,SAAS,mBAAmB;IAC1C,eAAe;GACjB,CAAC;GACD,gBAAgB,MAAM;EACxB;CACF,GAAG,CAAC,eAAe,CAAC;CACpB,OAAO;AACT"}
@@ -1,115 +1,115 @@
1
1
  import { getModality } from "../modality/index.mjs";
2
2
  import { useEvent } from "../useEvent/index.mjs";
3
- import { useLayoutEffectImpl as useLayoutEffect } from "../useLayoutEffect/index.mjs";
3
+ import { useLayoutEffectImpl } from "../useLayoutEffect/index.mjs";
4
+
4
5
  const emptyObject = {};
5
- const opts = {
6
- passive: true
7
- };
6
+ const opts = { passive: true };
8
7
  const lockEventType = "react-gui:hover:lock";
9
8
  const unlockEventType = "react-gui:hover:unlock";
10
9
  const supportsPointerEvent = () => !!(typeof window !== "undefined" && window.PointerEvent != null);
11
10
  function dispatchCustomEvent(target, type, payload) {
12
- const event = document.createEvent("CustomEvent");
13
- const {
14
- bubbles = true,
15
- cancelable = true,
16
- detail
17
- } = payload || emptyObject;
18
- event.initCustomEvent(type, bubbles, cancelable, detail);
19
- target.dispatchEvent(event);
11
+ const event = document.createEvent("CustomEvent");
12
+ const { bubbles = true, cancelable = true, detail } = payload || emptyObject;
13
+ event.initCustomEvent(type, bubbles, cancelable, detail);
14
+ target.dispatchEvent(event);
20
15
  }
21
16
  function getPointerType(event) {
22
- const {
23
- pointerType
24
- } = event;
25
- return pointerType != null ? pointerType : getModality();
17
+ const { pointerType } = event;
18
+ return pointerType != null ? pointerType : getModality();
26
19
  }
27
20
  function useHover(targetRef, config) {
28
- const {
29
- contain,
30
- disabled,
31
- onHoverStart,
32
- onHoverChange,
33
- onHoverUpdate,
34
- onHoverEnd
35
- } = config;
36
- const canUsePE = supportsPointerEvent();
37
- const addMoveListener = useEvent(canUsePE ? "pointermove" : "mousemove", opts);
38
- const addEnterListener = useEvent(canUsePE ? "pointerenter" : "mouseenter", opts);
39
- const addLeaveListener = useEvent(canUsePE ? "pointerleave" : "mouseleave", opts);
40
- const addLockListener = useEvent(lockEventType, opts);
41
- const addUnlockListener = useEvent(unlockEventType, opts);
42
- useLayoutEffect(() => {
43
- const target = targetRef.current;
44
- if (target !== null) {
45
- const hoverEnd = function (e) {
46
- if (onHoverEnd != null) {
47
- onHoverEnd(e);
48
- }
49
- if (onHoverChange != null) {
50
- onHoverChange(false);
51
- }
52
- addMoveListener(target, null);
53
- addLeaveListener(target, null);
54
- };
55
- const leaveListener = function (e) {
56
- const target2 = targetRef.current;
57
- if (target2 != null && getPointerType(e) !== "touch") {
58
- if (contain) {
59
- dispatchCustomEvent(target2, unlockEventType);
60
- }
61
- hoverEnd(e);
62
- }
63
- };
64
- const moveListener = function (e) {
65
- if (getPointerType(e) !== "touch") {
66
- if (onHoverUpdate != null) {
67
- if (e.x == null) {
68
- e.x = e.clientX;
69
- }
70
- if (e.y == null) {
71
- e.y = e.clientY;
72
- }
73
- onHoverUpdate(e);
74
- }
75
- }
76
- };
77
- const hoverStart = function (e) {
78
- if (onHoverStart != null) {
79
- onHoverStart(e);
80
- }
81
- if (onHoverChange != null) {
82
- onHoverChange(true);
83
- }
84
- if (onHoverUpdate != null) {
85
- addMoveListener(target, !disabled ? moveListener : null);
86
- }
87
- addLeaveListener(target, !disabled ? leaveListener : null);
88
- };
89
- const enterListener = function (e) {
90
- const target2 = targetRef.current;
91
- if (target2 != null && getPointerType(e) !== "touch") {
92
- if (contain) {
93
- dispatchCustomEvent(target2, lockEventType);
94
- }
95
- hoverStart(e);
96
- const lockListener = function (lockEvent) {
97
- if (lockEvent.target !== target2) {
98
- hoverEnd(e);
99
- }
100
- };
101
- const unlockListener = function (lockEvent) {
102
- if (lockEvent.target !== target2) {
103
- hoverStart(e);
104
- }
105
- };
106
- addLockListener(target2, !disabled ? lockListener : null);
107
- addUnlockListener(target2, !disabled ? unlockListener : null);
108
- }
109
- };
110
- addEnterListener(target, !disabled ? enterListener : null);
111
- }
112
- }, [addEnterListener, addMoveListener, addLeaveListener, addLockListener, addUnlockListener, contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd, targetRef]);
21
+ const { contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd } = config;
22
+ const canUsePE = supportsPointerEvent();
23
+ const addMoveListener = useEvent(canUsePE ? "pointermove" : "mousemove", opts);
24
+ const addEnterListener = useEvent(canUsePE ? "pointerenter" : "mouseenter", opts);
25
+ const addLeaveListener = useEvent(canUsePE ? "pointerleave" : "mouseleave", opts);
26
+ const addLockListener = useEvent(lockEventType, opts);
27
+ const addUnlockListener = useEvent(unlockEventType, opts);
28
+ useLayoutEffectImpl(() => {
29
+ const target = targetRef.current;
30
+ if (target !== null) {
31
+ const hoverEnd = function(e) {
32
+ if (onHoverEnd != null) {
33
+ onHoverEnd(e);
34
+ }
35
+ if (onHoverChange != null) {
36
+ onHoverChange(false);
37
+ }
38
+ addMoveListener(target, null);
39
+ addLeaveListener(target, null);
40
+ };
41
+ const leaveListener = function(e) {
42
+ const target2 = targetRef.current;
43
+ if (target2 != null && getPointerType(e) !== "touch") {
44
+ if (contain) {
45
+ dispatchCustomEvent(target2, unlockEventType);
46
+ }
47
+ hoverEnd(e);
48
+ }
49
+ };
50
+ const moveListener = function(e) {
51
+ if (getPointerType(e) !== "touch") {
52
+ if (onHoverUpdate != null) {
53
+ if (e.x == null) {
54
+ e.x = e.clientX;
55
+ }
56
+ if (e.y == null) {
57
+ e.y = e.clientY;
58
+ }
59
+ onHoverUpdate(e);
60
+ }
61
+ }
62
+ };
63
+ const hoverStart = function(e) {
64
+ if (onHoverStart != null) {
65
+ onHoverStart(e);
66
+ }
67
+ if (onHoverChange != null) {
68
+ onHoverChange(true);
69
+ }
70
+ if (onHoverUpdate != null) {
71
+ addMoveListener(target, !disabled ? moveListener : null);
72
+ }
73
+ addLeaveListener(target, !disabled ? leaveListener : null);
74
+ };
75
+ const enterListener = function(e) {
76
+ const target2 = targetRef.current;
77
+ if (target2 != null && getPointerType(e) !== "touch") {
78
+ if (contain) {
79
+ dispatchCustomEvent(target2, lockEventType);
80
+ }
81
+ hoverStart(e);
82
+ const lockListener = function(lockEvent) {
83
+ if (lockEvent.target !== target2) {
84
+ hoverEnd(e);
85
+ }
86
+ };
87
+ const unlockListener = function(lockEvent) {
88
+ if (lockEvent.target !== target2) {
89
+ hoverStart(e);
90
+ }
91
+ };
92
+ addLockListener(target2, !disabled ? lockListener : null);
93
+ addUnlockListener(target2, !disabled ? unlockListener : null);
94
+ }
95
+ };
96
+ addEnterListener(target, !disabled ? enterListener : null);
97
+ }
98
+ }, [
99
+ addEnterListener,
100
+ addMoveListener,
101
+ addLeaveListener,
102
+ addLockListener,
103
+ addUnlockListener,
104
+ contain,
105
+ disabled,
106
+ onHoverStart,
107
+ onHoverChange,
108
+ onHoverUpdate,
109
+ onHoverEnd,
110
+ targetRef
111
+ ]);
113
112
  }
113
+
114
114
  export { useHover };
115
115
  //# sourceMappingURL=index.mjs.map