@hanzogui/react-native-web-internals 2.0.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/LICENSE +21 -0
- package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +240 -0
- package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +407 -0
- package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +121 -0
- package/dist/cjs/StyleSheet/__tests__/index-test.cjs +404 -0
- package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +108 -0
- package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +36 -0
- package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +87 -0
- package/dist/cjs/StyleSheet/compiler/hash.cjs +26 -0
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +36 -0
- package/dist/cjs/StyleSheet/compiler/index.cjs +318 -0
- package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +40 -0
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +43 -0
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +48 -0
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +37 -0
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +110 -0
- package/dist/cjs/StyleSheet/dom/index.cjs +67 -0
- package/dist/cjs/StyleSheet/index.cjs +57 -0
- package/dist/cjs/StyleSheet/preprocess.cjs +101 -0
- package/dist/cjs/StyleSheet/validate.cjs +69 -0
- package/dist/cjs/TextAncestorContext.cjs +27 -0
- package/dist/cjs/colorProps.cjs +37 -0
- package/dist/cjs/index.cjs +103 -0
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +50 -0
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +40 -0
- package/dist/cjs/modules/AccessibilityUtil/index.cjs +33 -0
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +26 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +57 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +47 -0
- package/dist/cjs/modules/AssetRegistry/index.cjs +33 -0
- package/dist/cjs/modules/ImageLoader/index.cjs +111 -0
- package/dist/cjs/modules/InteractionManager.cjs +184 -0
- package/dist/cjs/modules/Platform/__tests__/index-test.cjs +48 -0
- package/dist/cjs/modules/Platform/index.cjs +30 -0
- package/dist/cjs/modules/TextInputState/index.cjs +55 -0
- package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +90 -0
- package/dist/cjs/modules/UIManager/index.cjs +60 -0
- package/dist/cjs/modules/canUseDOM.cjs +26 -0
- package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +156 -0
- package/dist/cjs/modules/createDOMProps/index.cjs +179 -0
- package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +344 -0
- package/dist/cjs/modules/createEventHandle/index.cjs +67 -0
- package/dist/cjs/modules/dismissKeyboard/index.cjs +29 -0
- package/dist/cjs/modules/forwardedProps/index.cjs +161 -0
- package/dist/cjs/modules/getBoundingClientRect/index.cjs +28 -0
- package/dist/cjs/modules/invariant.cjs +36 -0
- package/dist/cjs/modules/isSelectionValid/index.cjs +35 -0
- package/dist/cjs/modules/isWebColor/index.cjs +26 -0
- package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +42 -0
- package/dist/cjs/modules/mergeRefs/index.cjs +42 -0
- package/dist/cjs/modules/modality/__tests__/index-test.cjs +32 -0
- package/dist/cjs/modules/modality/index.cjs +135 -0
- package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +30 -0
- package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +35 -0
- package/dist/cjs/modules/normalizeColor/index.cjs +39 -0
- package/dist/cjs/modules/pick/index.cjs +30 -0
- package/dist/cjs/modules/processColor/__tests__/index-test.cjs +66 -0
- package/dist/cjs/modules/processColor/index.cjs +42 -0
- package/dist/cjs/modules/requestIdleCallback/index.cjs +44 -0
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +35 -0
- package/dist/cjs/modules/setValueForStyles/index.cjs +35 -0
- package/dist/cjs/modules/unitlessNumbers/index.cjs +85 -0
- package/dist/cjs/modules/useElementLayout/index.cjs +39 -0
- package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +408 -0
- package/dist/cjs/modules/useEvent/index.cjs +45 -0
- package/dist/cjs/modules/useHover/__tests__/index-test.cjs +273 -0
- package/dist/cjs/modules/useHover/index.cjs +97 -0
- package/dist/cjs/modules/useLayoutEffect/index.cjs +39 -0
- package/dist/cjs/modules/useLocale/index.cjs +66 -0
- package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +83 -0
- package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +102 -0
- package/dist/cjs/modules/useMergeRefs/index.cjs +43 -0
- package/dist/cjs/modules/usePlatformMethods/index.cjs +35 -0
- package/dist/cjs/modules/useStable/__tests__/index-test.cjs +92 -0
- package/dist/cjs/modules/useStable/index.cjs +42 -0
- package/dist/cjs/styleTypes.cjs +16 -0
- package/dist/cjs/types.cjs +16 -0
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +219 -0
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +408 -0
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +100 -0
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/__tests__/index-test.mjs +383 -0
- package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +109 -0
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs +37 -0
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +63 -0
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/hash.mjs +3 -0
- package/dist/esm/StyleSheet/compiler/hash.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +13 -0
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/index.mjs +292 -0
- package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +17 -0
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +20 -0
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -0
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +25 -0
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -0
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +14 -0
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -0
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +87 -0
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -0
- package/dist/esm/StyleSheet/dom/index.mjs +44 -0
- package/dist/esm/StyleSheet/dom/index.mjs.map +1 -0
- package/dist/esm/StyleSheet/index.mjs +33 -0
- package/dist/esm/StyleSheet/index.mjs.map +1 -0
- package/dist/esm/StyleSheet/preprocess.mjs +75 -0
- package/dist/esm/StyleSheet/preprocess.mjs.map +1 -0
- package/dist/esm/StyleSheet/validate.mjs +46 -0
- package/dist/esm/StyleSheet/validate.mjs.map +1 -0
- package/dist/esm/TextAncestorContext.mjs +4 -0
- package/dist/esm/TextAncestorContext.mjs.map +1 -0
- package/dist/esm/colorProps.mjs +14 -0
- package/dist/esm/colorProps.mjs.map +1 -0
- package/dist/esm/index.js +45 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +45 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +29 -0
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +19 -0
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/index.mjs +10 -0
- package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +3 -0
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +34 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +24 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -0
- package/dist/esm/modules/AssetRegistry/index.mjs +9 -0
- package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -0
- package/dist/esm/modules/ImageLoader/index.mjs +87 -0
- package/dist/esm/modules/ImageLoader/index.mjs.map +1 -0
- package/dist/esm/modules/InteractionManager.mjs +161 -0
- package/dist/esm/modules/InteractionManager.mjs.map +1 -0
- package/dist/esm/modules/Platform/__tests__/index-test.mjs +27 -0
- package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/Platform/index.mjs +7 -0
- package/dist/esm/modules/Platform/index.mjs.map +1 -0
- package/dist/esm/modules/TextInputState/index.mjs +32 -0
- package/dist/esm/modules/TextInputState/index.mjs.map +1 -0
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs +69 -0
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/UIManager/index.mjs +37 -0
- package/dist/esm/modules/UIManager/index.mjs.map +1 -0
- package/dist/esm/modules/canUseDOM.mjs +3 -0
- package/dist/esm/modules/canUseDOM.mjs.map +1 -0
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +135 -0
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/createDOMProps/index.mjs +155 -0
- package/dist/esm/modules/createDOMProps/index.mjs.map +1 -0
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +323 -0
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/createEventHandle/index.mjs +42 -0
- package/dist/esm/modules/createEventHandle/index.mjs.map +1 -0
- package/dist/esm/modules/dismissKeyboard/index.mjs +6 -0
- package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -0
- package/dist/esm/modules/forwardedProps/index.mjs +128 -0
- package/dist/esm/modules/forwardedProps/index.mjs.map +1 -0
- package/dist/esm/modules/getBoundingClientRect/index.mjs +5 -0
- package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -0
- package/dist/esm/modules/invariant.mjs +12 -0
- package/dist/esm/modules/invariant.mjs.map +1 -0
- package/dist/esm/modules/isSelectionValid/index.mjs +12 -0
- package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -0
- package/dist/esm/modules/isWebColor/index.mjs +3 -0
- package/dist/esm/modules/isWebColor/index.mjs.map +1 -0
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +21 -0
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/mergeRefs/index.mjs +19 -0
- package/dist/esm/modules/mergeRefs/index.mjs.map +1 -0
- package/dist/esm/modules/modality/__tests__/index-test.mjs +33 -0
- package/dist/esm/modules/modality/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/modality/index.mjs +109 -0
- package/dist/esm/modules/modality/index.mjs.map +1 -0
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +9 -0
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +12 -0
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -0
- package/dist/esm/modules/normalizeColor/index.mjs +16 -0
- package/dist/esm/modules/normalizeColor/index.mjs.map +1 -0
- package/dist/esm/modules/pick/index.mjs +7 -0
- package/dist/esm/modules/pick/index.mjs.map +1 -0
- package/dist/esm/modules/processColor/__tests__/index-test.mjs +45 -0
- package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/processColor/index.mjs +8 -0
- package/dist/esm/modules/processColor/index.mjs.map +1 -0
- package/dist/esm/modules/requestIdleCallback/index.mjs +20 -0
- package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -0
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +12 -0
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -0
- package/dist/esm/modules/setValueForStyles/index.mjs +12 -0
- package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -0
- package/dist/esm/modules/unitlessNumbers/index.mjs +62 -0
- package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -0
- package/dist/esm/modules/useElementLayout/index.mjs +16 -0
- package/dist/esm/modules/useElementLayout/index.mjs.map +1 -0
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs +387 -0
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/useEvent/index.mjs +22 -0
- package/dist/esm/modules/useEvent/index.mjs.map +1 -0
- package/dist/esm/modules/useHover/__tests__/index-test.mjs +252 -0
- package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/useHover/index.mjs +74 -0
- package/dist/esm/modules/useHover/index.mjs.map +1 -0
- package/dist/esm/modules/useLayoutEffect/index.mjs +5 -0
- package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -0
- package/dist/esm/modules/useLocale/index.mjs +30 -0
- package/dist/esm/modules/useLocale/index.mjs.map +1 -0
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs +60 -0
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -0
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +81 -0
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/useMergeRefs/index.mjs +9 -0
- package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -0
- package/dist/esm/modules/usePlatformMethods/index.mjs +12 -0
- package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -0
- package/dist/esm/modules/useStable/__tests__/index-test.mjs +71 -0
- package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +1 -0
- package/dist/esm/modules/useStable/index.mjs +8 -0
- package/dist/esm/modules/useStable/index.mjs.map +1 -0
- package/dist/esm/styleTypes.mjs +2 -0
- package/dist/esm/styleTypes.mjs.map +1 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/package.json +58 -0
- package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +236 -0
- package/src/StyleSheet/__tests__/compiler-test.tsx +426 -0
- package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +169 -0
- package/src/StyleSheet/__tests__/index-test.tsx +406 -0
- package/src/StyleSheet/__tests__/preprocess-test.tsx +107 -0
- package/src/StyleSheet/__tests__/validate-test.tsx +42 -0
- package/src/StyleSheet/compiler/createReactDOMStyle.tsx +215 -0
- package/src/StyleSheet/compiler/hash.tsx +1 -0
- package/src/StyleSheet/compiler/hyphenateStyleName.tsx +25 -0
- package/src/StyleSheet/compiler/index.tsx +478 -0
- package/src/StyleSheet/compiler/normalizeColor.tsx +35 -0
- package/src/StyleSheet/compiler/normalizeValueWithProperty.tsx +34 -0
- package/src/StyleSheet/compiler/resolveShadowValue.tsx +26 -0
- package/src/StyleSheet/dom/createCSSStyleSheet.tsx +42 -0
- package/src/StyleSheet/dom/createOrderedCSSStyleSheet.tsx +195 -0
- package/src/StyleSheet/dom/index.tsx +92 -0
- package/src/StyleSheet/index.tsx +99 -0
- package/src/StyleSheet/preprocess.tsx +119 -0
- package/src/StyleSheet/validate.tsx +90 -0
- package/src/TextAncestorContext.tsx +13 -0
- package/src/colorProps.tsx +12 -0
- package/src/index.tsx +58 -0
- package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +44 -0
- package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +25 -0
- package/src/modules/AccessibilityUtil/index.tsx +18 -0
- package/src/modules/AccessibilityUtil/isDisabled.tsx +13 -0
- package/src/modules/AccessibilityUtil/propsToAccessibilityComponent.tsx +54 -0
- package/src/modules/AccessibilityUtil/propsToAriaRole.tsx +37 -0
- package/src/modules/AssetRegistry/index.tsx +32 -0
- package/src/modules/ImageLoader/index.tsx +165 -0
- package/src/modules/InteractionManager.tsx +315 -0
- package/src/modules/Platform/__tests__/index-test.tsx +45 -0
- package/src/modules/Platform/index.tsx +15 -0
- package/src/modules/TextInputState/index.tsx +62 -0
- package/src/modules/UIManager/__tests__/index-test.tsx +87 -0
- package/src/modules/UIManager/index.tsx +68 -0
- package/src/modules/canUseDOM.tsx +14 -0
- package/src/modules/createDOMProps/__tests__/index-test.tsx +138 -0
- package/src/modules/createDOMProps/index.tsx +436 -0
- package/src/modules/createEventHandle/__tests__/index-test.tsx +459 -0
- package/src/modules/createEventHandle/index.tsx +100 -0
- package/src/modules/dismissKeyboard/index.tsx +14 -0
- package/src/modules/forwardedProps/index.tsx +145 -0
- package/src/modules/getBoundingClientRect/index.tsx +17 -0
- package/src/modules/invariant.ts +23 -0
- package/src/modules/isSelectionValid/index.tsx +20 -0
- package/src/modules/isWebColor/index.tsx +14 -0
- package/src/modules/mergeRefs/__tests__/index-test.tsx +32 -0
- package/src/modules/mergeRefs/index.tsx +36 -0
- package/src/modules/modality/__tests__/index-test.tsx +66 -0
- package/src/modules/modality/index.tsx +228 -0
- package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +23 -0
- package/src/modules/multiplyStyleLengthValue/index.tsx +26 -0
- package/src/modules/normalizeColor/index.tsx +32 -0
- package/src/modules/pick/index.tsx +25 -0
- package/src/modules/processColor/__tests__/index-test.tsx +78 -0
- package/src/modules/processColor/index.tsx +28 -0
- package/src/modules/requestIdleCallback/index.tsx +35 -0
- package/src/modules/setValueForStyles/dangerousStyleValue.tsx +74 -0
- package/src/modules/setValueForStyles/index.tsx +39 -0
- package/src/modules/unitlessNumbers/index.tsx +77 -0
- package/src/modules/useElementLayout/index.tsx +28 -0
- package/src/modules/useEvent/__tests__/index-test.tsx +511 -0
- package/src/modules/useEvent/index.tsx +64 -0
- package/src/modules/useHover/__tests__/index-test.tsx +342 -0
- package/src/modules/useHover/index.tsx +181 -0
- package/src/modules/useLayoutEffect/index.ts +15 -0
- package/src/modules/useLocale/index.tsx +57 -0
- package/src/modules/useLocale/isLocaleRTL.tsx +74 -0
- package/src/modules/useMergeRefs/__tests__/index-test.tsx +91 -0
- package/src/modules/useMergeRefs/index.tsx +22 -0
- package/src/modules/usePlatformMethods/index.tsx +40 -0
- package/src/modules/useStable/__tests__/index-test.tsx +101 -0
- package/src/modules/useStable/index.tsx +24 -0
- package/src/styleTypes.ts +321 -0
- package/src/types.ts +77 -0
- package/types/StyleSheet/compiler/createReactDOMStyle.d.ts +18 -0
- package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -0
- package/types/StyleSheet/compiler/hash.d.ts +2 -0
- package/types/StyleSheet/compiler/hash.d.ts.map +1 -0
- package/types/StyleSheet/compiler/hyphenateStyleName.d.ts +10 -0
- package/types/StyleSheet/compiler/hyphenateStyleName.d.ts.map +1 -0
- package/types/StyleSheet/compiler/index.d.ts +39 -0
- package/types/StyleSheet/compiler/index.d.ts.map +1 -0
- package/types/StyleSheet/compiler/normalizeColor.d.ts +10 -0
- package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -0
- package/types/StyleSheet/compiler/normalizeValueWithProperty.d.ts +10 -0
- package/types/StyleSheet/compiler/normalizeValueWithProperty.d.ts.map +1 -0
- package/types/StyleSheet/compiler/resolveShadowValue.d.ts +10 -0
- package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -0
- package/types/StyleSheet/dom/createCSSStyleSheet.d.ts +10 -0
- package/types/StyleSheet/dom/createCSSStyleSheet.d.ts.map +1 -0
- package/types/StyleSheet/dom/createOrderedCSSStyleSheet.d.ts +29 -0
- package/types/StyleSheet/dom/createOrderedCSSStyleSheet.d.ts.map +1 -0
- package/types/StyleSheet/dom/index.d.ts +15 -0
- package/types/StyleSheet/dom/index.d.ts.map +1 -0
- package/types/StyleSheet/index.d.ts +69 -0
- package/types/StyleSheet/index.d.ts.map +1 -0
- package/types/StyleSheet/preprocess.d.ts +16 -0
- package/types/StyleSheet/preprocess.d.ts.map +1 -0
- package/types/StyleSheet/validate.d.ts +10 -0
- package/types/StyleSheet/validate.d.ts.map +1 -0
- package/types/TextAncestorContext.d.ts +11 -0
- package/types/TextAncestorContext.d.ts.map +1 -0
- package/types/colorProps.d.ts +13 -0
- package/types/colorProps.d.ts.map +1 -0
- package/types/index.d.ts +45 -0
- package/types/index.d.ts.map +1 -0
- package/types/modules/AccessibilityUtil/index.d.ts +16 -0
- package/types/modules/AccessibilityUtil/index.d.ts.map +1 -0
- package/types/modules/AccessibilityUtil/isDisabled.d.ts +10 -0
- package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -0
- package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts +10 -0
- package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -0
- package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts +12 -0
- package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -0
- package/types/modules/AssetRegistry/index.d.ts +22 -0
- package/types/modules/AssetRegistry/index.d.ts.map +1 -0
- package/types/modules/ImageLoader/index.d.ts +27 -0
- package/types/modules/ImageLoader/index.d.ts.map +1 -0
- package/types/modules/InteractionManager.d.ts +48 -0
- package/types/modules/InteractionManager.d.ts.map +1 -0
- package/types/modules/Platform/index.d.ts +15 -0
- package/types/modules/Platform/index.d.ts.map +1 -0
- package/types/modules/TextInputState/index.d.ts +38 -0
- package/types/modules/TextInputState/index.d.ts.map +1 -0
- package/types/modules/UIManager/index.d.ts +23 -0
- package/types/modules/UIManager/index.d.ts.map +1 -0
- package/types/modules/canUseDOM.d.ts +10 -0
- package/types/modules/canUseDOM.d.ts.map +1 -0
- package/types/modules/createDOMProps/index.d.ts +12 -0
- package/types/modules/createDOMProps/index.d.ts.map +1 -0
- package/types/modules/createEventHandle/index.d.ts +20 -0
- package/types/modules/createEventHandle/index.d.ts.map +1 -0
- package/types/modules/dismissKeyboard/index.d.ts +10 -0
- package/types/modules/dismissKeyboard/index.d.ts.map +1 -0
- package/types/modules/forwardedProps/index.d.ts +383 -0
- package/types/modules/forwardedProps/index.d.ts.map +1 -0
- package/types/modules/getBoundingClientRect/index.d.ts +10 -0
- package/types/modules/getBoundingClientRect/index.d.ts.map +1 -0
- package/types/modules/invariant.d.ts +3 -0
- package/types/modules/invariant.d.ts.map +1 -0
- package/types/modules/isSelectionValid/index.d.ts +10 -0
- package/types/modules/isSelectionValid/index.d.ts.map +1 -0
- package/types/modules/isWebColor/index.d.ts +10 -0
- package/types/modules/isWebColor/index.d.ts.map +1 -0
- package/types/modules/mergeRefs/index.d.ts +11 -0
- package/types/modules/mergeRefs/index.d.ts.map +1 -0
- package/types/modules/modality/index.d.ts +17 -0
- package/types/modules/modality/index.d.ts.map +1 -0
- package/types/modules/multiplyStyleLengthValue/index.d.ts +10 -0
- package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -0
- package/types/modules/normalizeColor/index.d.ts +10 -0
- package/types/modules/normalizeColor/index.d.ts.map +1 -0
- package/types/modules/pick/index.d.ts +12 -0
- package/types/modules/pick/index.d.ts.map +1 -0
- package/types/modules/processColor/index.d.ts +11 -0
- package/types/modules/processColor/index.d.ts.map +1 -0
- package/types/modules/requestIdleCallback/index.d.ts +3 -0
- package/types/modules/requestIdleCallback/index.d.ts.map +1 -0
- package/types/modules/setValueForStyles/dangerousStyleValue.d.ts +11 -0
- package/types/modules/setValueForStyles/dangerousStyleValue.d.ts.map +1 -0
- package/types/modules/setValueForStyles/index.d.ts +9 -0
- package/types/modules/setValueForStyles/index.d.ts.map +1 -0
- package/types/modules/unitlessNumbers/index.d.ts +60 -0
- package/types/modules/unitlessNumbers/index.d.ts.map +1 -0
- package/types/modules/useElementLayout/index.d.ts +4 -0
- package/types/modules/useElementLayout/index.d.ts.map +1 -0
- package/types/modules/useEvent/index.d.ts +24 -0
- package/types/modules/useEvent/index.d.ts.map +1 -0
- package/types/modules/useHover/index.d.ts +21 -0
- package/types/modules/useHover/index.d.ts.map +1 -0
- package/types/modules/useLayoutEffect/index.d.ts +13 -0
- package/types/modules/useLayoutEffect/index.d.ts.map +1 -0
- package/types/modules/useLocale/index.d.ts +14 -0
- package/types/modules/useLocale/index.d.ts.map +1 -0
- package/types/modules/useLocale/isLocaleRTL.d.ts +13 -0
- package/types/modules/useLocale/isLocaleRTL.d.ts.map +1 -0
- package/types/modules/useMergeRefs/index.d.ts +11 -0
- package/types/modules/useMergeRefs/index.d.ts.map +1 -0
- package/types/modules/usePlatformMethods/index.d.ts +18 -0
- package/types/modules/usePlatformMethods/index.d.ts.map +1 -0
- package/types/modules/useStable/index.d.ts +10 -0
- package/types/modules/useStable/index.d.ts.map +1 -0
- package/types/styleTypes.d.ts +211 -0
- package/types/styleTypes.d.ts.map +1 -0
- package/types/types.d.ts +46 -0
- package/types/types.d.ts.map +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* From React 16.0.0
|
|
10
|
+
* @noflow
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { unitlessNumbers as isUnitlessNumber } from '../unitlessNumbers/index'
|
|
14
|
+
import { normalizeValueWithProperty } from '../../StyleSheet/compiler/normalizeValueWithProperty'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Convert a value into the proper css writable value. The style name `name`
|
|
18
|
+
* should be logical (no hyphens), as specified
|
|
19
|
+
* in `CSSProperty.isUnitlessNumber`.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} name CSS property name such as `topMargin`.
|
|
22
|
+
* @param {*} value CSS property value such as `10px`.
|
|
23
|
+
* @return {string} Normalized style value with dimensions applied.
|
|
24
|
+
*/
|
|
25
|
+
export function dangerousStyleValue(name, value, isCustomProperty) {
|
|
26
|
+
// Note that we've removed escapeTextForBrowser() calls here since the
|
|
27
|
+
// whole string will be escaped when the attribute is injected into
|
|
28
|
+
// the markup. If you provide unsafe user data here they can inject
|
|
29
|
+
// arbitrary CSS which may be problematic (I couldn't repro this):
|
|
30
|
+
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
|
|
31
|
+
// http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
|
|
32
|
+
// This is not an XSS hole but instead a potential CSS injection issue
|
|
33
|
+
// which has lead to a greater discussion about how we're going to
|
|
34
|
+
// trust URLs moving forward. See #2115901
|
|
35
|
+
|
|
36
|
+
var isEmpty = value == null || typeof value === 'boolean' || value === ''
|
|
37
|
+
if (isEmpty) {
|
|
38
|
+
return ''
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// handle Animated.Value objects that have __getValue
|
|
42
|
+
if (typeof value === 'object' && typeof value.__getValue === 'function') {
|
|
43
|
+
value = value.__getValue()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// handle transform arrays: [{ translateY: 10 }, { scale: 2 }]
|
|
47
|
+
if (name === 'transform' && Array.isArray(value)) {
|
|
48
|
+
return value
|
|
49
|
+
.map((t) => {
|
|
50
|
+
const key = Object.keys(t)[0]
|
|
51
|
+
let val = t[key]
|
|
52
|
+
// resolve nested Animated.Value
|
|
53
|
+
if (typeof val === 'object' && typeof val.__getValue === 'function') {
|
|
54
|
+
val = val.__getValue()
|
|
55
|
+
}
|
|
56
|
+
if (key === 'matrix' || key === 'matrix3d') {
|
|
57
|
+
return `${key}(${val.join(',')})`
|
|
58
|
+
}
|
|
59
|
+
return `${key}(${normalizeValueWithProperty(val, key)})`
|
|
60
|
+
})
|
|
61
|
+
.join(' ')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (
|
|
65
|
+
!isCustomProperty &&
|
|
66
|
+
typeof value === 'number' &&
|
|
67
|
+
value !== 0 &&
|
|
68
|
+
!(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])
|
|
69
|
+
) {
|
|
70
|
+
return value + 'px' // Presumes implicit 'px' suffix for unitless numbers
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return ('' + value).trim()
|
|
74
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* From React 16.3.0
|
|
10
|
+
* @noflow
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { dangerousStyleValue } from './dangerousStyleValue'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sets the value for multiple styles on a node. If a value is specified as
|
|
17
|
+
* '' (empty string), the corresponding style property will be unset.
|
|
18
|
+
*
|
|
19
|
+
* @param {DOMElement} node
|
|
20
|
+
* @param {object} styles
|
|
21
|
+
*/
|
|
22
|
+
export function setValueForStyles(node, styles) {
|
|
23
|
+
const style = node.style
|
|
24
|
+
for (let styleName in styles) {
|
|
25
|
+
if (!styles.hasOwnProperty(styleName)) {
|
|
26
|
+
continue
|
|
27
|
+
}
|
|
28
|
+
const isCustomProperty = styleName.indexOf('--') === 0
|
|
29
|
+
const styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty)
|
|
30
|
+
if (styleName === 'float') {
|
|
31
|
+
styleName = 'cssFloat'
|
|
32
|
+
}
|
|
33
|
+
if (isCustomProperty) {
|
|
34
|
+
style.setProperty(styleName, styleValue)
|
|
35
|
+
} else {
|
|
36
|
+
style[styleName] = styleValue
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Nicolas Gallagher.
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const unitlessNumbers = {
|
|
12
|
+
animationIterationCount: true,
|
|
13
|
+
aspectRatio: true,
|
|
14
|
+
borderImageOutset: true,
|
|
15
|
+
borderImageSlice: true,
|
|
16
|
+
borderImageWidth: true,
|
|
17
|
+
boxFlex: true,
|
|
18
|
+
boxFlexGroup: true,
|
|
19
|
+
boxOrdinalGroup: true,
|
|
20
|
+
columnCount: true,
|
|
21
|
+
flex: true,
|
|
22
|
+
flexGrow: true,
|
|
23
|
+
flexOrder: true,
|
|
24
|
+
flexPositive: true,
|
|
25
|
+
flexShrink: true,
|
|
26
|
+
flexNegative: true,
|
|
27
|
+
fontWeight: true,
|
|
28
|
+
gap: true,
|
|
29
|
+
columnGap: true,
|
|
30
|
+
rowGap: true,
|
|
31
|
+
gridRow: true,
|
|
32
|
+
gridRowEnd: true,
|
|
33
|
+
gridRowGap: true,
|
|
34
|
+
gridRowStart: true,
|
|
35
|
+
gridColumn: true,
|
|
36
|
+
gridColumnEnd: true,
|
|
37
|
+
gridColumnGap: true,
|
|
38
|
+
gridColumnStart: true,
|
|
39
|
+
lineClamp: true,
|
|
40
|
+
opacity: true,
|
|
41
|
+
order: true,
|
|
42
|
+
orphans: true,
|
|
43
|
+
tabSize: true,
|
|
44
|
+
widows: true,
|
|
45
|
+
zIndex: true,
|
|
46
|
+
zoom: true,
|
|
47
|
+
// SVG-related
|
|
48
|
+
fillOpacity: true,
|
|
49
|
+
floodOpacity: true,
|
|
50
|
+
stopOpacity: true,
|
|
51
|
+
strokeDasharray: true,
|
|
52
|
+
strokeDashoffset: true,
|
|
53
|
+
strokeMiterlimit: true,
|
|
54
|
+
strokeOpacity: true,
|
|
55
|
+
strokeWidth: true,
|
|
56
|
+
// transform types
|
|
57
|
+
scale: true,
|
|
58
|
+
scaleX: true,
|
|
59
|
+
scaleY: true,
|
|
60
|
+
scaleZ: true,
|
|
61
|
+
// RN properties
|
|
62
|
+
shadowOpacity: true,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Support style names that may come passed in prefixed by adding permutations
|
|
67
|
+
* of vendor prefixes.
|
|
68
|
+
*/
|
|
69
|
+
const prefixes = ['ms', 'Moz', 'O', 'Webkit']
|
|
70
|
+
const prefixKey = (prefix: string, key: string) => {
|
|
71
|
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1)
|
|
72
|
+
}
|
|
73
|
+
Object.keys(unitlessNumbers).forEach((prop) => {
|
|
74
|
+
prefixes.forEach((prefix) => {
|
|
75
|
+
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop]
|
|
76
|
+
})
|
|
77
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
enable,
|
|
3
|
+
useElementLayout as useGuiElementLayout,
|
|
4
|
+
} from '@hanzogui/use-element-layout'
|
|
5
|
+
import { type RefObject, useEffect, useMemo } from 'react'
|
|
6
|
+
import type { LayoutEvent } from '../../types'
|
|
7
|
+
|
|
8
|
+
export function useElementLayout(
|
|
9
|
+
ref: RefObject<any>,
|
|
10
|
+
onLayout?: ((e: LayoutEvent) => void) | null
|
|
11
|
+
) {
|
|
12
|
+
// translates to hanzo-gui style
|
|
13
|
+
const wrappedRef = useMemo(() => {
|
|
14
|
+
return {
|
|
15
|
+
current: {
|
|
16
|
+
get host() {
|
|
17
|
+
return ref.current
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
}, [ref])
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
enable()
|
|
25
|
+
}, [])
|
|
26
|
+
|
|
27
|
+
return useGuiElementLayout(wrappedRef, onLayout)
|
|
28
|
+
}
|