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