@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,41 +3,48 @@ 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 normalizeValueWithProperty_exports = {};
|
|
22
24
|
__export(normalizeValueWithProperty_exports, {
|
|
23
25
|
normalizeValueWithProperty: () => normalizeValueWithProperty
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(normalizeValueWithProperty_exports);
|
|
26
|
-
var import_unitlessNumbers = require("../../modules/unitlessNumbers/index.cjs")
|
|
27
|
-
|
|
28
|
+
var import_unitlessNumbers = require("../../modules/unitlessNumbers/index.cjs");
|
|
29
|
+
var import_normalizeColor = require("./normalizeColor.cjs");
|
|
28
30
|
const colorProps = {
|
|
29
|
-
backgroundColor:
|
|
30
|
-
borderColor:
|
|
31
|
-
borderTopColor:
|
|
32
|
-
borderRightColor:
|
|
33
|
-
borderBottomColor:
|
|
34
|
-
borderLeftColor:
|
|
35
|
-
color:
|
|
36
|
-
shadowColor:
|
|
37
|
-
textDecorationColor:
|
|
38
|
-
textShadowColor:
|
|
31
|
+
backgroundColor: true,
|
|
32
|
+
borderColor: true,
|
|
33
|
+
borderTopColor: true,
|
|
34
|
+
borderRightColor: true,
|
|
35
|
+
borderBottomColor: true,
|
|
36
|
+
borderLeftColor: true,
|
|
37
|
+
color: true,
|
|
38
|
+
shadowColor: true,
|
|
39
|
+
textDecorationColor: true,
|
|
40
|
+
textShadowColor: true
|
|
39
41
|
};
|
|
40
42
|
function normalizeValueWithProperty(value, property) {
|
|
41
43
|
let returnValue = value;
|
|
42
|
-
|
|
44
|
+
if ((property == null || !import_unitlessNumbers.unitlessNumbers[property]) && typeof value === "number") {
|
|
45
|
+
returnValue = `${value}px`;
|
|
46
|
+
} else if (property != null && colorProps[property]) {
|
|
47
|
+
returnValue = (0, import_normalizeColor.normalizeColor)(value);
|
|
48
|
+
}
|
|
49
|
+
return returnValue;
|
|
43
50
|
}
|
|
@@ -3,46 +3,50 @@ 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 resolveShadowValue_exports = {};
|
|
22
24
|
__export(resolveShadowValue_exports, {
|
|
23
25
|
resolveShadowValue: () => resolveShadowValue
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(resolveShadowValue_exports);
|
|
26
|
-
var import_normalizeColor = require("./normalizeColor.cjs")
|
|
27
|
-
|
|
28
|
+
var import_normalizeColor = require("./normalizeColor.cjs");
|
|
29
|
+
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
|
|
28
30
|
const defaultOffset = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
height: 0,
|
|
32
|
+
width: 0
|
|
33
|
+
};
|
|
34
|
+
const resolveShadowValue = style => {
|
|
35
|
+
const {
|
|
36
|
+
shadowColor,
|
|
37
|
+
shadowOffset,
|
|
38
|
+
shadowOpacity,
|
|
39
|
+
shadowRadius
|
|
40
|
+
} = style;
|
|
41
|
+
const {
|
|
42
|
+
height,
|
|
43
|
+
width
|
|
44
|
+
} = shadowOffset || defaultOffset;
|
|
45
|
+
const offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width);
|
|
46
|
+
const offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height);
|
|
47
|
+
const blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0);
|
|
48
|
+
const color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
|
|
49
|
+
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
|
50
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
@@ -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 createCSSStyleSheet_exports = {};
|
|
22
24
|
__export(createCSSStyleSheet_exports, {
|
|
@@ -26,12 +28,25 @@ module.exports = __toCommonJS(createCSSStyleSheet_exports);
|
|
|
26
28
|
var import_canUseDOM = require("../../modules/canUseDOM.cjs");
|
|
27
29
|
function createCSSStyleSheet(id, rootNode, textContent) {
|
|
28
30
|
if (import_canUseDOM.canUseDOM) {
|
|
29
|
-
const root = rootNode
|
|
31
|
+
const root = rootNode != null ? rootNode : document;
|
|
30
32
|
let element = root.getElementById(id);
|
|
31
|
-
if (element == null)
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
if (element == null) {
|
|
34
|
+
element = document.createElement("style");
|
|
35
|
+
element.setAttribute("id", id);
|
|
36
|
+
if (typeof textContent === "string") {
|
|
37
|
+
element.appendChild(document.createTextNode(textContent));
|
|
38
|
+
}
|
|
39
|
+
if (root instanceof ShadowRoot) {
|
|
40
|
+
root.insertBefore(element, root.firstChild);
|
|
41
|
+
} else {
|
|
42
|
+
const head = root.head;
|
|
43
|
+
if (head) {
|
|
44
|
+
head.appendChild(element);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
48
|
return element.sheet;
|
|
36
|
-
} else
|
|
49
|
+
} else {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
37
52
|
}
|
|
@@ -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 createOrderedCSSStyleSheet_exports = {};
|
|
22
24
|
__export(createOrderedCSSStyleSheet_exports, {
|
|
@@ -25,49 +27,58 @@ __export(createOrderedCSSStyleSheet_exports, {
|
|
|
25
27
|
module.exports = __toCommonJS(createOrderedCSSStyleSheet_exports);
|
|
26
28
|
const slice = Array.prototype.slice;
|
|
27
29
|
function createOrderedCSSStyleSheet(sheet) {
|
|
28
|
-
const groups = {}
|
|
29
|
-
|
|
30
|
+
const groups = {};
|
|
31
|
+
const selectors = {};
|
|
30
32
|
if (sheet != null) {
|
|
31
33
|
let group;
|
|
32
34
|
slice.call(sheet.cssRules).forEach((cssRule, i) => {
|
|
33
35
|
const cssText = cssRule.cssText;
|
|
34
|
-
if (cssText.indexOf("stylesheet-group") > -1)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (cssText.indexOf("stylesheet-group") > -1) {
|
|
37
|
+
group = decodeGroupRule(cssRule);
|
|
38
|
+
groups[group] = {
|
|
39
|
+
start: i,
|
|
40
|
+
rules: [cssText]
|
|
41
|
+
};
|
|
42
|
+
} else {
|
|
38
43
|
const selectorText = getSelectorText(cssText);
|
|
39
|
-
selectorText != null
|
|
44
|
+
if (selectorText != null) {
|
|
45
|
+
selectors[selectorText] = true;
|
|
46
|
+
groups[group].rules.push(cssText);
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
});
|
|
42
50
|
}
|
|
43
51
|
function sheetInsert(sheet2, group, text) {
|
|
44
|
-
const orderedGroups = getOrderedGroups(groups)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
const orderedGroups = getOrderedGroups(groups);
|
|
53
|
+
const groupIndex = orderedGroups.indexOf(group);
|
|
54
|
+
const nextGroupIndex = groupIndex + 1;
|
|
55
|
+
const nextGroup = orderedGroups[nextGroupIndex];
|
|
56
|
+
const position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length;
|
|
57
|
+
const isInserted = insertRuleAt(sheet2, text, position);
|
|
49
58
|
if (isInserted) {
|
|
50
|
-
groups[group].start == null
|
|
59
|
+
if (groups[group].start == null) {
|
|
60
|
+
groups[group].start = position;
|
|
61
|
+
}
|
|
51
62
|
for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
|
52
|
-
const groupNumber = orderedGroups[i]
|
|
53
|
-
|
|
63
|
+
const groupNumber = orderedGroups[i];
|
|
64
|
+
const previousStart = groups[groupNumber].start || 0;
|
|
54
65
|
groups[groupNumber].start = previousStart + 1;
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
68
|
return isInserted;
|
|
58
69
|
}
|
|
59
|
-
|
|
70
|
+
const OrderedCSSStyleSheet = {
|
|
60
71
|
/**
|
|
61
72
|
* The textContent of the style sheet.
|
|
62
73
|
*/
|
|
63
74
|
getTextContent() {
|
|
64
75
|
return getOrderedGroups(groups).map(group => {
|
|
65
|
-
const rules = groups[group].rules
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
const rules = groups[group].rules;
|
|
77
|
+
const marker = rules.shift();
|
|
78
|
+
rules.sort();
|
|
79
|
+
rules.unshift(marker);
|
|
80
|
+
return rules.join("\n");
|
|
81
|
+
}).join("\n");
|
|
71
82
|
},
|
|
72
83
|
/**
|
|
73
84
|
* Insert a rule into the style sheet
|
|
@@ -79,12 +90,25 @@ function createOrderedCSSStyleSheet(sheet) {
|
|
|
79
90
|
groups[group] = {
|
|
80
91
|
start: null,
|
|
81
92
|
rules: [markerRule]
|
|
82
|
-
}
|
|
93
|
+
};
|
|
94
|
+
if (sheet != null) {
|
|
95
|
+
sheetInsert(sheet, group, markerRule);
|
|
96
|
+
}
|
|
83
97
|
}
|
|
84
98
|
const selectorText = getSelectorText(cssText);
|
|
85
|
-
selectorText != null && selectors[selectorText] == null
|
|
99
|
+
if (selectorText != null && selectors[selectorText] == null) {
|
|
100
|
+
selectors[selectorText] = true;
|
|
101
|
+
groups[group].rules.push(cssText);
|
|
102
|
+
if (sheet != null) {
|
|
103
|
+
const isInserted = sheetInsert(sheet, group, cssText);
|
|
104
|
+
if (!isInserted) {
|
|
105
|
+
groups[group].rules.pop();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
86
109
|
}
|
|
87
110
|
};
|
|
111
|
+
return OrderedCSSStyleSheet;
|
|
88
112
|
}
|
|
89
113
|
function encodeGroupRule(group) {
|
|
90
114
|
return `[stylesheet-group="${group}"]{}`;
|
|
@@ -103,8 +127,9 @@ function getSelectorText(cssText) {
|
|
|
103
127
|
}
|
|
104
128
|
function insertRuleAt(root, cssText, position) {
|
|
105
129
|
try {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
130
|
+
root.insertRule(cssText, position);
|
|
131
|
+
return true;
|
|
132
|
+
} catch (e) {
|
|
133
|
+
return false;
|
|
109
134
|
}
|
|
110
135
|
}
|
|
@@ -3,63 +3,85 @@ 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 dom_exports = {};
|
|
22
24
|
__export(dom_exports, {
|
|
23
25
|
createSheet: () => createSheet
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(dom_exports);
|
|
26
|
-
var import_canUseDOM = require("../../modules/canUseDOM.cjs")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const defaultId = "react-native-stylesheet"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
var import_canUseDOM = require("../../modules/canUseDOM.cjs");
|
|
29
|
+
var import_createCSSStyleSheet = require("./createCSSStyleSheet.cjs");
|
|
30
|
+
var import_createOrderedCSSStyleSheet = require("./createOrderedCSSStyleSheet.cjs");
|
|
31
|
+
const defaultId = "react-native-stylesheet";
|
|
32
|
+
const roots = /* @__PURE__ */new WeakMap();
|
|
33
|
+
const sheets = [];
|
|
34
|
+
const initialRules = [
|
|
35
|
+
// minimal top-level reset
|
|
36
|
+
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}", "body{margin:0;}",
|
|
37
|
+
// minimal form pseudo-element reset
|
|
38
|
+
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}", "input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];
|
|
37
39
|
function createSheet(root, id = defaultId) {
|
|
38
40
|
let sheet;
|
|
39
41
|
function createSheet2() {
|
|
40
|
-
if (
|
|
42
|
+
if (sheet) return;
|
|
43
|
+
if (import_canUseDOM.canUseDOM) {
|
|
41
44
|
const rootNode = root != null ? root.getRootNode() : document;
|
|
42
|
-
if (sheets.length === 0)
|
|
43
|
-
sheet.
|
|
44
|
-
|
|
45
|
+
if (sheets.length === 0) {
|
|
46
|
+
sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id));
|
|
47
|
+
initialRules.forEach(rule => {
|
|
48
|
+
sheet.insert(rule, 0);
|
|
49
|
+
});
|
|
50
|
+
roots.set(rootNode, sheets.length);
|
|
51
|
+
sheets.push(sheet);
|
|
52
|
+
} else {
|
|
45
53
|
const index = roots.get(rootNode);
|
|
46
54
|
if (index == null) {
|
|
47
|
-
const initialSheet = sheets[0]
|
|
48
|
-
|
|
49
|
-
sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id, rootNode, textContent))
|
|
50
|
-
|
|
55
|
+
const initialSheet = sheets[0];
|
|
56
|
+
const textContent = initialSheet != null ? initialSheet.getTextContent() : "";
|
|
57
|
+
sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id, rootNode, textContent));
|
|
58
|
+
roots.set(rootNode, sheets.length);
|
|
59
|
+
sheets.push(sheet);
|
|
60
|
+
} else {
|
|
61
|
+
sheet = sheets[index];
|
|
62
|
+
}
|
|
51
63
|
}
|
|
52
|
-
} else
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
} else {
|
|
65
|
+
if (sheets.length === 0) {
|
|
66
|
+
sheet = (0, import_createOrderedCSSStyleSheet.createOrderedCSSStyleSheet)((0, import_createCSSStyleSheet.createCSSStyleSheet)(id));
|
|
67
|
+
initialRules.forEach(rule => {
|
|
68
|
+
sheet.insert(rule, 0);
|
|
69
|
+
});
|
|
70
|
+
sheets.push(sheet);
|
|
71
|
+
} else {
|
|
72
|
+
sheet = sheets[0];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
55
75
|
}
|
|
56
76
|
return {
|
|
57
77
|
getTextContent() {
|
|
58
|
-
|
|
78
|
+
createSheet2();
|
|
79
|
+
return sheet.getTextContent();
|
|
59
80
|
},
|
|
60
81
|
id,
|
|
61
82
|
insert(cssText, groupValue) {
|
|
62
|
-
createSheet2()
|
|
83
|
+
createSheet2();
|
|
84
|
+
sheets.forEach(s => {
|
|
63
85
|
s.insert(cssText, groupValue);
|
|
64
86
|
});
|
|
65
87
|
}
|
|
@@ -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 StyleSheet_exports = {};
|
|
22
24
|
__export(StyleSheet_exports, {
|
|
@@ -25,13 +27,13 @@ __export(StyleSheet_exports, {
|
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(StyleSheet_exports);
|
|
27
29
|
const absoluteFillObject = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
position: "absolute",
|
|
31
|
+
left: 0,
|
|
32
|
+
right: 0,
|
|
33
|
+
top: 0,
|
|
34
|
+
bottom: 0
|
|
35
|
+
};
|
|
36
|
+
const absoluteFill = absoluteFillObject;
|
|
35
37
|
function create(styles) {
|
|
36
38
|
return styles;
|
|
37
39
|
}
|
|
@@ -39,7 +41,12 @@ function compose(style1, style2) {
|
|
|
39
41
|
return flatten(style1, style2);
|
|
40
42
|
}
|
|
41
43
|
function flatten(...styles) {
|
|
42
|
-
return styles.flat().flat().flat().flat().reduce((acc, cur) =>
|
|
44
|
+
return styles.flat().flat().flat().flat().reduce((acc, cur) => {
|
|
45
|
+
if (cur) {
|
|
46
|
+
Object.assign(acc, cur);
|
|
47
|
+
}
|
|
48
|
+
return acc;
|
|
49
|
+
}, {});
|
|
43
50
|
}
|
|
44
51
|
function getSheet() {
|
|
45
52
|
return {
|