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