@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,41 +3,48 @@ 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 normalizeValueWithProperty_exports = {};
22
24
  __export(normalizeValueWithProperty_exports, {
23
25
  normalizeValueWithProperty: () => normalizeValueWithProperty
24
26
  });
25
27
  module.exports = __toCommonJS(normalizeValueWithProperty_exports);
26
- var import_unitlessNumbers = require("../../modules/unitlessNumbers/index.cjs"),
27
- import_normalizeColor = require("./normalizeColor.cjs");
28
+ var import_unitlessNumbers = require("../../modules/unitlessNumbers/index.cjs");
29
+ var import_normalizeColor = require("./normalizeColor.cjs");
28
30
  const colorProps = {
29
- backgroundColor: !0,
30
- borderColor: !0,
31
- borderTopColor: !0,
32
- borderRightColor: !0,
33
- borderBottomColor: !0,
34
- borderLeftColor: !0,
35
- color: !0,
36
- shadowColor: !0,
37
- textDecorationColor: !0,
38
- textShadowColor: !0
31
+ backgroundColor: true,
32
+ borderColor: true,
33
+ borderTopColor: true,
34
+ borderRightColor: true,
35
+ borderBottomColor: true,
36
+ borderLeftColor: true,
37
+ color: true,
38
+ shadowColor: true,
39
+ textDecorationColor: true,
40
+ textShadowColor: true
39
41
  };
40
42
  function normalizeValueWithProperty(value, property) {
41
43
  let returnValue = value;
42
- return (property == null || !import_unitlessNumbers.unitlessNumbers[property]) && typeof value == "number" ? returnValue = `${value}px` : property != null && colorProps[property] && (returnValue = (0, import_normalizeColor.normalizeColor)(value)), returnValue;
44
+ if ((property == null || !import_unitlessNumbers.unitlessNumbers[property]) && typeof value === "number") {
45
+ returnValue = `${value}px`;
46
+ } else if (property != null && colorProps[property]) {
47
+ returnValue = (0, import_normalizeColor.normalizeColor)(value);
48
+ }
49
+ return returnValue;
43
50
  }
@@ -3,46 +3,50 @@ 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 resolveShadowValue_exports = {};
22
24
  __export(resolveShadowValue_exports, {
23
25
  resolveShadowValue: () => resolveShadowValue
24
26
  });
25
27
  module.exports = __toCommonJS(resolveShadowValue_exports);
