@hanzogui/react-native-web-internals 3.0.6 → 4.4.0

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 +8 -8
  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 compiler_exports = {};
22
24
  __export(compiler_exports, {
@@ -26,203 +28,242 @@ __export(compiler_exports, {
26
28
  stringifyValueWithProperty: () => stringifyValueWithProperty
27
29
  });
28
30
  module.exports = __toCommonJS(compiler_exports);
29
- var import_simple_hash = require("@hanzogui/simple-hash"),
30
- import_createReactDOMStyle = require("./createReactDOMStyle.cjs"),
31
- import_hyphenateStyleName = require("./hyphenateStyleName.cjs"),
32
- import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
33
- const cache = /* @__PURE__ */new Map(),
34
- emptyObject = {},
35
- classicGroup = 1,
36
- atomicGroup = 2.2,
37
- customGroup = {
38
- borderColor: 2,
39
- borderRadius: 2,
40
- borderStyle: 2,
41
- borderWidth: 2,
42
- display: 2,
43
- flex: 2,
44
- margin: 2,
45
- overflow: 2,
46
- overscrollBehavior: 2,
47
- padding: 2,
48
- marginHorizontal: 2.1,
49
- marginVertical: 2.1,
50
- paddingHorizontal: 2.1,
51
- paddingVertical: 2.1
52
- },
53
- borderTopLeftRadius = "borderTopLeftRadius",
54
- borderTopRightRadius = "borderTopRightRadius",
55
- borderBottomLeftRadius = "borderBottomLeftRadius",
56
- borderBottomRightRadius = "borderBottomRightRadius",
57
- borderLeftColor = "borderLeftColor",
58
- borderLeftStyle = "borderLeftStyle",
59
- borderLeftWidth = "borderLeftWidth",
60
- borderRightColor = "borderRightColor",
61
- borderRightStyle = "borderRightStyle",
62
- borderRightWidth = "borderRightWidth",
63
- right = "right",
64
- marginLeft = "marginLeft",
65
- marginRight = "marginRight",
66
- paddingLeft = "paddingLeft",
67
- paddingRight = "paddingRight",
68
- left = "left",
69
- PROPERTIES_FLIP = {
70
- [borderTopLeftRadius]: borderTopRightRadius,
71
- [borderTopRightRadius]: borderTopLeftRadius,
72
- [borderBottomLeftRadius]: borderBottomRightRadius,
73
- [borderBottomRightRadius]: borderBottomLeftRadius,
74
- [borderLeftColor]: borderRightColor,
75
- [borderLeftStyle]: borderRightStyle,
76
- [borderLeftWidth]: borderRightWidth,
77
- [borderRightColor]: borderLeftColor,
78
- [borderRightStyle]: borderLeftStyle,
79
- [borderRightWidth]: borderLeftWidth,
80
- [left]: right,
81
- [marginLeft]: marginRight,
82
- [marginRight]: marginLeft,
83
- [paddingLeft]: paddingRight,
84
- [paddingRight]: paddingLeft,
85
- [right]: left
86
- },
87
- PROPERTIES_I18N = {
88
- borderTopStartRadius: borderTopLeftRadius,
89
- borderTopEndRadius: borderTopRightRadius,
90
- borderBottomStartRadius: borderBottomLeftRadius,
91
- borderBottomEndRadius: borderBottomRightRadius,
92
- borderStartColor: borderLeftColor,
93
- borderStartStyle: borderLeftStyle,
94
- borderStartWidth: borderLeftWidth,
95
- borderEndColor: borderRightColor,
96
- borderEndStyle: borderRightStyle,
97
- borderEndWidth: borderRightWidth,
98
- end: right,
99
- marginStart: marginLeft,
100
- marginEnd: marginRight,
101
- paddingStart: paddingLeft,
102
- paddingEnd: paddingRight,
103
- start: left
104
- },
105
- PROPERTIES_VALUE = ["clear", "float", "textAlign"];
31
+ var import_simple_hash = require("@hanzogui/simple-hash");
32
+ var import_createReactDOMStyle = require("./createReactDOMStyle.cjs");
33
+ var import_hyphenateStyleName = require("./hyphenateStyleName.cjs");
34
+ var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
35
+ const cache = /* @__PURE__ */new Map();
36
+ const emptyObject = {};
37
+ const classicGroup = 1;
38
+ const atomicGroup = 2.2;
39
+ const customGroup = {
40
+ borderColor: 2,
41
+ borderRadius: 2,
42
+ borderStyle: 2,
43
+ borderWidth: 2,
44
+ display: 2,
45
+ flex: 2,
46
+ margin: 2,
47
+ overflow: 2,
48
+ overscrollBehavior: 2,
49
+ padding: 2,
50
+ marginHorizontal: 2.1,
51
+ marginVertical: 2.1,
52
+ paddingHorizontal: 2.1,
53
+ paddingVertical: 2.1
54
+ };
55
+ const borderTopLeftRadius = "borderTopLeftRadius";
56
+ const borderTopRightRadius = "borderTopRightRadius";
57
+ const borderBottomLeftRadius = "borderBottomLeftRadius";
58
+ const borderBottomRightRadius = "borderBottomRightRadius";
59
+ const borderLeftColor = "borderLeftColor";
60
+ const borderLeftStyle = "borderLeftStyle";
61
+ const borderLeftWidth = "borderLeftWidth";
62
+ const borderRightColor = "borderRightColor";
63
+ const borderRightStyle = "borderRightStyle";
64
+ const borderRightWidth = "borderRightWidth";
65
+ const right = "right";
66
+ const marginLeft = "marginLeft";
67
+ const marginRight = "marginRight";
68
+ const paddingLeft = "paddingLeft";
69
+ const paddingRight = "paddingRight";
70
+ const left = "left";
71
+ const PROPERTIES_FLIP = {
72
+ [borderTopLeftRadius]: borderTopRightRadius,
73
+ [borderTopRightRadius]: borderTopLeftRadius,
74
+ [borderBottomLeftRadius]: borderBottomRightRadius,
75
+ [borderBottomRightRadius]: borderBottomLeftRadius,
76
+ [borderLeftColor]: borderRightColor,
77
+ [borderLeftStyle]: borderRightStyle,
78
+ [borderLeftWidth]: borderRightWidth,
79
+ [borderRightColor]: borderLeftColor,
80
+ [borderRightStyle]: borderLeftStyle,
81
+ [borderRightWidth]: borderLeftWidth,
82
+ [left]: right,
83
+ [marginLeft]: marginRight,
84
+ [marginRight]: marginLeft,
85
+ [paddingLeft]: paddingRight,
86
+ [paddingRight]: paddingLeft,
87
+ [right]: left
88
+ };
89
+ const PROPERTIES_I18N = {
90
+ borderTopStartRadius: borderTopLeftRadius,
91
+ borderTopEndRadius: borderTopRightRadius,
92
+ borderBottomStartRadius: borderBottomLeftRadius,
93
+ borderBottomEndRadius: borderBottomRightRadius,
94
+ borderStartColor: borderLeftColor,
95
+ borderStartStyle: borderLeftStyle,
96
+ borderStartWidth: borderLeftWidth,
97
+ borderEndColor: borderRightColor,
98
+ borderEndStyle: borderRightStyle,
99
+ borderEndWidth: borderRightWidth,
100
+ end: right,
101
+ marginStart: marginLeft,
102
+ marginEnd: marginRight,
103
+ paddingStart: paddingLeft,
104
+ paddingEnd: paddingRight,
105
+ start: left
106
+ };
107
+ const PROPERTIES_VALUE = ["clear", "float", "textAlign"];
106
108
  function atomic(style) {
107
109
  const compiledStyle = {
108
- $$css: !0
109
- },
110
- compiledRules = [];
110
+ $$css: true
111
+ };
112
+ const compiledRules = [];
111
113
  function atomicCompile(prop, value) {
112
- const valueString = stringifyValueWithProperty(value, prop),
113
- cacheKey = prop + valueString,
114
- cachedResult = cache.get(cacheKey);
114
+ const valueString = stringifyValueWithProperty(value, prop);
115
+ const cacheKey = prop + valueString;
116
+ const cachedResult = cache.get(cacheKey);
115
117
  let identifier;
116
- if (cachedResult != null) identifier = cachedResult[0], compiledRules.push(cachedResult[1]);else {
118
+ if (cachedResult != null) {
119
+ identifier = cachedResult[0];
120
+ compiledRules.push(cachedResult[1]);
121
+ } else {
117
122
  identifier = createIdentifier("r", prop, value);
118
- const order = customGroup[prop] || atomicGroup,
119
- orderedRules = [createAtomicRules(identifier, prop, value), order];
120
- compiledRules.push(orderedRules), cache.set(cacheKey, [identifier, orderedRules]);
123
+ const order = customGroup[prop] || atomicGroup;
124
+ const rules = createAtomicRules(identifier, prop, value);
125
+ const orderedRules = [rules, order];
126
+ compiledRules.push(orderedRules);
127
+ cache.set(cacheKey, [identifier, orderedRules]);
121
128
  }
122
129
  return identifier;
123
130
  }
124
- return Object.keys(style).sort().forEach(prop => {
131
+ Object.keys(style).sort().forEach(prop => {
125
132
  const value = style[prop];
126
133
  if (value != null) {
127
134
  let localizeableValue;
128
135
  if (PROPERTIES_VALUE.indexOf(prop) > -1) {
129
- const left2 = atomicCompile(prop, "left"),
130
- right2 = atomicCompile(prop, "right");
131
- value === "start" ? localizeableValue = [left2, right2] : value === "end" && (localizeableValue = [right2, left2]);
136
+ const left2 = atomicCompile(prop, "left");
137
+ const right2 = atomicCompile(prop, "right");
138
+ if (value === "start") {
139
+ localizeableValue = [left2, right2];
140
+ } else if (value === "end") {
141
+ localizeableValue = [right2, left2];
142
+ }
132
143
  }
133
144
  const propPolyfill = PROPERTIES_I18N[prop];
134
145
  if (propPolyfill != null) {
135
- const ltr = atomicCompile(propPolyfill, value),
136
- rtl = atomicCompile(PROPERTIES_FLIP[propPolyfill], value);
146
+ const ltr = atomicCompile(propPolyfill, value);
147
+ const rtl = atomicCompile(PROPERTIES_FLIP[propPolyfill], value);
137
148
  localizeableValue = [ltr, rtl];
138
149
  }
139
150
  if (prop === "transitionProperty") {
140
- const values = Array.isArray(value) ? value : [value],
141
- polyfillIndices = [];
151
+ const values = Array.isArray(value) ? value : [value];
152
+ const polyfillIndices = [];
142
153
  for (let i = 0; i < values.length; i++) {
143
154
  const val = values[i];
144
- typeof val == "string" && PROPERTIES_I18N[val] != null && polyfillIndices.push(i);
155
+ if (typeof val === "string" && PROPERTIES_I18N[val] != null) {
156
+ polyfillIndices.push(i);
157
+ }
145
158
  }
146
159
  if (polyfillIndices.length > 0) {
147
- const ltrPolyfillValues = [...values],
148
- rtlPolyfillValues = [...values];
160
+ const ltrPolyfillValues = [...values];
161
+ const rtlPolyfillValues = [...values];
149
162
  polyfillIndices.forEach(i => {
150
163
  const ltrVal = ltrPolyfillValues[i];
151
- if (typeof ltrVal == "string") {
152
- const ltrPolyfill = PROPERTIES_I18N[ltrVal],
153
- rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
154
- ltrPolyfillValues[i] = ltrPolyfill, rtlPolyfillValues[i] = rtlPolyfill;
155
- const ltr = atomicCompile(prop, ltrPolyfillValues),
156
- rtl = atomicCompile(prop, rtlPolyfillValues);
164
+ if (typeof ltrVal === "string") {
165
+ const ltrPolyfill = PROPERTIES_I18N[ltrVal];
166
+ const rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
167
+ ltrPolyfillValues[i] = ltrPolyfill;
168
+ rtlPolyfillValues[i] = rtlPolyfill;
169
+ const ltr = atomicCompile(prop, ltrPolyfillValues);
170
+ const rtl = atomicCompile(prop, rtlPolyfillValues);
157
171
  localizeableValue = [ltr, rtl];
158
172
  }
159
173
  });
160
174
  }
161
175
  }
162
- localizeableValue == null ? localizeableValue = atomicCompile(prop, value) : compiledStyle.$$css$localize = !0, compiledStyle[prop] = localizeableValue;
176
+ if (localizeableValue == null) {
177
+ localizeableValue = atomicCompile(prop, value);
178
+ } else {
179
+ compiledStyle["$$css$localize"] = true;
180
+ }
181
+ compiledStyle[prop] = localizeableValue;
163
182
  }
164
- }), [compiledStyle, compiledRules];
183
+ });
184
+ return [compiledStyle, compiledRules];
165
185
  }
166
186
  function classic(style, name) {
167
187
  const compiledStyle = {
168
- $$css: !0
169
- },
170
- compiledRules = [],
171
- {
172
- animationKeyframes,
173
- ...rest
174
- } = style,
175
- identifier = createIdentifier("css", name, style),
176
- selector = `.${identifier}`;
188
+ $$css: true
189
+ };
190
+ const compiledRules = [];
191
+ const {
192
+ animationKeyframes,
193
+ ...rest
194
+ } = style;
195
+ const identifier = createIdentifier("css", name, style);
196
+ const selector = `.${identifier}`;
177
197
  let animationName;
178
198
  if (animationKeyframes != null) {
179
199
  const [animationNames, keyframesRules] = processKeyframesValue(animationKeyframes);
180
- animationName = animationNames.join(","), compiledRules.push(...keyframesRules);
200
+ animationName = animationNames.join(",");
201
+ compiledRules.push(...keyframesRules);
181
202
  }
182
203
  const block = createDeclarationBlock({
183
204
  ...rest,
184
205
  animationName
185
206
  });
186
- return compiledRules.push(`${selector}${block}`), compiledStyle[identifier] = identifier, [compiledStyle, [[compiledRules, classicGroup]]];
207
+ compiledRules.push(`${selector}${block}`);
208
+ compiledStyle[identifier] = identifier;
209
+ return [compiledStyle, [[compiledRules, classicGroup]]];
187
210
  }
188
211
  function inline(originalStyle, isRTL) {
189
- const style = originalStyle || emptyObject,
190
- frozenProps = {},
191
- nextStyle = {};
212
+ const style = originalStyle || emptyObject;
213
+ const frozenProps = {};
214
+ const nextStyle = {};
192
215
  for (const originalProp in style) {
193
216
  const originalValue = style[originalProp];
194
- let prop = originalProp,
195
- value = originalValue;
196
- if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) continue;
197
- PROPERTIES_VALUE.indexOf(originalProp) > -1 && (originalValue === "start" ? value = isRTL ? "right" : "left" : originalValue === "end" && (value = isRTL ? "left" : "right"));
217
+ let prop = originalProp;
218
+ let value = originalValue;
219
+ if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {
220
+ continue;
221
+ }
222
+ if (PROPERTIES_VALUE.indexOf(originalProp) > -1) {
223
+ if (originalValue === "start") {
224
+ value = isRTL ? "right" : "left";
225
+ } else if (originalValue === "end") {
226
+ value = isRTL ? "left" : "right";
227
+ }
228
+ }
198
229
  const propPolyfill = PROPERTIES_I18N[originalProp];
199
- if (propPolyfill != null && (prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill), originalProp === "transitionProperty") {
230
+ if (propPolyfill != null) {
231
+ prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill;
232
+ }
233
+ if (originalProp === "transitionProperty") {
200
234
  const originalValues = Array.isArray(originalValue) ? originalValue : [originalValue];
201
235
  originalValues.forEach((val, i) => {
202
- if (typeof val == "string") {
236
+ if (typeof val === "string") {
203
237
  const valuePolyfill = PROPERTIES_I18N[val];
204
- valuePolyfill != null && (originalValues[i] = isRTL ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill);
238
+ if (valuePolyfill != null) {
239
+ originalValues[i] = isRTL ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill;
240
+ }
205
241
  }
206
242
  });
207
243
  }
208
- frozenProps[prop] || (nextStyle[prop] = value), PROPERTIES_I18N.hasOwnProperty(originalProp) && (frozenProps[prop] = !0);
244
+ if (!frozenProps[prop]) {
245
+ nextStyle[prop] = value;
246
+ }
247
+ if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {
248
+ frozenProps[prop] = true;
249
+ }
209
250
  }
210
- return (0, import_createReactDOMStyle.createReactDOMStyle)(nextStyle, !0);
251
+ return (0, import_createReactDOMStyle.createReactDOMStyle)(nextStyle, true);
211
252
  }
212
253
  function stringifyValueWithProperty(value, property) {
213
254
  const normalizedValue = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, property);
214
- return typeof normalizedValue != "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
255
+ return typeof normalizedValue !== "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
215
256
  }
216
257
  function createAtomicRules(identifier, property, value) {
217
- const rules = [],
218
- selector = `.${identifier}`;
258
+ const rules = [];
259
+ const selector = `.${identifier}`;
219
260
  switch (property) {
220
261
  case "animationKeyframes":
221
262
  {
222
- const [animationNames, keyframesRules] = processKeyframesValue(value),
223
- block = createDeclarationBlock({
224
- animationName: animationNames.join(",")
225
- });
263
+ const [animationNames, keyframesRules] = processKeyframesValue(value);
264
+ const block = createDeclarationBlock({
265
+ animationName: animationNames.join(",")
266
+ });
226
267
  rules.push(`${selector}${block}`, ...keyframesRules);
227
268
  break;
228
269
  }
@@ -242,17 +283,21 @@ function createAtomicRules(identifier, property, value) {
242
283
  {
243
284
  let finalValue = value;
244
285
  if (value === "auto" || value === "box-only") {
245
- if (finalValue = "auto!important", value === "box-only") {
286
+ finalValue = "auto!important";
287
+ if (value === "box-only") {
246
288
  const block2 = createDeclarationBlock({
247
289
  pointerEvents: "none"
248
290
  });
249
291
  rules.push(`${selector}>*${block2}`);
250
292
  }
251
- } else if ((value === "none" || value === "box-none") && (finalValue = "none!important", value === "box-none")) {
252
- const block2 = createDeclarationBlock({
253
- pointerEvents: "auto"
254
- });
255
- rules.push(`${selector}>*${block2}`);
293
+ } else if (value === "none" || value === "box-none") {
294
+ finalValue = "none!important";
295
+ if (value === "box-none") {
296
+ const block2 = createDeclarationBlock({
297
+ pointerEvents: "auto"
298
+ });
299
+ rules.push(`${selector}>*${block2}`);
300
+ }
256
301
  }
257
302
  const block = createDeclarationBlock({
258
303
  pointerEvents: finalValue
@@ -264,7 +309,9 @@ function createAtomicRules(identifier, property, value) {
264
309
  // https://drafts.csswg.org/css-scrollbars-1/
265
310
  case "scrollbarWidth":
266
311
  {
267
- value === "none" && rules.push(`${selector}::-webkit-scrollbar{display:none}`);
312
+ if (value === "none") {
313
+ rules.push(`${selector}::-webkit-scrollbar{display:none}`);
314
+ }
268
315
  const block = createDeclarationBlock({
269
316
  scrollbarWidth: value
270
317
  });
@@ -284,35 +331,49 @@ function createAtomicRules(identifier, property, value) {
284
331
  }
285
332
  function createDeclarationBlock(style) {
286
333
  const domStyle = (0, import_createReactDOMStyle.createReactDOMStyle)(style);
287
- return `{${Object.keys(domStyle).map(property => {
288
- const value = domStyle[property],
289
- prop = (0, import_hyphenateStyleName.hyphenateStyleName)(property);
290
- return Array.isArray(value) ? value.map(v => `${prop}:${v}`).join(";") : `${prop}:${value}`;
291
- }).sort().join(";")};}`;
334
+ const declarationsString = Object.keys(domStyle).map(property => {
335
+ const value = domStyle[property];
336
+ const prop = (0, import_hyphenateStyleName.hyphenateStyleName)(property);
337
+ if (Array.isArray(value)) {
338
+ return value.map(v => `${prop}:${v}`).join(";");
339
+ } else {
340
+ return `${prop}:${value}`;
341
+ }
342
+ }).sort().join(";");
343
+ return `{${declarationsString};}`;
292
344
  }
293
345
  function createIdentifier(prefix, name, value) {
294
346
  const hashedString = (0, import_simple_hash.simpleHash)(name + stringifyValueWithProperty(value, name));
295
347
  return process.env.NODE_ENV !== "production" ? `${prefix}-${name}-${hashedString}` : `${prefix}-${hashedString}`;
296
348
  }
297
349
  function createKeyframes(keyframes) {
298
- const prefixes = ["-webkit-", ""],
299
- identifier = createIdentifier("r", "animation", keyframes),
300
- steps = "{" + Object.keys(keyframes).map(stepName => {
301
- const rule = keyframes[stepName],
302
- block = createDeclarationBlock(rule);
303
- return `${stepName}${block}`;
304
- }).join("") + "}",
305
- rules = prefixes.map(prefix => `@${prefix}keyframes ${identifier}${steps}`);
350
+ const prefixes = ["-webkit-", ""];
351
+ const identifier = createIdentifier("r", "animation", keyframes);
352
+ const steps = "{" + Object.keys(keyframes).map(stepName => {
353
+ const rule = keyframes[stepName];
354
+ const block = createDeclarationBlock(rule);
355
+ return `${stepName}${block}`;
356
+ }).join("") + "}";
357
+ const rules = prefixes.map(prefix => {
358
+ return `@${prefix}keyframes ${identifier}${steps}`;
359
+ });
306
360
  return [identifier, rules];
307
361
  }
308
362
  function processKeyframesValue(keyframesValue) {
309
- if (typeof keyframesValue == "number") throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
310
- const animationNames = [],
311
- rules = [];
312
- return (Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue]).forEach(keyframes => {
313
- if (typeof keyframes == "string") animationNames.push(keyframes);else {
363
+ if (typeof keyframesValue === "number") {
364
+ throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
365
+ }
366
+ const animationNames = [];
367
+ const rules = [];
368
+ const value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
369
+ value.forEach(keyframes => {
370
+ if (typeof keyframes === "string") {
371
+ animationNames.push(keyframes);
372
+ } else {
314
373
  const [identifier, keyframesRules] = createKeyframes(keyframes);
315
- animationNames.push(identifier), rules.push(...keyframesRules);
374
+ animationNames.push(identifier);
375
+ rules.push(...keyframesRules);
316
376
  }
317
- }), [animationNames, rules];
377
+ });
378
+ return [animationNames, rules];
318
379
  }
@@ -3,38 +3,47 @@ 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 normalizeColor_exports = {};
22
24
  __export(normalizeColor_exports, {
23
25
  normalizeColor: () => normalizeColor
24
26
  });
25
27
  module.exports = __toCommonJS(normalizeColor_exports);
26
- var import_isWebColor = require("../../modules/isWebColor/index.cjs"),
27
- import_processColor = require("../../modules/processColor/index.cjs");
28
+ var import_isWebColor = require("../../modules/isWebColor/index.cjs");
29
+ var import_processColor = require("../../modules/processColor/index.cjs");
28
30
  const normalizeColor = (color, opacity = 1) => {
29
31
  if (color == null) return;
30
- if (typeof color == "string" && (0, import_isWebColor.isWebColor)(color)) return color;
32
+ if (typeof color === "string" && (0, import_isWebColor.isWebColor)(color)) {
33
+ return color;
34
+ }
31
35
  const colorInt = (0, import_processColor.processColor)(color);
32
36
  if (colorInt != null) {
33
- const r = colorInt >> 16 & 255,
34
- g = colorInt >> 8 & 255,
35
- b = colorInt & 255,
36
- alpha = ((colorInt >> 24 & 255) / 255 * opacity).toFixed(2);
37
+ const r = colorInt >> 16 & 255;
38
+ const g = colorInt >> 8 & 255;
39
+ const b = colorInt & 255;
40
+ const a = (colorInt >> 24 & 255) / 255;
41
+ const alpha = (a * opacity).toFixed(2);
37
42
  return `rgba(${r},${g},${b},${alpha})`;
38
43
  }
39
- if (typeof color == "string") return color;
44
+ if (true) {
45
+ if (typeof color === "string") {
46
+ return color;
47
+ }
48
+ }
40
49
  };