@hanzogui/react-native-web-internals 3.0.6 → 4.3.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 (205) hide show
  1. package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +62 -37
  2. package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +129 -117
  3. package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +69 -30
  4. package/dist/cjs/StyleSheet/__tests__/index-test.cjs +127 -95
  5. package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +26 -13
  6. package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +30 -15
  7. package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +141 -68
  8. package/dist/cjs/StyleSheet/compiler/hash.cjs +12 -10
  9. package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +18 -14
  10. package/dist/cjs/StyleSheet/compiler/index.cjs +234 -173
  11. package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +27 -18
  12. package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +30 -23
  13. package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +36 -32
  14. package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +30 -15
  15. package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +62 -37
  16. package/dist/cjs/StyleSheet/dom/index.cjs +56 -34
  17. package/dist/cjs/StyleSheet/index.cjs +25 -18
  18. package/dist/cjs/StyleSheet/preprocess.cjs +94 -81
  19. package/dist/cjs/StyleSheet/validate.cjs +67 -44
  20. package/dist/cjs/TextAncestorContext.cjs +13 -11
  21. package/dist/cjs/colorProps.cjs +22 -20
  22. package/dist/cjs/index.cjs +47 -45
  23. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +19 -12
  24. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +17 -11
  25. package/dist/cjs/modules/AccessibilityUtil/index.cjs +15 -13
  26. package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +12 -10
  27. package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +45 -38
  28. package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +34 -30
  29. package/dist/cjs/modules/AssetRegistry/index.cjs +12 -10
  30. package/dist/cjs/modules/ImageLoader/index.cjs +117 -71
  31. package/dist/cjs/modules/InteractionManager.cjs +155 -99
  32. package/dist/cjs/modules/Platform/__tests__/index-test.cjs +21 -13
  33. package/dist/cjs/modules/Platform/index.cjs +12 -10
  34. package/dist/cjs/modules/TextInputState/index.cjs +28 -13
  35. package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +77 -56
  36. package/dist/cjs/modules/UIManager/index.cjs +47 -42
  37. package/dist/cjs/modules/canUseDOM.cjs +13 -11
  38. package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +75 -54
  39. package/dist/cjs/modules/createDOMProps/index.cjs +353 -145
  40. package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +238 -160
  41. package/dist/cjs/modules/createEventHandle/index.cjs +46 -25
  42. package/dist/cjs/modules/dismissKeyboard/index.cjs +12 -10
  43. package/dist/cjs/modules/forwardedProps/index.cjs +137 -135
  44. package/dist/cjs/modules/getBoundingClientRect/index.cjs +18 -11
  45. package/dist/cjs/modules/invariant.cjs +21 -15
  46. package/dist/cjs/modules/isSelectionValid/index.cjs +18 -17
  47. package/dist/cjs/modules/isWebColor/index.cjs +12 -10
  48. package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +21 -15
  49. package/dist/cjs/modules/mergeRefs/index.cjs +24 -21
  50. package/dist/cjs/modules/modality/__tests__/index-test.cjs +44 -17
  51. package/dist/cjs/modules/modality/index.cjs +148 -71
  52. package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +18 -10
  53. package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +26 -20
  54. package/dist/cjs/modules/normalizeColor/index.cjs +22 -17
  55. package/dist/cjs/modules/pick/index.cjs +19 -11
  56. package/dist/cjs/modules/processColor/__tests__/index-test.cjs +43 -24
  57. package/dist/cjs/modules/processColor/index.cjs +32 -24
  58. package/dist/cjs/modules/requestIdleCallback/index.cjs +28 -26
  59. package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +38 -18
  60. package/dist/cjs/modules/setValueForStyles/index.cjs +25 -14
  61. package/dist/cjs/modules/unitlessNumbers/index.cjs +68 -64
  62. package/dist/cjs/modules/useElementLayout/index.cjs +25 -20
  63. package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +255 -173
  64. package/dist/cjs/modules/useEvent/index.cjs +40 -28
  65. package/dist/cjs/modules/useHover/__tests__/index-test.cjs +233 -124
  66. package/dist/cjs/modules/useHover/index.cjs +105 -62
  67. package/dist/cjs/modules/useLayoutEffect/index.cjs +26 -24
  68. package/dist/cjs/modules/useLocale/index.cjs +33 -30
  69. package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +63 -58
  70. package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +54 -31
  71. package/dist/cjs/modules/useMergeRefs/index.cjs +26 -24
  72. package/dist/cjs/modules/usePlatformMethods/index.cjs +21 -14
  73. package/dist/cjs/modules/useStable/__tests__/index-test.cjs +60 -30
  74. package/dist/cjs/modules/useStable/index.cjs +29 -24
  75. package/dist/cjs/styleTypes.cjs +7 -5
  76. package/dist/cjs/types.cjs +7 -5
  77. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +53 -30
  78. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +1 -1
  79. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +129 -117
  80. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +1 -1
  81. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +60 -23
  82. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +1 -1
  83. package/dist/esm/StyleSheet/__tests__/index-test.mjs +118 -88
  84. package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +1 -1
  85. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +26 -13
  86. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +1 -1
  87. package/dist/esm/StyleSheet/__tests__/validate-test.mjs +30 -15
  88. package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +1 -1
  89. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +127 -56
  90. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -1
  91. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +6 -4
  92. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -1
  93. package/dist/esm/StyleSheet/compiler/index.mjs +218 -159
  94. package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -1
  95. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +13 -6
  96. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -1
  97. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +16 -11
  98. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -1
  99. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +22 -20
  100. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -1
  101. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +18 -5
  102. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -1
  103. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +50 -27
  104. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -1
  105. package/dist/esm/StyleSheet/dom/index.mjs +41 -21
  106. package/dist/esm/StyleSheet/dom/index.mjs.map +1 -1
  107. package/dist/esm/StyleSheet/index.mjs +13 -8
  108. package/dist/esm/StyleSheet/index.mjs.map +1 -1
  109. package/dist/esm/StyleSheet/preprocess.mjs +80 -69
  110. package/dist/esm/StyleSheet/preprocess.mjs.map +1 -1
  111. package/dist/esm/StyleSheet/validate.mjs +55 -34
  112. package/dist/esm/StyleSheet/validate.mjs.map +1 -1
  113. package/dist/esm/TextAncestorContext.mjs +1 -1
  114. package/dist/esm/TextAncestorContext.mjs.map +1 -1
  115. package/dist/esm/colorProps.mjs +10 -10
  116. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +10 -5
  117. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +1 -1
  118. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +8 -4
  119. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +1 -1
  120. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +33 -28
  121. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -1
  122. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +22 -20
  123. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -1
  124. package/dist/esm/modules/ImageLoader/index.mjs +105 -61
  125. package/dist/esm/modules/ImageLoader/index.mjs.map +1 -1
  126. package/dist/esm/modules/InteractionManager.mjs +141 -87
  127. package/dist/esm/modules/InteractionManager.mjs.map +1 -1
  128. package/dist/esm/modules/Platform/__tests__/index-test.mjs +12 -6
  129. package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +1 -1
  130. package/dist/esm/modules/TextInputState/index.mjs +16 -3
  131. package/dist/esm/modules/TextInputState/index.mjs.map +1 -1
  132. package/dist/esm/modules/UIManager/__tests__/index-test.mjs +68 -49
  133. package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +1 -1
  134. package/dist/esm/modules/UIManager/index.mjs +35 -32
  135. package/dist/esm/modules/UIManager/index.mjs.map +1 -1
  136. package/dist/esm/modules/canUseDOM.mjs +1 -1
  137. package/dist/esm/modules/canUseDOM.mjs.map +1 -1
  138. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +66 -47
  139. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +1 -1
  140. package/dist/esm/modules/createDOMProps/index.mjs +339 -133
  141. package/dist/esm/modules/createDOMProps/index.mjs.map +1 -1
  142. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +222 -146
  143. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +1 -1
  144. package/dist/esm/modules/createEventHandle/index.mjs +34 -15
  145. package/dist/esm/modules/createEventHandle/index.mjs.map +1 -1
  146. package/dist/esm/modules/forwardedProps/index.mjs +125 -125
  147. package/dist/esm/modules/forwardedProps/index.mjs.map +1 -1
  148. package/dist/esm/modules/getBoundingClientRect/index.mjs +6 -1
  149. package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -1
  150. package/dist/esm/modules/invariant.mjs +9 -5
  151. package/dist/esm/modules/invariant.mjs.map +1 -1
  152. package/dist/esm/modules/isSelectionValid/index.mjs +6 -7
  153. package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -1
  154. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +8 -4
  155. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +1 -1
  156. package/dist/esm/modules/mergeRefs/index.mjs +12 -11
  157. package/dist/esm/modules/mergeRefs/index.mjs.map +1 -1
  158. package/dist/esm/modules/modality/__tests__/index-test.mjs +42 -15
  159. package/dist/esm/modules/modality/__tests__/index-test.mjs.map +1 -1
  160. package/dist/esm/modules/modality/index.mjs +134 -59
  161. package/dist/esm/modules/modality/index.mjs.map +1 -1
  162. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +9 -3
  163. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +1 -1
  164. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +14 -10
  165. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -1
  166. package/dist/esm/modules/normalizeColor/index.mjs +8 -5
  167. package/dist/esm/modules/normalizeColor/index.mjs.map +1 -1
  168. package/dist/esm/modules/pick/index.mjs +7 -1
  169. package/dist/esm/modules/pick/index.mjs.map +1 -1
  170. package/dist/esm/modules/processColor/__tests__/index-test.mjs +34 -17
  171. package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +1 -1
  172. package/dist/esm/modules/processColor/index.mjs +8 -2
  173. package/dist/esm/modules/processColor/index.mjs.map +1 -1
  174. package/dist/esm/modules/requestIdleCallback/index.mjs +16 -16
  175. package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -1
  176. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +24 -6
  177. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -1
  178. package/dist/esm/modules/setValueForStyles/index.mjs +13 -4
  179. package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -1
  180. package/dist/esm/modules/unitlessNumbers/index.mjs +56 -54
  181. package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -1
  182. package/dist/esm/modules/useElementLayout/index.mjs +11 -8
  183. package/dist/esm/modules/useElementLayout/index.mjs.map +1 -1
  184. package/dist/esm/modules/useEvent/__tests__/index-test.mjs +240 -160
  185. package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +1 -1
  186. package/dist/esm/modules/useEvent/index.mjs +25 -15
  187. package/dist/esm/modules/useEvent/index.mjs.map +1 -1
  188. package/dist/esm/modules/useHover/__tests__/index-test.mjs +217 -110
  189. package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +1 -1
  190. package/dist/esm/modules/useHover/index.mjs +90 -49
  191. package/dist/esm/modules/useHover/index.mjs.map +1 -1
  192. package/dist/esm/modules/useLocale/index.mjs +6 -5
  193. package/dist/esm/modules/useLocale/index.mjs.map +1 -1
  194. package/dist/esm/modules/useLocale/isLocaleRTL.mjs +51 -48
  195. package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -1
  196. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +40 -19
  197. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +1 -1
  198. package/dist/esm/modules/usePlatformMethods/index.mjs +7 -2
  199. package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
  200. package/dist/esm/modules/useStable/__tests__/index-test.mjs +47 -19
  201. package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +1 -1
  202. package/dist/esm/modules/useStable/index.mjs +5 -2
  203. package/dist/esm/modules/useStable/index.mjs.map +1 -1
  204. package/package.json +1 -1
  205. package/src/StyleSheet/compiler/normalizeColor.tsx +1 -1
