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