@tamagui/react-native-web-internals 2.0.0-rc.35 → 2.0.0-rc.36-1775243248161

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 (204) 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
@@ -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_createReactDOMStyle = __toESM(require("../compiler/createReactDOMStyle.cjs"), 1);
24
26
  const reactNativeStyle = {
@@ -38,10 +40,11 @@ const reactNativeStyle = {
38
40
  };
39
41
  describe("compiler/createReactDOMStyle", () => {
40
42
  test("noop on DOM styles", () => {
41
- const firstStyle = (0, import_createReactDOMStyle.default)(reactNativeStyle),
42
- secondStyle = (0, import_createReactDOMStyle.default)(firstStyle);
43
+ const firstStyle = (0, import_createReactDOMStyle.default)(reactNativeStyle);
44
+ const secondStyle = (0, import_createReactDOMStyle.default)(firstStyle);
43
45
  expect(firstStyle).toEqual(secondStyle);
44
- }), test("shortform -> longform for inline styles", () => {
46
+ });
47
+ test("shortform -> longform for inline styles", () => {
45
48
  const style = {
46
49
  borderStyle: "solid",
47
50
  boxSizing: "border-box",
@@ -57,7 +60,7 @@ describe("compiler/createReactDOMStyle", () => {
57
60
  paddingHorizontal: 25,
58
61
  padding: 10
59
62
  };
60
- expect((0, import_createReactDOMStyle.default)(style, !0)).toMatchInlineSnapshot(`
63
+ expect((0, import_createReactDOMStyle.default)(style, true)).toMatchInlineSnapshot(`
61
64
  {
62
65
  "borderBottomColor": "rgba(255,255,255,1.00)",
63
66
  "borderBottomStyle": "solid",
@@ -83,13 +86,15 @@ describe("compiler/createReactDOMStyle", () => {
83
86
  "paddingTop": "10px",
84
87
  }
85
88
  `);
86
- }), test("aspectRatio", () => {
89
+ });
90
+ test("aspectRatio", () => {
87
91
  expect((0, import_createReactDOMStyle.default)({
88
92
  aspectRatio: 9 / 16
89
93
  })).toEqual({
90
94
  aspectRatio: "0.5625"
91
95
  });
92
- }), describe("flexbox styles", () => {
96
+ });
97
+ describe("flexbox styles", () => {
93
98
  test("flex: -1", () => {
94
99
  expect((0, import_createReactDOMStyle.default)({
95
100
  flex: -1
@@ -98,42 +103,49 @@ describe("compiler/createReactDOMStyle", () => {
98
103
  flexShrink: 1,
99
104
  flexBasis: "auto"
100
105
  });
101
- }), test("flex: 0", () => {
106
+ });
107
+ test("flex: 0", () => {
102
108
  expect((0, import_createReactDOMStyle.default)({
103
109
  flex: 0
104
110
  })).toEqual({
105
111
  flex: 0
106
112
  });
107
- }), test("flex: 1", () => {
113
+ });
114
+ test("flex: 1", () => {
108
115
  expect((0, import_createReactDOMStyle.default)({
109
116
  flex: 1
110
117
  })).toEqual({
111
118
  flex: 1
112
119
  });
113
- }), test("flex: 10", () => {
120
+ });
121
+ test("flex: 10", () => {
114
122
  expect((0, import_createReactDOMStyle.default)({
115
123
  flex: 10
116
124
  })).toEqual({
117
125
  flex: 10
118
126
  });
119
- }), test("flexBasis overrides", () => {
127
+ });
128
+ test("flexBasis overrides", () => {
120
129
  expect((0, import_createReactDOMStyle.default)({
121
130
  flexBasis: "25%"
122
131
  })).toEqual({
123
132
  flexBasis: "25%"
124
- }), expect((0, import_createReactDOMStyle.default)({
133
+ });
134
+ expect((0, import_createReactDOMStyle.default)({
125
135
  flex: 1,
126
136
  flexBasis: "25%"
127
137
  })).toEqual({
128
138
  flex: 1,
129
139
  flexBasis: "25%"
130
140
  });
131
- }), test("flexShrink overrides", () => {
141
+ });
142
+ test("flexShrink overrides", () => {
132
143
  expect((0, import_createReactDOMStyle.default)({
133
144
  flexShrink: 1
134
145
  })).toEqual({
135
146
  flexShrink: 1
136
- }), expect((0, import_createReactDOMStyle.default)({
147
+ });
148
+ expect((0, import_createReactDOMStyle.default)({
137
149
  flex: 1,
138
150
  flexShrink: 2
139
151
  })).toEqual({
@@ -141,7 +153,8 @@ describe("compiler/createReactDOMStyle", () => {
141
153
  flexShrink: 2
142
154
  });
143
155
  });
144
- }), describe("fontFamily", () => {
156
+ });
157
+ describe("fontFamily", () => {
145
158
  test("general case", () => {
146
159
  expect((0, import_createReactDOMStyle.default)({
147
160
  fontFamily: "Georgia, Times, serif"
@@ -150,7 +163,8 @@ describe("compiler/createReactDOMStyle", () => {
150
163
  "fontFamily": "Georgia, Times, serif",
151
164
  }
152
165
  `);
153
- }), test('"monospace"', () => {
166
+ });
167
+ test('"monospace"', () => {
154
168
  expect((0, import_createReactDOMStyle.default)({
155
169
  fontFamily: "monospace"
156
170
  })).toMatchInlineSnapshot(`
@@ -158,35 +172,40 @@ describe("compiler/createReactDOMStyle", () => {
158
172
  "fontFamily": "monospace,monospace",
159
173
  }
160
174
  `);
161
- }), test('"System"', () => {
175
+ });
176
+ test('"System"', () => {
162
177
  expect((0, import_createReactDOMStyle.default)({
163
178
  fontFamily: "System"
164
179
  })).toMatchInlineSnapshot(`
165
180
  {
166
181
  "fontFamily": "-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
167
182
  }
168
- `), expect((0, import_createReactDOMStyle.default)({
183
+ `);
184
+ expect((0, import_createReactDOMStyle.default)({
169
185
  font: "14px System"
170
186
  })).toMatchInlineSnapshot(`
171
187
  {
172
188
  "font": "14px -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
173
189
  }
174
190
  `);
175
- }), test('"Noto, System"', () => {
191
+ });
192
+ test('"Noto, System"', () => {
176
193
  expect((0, import_createReactDOMStyle.default)({
177
194
  fontFamily: "Noto, System"
178
195
  })).toMatchInlineSnapshot(`
179
196
  {
180
197
  "fontFamily": "Noto,-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
181
198
  }
182
- `), expect((0, import_createReactDOMStyle.default)({
199
+ `);
200
+ expect((0, import_createReactDOMStyle.default)({
183
201
  font: "14px Noto, System"
184
202
  })).toMatchInlineSnapshot(`
185
203
  {
186
204
  "font": "14px Noto, -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
187
205
  }
188
206
  `);
189
- }), test('"Noto, BlinkMacSystemFont"', () => {
207
+ });
208
+ test('"Noto, BlinkMacSystemFont"', () => {
190
209
  expect((0, import_createReactDOMStyle.default)({
191
210
  fontFamily: "Noto, BlinkMacSystemFont"
192
211
  })).toMatchInlineSnapshot(`
@@ -195,29 +214,34 @@ describe("compiler/createReactDOMStyle", () => {
195
214
  }
196
215
  `);
197
216
  });
198
- }), test("fontVariant", () => {
217
+ });
218
+ test("fontVariant", () => {
199
219
  expect((0, import_createReactDOMStyle.default)({
200
220
  fontVariant: ["common-ligatures", "small-caps"]
201
221
  })).toEqual({
202
222
  fontVariant: "common-ligatures small-caps"
203
223
  });
204
- }), test("textAlignVertical", () => {
224
+ });
225
+ test("textAlignVertical", () => {
205
226
  expect((0, import_createReactDOMStyle.default)({
206
227
  textAlignVertical: "center"
207
228
  })).toEqual({
208
229
  verticalAlign: "middle"
209
230
  });
210
- }), describe("transform", () => {
231
+ });
232
+ describe("transform", () => {
211
233
  test("string", () => {
212
- const transform = "perspective(50px) scaleX(20) translateX(20px) rotate(20deg)",
213
- resolved = (0, import_createReactDOMStyle.default)({
214
- transform
215
- });
234
+ const transform = "perspective(50px) scaleX(20) translateX(20px) rotate(20deg)";
235
+ const style = {
236
+ transform
237
+ };
238
+ const resolved = (0, import_createReactDOMStyle.default)(style);
216
239
  expect(resolved).toEqual({
217
240
  transform
218
241
  });
219
- }), test("array", () => {
220
- const resolved = (0, import_createReactDOMStyle.default)({
242
+ });
243
+ test("array", () => {
244
+ const style = {
221
245
  transform: [{
222
246
  perspective: 50
223
247
  }, {
@@ -231,7 +255,8 @@ describe("compiler/createReactDOMStyle", () => {
231
255
  }, {
232
256
  matrix3d: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
233
257
  }]
234
- });
258
+ };
259
+ const resolved = (0, import_createReactDOMStyle.default)(style);
235
260
  expect(resolved).toEqual({
236
261
  transform: "perspective(50px) scaleX(20) translateX(20px) rotate(20deg) matrix(1,2,3,4,5,6) matrix3d(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)"
237
262
  });
@@ -176,7 +176,8 @@ describe("StyleSheet/compile", () => {
176
176
  ]
177
177
  `);
178
178
  });
179
- }), describe("classic", () => {
179
+ });
180
+ describe("classic", () => {
180
181
  test("converts style to classic CSS", () => {
181
182
  const result = (0, import_compiler.classic)({
182
183
  animationDirection: ["alternate", "alternate-reverse"],
@@ -226,7 +227,8 @@ describe("StyleSheet/compile", () => {
226
227
  ]
227
228
  `);
228
229
  });
229
- }), describe("inline", () => {
230
+ });
231
+ describe("inline", () => {
230
232
  test("converts style to inline styles", () => {
231
233
  const result = (0, import_compiler.inline)({
232
234
  marginHorizontal: 10,
@@ -241,8 +243,10 @@ describe("StyleSheet/compile", () => {
241
243
  "marginRight": "10px",
242
244
  }
243
245
  `);
244
- }), describe("logical style polyfill", () => {
245
- [!1, !0].forEach(isRTL => {
246
+ });
247
+ describe("logical style polyfill", () => {
248
+ ;
249
+ [false, true].forEach(isRTL => {
246
250
  const dir = isRTL ? "rtl" : "ltr";
247
251
  test(`ignores "left" properties for ${dir}`, () => {
248
252
  const initial = {
@@ -254,7 +258,8 @@ describe("StyleSheet/compile", () => {
254
258
  paddingLeft: "10px"
255
259
  };
256
260
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
257
- }), test(`ignores "right" properties for ${dir}`, () => {
261
+ });
262
+ test(`ignores "right" properties for ${dir}`, () => {
258
263
  const initial = {
259
264
  borderRightColor: "rgba(255,0,0,1.00)",
260
265
  borderRightStyle: "solid",
@@ -264,7 +269,8 @@ describe("StyleSheet/compile", () => {
264
269
  paddingRight: "10px"
265
270
  };
266
271
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
267
- }), test(`ignores "left" values for ${dir}`, () => {
272
+ });
273
+ test(`ignores "left" values for ${dir}`, () => {
268
274
  const initial = {
269
275
  clear: "left",
270
276
  float: "left",
@@ -272,7 +278,8 @@ describe("StyleSheet/compile", () => {
272
278
  transitionProperty: "left"
273
279
  };
274
280
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
275
- }), test(`ignores "right" values for ${dir}`, () => {
281
+ });
282
+ test(`ignores "right" values for ${dir}`, () => {
276
283
  const initial = {
277
284
  clear: "right",
278
285
  float: "right",
@@ -280,125 +287,130 @@ describe("StyleSheet/compile", () => {
280
287
  transitionProperty: "right"
281
288
  };
282
289
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
283
- }), test(`converts "start" properties for ${dir}`, () => {
290
+ });
291
+ test(`converts "start" properties for ${dir}`, () => {
284
292
  const initial = {
285
- borderStartColor: "red",
286
- borderStartStyle: "solid",
287
- borderStartWidth: 1,
288
- start: 1,
289
- marginStart: 5,
290
- paddingStart: 10
291
- },
292
- expectedLTR = {
293
- borderLeftColor: "rgba(255,0,0,1.00)",
294
- borderLeftStyle: "solid",
295
- borderLeftWidth: "1px",
296
- left: "1px",
297
- marginLeft: "5px",
298
- paddingLeft: "10px"
299
- },
300
- expectedRTL = {
301
- borderRightColor: "rgba(255,0,0,1.00)",
302
- borderRightStyle: "solid",
303
- borderRightWidth: "1px",
304
- right: "1px",
305
- marginRight: "5px",
306
- paddingRight: "10px"
307
- };
293
+ borderStartColor: "red",
294
+ borderStartStyle: "solid",
295
+ borderStartWidth: 1,
296
+ start: 1,
297
+ marginStart: 5,
298
+ paddingStart: 10
299
+ };
300
+ const expectedLTR = {
301
+ borderLeftColor: "rgba(255,0,0,1.00)",
302
+ borderLeftStyle: "solid",
303
+ borderLeftWidth: "1px",
304
+ left: "1px",
305
+ marginLeft: "5px",
306
+ paddingLeft: "10px"
307
+ };
308
+ const expectedRTL = {
309
+ borderRightColor: "rgba(255,0,0,1.00)",
310
+ borderRightStyle: "solid",
311
+ borderRightWidth: "1px",
312
+ right: "1px",
313
+ marginRight: "5px",
314
+ paddingRight: "10px"
315
+ };
308
316
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
309
- }), test(`converts "end" properties for ${dir}`, () => {
317
+ });
318
+ test(`converts "end" properties for ${dir}`, () => {
310
319
  const initial = {
311
- borderEndColor: "red",
312
- borderEndStyle: "solid",
313
- borderEndWidth: 1,
314
- end: 1,
315
- marginEnd: 5,
316
- paddingEnd: 10
317
- },
318
- expectedLTR = {
319
- borderRightColor: "rgba(255,0,0,1.00)",
320
- borderRightStyle: "solid",
321
- borderRightWidth: "1px",
322
- right: "1px",
323
- marginRight: "5px",
324
- paddingRight: "10px"
325
- },
326
- expectedRTL = {
327
- borderLeftColor: "rgba(255,0,0,1.00)",
328
- borderLeftStyle: "solid",
329
- borderLeftWidth: "1px",
330
- left: "1px",
331
- marginLeft: "5px",
332
- paddingLeft: "10px"
333
- };
320
+ borderEndColor: "red",
321
+ borderEndStyle: "solid",
322
+ borderEndWidth: 1,
323
+ end: 1,
324
+ marginEnd: 5,
325
+ paddingEnd: 10
326
+ };
327
+ const expectedLTR = {
328
+ borderRightColor: "rgba(255,0,0,1.00)",
329
+ borderRightStyle: "solid",
330
+ borderRightWidth: "1px",
331
+ right: "1px",
332
+ marginRight: "5px",
333
+ paddingRight: "10px"
334
+ };
335
+ const expectedRTL = {
336
+ borderLeftColor: "rgba(255,0,0,1.00)",
337
+ borderLeftStyle: "solid",
338
+ borderLeftWidth: "1px",
339
+ left: "1px",
340
+ marginLeft: "5px",
341
+ paddingLeft: "10px"
342
+ };
334
343
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
335
- }), test(`converts "start" values for ${dir}`, () => {
344
+ });
345
+ test(`converts "start" values for ${dir}`, () => {
336
346
  const initial = {
337
- clear: "start",
338
- float: "start",
339
- textAlign: "start",
340
- transitionProperty: "start"
341
- },
342
- expectedLTR = {
343
- clear: "left",
344
- float: "left",
345
- textAlign: "left",
346
- transitionProperty: "left"
347
- },
348
- expectedRTL = {
349
- clear: "right",
350
- float: "right",
351
- textAlign: "right",
352
- transitionProperty: "right"
353
- };
347
+ clear: "start",
348
+ float: "start",
349
+ textAlign: "start",
350
+ transitionProperty: "start"
351
+ };
352
+ const expectedLTR = {
353
+ clear: "left",
354
+ float: "left",
355
+ textAlign: "left",
356
+ transitionProperty: "left"
357
+ };
358
+ const expectedRTL = {
359
+ clear: "right",
360
+ float: "right",
361
+ textAlign: "right",
362
+ transitionProperty: "right"
363
+ };
354
364
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
355
- }), test(`converts "end" values for ${dir}`, () => {
365
+ });
366
+ test(`converts "end" values for ${dir}`, () => {
356
367
  const initial = {
357
- clear: "end",
358
- float: "end",
359
- textAlign: "end",
360
- transitionProperty: "end"
361
- },
362
- expectedLTR = {
363
- clear: "right",
364
- float: "right",
365
- textAlign: "right",
366
- transitionProperty: "right"
367
- },
368
- expectedRTL = {
369
- clear: "left",
370
- float: "left",
371
- textAlign: "left",
372
- transitionProperty: "left"
373
- };
368
+ clear: "end",
369
+ float: "end",
370
+ textAlign: "end",
371
+ transitionProperty: "end"
372
+ };
373
+ const expectedLTR = {
374
+ clear: "right",
375
+ float: "right",
376
+ textAlign: "right",
377
+ transitionProperty: "right"
378
+ };
379
+ const expectedRTL = {
380
+ clear: "left",
381
+ float: "left",
382
+ textAlign: "left",
383
+ transitionProperty: "left"
384
+ };
374
385
  expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
375
- }), test("end/start properties take precedence over left/right", () => {
386
+ });
387
+ test("end/start properties take precedence over left/right", () => {
376
388
  const initialLTR = {
377
- borderStartWidth: 10,
378
- borderLeftWidth: 0,
379
- end: 10,
380
- right: 0,
381
- marginStart: 10,
382
- marginLeft: 0
383
- },
384
- expectedLTR = {
385
- borderLeftWidth: "10px",
386
- marginLeft: "10px",
387
- right: "10px"
388
- },
389
- initialRTL = {
390
- borderStartWidth: 10,
391
- borderRightWidth: 0,
392
- end: 10,
393
- left: 0,
394
- marginStart: 10,
395
- marginRight: 0
396
- },
397
- expectedRTL = {
398
- borderRightWidth: "10px",
399
- marginRight: "10px",
400
- left: "10px"
401
- };
389
+ borderStartWidth: 10,
390
+ borderLeftWidth: 0,
391
+ end: 10,
392
+ right: 0,
393
+ marginStart: 10,
394
+ marginLeft: 0
395
+ };
396
+ const expectedLTR = {
397
+ borderLeftWidth: "10px",
398
+ marginLeft: "10px",
399
+ right: "10px"
400
+ };
401
+ const initialRTL = {
402
+ borderStartWidth: 10,
403
+ borderRightWidth: 0,
404
+ end: 10,
405
+ left: 0,
406
+ marginStart: 10,
407
+ marginRight: 0
408
+ };
409
+ const expectedRTL = {
410
+ borderRightWidth: "10px",
411
+ marginRight: "10px",
412
+ left: "10px"
413
+ };
402
414
  expect((0, import_compiler.inline)(isRTL ? initialRTL : initialLTR, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
403
415
  });
404
416
  });