26
- var import_normalizeColor = require("./normalizeColor.cjs"),
27
- import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
28
+ var import_normalizeColor = require("./normalizeColor.cjs");
29
+ var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
28
30
  const defaultOffset = {
29
- height: 0,
30
- width: 0
31
- },
32
- resolveShadowValue = style => {
33
- const {
34
- shadowColor,
35
- shadowOffset,
36
- shadowOpacity,
37
- shadowRadius
38
- } = style,
39
- {
40
- height,
41
- width
42
- } = shadowOffset || defaultOffset,
43
- offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width),
44
- offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height),
45
- blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
46
- color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
47
- if (color != null && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
48
- };
31
+ height: 0,
32
+ width: 0
33
+ };
34
+ const resolveShadowValue = style => {
35
+ const {
36
+ shadowColor,
37
+ shadowOffset,
38
+ shadowOpacity,
39
+ shadowRadius
40
+ } = style;
41
+ const {
42
+ height,
43
+ width
44
+ } = shadowOffset || defaultOffset;
45
+ const offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width);
46
+ const offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height);
47
+ const blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0);
48
+ const color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
49
+ if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
50
+ return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
51
+ }
52
+ };
@@ -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 createCSSStyleSheet_exports = {};
22
24
  __export(createCSSStyleSheet_exports, {
@@ -26,12 +28,25 @@ module.exports = __toCommonJS(createCSSStyleSheet_exports);
26
28
  var import_canUseDOM = require("../../modules/canUseDOM.cjs");
27
29
  function createCSSStyleSheet(id, rootNode, textContent) {
28
30
  if (import_canUseDOM.canUseDOM) {
29
- const root = rootNode ?? document;
31
+ const root = rootNode != null ? rootNode : document;
30
32
  let element = root.getElementById(id);
31
- if (element == null) if (element = document.createElement("style"), element.setAttribute("id", id), typeof textContent == "string" && element.appendChild(document.createTextNode(textContent)), root instanceof ShadowRoot) root.insertBefore(element, root.firstChild);else {
32
- const head = root.head;
33
- head && head.appendChild(element);
33
+ if (element == null) {
34
+ element = document.createElement("style");
35
+ element.setAttribute("id", id);
36
+ if (typeof textContent === "string") {
37
+ element.appendChild(document.createTextNode(textContent));
38
+ }
39
+ if (root instanceof ShadowRoot) {
40
+ root.insertBefore(element, root.firstChild);
41
+ } else {
42
+ const head = root.head;
43
+ if (head) {
44
+ head.appendChild(element);
45
+ }
46
+ }
34
47
  }
35
48
  return element.sheet;
36
- } else return null;
49
+ } else {
50
+ return null;
51
+ }
37
52
  }
@@ -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 createOrderedCSSStyleSheet_exports = {};
22
24
  __export(createOrderedCSSStyleSheet_exports, {
@@ -25,49 +27,58 @@ __export(createOrderedCSSStyleSheet_exports, {
25
27
  module.exports = __toCommonJS(createOrderedCSSStyleSheet_exports);
26
28
  const slice = Array.prototype.slice;
27
29
  function createOrderedCSSStyleSheet(sheet) {
28
- const groups = {},
29
- selectors = {};
30
+ const groups = {};
31
+ const selectors = {};
30
32
  if (sheet != null) {
31
33
  let group;
32
34
  slice.call(sheet.cssRules).forEach((cssRule, i) => {
33
35
  const cssText = cssRule.cssText;
34
- if (cssText.indexOf("stylesheet-group") > -1) group = decodeGroupRule(cssRule), groups[group] = {
35
- start: i,
36
- rules: [cssText]
37
- };else {
36
+ if (cssText.indexOf("stylesheet-group") > -1) {
37
+ group = decodeGroupRule(cssRule);
38
+ groups[group] = {
39
+ start: i,
40
+ rules: [cssText]
41
+ };
42
+ } else {
38
43
  const selectorText = getSelectorText(cssText);
39
- selectorText != null && (selectors[selectorText] = !0, groups[group].rules.push(cssText));
44
+ if (selectorText != null) {
45
+ selectors[selectorText] = true;
46
+ groups[group].rules.push(cssText);
47
+ }
40
48
  }
41
49
  });
42
50
  }
43
51
  function sheetInsert(sheet2, group, text) {
44
- const orderedGroups = getOrderedGroups(groups),
45
- nextGroupIndex = orderedGroups.indexOf(group) + 1,
46
- nextGroup = orderedGroups[nextGroupIndex],
47
- position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length,
48
- isInserted = insertRuleAt(sheet2, text, position);
52
+ const orderedGroups = getOrderedGroups(groups);
53
+ const groupIndex = orderedGroups.indexOf(group);
54
+ const nextGroupIndex = groupIndex + 1;
55
+ const nextGroup = orderedGroups[nextGroupIndex];
56
+ const position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length;
57
+ const isInserted = insertRuleAt(sheet2, text, position);
49
58
  if (isInserted) {
50
- groups[group].start == null && (groups[group].start = position);
59
+ if (groups[group].start == null) {
60
+ groups[group].start = position;
61
+ }
51
62
  for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {
52
- const groupNumber = orderedGroups[i],
53
- previousStart = groups[groupNumber].start || 0;
63
+ const groupNumber = orderedGroups[i];
64
+ const previousStart = groups[groupNumber].start || 0;
54
65
  groups[groupNumber].start = previousStart + 1;
55
66
  }
56
67
  }
57
68
  return isInserted;
58
69
  }
59
- return {
70
+ const OrderedCSSStyleSheet = {
60
71
  /**
61
72
  * The textContent of the style sheet.
62
73
  */
63
74
  getTextContent() {
64
75
  return getOrderedGroups(groups).map(group => {
65
- const rules = groups[group].rules,
66
- marker = rules.shift();
67
- return rules.sort(), rules.unshift(marker), rules.join(`
68
- `);
69
- }).join(`
70
- `);
76
+ const rules = groups[group].rules;
77
+ const marker = rules.shift();
78
+ rules.sort();
79
+ rules.unshift(marker);
80
+ return rules.join("\n");
81
+ }).join("\n");
71
82
  },
72
83
  /**
73
84
  * Insert a rule into the style sheet
@@ -79,12 +90,25 @@ function createOrderedCSSStyleSheet(sheet) {
79
90
  groups[group] = {
80
91
  start: null,
81
92
  rules: [markerRule]
82
- }, sheet != null && sheetInsert(sheet, group, markerRule);
93
+ };
94
+ if (sheet != null) {
95
+ sheetInsert(sheet, group, markerRule);
96
+ }
83
97
  }
84
98
  const selectorText = getSelectorText(cssText);
85
- selectorText != null && selectors[selectorText] == null && (selectors[selectorText] = !0, groups[group].rules.push(cssText), sheet != null && (sheetInsert(sheet, group, cssText) || groups[group].rules.pop()));
99
+ if (selectorText != null && selectors[selectorText] == null) {
100
+ selectors[selectorText] = true;
101
+ groups[group].rules.push(cssText);
102
+ if (sheet != null) {
103
+ const isInserted = sheetInsert(sheet, group, cssText);
104
+ if (!isInserted) {
105
+ groups[group].rules.pop();
106
+ }
107
+ }
108
+ }
86
109
  }
87
110
  };
111
+ return OrderedCSSStyleSheet;
88
112
  }
89
113
  function encodeGroupRule(group) {
90
114
  return `[stylesheet-group="${group}"]{}`;
@@ -103,8 +127,9 @@ function getSelectorText(cssText) {
103
127
  }
104
128
  function insertRuleAt(root, cssText, position) {
105
129
  try {
106
- return root.insertRule(cssText, position), !0;
107
- } catch {
108
- return !1;
130
+ root.insertRule(cssText, position);
131
+ return true;
132
+ } catch (e) {
133
+ return false;
109
134
  }
110
135
  }
@@ -3,63 +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: !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 dom_exports = {};
22
24
  __export(dom_exports, {
23
25
  createSheet: () => createSheet
24
26
  });
25
27
  module.exports = __toCommonJS(dom_exports);
26
- var import_canUseDOM = require("../../modules/canUseDOM.cjs"),
27
- import_createCSSStyleSheet = require("./createCSSStyleSheet.cjs"),
28
- import_createOrderedCSSStyleSheet = require("./createOrderedCSSStyleSheet.cjs");
29
- const defaultId = "react-native-stylesheet",
30
- roots = /* @__PURE__ */new WeakMap(),
31
- sheets = [],
32
- initialRules = [
33
- // minimal top-level reset
34
- "html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}", "body{margin:0;}",
35
- // minimal form pseudo-element reset
36
- "button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}", "input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];
28
+ var import_canUseDOM = require("../../modules/canUseDOM.cjs");
29
+ var import_createCSSStyleSheet = require("./createCSSStyleSheet.cjs");
30
+ var import_createOrderedCSSStyleSheet = require("./createOrderedCSSStyleSheet.cjs");
31
+ const defaultId = "react-native-stylesheet";
32
+ const roots = /* @__PURE__ */new WeakMap();
33
+ const sheets = [];
34
+ const initialRules = [
35
+ // minimal top-level reset
36
+ "html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}", "body{margin:0;}",
37
+ // minimal form pseudo-element reset
38
+ "button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}", "input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];
37
39
  function createSheet(root, id = defaultId) {
38
40
  let sheet;
39
41
  function createSheet2() {
40
- if (!sheet) if (import_canUseDOM.canUseDOM) {
42
+ if (sheet) return;
43
+ if (import_canUseDOM.canUseDOM) {
41
44
  const rootNode = root != null ? root.getRootNode() : document;
42
- if (sheets.length === 0) sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id)), initialRules.forEach(rule => {
43
- sheet.insert(rule, 0);
44
- }), roots.set(rootNode, sheets.length), sheets.push(sheet);else {
45
+ if (sheets.length === 0) {
46
+ sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id));
47
+ initialRules.forEach(rule => {
48
+ sheet.insert(rule, 0);
49
+ });
50
+ roots.set(rootNode, sheets.length);
51
+ sheets.push(sheet);
52
+ } else {
45
53
  const index = roots.get(rootNode);
46
54
  if (index == null) {
47
- const initialSheet = sheets[0],
48
- textContent = initialSheet != null ? initialSheet.getTextContent() : "";
49
- sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id, rootNode, textContent)), roots.set(rootNode, sheets.length), sheets.push(sheet);
50
- } else sheet = sheets[index];
55
+ const initialSheet = sheets[0];
56
+ const textContent = initialSheet != null ? initialSheet.getTextContent() : "";
57
+ sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id, rootNode, textContent));
58
+ roots.set(rootNode, sheets.length);
59
+ sheets.push(sheet);
60
+ } else {
61
+ sheet = sheets[index];
62
+ }
51
63
  }
52
- } else sheets.length === 0 ? (sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id)), initialRules.forEach(rule => {
53
- sheet.insert(rule, 0);
54
- }), sheets.push(sheet)) : sheet = sheets[0];
64
+ } else {
65
+ if (sheets.length === 0) {
66
+ sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id));
67
+ initialRules.forEach(rule => {
68
+ sheet.insert(rule, 0);
69
+ });
70
+ sheets.push(sheet);
71
+ } else {
72
+ sheet = sheets[0];
73
+ }
74
+ }
55
75
  }
