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