@@ -3,20 +3,22 @@ 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: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var preprocess_exports = {};
22
24
  __export(preprocess_exports, {
@@ -26,76 +28,87 @@ __export(preprocess_exports, {
26
28
  processStyle: () => processStyle
27
29
  });
28
30
  module.exports = __toCommonJS(preprocess_exports);
29
- var import_normalizeColor = require("./compiler/normalizeColor.cjs"),
30
- import_normalizeValueWithProperty = require("./compiler/normalizeValueWithProperty.cjs");
31
- const emptyObject = {},
32
- defaultOffset = {
33
- height: 0,
34
- width: 0
35
- },
36
- createBoxShadowValue = style => {
37
- const {
38
- shadowColor,
39
- shadowOffset,
40
- shadowOpacity,
41
- shadowRadius
42
- } = style,
43
- {
44
- height,
45
- width
46
- } = shadowOffset || defaultOffset,
47
- offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width),
48
- offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height),
49
- blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
50
- color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
51
- if (color != null && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
52
- },
53
- createTextShadowValue = style => {
54
- const {
55
- textShadowColor,
56
- textShadowOffset,
57
- textShadowRadius
58
- } = style,
59
- {
60
- height,
61
- width
62
- } = textShadowOffset || defaultOffset,
63
- radius = textShadowRadius || 0,
64
- offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width),
65
- offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height),
66
- blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(radius),
67
- color = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(textShadowColor, "textShadowColor");
68
- if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
69
- },
70
- preprocess = originalStyle => {
71
- const style = originalStyle || emptyObject,
72
- nextStyle = {};
73
- for (const originalProp in style) {
74
- const originalValue = style[originalProp];
75
- let prop = originalProp,
76
- value = originalValue;
77
- if (!(!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null)) {
78
- if (prop === "shadowColor" || prop === "shadowOffset" || prop === "shadowOpacity" || prop === "shadowRadius") {
79
- const boxShadowValue = createBoxShadowValue(style);
80
- if (boxShadowValue != null && nextStyle.boxShadow == null) {
81
- const {
82
- boxShadow
83
- } = style;
84
- prop = "boxShadow", value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;
85
- } else continue;
86
- }
87
- if (prop === "textShadowColor" || prop === "textShadowOffset" || prop === "textShadowRadius") {
88
- const textShadowValue = createTextShadowValue(style);
89
- if (textShadowValue != null && nextStyle.textShadow == null) {
90
- const {
91
- textShadow
92
- } = style;
93
- prop = "textShadow", value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;
94
- } else continue;
95
- }
96
- nextStyle[prop] = value;
31
+ var import_normalizeColor = require("./compiler/normalizeColor.cjs");
32
+ var import_normalizeValueWithProperty = require("./compiler/normalizeValueWithProperty.cjs");
33
+ const emptyObject = {};
34
+ const defaultOffset = {
35
+ height: 0,
36
+ width: 0
37
+ };
38
+ const createBoxShadowValue = style => {
39
+ const {
40
+ shadowColor,
41
+ shadowOffset,
42
+ shadowOpacity,
43
+ shadowRadius
44
+ } = style;
45
+ const {
46
+ height,
47
+ width
48
+ } = shadowOffset || defaultOffset;
49
+ const offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width);
50
+ const offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height);
51
+ const blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0);
52
+ const color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
53
+ if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
54
+ return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
55
+ }
56
+ };
57
+ const createTextShadowValue = style => {
58
+ const {
59
+ textShadowColor,
60
+ textShadowOffset,
61
+ textShadowRadius
62
+ } = style;
63
+ const {
64
+ height,
65
+ width
66
+ } = textShadowOffset || defaultOffset;
67
+ const radius = textShadowRadius || 0;
68
+ const offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width);
69
+ const offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height);
70
+ const blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(radius);
71
+ const color = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(textShadowColor, "textShadowColor");
72
+ if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
73
+ return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
74
+ }
75
+ };
76
+ const preprocess = originalStyle => {
77
+ const style = originalStyle || emptyObject;
78
+ const nextStyle = {};
79
+ for (const originalProp in style) {
80
+ const originalValue = style[originalProp];
81
+ let prop = originalProp;
82
+ let value = originalValue;
83
+ if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {
84
+ continue;
85
+ }
86
+ if (prop === "shadowColor" || prop === "shadowOffset" || prop === "shadowOpacity" || prop === "shadowRadius") {
87
+ const boxShadowValue = createBoxShadowValue(style);
88
+ if (boxShadowValue != null && nextStyle.boxShadow == null) {
89
+ const {
90
+ boxShadow
91
+ } = style;
92
+ prop = "boxShadow";
93
+ value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;
94
+ } else {
95
+ continue;
96
+ }
97
+ }
98
+ if (prop === "textShadowColor" || prop === "textShadowOffset" || prop === "textShadowRadius") {
99
+ const textShadowValue = createTextShadowValue(style);
100
+ if (textShadowValue != null && nextStyle.textShadow == null) {
101
+ const {
102
+ textShadow
103
+ } = style;
104
+ prop = "textShadow";
105
+ value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;
106
+ } else {
107
+ continue;
97
108
  }
98
109
  }
99
- return nextStyle;
100
- },
101
- processStyle = preprocess;
110
+ nextStyle[prop] = value;
111
+ }
112
+ return nextStyle;
113
+ };
114
+ const processStyle = preprocess;
@@ -3,20 +3,22 @@ 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: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var validate_exports = {};
22
24
  __export(validate_exports, {
@@ -24,46 +26,67 @@ __export(validate_exports, {
24
26
  });
25
27
  module.exports = __toCommonJS(validate_exports);
26
28
  const invalidShortforms = {
27
- background: !0,
28
- borderBottom: !0,
29
- borderLeft: !0,
30
- borderRight: !0,
31
- borderTop: !0,
32
- font: !0,
33
- grid: !0,
34
- outline: !0,
35
- textDecoration: !0
36
- },
37
- invalidMultiValueShortforms = {
38
- flex: !0,
39
- margin: !0,
40
- padding: !0,
41
- borderColor: !0,
42
- borderRadius: !0,
43
- borderStyle: !0,
44
- borderWidth: !0,
45
- marginHorizontal: !0,
46
- marginVertical: !0,
47
- paddingHorizontal: !0,
48
- paddingVertical: !0,
49
- overflow: !0,
50
- overscrollBehavior: !0,
51
- backgroundPosition: !0
52
- };
29
+ background: true,
30
+ borderBottom: true,
31
+ borderLeft: true,
32
+ borderRight: true,
33
+ borderTop: true,
34
+ font: true,
35
+ grid: true,
36
+ outline: true,
37
+ textDecoration: true
38
+ };
39
+ const invalidMultiValueShortforms = {
40
+ flex: true,
41
+ margin: true,
42
+ padding: true,
43
+ borderColor: true,
44
+ borderRadius: true,
45
+ borderStyle: true,
46
+ borderWidth: true,
47
+ marginHorizontal: true,
48
+ marginVertical: true,
49
+ paddingHorizontal: true,
50
+ paddingVertical: true,
51
+ overflow: true,
52
+ overscrollBehavior: true,
53
+ backgroundPosition: true
54
+ };
53
55
  function error(message) {
54
56
  console.error(message);
55
57
  }
56
58
  function validate(obj) {
57
59
  for (const k in obj) {
58
- const prop = k.trim(),
59
- value = obj[prop];
60
- let isInvalid = !1;
61
- if (value !== null) {
62
- if (typeof value == "string" && value.indexOf("!important") > -1) error(`Invalid style declaration "${prop}:${value}". Values cannot include "!important"`), isInvalid = !0;else {
63
- let suggestion = "";
64
- prop === "animation" || prop === "animationName" ? (suggestion = 'Did you mean "animationKeyframes"?', isInvalid = !0) : prop === "direction" ? (suggestion = 'Did you mean "writingDirection"?', isInvalid = !0) : prop === "verticalAlign" ? (suggestion = 'Did you mean "textAlignVertical"?', isInvalid = !0) : invalidShortforms[prop] ? (suggestion = "Please use long-form properties.", isInvalid = !0) : invalidMultiValueShortforms[prop], suggestion !== "" && error(`Invalid style property of "${prop}". ${suggestion}`);
60
+ const prop = k.trim();
61
+ const value = obj[prop];
62
+ let isInvalid = false;
63
+ if (value === null) {
64
+ continue;
65
+ }
66
+ if (typeof value === "string" && value.indexOf("!important") > -1) {
67
+ error(`Invalid style declaration "${prop}:${value}". Values cannot include "!important"`);
68
+ isInvalid = true;
69
+ } else {
70
+ let suggestion = "";
71
+ if (prop === "animation" || prop === "animationName") {
72
+ suggestion = 'Did you mean "animationKeyframes"?';
73
+ isInvalid = true;
74
+ } else if (prop === "direction") {
75
+ suggestion = 'Did you mean "writingDirection"?';
76
+ isInvalid = true;
77
+ } else if (prop === "verticalAlign") {
78
+ suggestion = 'Did you mean "textAlignVertical"?';
79
+ isInvalid = true;
80
+ } else if (invalidShortforms[prop]) {
81
+ suggestion = "Please use long-form properties.";
82
+ isInvalid = true;
83
+ } else if (invalidMultiValueShortforms[prop]) {}
84
+ if (suggestion !== "") {
85
+ error(`Invalid style property of "${prop}". ${suggestion}`);
65
86
  }
66
- isInvalid && delete obj[k];
87
+ }
88
+ if (isInvalid) {
89
+ delete obj[k];
67
90
  }
68
91
  }
69
92
  }
@@ -3,20 +3,22 @@ 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: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var TextAncestorContext_exports = {};
22
24
  __export(TextAncestorContext_exports, {
@@ -24,4 +26,4 @@ __export(TextAncestorContext_exports, {
24
26
  });
25
27
  module.exports = __toCommonJS(TextAncestorContext_exports);
26
28
  var import_react = require("react");
27
- const TextAncestorContext = (0, import_react.createContext)(!1);
29
+ const TextAncestorContext = (0, import_react.createContext)(false);
@@ -3,20 +3,22 @@ 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: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var colorProps_exports = {};
22
24
  __export(colorProps_exports, {
@@ -24,14 +26,14 @@ __export(colorProps_exports, {
24
26
  });
25
27
  module.exports = __toCommonJS(colorProps_exports);
26
28
  const colorProps = {
27
- backgroundColor: !0,
28
- borderColor: !0,
29
- borderTopColor: !0,
30
- borderRightColor: !0,
31
- borderBottomColor: !0,
32
- borderLeftColor: !0,
33
- color: !0,
34
- shadowColor: !0,
35
- textDecorationColor: !0,
36
- textShadowColor: !0
29
+ backgroundColor: true,
30
+ borderColor: true,
31
+ borderTopColor: true,
32
+ borderRightColor: true,
33
+ borderBottomColor: true,
34
+ borderLeftColor: true,
35
+ color: true,
36
+ shadowColor: true,
37
+ textDecorationColor: true,
38
+ textShadowColor: true
37
39
  };
@@ -3,21 +3,23 @@ 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: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- },
18
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
21
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
20
- value: !0
22
+ value: true
21
23
  }), mod);
22
24
  var index_exports = {};
23
25
  __export(index_exports, {
@@ -63,41 +65,41 @@ __reExport(index_exports, require("./modules/forwardedProps/index.cjs"), module.
63
65
  __reExport(index_exports, require("./modules/mergeRefs/index.cjs"), module.exports);
64
66
  __reExport(index_exports, require("./modules/modality/index.cjs"), module.exports);
65
67
  __reExport(index_exports, require("./modules/useLocale/index.cjs"), module.exports);
66
- var import_usePlatformMethods = require("./modules/usePlatformMethods/index.cjs"),
67
- import_TextAncestorContext = require("./TextAncestorContext.cjs");
68
+ var import_usePlatformMethods = require("./modules/usePlatformMethods/index.cjs");
69
+ var import_TextAncestorContext = require("./TextAncestorContext.cjs");
68
70
  __reExport(index_exports, require("@hanzogui/react-native-use-pressable"), module.exports);
69
71
  __reExport(index_exports, require("@hanzogui/react-native-use-responder-events"), module.exports);
70
- var import_colorProps = require("./colorProps.cjs"),
71
- import_AccessibilityUtil = require("./modules/AccessibilityUtil/index.cjs"),
72
- import_canUseDOM = require("./modules/canUseDOM.cjs"),
73
- import_createDOMProps = require("./modules/createDOMProps/index.cjs"),
74
- import_createDOMProps2 = require("./modules/createDOMProps/index.cjs"),
75
- import_createReactDOMStyle = require("./StyleSheet/compiler/createReactDOMStyle.cjs"),
76
- import_createEventHandle = require("./modules/createEventHandle/index.cjs"),
77
- import_dismissKeyboard = require("./modules/dismissKeyboard/index.cjs"),
78
- import_getBoundingClientRect = require("./modules/getBoundingClientRect/index.cjs"),
79
- import_ImageLoader = require("./modules/ImageLoader/index.cjs"),
80
- import_isSelectionValid = require("./modules/isSelectionValid/index.cjs"),
81
- import_isWebColor = require("./modules/isWebColor/index.cjs"),
82
- import_multiplyStyleLengthValue = require("./modules/multiplyStyleLengthValue/index.cjs"),
83
- import_normalizeColor = require("./modules/normalizeColor/index.cjs"),
84
- import_pick = require("./modules/pick/index.cjs"),
85
- import_Platform = require("./modules/Platform/index.cjs");
72
+ var import_colorProps = require("./colorProps.cjs");
73
+ var import_AccessibilityUtil = require("./modules/AccessibilityUtil/index.cjs");
74
+ var import_canUseDOM = require("./modules/canUseDOM.cjs");
75
+ var import_createDOMProps = require("./modules/createDOMProps/index.cjs");
76
+ var import_createDOMProps2 = require("./modules/createDOMProps/index.cjs");
77
+ var import_createReactDOMStyle = require("./StyleSheet/compiler/createReactDOMStyle.cjs");
78
+ var import_createEventHandle = require("./modules/createEventHandle/index.cjs");
79
+ var import_dismissKeyboard = require("./modules/dismissKeyboard/index.cjs");
80
+ var import_getBoundingClientRect = require("./modules/getBoundingClientRect/index.cjs");
81
+ var import_ImageLoader = require("./modules/ImageLoader/index.cjs");
82
+ var import_isSelectionValid = require("./modules/isSelectionValid/index.cjs");
83
+ var import_isWebColor = require("./modules/isWebColor/index.cjs");
84
+ var import_multiplyStyleLengthValue = require("./modules/multiplyStyleLengthValue/index.cjs");
85
+ var import_normalizeColor = require("./modules/normalizeColor/index.cjs");
86
+ var import_pick = require("./modules/pick/index.cjs");
87
+ var import_Platform = require("./modules/Platform/index.cjs");
86
88
  __reExport(index_exports, require("./StyleSheet/preprocess.cjs"), module.exports);
87
- var import_StyleSheet = require("./StyleSheet/index.cjs"),
88
- import_dom = require("./StyleSheet/dom/index.cjs"),
89
- import_requestIdleCallback = require("./modules/requestIdleCallback/index.cjs"),
90
- import_setValueForStyles = require("./modules/setValueForStyles/index.cjs"),
91
- import_TextInputState = require("./modules/TextInputState/index.cjs"),
92
- import_UIManager = require("./modules/UIManager/index.cjs"),
93
- import_unitlessNumbers = require("./modules/unitlessNumbers/index.cjs"),
94
- import_useElementLayout = require("./modules/useElementLayout/index.cjs"),
95
- import_useEvent = require("./modules/useEvent/index.cjs"),
96
- import_useHover = require("./modules/useHover/index.cjs"),
97
- import_useLayoutEffect = require("./modules/useLayoutEffect/index.cjs"),
98
- import_useStable = require("./modules/useStable/index.cjs"),
99
- import_InteractionManager = require("./modules/InteractionManager.cjs");
89
+ var import_StyleSheet = require("./StyleSheet/index.cjs");
90
+ var import_dom = require("./StyleSheet/dom/index.cjs");
91
+ var import_requestIdleCallback = require("./modules/requestIdleCallback/index.cjs");
92
+ var import_setValueForStyles = require("./modules/setValueForStyles/index.cjs");
93
+ var import_TextInputState = require("./modules/TextInputState/index.cjs");
94
+ var import_UIManager = require("./modules/UIManager/index.cjs");
95
+ var import_unitlessNumbers = require("./modules/unitlessNumbers/index.cjs");
96
+ var import_useElementLayout = require("./modules/useElementLayout/index.cjs");
97
+ var import_useEvent = require("./modules/useEvent/index.cjs");
98
+ var import_useHover = require("./modules/useHover/index.cjs");
99
+ var import_useLayoutEffect = require("./modules/useLayoutEffect/index.cjs");
100
+ var import_useStable = require("./modules/useStable/index.cjs");
101
+ var import_InteractionManager = require("./modules/InteractionManager.cjs");
100
102
  __reExport(index_exports, require("./modules/invariant.cjs"), module.exports);
101
- var import_processColor = require("./modules/processColor/index.cjs"),
102
- import_StyleSheet2 = require("./StyleSheet/index.cjs"),
103
- import_useMergeRefs = require("./modules/useMergeRefs/index.cjs");
103
+ var import_processColor = require("./modules/processColor/index.cjs");
104
+ var import_StyleSheet2 = require("./StyleSheet/index.cjs");
105
+ var import_useMergeRefs = require("./modules/useMergeRefs/index.cjs");
@@ -2,13 +2,15 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
9
- get: () => from[key],
10
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
- });
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
12
14
  return to;
13
15
  };
14
16
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
@@ -18,31 +20,36 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
18
20
  // "default" to the CommonJS "module.exports" for node compatibility.
19
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
22
  value: mod,
21
- enumerable: !0
23
+ enumerable: true
22
24
  }) : target, mod));
