@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
@@ -5,46 +5,37 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
30
25
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
27
  var processColor_exports = {};
35
- __export(processColor_exports, {
36
- processColor: () => processColor
37
- });
28
+ __export(processColor_exports, { processColor: () => processColor });
38
29
  module.exports = __toCommonJS(processColor_exports);
39
30
  var import_normalize_css_color = __toESM(require("@tamagui/normalize-css-color"), 1);
40
- const processColor = color => {
41
- if (color === void 0 || color === null) {
42
- return color;
43
- }
44
- let int32Color = (0, import_normalize_css_color.default)(color);
45
- if (int32Color === void 0 || int32Color === null) {
46
- return void 0;
47
- }
48
- int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
49
- return int32Color;
50
- };
31
+ const processColor = (color) => {
32
+ if (color === void 0 || color === null) {
33
+ return color;
34
+ }
35
+ let int32Color = (0, import_normalize_css_color.default)(color);
36
+ if (int32Color === void 0 || int32Color === null) {
37
+ return void 0;
38
+ }
39
+ int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
40
+ return int32Color;
41
+ };
@@ -3,44 +3,42 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var requestIdleCallback_exports = {};
24
22
  __export(requestIdleCallback_exports, {
25
- cancelIdleCallback: () => cancelIdleCallback,
26
- requestIdleCallback: () => requestIdleCallback
23
+ cancelIdleCallback: () => cancelIdleCallback,
24
+ requestIdleCallback: () => requestIdleCallback
27
25
  });
28
26
  module.exports = __toCommonJS(requestIdleCallback_exports);
29
27
  var import_canUseDOM = require("../canUseDOM.cjs");
