@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Nicolas Gallagher.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
15
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
16
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
17
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
18
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
19
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: !0
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
var import_createReactDOMStyle = __toESM(require("../compiler/createReactDOMStyle.cjs"), 1);
|
|
24
|
+
const reactNativeStyle = {
|
|
25
|
+
boxShadow: "1px 1px 1px 1px #000",
|
|
26
|
+
borderWidthLeft: 2,
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
borderWidthRight: 3,
|
|
29
|
+
display: "flex",
|
|
30
|
+
marginVertical: 0,
|
|
31
|
+
opacity: 0,
|
|
32
|
+
shadowColor: "red",
|
|
33
|
+
shadowOffset: {
|
|
34
|
+
width: 1,
|
|
35
|
+
height: 2
|
|
36
|
+
},
|
|
37
|
+
resizeMode: "contain"
|
|
38
|
+
};
|
|
39
|
+
describe("compiler/createReactDOMStyle", () => {
|
|
40
|
+
test("noop on DOM styles", () => {
|
|
41
|
+
const firstStyle = (0, import_createReactDOMStyle.default)(reactNativeStyle),
|
|
42
|
+
secondStyle = (0, import_createReactDOMStyle.default)(firstStyle);
|
|
43
|
+
expect(firstStyle).toEqual(secondStyle);
|
|
44
|
+
}), test("shortform -> longform for inline styles", () => {
|
|
45
|
+
const style = {
|
|
46
|
+
borderStyle: "solid",
|
|
47
|
+
boxSizing: "border-box",
|
|
48
|
+
borderBottomColor: "white",
|
|
49
|
+
borderBottomWidth: 1,
|
|
50
|
+
borderWidth: 0,
|
|
51
|
+
marginTop: 50,
|
|
52
|
+
marginVertical: 25,
|
|
53
|
+
margin: 10,
|
|
54
|
+
overflow: "hidden",
|
|
55
|
+
overscrollBehavior: "contain",
|
|
56
|
+
paddingLeft: 50,
|
|
57
|
+
paddingHorizontal: 25,
|
|
58
|
+
padding: 10
|
|
59
|
+
};
|
|
60
|
+
expect((0, import_createReactDOMStyle.default)(style, !0)).toMatchInlineSnapshot(`
|
|
61
|
+
{
|
|
62
|
+
"borderBottomColor": "rgba(255,255,255,1.00)",
|
|
63
|
+
"borderBottomStyle": "solid",
|
|
64
|
+
"borderBottomWidth": "1px",
|
|
65
|
+
"borderLeftStyle": "solid",
|
|
66
|
+
"borderLeftWidth": "0px",
|
|
67
|
+
"borderRightStyle": "solid",
|
|
68
|
+
"borderRightWidth": "0px",
|
|
69
|
+
"borderTopStyle": "solid",
|
|
70
|
+
"borderTopWidth": "0px",
|
|
71
|
+
"boxSizing": "border-box",
|
|
72
|
+
"marginBottom": "25px",
|
|
73
|
+
"marginLeft": "10px",
|
|
74
|
+
"marginRight": "10px",
|
|
75
|
+
"marginTop": "50px",
|
|
76
|
+
"overflowX": "hidden",
|
|
77
|
+
"overflowY": "hidden",
|
|
78
|
+
"overscrollBehaviorX": "contain",
|
|
79
|
+
"overscrollBehaviorY": "contain",
|
|
80
|
+
"paddingBottom": "10px",
|
|
81
|
+
"paddingLeft": "50px",
|
|
82
|
+
"paddingRight": "25px",
|
|
83
|
+
"paddingTop": "10px",
|
|
84
|
+
}
|
|
85
|
+
`);
|
|
86
|
+
}), test("aspectRatio", () => {
|
|
87
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
88
|
+
aspectRatio: 9 / 16
|
|
89
|
+
})).toEqual({
|
|
90
|
+
aspectRatio: "0.5625"
|
|
91
|
+
});
|
|
92
|
+
}), describe("flexbox styles", () => {
|
|
93
|
+
test("flex: -1", () => {
|
|
94
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
95
|
+
flex: -1
|
|
96
|
+
})).toEqual({
|
|
97
|
+
flexGrow: 0,
|
|
98
|
+
flexShrink: 1,
|
|
99
|
+
flexBasis: "auto"
|
|
100
|
+
});
|
|
101
|
+
}), test("flex: 0", () => {
|
|
102
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
103
|
+
flex: 0
|
|
104
|
+
})).toEqual({
|
|
105
|
+
flex: 0
|
|
106
|
+
});
|
|
107
|
+
}), test("flex: 1", () => {
|
|
108
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
109
|
+
flex: 1
|
|
110
|
+
})).toEqual({
|
|
111
|
+
flex: 1
|
|
112
|
+
});
|
|
113
|
+
}), test("flex: 10", () => {
|
|
114
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
115
|
+
flex: 10
|
|
116
|
+
})).toEqual({
|
|
117
|
+
flex: 10
|
|
118
|
+
});
|
|
119
|
+
}), test("flexBasis overrides", () => {
|
|
120
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
121
|
+
flexBasis: "25%"
|
|
122
|
+
})).toEqual({
|
|
123
|
+
flexBasis: "25%"
|
|
124
|
+
}), expect((0, import_createReactDOMStyle.default)({
|
|
125
|
+
flex: 1,
|
|
126
|
+
flexBasis: "25%"
|
|
127
|
+
})).toEqual({
|
|
128
|
+
flex: 1,
|
|
129
|
+
flexBasis: "25%"
|
|
130
|
+
});
|
|
131
|
+
}), test("flexShrink overrides", () => {
|
|
132
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
133
|
+
flexShrink: 1
|
|
134
|
+
})).toEqual({
|
|
135
|
+
flexShrink: 1
|
|
136
|
+
}), expect((0, import_createReactDOMStyle.default)({
|
|
137
|
+
flex: 1,
|
|
138
|
+
flexShrink: 2
|
|
139
|
+
})).toEqual({
|
|
140
|
+
flex: 1,
|
|
141
|
+
flexShrink: 2
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}), describe("fontFamily", () => {
|
|
145
|
+
test("general case", () => {
|
|
146
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
147
|
+
fontFamily: "Georgia, Times, serif"
|
|
148
|
+
})).toMatchInlineSnapshot(`
|
|
149
|
+
{
|
|
150
|
+
"fontFamily": "Georgia, Times, serif",
|
|
151
|
+
}
|
|
152
|
+
`);
|
|
153
|
+
}), test('"monospace"', () => {
|
|
154
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
155
|
+
fontFamily: "monospace"
|
|
156
|
+
})).toMatchInlineSnapshot(`
|
|
157
|
+
{
|
|
158
|
+
"fontFamily": "monospace,monospace",
|
|
159
|
+
}
|
|
160
|
+
`);
|
|
161
|
+
}), test('"System"', () => {
|
|
162
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
163
|
+
fontFamily: "System"
|
|
164
|
+
})).toMatchInlineSnapshot(`
|
|
165
|
+
{
|
|
166
|
+
"fontFamily": "-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
|
|
167
|
+
}
|
|
168
|
+
`), expect((0, import_createReactDOMStyle.default)({
|
|
169
|
+
font: "14px System"
|
|
170
|
+
})).toMatchInlineSnapshot(`
|
|
171
|
+
{
|
|
172
|
+
"font": "14px -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
|
|
173
|
+
}
|
|
174
|
+
`);
|
|
175
|
+
}), test('"Noto, System"', () => {
|
|
176
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
177
|
+
fontFamily: "Noto, System"
|
|
178
|
+
})).toMatchInlineSnapshot(`
|
|
179
|
+
{
|
|
180
|
+
"fontFamily": "Noto,-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
|
|
181
|
+
}
|
|
182
|
+
`), expect((0, import_createReactDOMStyle.default)({
|
|
183
|
+
font: "14px Noto, System"
|
|
184
|
+
})).toMatchInlineSnapshot(`
|
|
185
|
+
{
|
|
186
|
+
"font": "14px Noto, -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
|
|
187
|
+
}
|
|
188
|
+
`);
|
|
189
|
+
}), test('"Noto, BlinkMacSystemFont"', () => {
|
|
190
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
191
|
+
fontFamily: "Noto, BlinkMacSystemFont"
|
|
192
|
+
})).toMatchInlineSnapshot(`
|
|
193
|
+
{
|
|
194
|
+
"fontFamily": "Noto,BlinkMacSystemFont",
|
|
195
|
+
}
|
|
196
|
+
`);
|
|
197
|
+
});
|
|
198
|
+
}), test("fontVariant", () => {
|
|
199
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
200
|
+
fontVariant: ["common-ligatures", "small-caps"]
|
|
201
|
+
})).toEqual({
|
|
202
|
+
fontVariant: "common-ligatures small-caps"
|
|
203
|
+
});
|
|
204
|
+
}), test("textAlignVertical", () => {
|
|
205
|
+
expect((0, import_createReactDOMStyle.default)({
|
|
206
|
+
textAlignVertical: "center"
|
|
207
|
+
})).toEqual({
|
|
208
|
+
verticalAlign: "middle"
|
|
209
|
+
});
|
|
210
|
+
}), describe("transform", () => {
|
|
211
|
+
test("string", () => {
|
|
212
|
+
const transform = "perspective(50px) scaleX(20) translateX(20px) rotate(20deg)",
|
|
213
|
+
resolved = (0, import_createReactDOMStyle.default)({
|
|
214
|
+
transform
|
|
215
|
+
});
|
|
216
|
+
expect(resolved).toEqual({
|
|
217
|
+
transform
|
|
218
|
+
});
|
|
219
|
+
}), test("array", () => {
|
|
220
|
+
const resolved = (0, import_createReactDOMStyle.default)({
|
|
221
|
+
transform: [{
|
|
222
|
+
perspective: 50
|
|
223
|
+
}, {
|
|
224
|
+
scaleX: 20
|
|
225
|
+
}, {
|
|
226
|
+
translateX: 20
|
|
227
|
+
}, {
|
|
228
|
+
rotate: "20deg"
|
|
229
|
+
}, {
|
|
230
|
+
matrix: [1, 2, 3, 4, 5, 6]
|
|
231
|
+
}, {
|
|
232
|
+
matrix3d: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
|
|
233
|
+
}]
|
|
234
|
+
});
|
|
235
|
+
expect(resolved).toEqual({
|
|
236
|
+
transform: "perspective(50px) scaleX(20) translateX(20px) rotate(20deg) matrix(1,2,3,4,5,6) matrix3d(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)"
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
});
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
var import_compiler = require("../compiler/index.cjs");
|
|
2
|
+
describe("StyleSheet/compile", () => {
|
|
3
|
+
describe("atomic", () => {
|
|
4
|
+
test("converts style to atomic CSS", () => {
|
|
5
|
+
const result = (0, import_compiler.atomic)({
|
|
6
|
+
animationDirection: ["alternate", "alternate-reverse"],
|
|
7
|
+
animationKeyframes: [{
|
|
8
|
+
"0%": {
|
|
9
|
+
top: 0
|
|
10
|
+
},
|
|
11
|
+
"50%": {
|
|
12
|
+
top: 5
|
|
13
|
+
},
|
|
14
|
+
"100%": {
|
|
15
|
+
top: 10
|
|
16
|
+
}
|
|
17
|
+
}, {
|
|
18
|
+
from: {
|
|
19
|
+
left: 0
|
|
20
|
+
},
|
|
21
|
+
to: {
|
|
22
|
+
left: 10
|
|
23
|
+
}
|
|
24
|
+
}],
|
|
25
|
+
fontFamily: "System",
|
|
26
|
+
marginHorizontal: 10,
|
|
27
|
+
marginStart: 1,
|
|
28
|
+
marginEnd: 2,
|
|
29
|
+
placeholderTextColor: "gray",
|
|
30
|
+
scrollbarWidth: "none",
|
|
31
|
+
pointerEvents: "box-only",
|
|
32
|
+
start: "12.34%",
|
|
33
|
+
textAlign: "start",
|
|
34
|
+
transform: [{
|
|
35
|
+
translateX: 50,
|
|
36
|
+
scale: -1
|
|
37
|
+
}]
|
|
38
|
+
});
|
|
39
|
+
expect(result).toMatchInlineSnapshot(`
|
|
40
|
+
[
|
|
41
|
+
{
|
|
42
|
+
"$$css": true,
|
|
43
|
+
"$$css$localize": true,
|
|
44
|
+
"animationDirection": "r-animationDirection-1kmv48j",
|
|
45
|
+
"animationKeyframes": "r-animationKeyframes-zacbmr",
|
|
46
|
+
"fontFamily": "r-fontFamily-1qd0xha",
|
|
47
|
+
"marginEnd": [
|
|
48
|
+
"r-marginRight-a5pmau",
|
|
49
|
+
"r-marginLeft-9cviqr",
|
|
50
|
+
],
|
|
51
|
+
"marginHorizontal": "r-marginHorizontal-vlx1xi",
|
|
52
|
+
"marginStart": [
|
|
53
|
+
"r-marginLeft-13kc5u0",
|
|
54
|
+
"r-marginRight-1knfw1x",
|
|
55
|
+
],
|
|
56
|
+
"placeholderTextColor": "r-placeholderTextColor-1418aci",
|
|
57
|
+
"pointerEvents": "r-pointerEvents-ah5dr5",
|
|
58
|
+
"scrollbarWidth": "r-scrollbarWidth-2eszeu",
|
|
59
|
+
"start": [
|
|
60
|
+
"r-left-2s0hu9",
|
|
61
|
+
"r-right-1bnbe1j",
|
|
62
|
+
],
|
|
63
|
+
"textAlign": [
|
|
64
|
+
"r-textAlign-fdjqy7",
|
|
65
|
+
"r-textAlign-1ff274t",
|
|
66
|
+
],
|
|
67
|
+
"transform": "r-transform-1ehiua4",
|
|
68
|
+
},
|
|
69
|
+
[
|
|
70
|
+
[
|
|
71
|
+
[
|
|
72
|
+
".r-animationDirection-1kmv48j{animation-direction:alternate,alternate-reverse;}",
|
|
73
|
+
],
|
|
74
|
+
2.2,
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
[
|
|
78
|
+
".r-animationKeyframes-zacbmr{animation-name:r-animation-8jhqzh,r-animation-5azpl5;}",
|
|
79
|
+
"@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
|
|
80
|
+
"@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
|
|
81
|
+
"@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
|
|
82
|
+
"@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
|
|
83
|
+
],
|
|
84
|
+
2.2,
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
[
|
|
88
|
+
".r-fontFamily-1qd0xha{font-family:-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif;}",
|
|
89
|
+
],
|
|
90
|
+
2.2,
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
[
|
|
94
|
+
".r-marginRight-a5pmau{margin-right:2px;}",
|
|
95
|
+
],
|
|
96
|
+
2.2,
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
[
|
|
100
|
+
".r-marginLeft-9cviqr{margin-left:2px;}",
|
|
101
|
+
],
|
|
102
|
+
2.2,
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
[
|
|
106
|
+
".r-marginHorizontal-vlx1xi{margin-left:10px;margin-right:10px;}",
|
|
107
|
+
],
|
|
108
|
+
2.1,
|
|
109
|
+
],
|
|
110
|
+
[
|
|
111
|
+
[
|
|
112
|
+
".r-marginLeft-13kc5u0{margin-left:1px;}",
|
|
113
|
+
],
|
|
114
|
+
2.2,
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
[
|
|
118
|
+
".r-marginRight-1knfw1x{margin-right:1px;}",
|
|
119
|
+
],
|
|
120
|
+
2.2,
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
[
|
|
124
|
+
".r-placeholderTextColor-1418aci::-webkit-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
|
|
125
|
+
".r-placeholderTextColor-1418aci::-moz-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
|
|
126
|
+
".r-placeholderTextColor-1418aci:-ms-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
|
|
127
|
+
".r-placeholderTextColor-1418aci::placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
|
|
128
|
+
],
|
|
129
|
+
2.2,
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
[
|
|
133
|
+
".r-pointerEvents-ah5dr5>*{pointer-events:none;}",
|
|
134
|
+
".r-pointerEvents-ah5dr5{pointer-events:auto!important;}",
|
|
135
|
+
],
|
|
136
|
+
2.2,
|
|
137
|
+
],
|
|
138
|
+
[
|
|
139
|
+
[
|
|
140
|
+
".r-scrollbarWidth-2eszeu::-webkit-scrollbar{display:none}",
|
|
141
|
+
".r-scrollbarWidth-2eszeu{scrollbar-width:none;}",
|
|
142
|
+
],
|
|
143
|
+
2.2,
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
[
|
|
147
|
+
".r-left-2s0hu9{left:12.34%;}",
|
|
148
|
+
],
|
|
149
|
+
2.2,
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
[
|
|
153
|
+
".r-right-1bnbe1j{right:12.34%;}",
|
|
154
|
+
],
|
|
155
|
+
2.2,
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
[
|
|
159
|
+
".r-textAlign-fdjqy7{text-align:left;}",
|
|
160
|
+
],
|
|
161
|
+
2.2,
|
|
162
|
+
],
|
|
163
|
+
[
|
|
164
|
+
[
|
|
165
|
+
".r-textAlign-1ff274t{text-align:right;}",
|
|
166
|
+
],
|
|
167
|
+
2.2,
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
[
|
|
171
|
+
".r-transform-1ehiua4{transform:translateX(50px);}",
|
|
172
|
+
],
|
|
173
|
+
2.2,
|
|
174
|
+
],
|
|
175
|
+
],
|
|
176
|
+
]
|
|
177
|
+
`);
|
|
178
|
+
});
|
|
179
|
+
}), describe("classic", () => {
|
|
180
|
+
test("converts style to classic CSS", () => {
|
|
181
|
+
const result = (0, import_compiler.classic)({
|
|
182
|
+
animationDirection: ["alternate", "alternate-reverse"],
|
|
183
|
+
animationKeyframes: [{
|
|
184
|
+
"0%": {
|
|
185
|
+
top: 0
|
|
186
|
+
},
|
|
187
|
+
"50%": {
|
|
188
|
+
top: 5
|
|
189
|
+
},
|
|
190
|
+
"100%": {
|
|
191
|
+
top: 10
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
from: {
|
|
195
|
+
left: 0
|
|
196
|
+
},
|
|
197
|
+
to: {
|
|
198
|
+
left: 10
|
|
199
|
+
}
|
|
200
|
+
}],
|
|
201
|
+
marginHorizontal: 10,
|
|
202
|
+
font: "14px System",
|
|
203
|
+
transform: [{
|
|
204
|
+
translateX: 50,
|
|
205
|
+
scale: -1
|
|
206
|
+
}]
|
|
207
|
+
}, "text");
|
|
208
|
+
expect(result).toMatchInlineSnapshot(`
|
|
209
|
+
[
|
|
210
|
+
{
|
|
211
|
+
"$$css": true,
|
|
212
|
+
"css-text-1jr0ypv": "css-text-1jr0ypv",
|
|
213
|
+
},
|
|
214
|
+
[
|
|
215
|
+
[
|
|
216
|
+
[
|
|
217
|
+
"@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
|
|
218
|
+
"@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
|
|
219
|
+
"@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
|
|
220
|
+
"@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
|
|
221
|
+
".css-text-1jr0ypv{animation-direction:alternate,alternate-reverse;animation-name:r-animation-8jhqzh,r-animation-5azpl5;font:14px -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif;margin-left:10px;margin-right:10px;transform:translateX(50px);}",
|
|
222
|
+
],
|
|
223
|
+
1,
|
|
224
|
+
],
|
|
225
|
+
],
|
|
226
|
+
]
|
|
227
|
+
`);
|
|
228
|
+
});
|
|
229
|
+
}), describe("inline", () => {
|
|
230
|
+
test("converts style to inline styles", () => {
|
|
231
|
+
const result = (0, import_compiler.inline)({
|
|
232
|
+
marginHorizontal: 10,
|
|
233
|
+
display: "flex",
|
|
234
|
+
flexShrink: 1
|
|
235
|
+
});
|
|
236
|
+
expect(result).toMatchInlineSnapshot(`
|
|
237
|
+
{
|
|
238
|
+
"display": "flex",
|
|
239
|
+
"flexShrink": 1,
|
|
240
|
+
"marginLeft": "10px",
|
|
241
|
+
"marginRight": "10px",
|
|
242
|
+
}
|
|
243
|
+
`);
|
|
244
|
+
}), describe("logical style polyfill", () => {
|
|
245
|
+
[!1, !0].forEach(isRTL => {
|
|
246
|
+
const dir = isRTL ? "rtl" : "ltr";
|
|
247
|
+
test(`ignores "left" properties for ${dir}`, () => {
|
|
248
|
+
const initial = {
|
|
249
|
+
borderLeftColor: "rgba(255,0,0,1.00)",
|
|
250
|
+
borderLeftStyle: "solid",
|
|
251
|
+
borderLeftWidth: "1px",
|
|
252
|
+
left: "1px",
|
|
253
|
+
marginLeft: "5px",
|
|
254
|
+
paddingLeft: "10px"
|
|
255
|
+
};
|
|
256
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
|
|
257
|
+
}), test(`ignores "right" properties for ${dir}`, () => {
|
|
258
|
+
const initial = {
|
|
259
|
+
borderRightColor: "rgba(255,0,0,1.00)",
|
|
260
|
+
borderRightStyle: "solid",
|
|
261
|
+
borderRightWidth: "1px",
|
|
262
|
+
right: "1px",
|
|
263
|
+
marginRight: "5px",
|
|
264
|
+
paddingRight: "10px"
|
|
265
|
+
};
|
|
266
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
|
|
267
|
+
}), test(`ignores "left" values for ${dir}`, () => {
|
|
268
|
+
const initial = {
|
|
269
|
+
clear: "left",
|
|
270
|
+
float: "left",
|
|
271
|
+
textAlign: "left",
|
|
272
|
+
transitionProperty: "left"
|
|
273
|
+
};
|
|
274
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
|
|
275
|
+
}), test(`ignores "right" values for ${dir}`, () => {
|
|
276
|
+
const initial = {
|
|
277
|
+
clear: "right",
|
|
278
|
+
float: "right",
|
|
279
|
+
textAlign: "right",
|
|
280
|
+
transitionProperty: "right"
|
|
281
|
+
};
|
|
282
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(initial);
|
|
283
|
+
}), test(`converts "start" properties for ${dir}`, () => {
|
|
284
|
+
const initial = {
|
|
285
|
+
borderStartColor: "red",
|
|
286
|
+
borderStartStyle: "solid",
|
|
287
|
+
borderStartWidth: 1,
|
|
288
|
+
start: 1,
|
|
289
|
+
marginStart: 5,
|
|
290
|
+
paddingStart: 10
|
|
291
|
+
},
|
|
292
|
+
expectedLTR = {
|
|
293
|
+
borderLeftColor: "rgba(255,0,0,1.00)",
|
|
294
|
+
borderLeftStyle: "solid",
|
|
295
|
+
borderLeftWidth: "1px",
|
|
296
|
+
left: "1px",
|
|
297
|
+
marginLeft: "5px",
|
|
298
|
+
paddingLeft: "10px"
|
|
299
|
+
},
|
|
300
|
+
expectedRTL = {
|
|
301
|
+
borderRightColor: "rgba(255,0,0,1.00)",
|
|
302
|
+
borderRightStyle: "solid",
|
|
303
|
+
borderRightWidth: "1px",
|
|
304
|
+
right: "1px",
|
|
305
|
+
marginRight: "5px",
|
|
306
|
+
paddingRight: "10px"
|
|
307
|
+
};
|
|
308
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
|
|
309
|
+
}), test(`converts "end" properties for ${dir}`, () => {
|
|
310
|
+
const initial = {
|
|
311
|
+
borderEndColor: "red",
|
|
312
|
+
borderEndStyle: "solid",
|
|
313
|
+
borderEndWidth: 1,
|
|
314
|
+
end: 1,
|
|
315
|
+
marginEnd: 5,
|
|
316
|
+
paddingEnd: 10
|
|
317
|
+
},
|
|
318
|
+
expectedLTR = {
|
|
319
|
+
borderRightColor: "rgba(255,0,0,1.00)",
|
|
320
|
+
borderRightStyle: "solid",
|
|
321
|
+
borderRightWidth: "1px",
|
|
322
|
+
right: "1px",
|
|
323
|
+
marginRight: "5px",
|
|
324
|
+
paddingRight: "10px"
|
|
325
|
+
},
|
|
326
|
+
expectedRTL = {
|
|
327
|
+
borderLeftColor: "rgba(255,0,0,1.00)",
|
|
328
|
+
borderLeftStyle: "solid",
|
|
329
|
+
borderLeftWidth: "1px",
|
|
330
|
+
left: "1px",
|
|
331
|
+
marginLeft: "5px",
|
|
332
|
+
paddingLeft: "10px"
|
|
333
|
+
};
|
|
334
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
|
|
335
|
+
}), test(`converts "start" values for ${dir}`, () => {
|
|
336
|
+
const initial = {
|
|
337
|
+
clear: "start",
|
|
338
|
+
float: "start",
|
|
339
|
+
textAlign: "start",
|
|
340
|
+
transitionProperty: "start"
|
|
341
|
+
},
|
|
342
|
+
expectedLTR = {
|
|
343
|
+
clear: "left",
|
|
344
|
+
float: "left",
|
|
345
|
+
textAlign: "left",
|
|
346
|
+
transitionProperty: "left"
|
|
347
|
+
},
|
|
348
|
+
expectedRTL = {
|
|
349
|
+
clear: "right",
|
|
350
|
+
float: "right",
|
|
351
|
+
textAlign: "right",
|
|
352
|
+
transitionProperty: "right"
|
|
353
|
+
};
|
|
354
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
|
|
355
|
+
}), test(`converts "end" values for ${dir}`, () => {
|
|
356
|
+
const initial = {
|
|
357
|
+
clear: "end",
|
|
358
|
+
float: "end",
|
|
359
|
+
textAlign: "end",
|
|
360
|
+
transitionProperty: "end"
|
|
361
|
+
},
|
|
362
|
+
expectedLTR = {
|
|
363
|
+
clear: "right",
|
|
364
|
+
float: "right",
|
|
365
|
+
textAlign: "right",
|
|
366
|
+
transitionProperty: "right"
|
|
367
|
+
},
|
|
368
|
+
expectedRTL = {
|
|
369
|
+
clear: "left",
|
|
370
|
+
float: "left",
|
|
371
|
+
textAlign: "left",
|
|
372
|
+
transitionProperty: "left"
|
|
373
|
+
};
|
|
374
|
+
expect((0, import_compiler.inline)(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
|
|
375
|
+
}), test("end/start properties take precedence over left/right", () => {
|
|
376
|
+
const initialLTR = {
|
|
377
|
+
borderStartWidth: 10,
|
|
378
|
+
borderLeftWidth: 0,
|
|
379
|
+
end: 10,
|
|
380
|
+
right: 0,
|
|
381
|
+
marginStart: 10,
|
|
382
|
+
marginLeft: 0
|
|
383
|
+
},
|
|
384
|
+
expectedLTR = {
|
|
385
|
+
borderLeftWidth: "10px",
|
|
386
|
+
marginLeft: "10px",
|
|
387
|
+
right: "10px"
|
|
388
|
+
},
|
|
389
|
+
initialRTL = {
|
|
390
|
+
borderStartWidth: 10,
|
|
391
|
+
borderRightWidth: 0,
|
|
392
|
+
end: 10,
|
|
393
|
+
left: 0,
|
|
394
|
+
marginStart: 10,
|
|
395
|
+
marginRight: 0
|
|
396
|
+
},
|
|
397
|
+
expectedRTL = {
|
|
398
|
+
borderRightWidth: "10px",
|
|
399
|
+
marginRight: "10px",
|
|
400
|
+
left: "10px"
|
|
401
|
+
};
|
|
402
|
+
expect((0, import_compiler.inline)(isRTL ? initialRTL : initialLTR, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR);
|
|
403
|
+
});
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
});
|