23
25
  var import_propsToAccessibilityComponent = __toESM(require("../propsToAccessibilityComponent.cjs"), 1);
24
26
  describe("modules/AccessibilityUtil/propsToAccessibilityComponent", () => {
25
27
  test('when missing accessibility props"', () => {
26
28
  expect((0, import_propsToAccessibilityComponent.default)({})).toBeUndefined();
27
- }), test('when "accessibilityRole" is "button"', () => {
29
+ });
30
+ test('when "accessibilityRole" is "button"', () => {
28
31
  expect((0, import_propsToAccessibilityComponent.default)({
29
32
  accessibilityRole: "button"
30
33
  })).toBeUndefined();
31
- }), test('when "accessibilityRole" is "heading"', () => {
34
+ });
35
+ test('when "accessibilityRole" is "heading"', () => {
32
36
  expect((0, import_propsToAccessibilityComponent.default)({
33
37
  accessibilityRole: "heading"
34
38
  })).toEqual("h1");
35
- }), test('when "accessibilityRole" is "heading" and "aria-level" is set', () => {
39
+ });
40
+ test('when "accessibilityRole" is "heading" and "aria-level" is set', () => {
36
41
  expect((0, import_propsToAccessibilityComponent.default)({
37
42
  accessibilityRole: "heading",
38
43
  "aria-level": 3
39
44
  })).toEqual("h3");
40
- }), test('when "accessibilityRole" is "heading" and "accessibilityLevel" is set', () => {
45
+ });
46
+ test('when "accessibilityRole" is "heading" and "accessibilityLevel" is set', () => {
41
47
  expect((0, import_propsToAccessibilityComponent.default)({
42
48
  accessibilityRole: "heading",
43
49
  accessibilityLevel: 3
44
50
  })).toEqual("h3");
45
- }), test('when "accessibilityRole" is "label"', () => {
51
+ });
52
+ test('when "accessibilityRole" is "label"', () => {
46
53
  expect((0, import_propsToAccessibilityComponent.default)({
47
54
  accessibilityRole: "label"
48
55
  })).toEqual("label");