30
- const _requestIdleCallback = function (cb, options) {
31
- return setTimeout(() => {
32
- const start = Date.now();
33
- cb({
34
- didTimeout: false,
35
- timeRemaining() {
36
- return Math.max(0, 50 - (Date.now() - start));
37
- }
38
- });
39
- }, 1);
28
+ const _requestIdleCallback = function(cb, options) {
29
+ return setTimeout(() => {
30
+ const start = Date.now();
31
+ cb({
32
+ didTimeout: false,
33
+ timeRemaining() {
34
+ return Math.max(0, 50 - (Date.now() - start));
35
+ }
36
+ });
37
+ }, 1);
40
38
  };
41
- const _cancelIdleCallback = function (id) {
42
- clearTimeout(id);
39
+ const _cancelIdleCallback = function(id) {
40
+ clearTimeout(id);
43
41
  };
44
42
  const isSupported = import_canUseDOM.canUseDOM && typeof window.requestIdleCallback !== "undefined";
45
43
  const requestIdleCallback = isSupported ? window.requestIdleCallback : _requestIdleCallback;
46
- const cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;
44
+ const cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;
@@ -3,53 +3,49 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var dangerousStyleValue_exports = {};
24
- __export(dangerousStyleValue_exports, {
25
- dangerousStyleValue: () => dangerousStyleValue
26
- });
22
+ __export(dangerousStyleValue_exports, { dangerousStyleValue: () => dangerousStyleValue });
27
23
  module.exports = __toCommonJS(dangerousStyleValue_exports);
28
24
  var import_unitlessNumbers = require("../unitlessNumbers/index.cjs");
29
25
  var import_normalizeValueWithProperty = require("../../StyleSheet/compiler/normalizeValueWithProperty.cjs");
30
26
  function dangerousStyleValue(name, value, isCustomProperty) {
31
- var isEmpty = value == null || typeof value === "boolean" || value === "";
32
- if (isEmpty) {
33
- return "";
34
- }
35
- if (typeof value === "object" && typeof value.__getValue === "function") {
36
- value = value.__getValue();
37
- }
38
- if (name === "transform" && Array.isArray(value)) {
39
- return value.map(t => {
40
- const key = Object.keys(t)[0];
41
- let val = t[key];
42
- if (typeof val === "object" && typeof val.__getValue === "function") {
43
- val = val.__getValue();
44
- }
45
- if (key === "matrix" || key === "matrix3d") {
46
- return `${key}(${val.join(",")})`;
47
- }
48
- return `${key}(${(0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key)})`;
49
- }).join(" ");
50
- }
51
- if (!isCustomProperty && typeof value === "number" && value !== 0 && !(import_unitlessNumbers.unitlessNumbers.hasOwnProperty(name) && import_unitlessNumbers.unitlessNumbers[name])) {
52
- return value + "px";
53
- }
54
- return ("" + value).trim();
55
- }
27
+ var isEmpty = value == null || typeof value === "boolean" || value === "";
28
+ if (isEmpty) {
29
+ return "";
30
+ }
31
+ if (typeof value === "object" && typeof value.__getValue === "function") {
32
+ value = value.__getValue();
33
+ }
34
+ if (name === "transform" && Array.isArray(value)) {
35
+ return value.map((t) => {
36
+ const key = Object.keys(t)[0];
37
+ let val = t[key];
38
+ if (typeof val === "object" && typeof val.__getValue === "function") {
39
+ val = val.__getValue();
40
+ }
41
+ if (key === "matrix" || key === "matrix3d") {
42
+ return `${key}(${val.join(",")})`;
43
+ }
44
+ return `${key}(${(0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key)})`;
45
+ }).join(" ");
46
+ }
47
+ if (!isCustomProperty && typeof value === "number" && value !== 0 && !import_unitlessNumbers.unitlessNumbers[name]) {
48
+ return value + "px";
49
+ }
50
+ return ("" + value).trim();
51
+ }
@@ -3,44 +3,37 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var setValueForStyles_exports = {};
24
- __export(setValueForStyles_exports, {
25
- setValueForStyles: () => setValueForStyles
26
- });
22
+ __export(setValueForStyles_exports, { setValueForStyles: () => setValueForStyles });
27
23
  module.exports = __toCommonJS(setValueForStyles_exports);
28
24
  var import_dangerousStyleValue = require("./dangerousStyleValue.cjs");
29
25
  function setValueForStyles(node, styles) {
30
- const style = node.style;
31
- for (let styleName in styles) {
32
- if (!styles.hasOwnProperty(styleName)) {
33
- continue;
34
- }
35
- const isCustomProperty = styleName.indexOf("--") === 0;
36
- const styleValue = (0, import_dangerousStyleValue.dangerousStyleValue)(styleName, styles[styleName], isCustomProperty);
37
- if (styleName === "float") {
38
- styleName = "cssFloat";
39
- }
40
- if (isCustomProperty) {
41
- style.setProperty(styleName, styleValue);
42
- } else {
43
- style[styleName] = styleValue;
44
- }
45
- }
46
- }
26
+ const style = node.style;
27
+ for (let styleName in styles) {
28
+ const isCustomProperty = styleName.indexOf("--") === 0;
29
+ const styleValue = (0, import_dangerousStyleValue.dangerousStyleValue)(styleName, styles[styleName], isCustomProperty);
30
+ if (styleName === "float") {
31
+ styleName = "cssFloat";
32
+ }
33
+ if (isCustomProperty) {
34
+ style.setProperty(styleName, styleValue);
35
+ } else {
36
+ style[styleName] = styleValue;
37
+ }
38
+ }
39
+ }
@@ -3,87 +3,85 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var unitlessNumbers_exports = {};
24
- __export(unitlessNumbers_exports, {
25
- unitlessNumbers: () => unitlessNumbers
26
- });
22
+ __export(unitlessNumbers_exports, { unitlessNumbers: () => unitlessNumbers });
27
23
  module.exports = __toCommonJS(unitlessNumbers_exports);