56
76
  return {
57
77
  getTextContent() {
58
- return createSheet2(), sheet.getTextContent();
78
+ createSheet2();
79
+ return sheet.getTextContent();
59
80
  },
60
81
  id,
61
82
  insert(cssText, groupValue) {
62
- createSheet2(), sheets.forEach(s => {
83
+ createSheet2();
84
+ sheets.forEach(s => {
63
85
  s.insert(cssText, groupValue);
64
86
  });
65
87
  }
@@ -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 StyleSheet_exports = {};
22
24
  __export(StyleSheet_exports, {
@@ -25,13 +27,13 @@ __export(StyleSheet_exports, {
25
27
  });
26
28
  module.exports = __toCommonJS(StyleSheet_exports);
27
29
  const absoluteFillObject = {
28
- position: "absolute",
29
- left: 0,
30
- right: 0,
31
- top: 0,
32
- bottom: 0
33
- },
34
- absoluteFill = absoluteFillObject;
30
+ position: "absolute",
31
+ left: 0,
32
+ right: 0,
33
+ top: 0,
34
+ bottom: 0
35
+ };
36
+ const absoluteFill = absoluteFillObject;
35
37
  function create(styles) {
36
38
  return styles;
37
39
  }
@@ -39,7 +41,12 @@ function compose(style1, style2) {
39
41
  return flatten(style1, style2);
40
42
  }
41
43
  function flatten(...styles) {
42
- return styles.flat().flat().flat().flat().reduce((acc, cur) => (cur && Object.assign(acc, cur), acc), {});
44
+ return styles.flat().flat().flat().flat().reduce((acc, cur) => {
45
+ if (cur) {
46
+ Object.assign(acc, cur);
47
+ }
48
+ return acc;
49
+ }, {});
43
50
  }
44
51
  function getSheet() {
45
52
  return {