28
24
  const unitlessNumbers = {
29
- animationIterationCount: true,
30
- aspectRatio: true,
31
- borderImageOutset: true,
32
- borderImageSlice: true,
33
- borderImageWidth: true,
34
- boxFlex: true,
35
- boxFlexGroup: true,
36
- boxOrdinalGroup: true,
37
- columnCount: true,
38
- flex: true,
39
- flexGrow: true,
40
- flexOrder: true,
41
- flexPositive: true,
42
- flexShrink: true,
43
- flexNegative: true,
44
- fontWeight: true,
45
- gap: true,
46
- columnGap: true,
47
- rowGap: true,
48
- gridRow: true,
49
- gridRowEnd: true,
50
- gridRowGap: true,
51
- gridRowStart: true,
52
- gridColumn: true,
53
- gridColumnEnd: true,
54
- gridColumnGap: true,
55
- gridColumnStart: true,
56
- lineClamp: true,
57
- opacity: true,
58
- order: true,
59
- orphans: true,
60
- tabSize: true,
61
- widows: true,
62
- zIndex: true,
63
- zoom: true,
64
- // SVG-related
65
- fillOpacity: true,
66
- floodOpacity: true,
67
- stopOpacity: true,
68
- strokeDasharray: true,
69
- strokeDashoffset: true,
70
- strokeMiterlimit: true,
71
- strokeOpacity: true,
72
- strokeWidth: true,
73
- // transform types
74
- scale: true,
75
- scaleX: true,
76
- scaleY: true,
77
- scaleZ: true,
78
- // RN properties
79
- shadowOpacity: true
25
+ animationIterationCount: true,
26
+ aspectRatio: true,
27
+ borderImageOutset: true,
28
+ borderImageSlice: true,
29
+ borderImageWidth: true,
30
+ boxFlex: true,
31
+ boxFlexGroup: true,
32
+ boxOrdinalGroup: true,
33
+ columnCount: true,
34
+ flex: true,
35
+ flexGrow: true,
36
+ flexOrder: true,
37
+ flexPositive: true,
38
+ flexShrink: true,
39
+ flexNegative: true,
40
+ fontWeight: true,
41
+ gap: true,
42
+ columnGap: true,
43
+ rowGap: true,
44
+ gridRow: true,
45
+ gridRowEnd: true,
46
+ gridRowGap: true,
47
+ gridRowStart: true,
48
+ gridColumn: true,
49
+ gridColumnEnd: true,
50
+ gridColumnGap: true,
51
+ gridColumnStart: true,
52
+ lineClamp: true,
53
+ opacity: true,
54
+ order: true,
55
+ orphans: true,
56
+ tabSize: true,
57
+ widows: true,
58
+ zIndex: true,
59
+ zoom: true,
60
+ fillOpacity: true,
61
+ floodOpacity: true,
62
+ stopOpacity: true,
63
+ strokeDasharray: true,
64
+ strokeDashoffset: true,
65
+ strokeMiterlimit: true,
66
+ strokeOpacity: true,
67
+ strokeWidth: true,
68
+ scale: true,
69
+ scaleX: true,
70
+ scaleY: true,
71
+ scaleZ: true,
72
+ shadowOpacity: true
80
73
  };
81
- const prefixes = ["ms", "Moz", "O", "Webkit"];
74
+ const prefixes = [
75
+ "ms",
76
+ "Moz",
77
+ "O",
78
+ "Webkit"
79
+ ];
82
80
  const prefixKey = (prefix, key) => {
83
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
81
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
84
82
  };
85
- Object.keys(unitlessNumbers).forEach(prop => {
86
- prefixes.forEach(prefix => {
87
- unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
88
- });
89
- });
83
+ Object.keys(unitlessNumbers).forEach((prop) => {
84
+ prefixes.forEach((prefix) => {
85
+ unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
86
+ });
87
+ });
@@ -3,42 +3,34 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var useElementLayout_exports = {};
24
- __export(useElementLayout_exports, {
25
- useElementLayout: () => useElementLayout
26
- });
22
+ __export(useElementLayout_exports, { useElementLayout: () => useElementLayout });
27
23
  module.exports = __toCommonJS(useElementLayout_exports);
28
24
  var import_use_element_layout = require("@tamagui/use-element-layout");
29
25
  var import_react = require("react");
30
26
  function useElementLayout(ref, onLayout) {
31
- const wrappedRef = (0, import_react.useMemo)(() => {
32
- return {
33
- current: {
34
- get host() {
35
- return ref.current;
36
- }
37
- }
38
- };
39
- }, [ref]);
40
- (0, import_react.useEffect)(() => {
41
- (0, import_use_element_layout.enable)();
42
- }, []);
43
- return (0, import_use_element_layout.useElementLayout)(wrappedRef, onLayout);
44
- }
27
+ const wrappedRef = (0, import_react.useMemo)(() => {
28
+ return { current: { get host() {
29
+ return ref.current;
30
+ } } };
31
+ }, [ref]);
32
+ (0, import_react.useEffect)(() => {
33
+ (0, import_use_element_layout.enable)();
34
+ }, []);
35
+ return (0, import_use_element_layout.useElementLayout)(wrappedRef, onLayout);
36
+ }
@@ -3,55 +3,51 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var useEvent_exports = {};
24
- __export(useEvent_exports, {
25
- useEvent: () => useEvent
26
- });
22
+ __export(useEvent_exports, { useEvent: () => useEvent });
27
23
  module.exports = __toCommonJS(useEvent_exports);
28
24
  var import_createEventHandle = require("../createEventHandle/index.cjs");
29
25
  var import_useLayoutEffect = require("../useLayoutEffect/index.cjs");
30
26
  var import_useStable = require("../useStable/index.cjs");
31
27
  function useEvent(event, options) {
32
- const targetListeners = (0, import_useStable.useStable)(() => /* @__PURE__ */new Map());
33
- const addListener = (0, import_useStable.useStable)(() => {
34
- const addEventListener = (0, import_createEventHandle.createEventHandle)(event, options);
35
- return (target, callback) => {
36
- const removeTargetListener = targetListeners.get(target);
37
- if (removeTargetListener != null) {
38
- removeTargetListener();
39
- }
40
- if (callback == null) {
41
- targetListeners.delete(target);
42
- }
43
- const removeEventListener = addEventListener(target, callback);
44
- targetListeners.set(target, removeEventListener);
45
- return removeEventListener;
46
- };
47
- });
48
- (0, import_useLayoutEffect.useLayoutEffectImpl)(() => {
49
- return () => {
50
- targetListeners.forEach(removeListener => {
51
- removeListener();
52
- });
53
- targetListeners.clear();
54
- };
55
- }, [targetListeners]);
56
- return addListener;
57
- }
28
+ const targetListeners = (0, import_useStable.useStable)(() => /* @__PURE__ */ new Map());
29
+ const addListener = (0, import_useStable.useStable)(() => {
30
+ const addEventListener = (0, import_createEventHandle.createEventHandle)(event, options);
31
+ return (target, callback) => {
32
+ const removeTargetListener = targetListeners.get(target);
33
+ if (removeTargetListener != null) {
34
+ removeTargetListener();
35
+ }
36
+ if (callback == null) {
37
+ targetListeners.delete(target);
38
+ }
39
+ const removeEventListener = addEventListener(target, callback);
40
+ targetListeners.set(target, removeEventListener);
41
+ return removeEventListener;
42
+ };
43
+ });
44
+ (0, import_useLayoutEffect.useLayoutEffectImpl)(() => {
45
+ return () => {
46
+ targetListeners.forEach((removeListener) => {
47
+ removeListener();
48
+ });
49
+ targetListeners.clear();
50
+ };
51
+ }, [targetListeners]);
52
+ return addListener;
53
+ }