@hanzogui/react-native-web-internals 8.3.1 → 8.3.2
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/compiler/createReactDOMStyle.js +214 -0
- package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/hash.js +6 -0
- package/dist/cjs/StyleSheet/compiler/hash.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.js +25 -0
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/index.js +409 -0
- package/dist/cjs/StyleSheet/compiler/index.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/normalizeColor.js +36 -0
- package/dist/cjs/StyleSheet/compiler/normalizeColor.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.js +36 -0
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.js.map +1 -0
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.js +28 -0
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.js.map +1 -0
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.js +42 -0
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.js.map +1 -0
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.js +163 -0
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.js.map +1 -0
- package/dist/cjs/StyleSheet/dom/index.js +87 -0
- package/dist/cjs/StyleSheet/dom/index.js.map +1 -0
- package/dist/cjs/StyleSheet/index.js +74 -0
- package/dist/cjs/StyleSheet/index.js.map +1 -0
- package/dist/cjs/StyleSheet/preprocess.js +99 -0
- package/dist/cjs/StyleSheet/preprocess.js.map +1 -0
- package/dist/cjs/StyleSheet/validate.js +90 -0
- package/dist/cjs/StyleSheet/validate.js.map +1 -0
- package/dist/cjs/TextAncestorContext.js +14 -0
- package/dist/cjs/TextAncestorContext.js.map +1 -0
- package/dist/cjs/colorProps.js +16 -0
- package/dist/cjs/colorProps.js.map +1 -0
- package/dist/cjs/index.js +83 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/AccessibilityUtil/index.js +20 -0
- package/dist/cjs/modules/AccessibilityUtil/index.js.map +1 -0
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.js +16 -0
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.js.map +1 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.js +52 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.js.map +1 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.js +36 -0
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.js.map +1 -0
- package/dist/cjs/modules/AssetRegistry/index.js +22 -0
- package/dist/cjs/modules/AssetRegistry/index.js.map +1 -0
- package/dist/cjs/modules/ImageLoader/index.js +149 -0
- package/dist/cjs/modules/ImageLoader/index.js.map +1 -0
- package/dist/cjs/modules/InteractionManager.js +235 -0
- package/dist/cjs/modules/InteractionManager.js.map +1 -0
- package/dist/cjs/modules/Platform/index.js +18 -0
- package/dist/cjs/modules/Platform/index.js.map +1 -0
- package/dist/cjs/modules/TextInputState/index.js +61 -0
- package/dist/cjs/modules/TextInputState/index.js.map +1 -0
- package/dist/cjs/modules/UIManager/index.js +60 -0
- package/dist/cjs/modules/UIManager/index.js.map +1 -0
- package/dist/cjs/modules/canUseDOM.js +15 -0
- package/dist/cjs/modules/canUseDOM.js.map +1 -0
- package/dist/cjs/modules/createDOMProps/index.js +357 -0
- package/dist/cjs/modules/createDOMProps/index.js.map +1 -0
- package/dist/cjs/modules/createEventHandle/index.js +84 -0
- package/dist/cjs/modules/createEventHandle/index.js.map +1 -0
- package/dist/cjs/modules/dismissKeyboard/index.js +17 -0
- package/dist/cjs/modules/dismissKeyboard/index.js.map +1 -0
- package/dist/cjs/modules/forwardedProps/index.js +138 -0
- package/dist/cjs/modules/forwardedProps/index.js.map +1 -0
- package/dist/cjs/modules/getBoundingClientRect/index.js +21 -0
- package/dist/cjs/modules/getBoundingClientRect/index.js.map +1 -0
- package/dist/cjs/modules/invariant.js +26 -0
- package/dist/cjs/modules/invariant.js.map +1 -0
- package/dist/cjs/modules/isSelectionValid/index.js +23 -0
- package/dist/cjs/modules/isSelectionValid/index.js.map +1 -0
- package/dist/cjs/modules/isWebColor/index.js +17 -0
- package/dist/cjs/modules/isWebColor/index.js.map +1 -0
- package/dist/cjs/modules/mergeRefs/index.js +31 -0
- package/dist/cjs/modules/mergeRefs/index.js.map +1 -0
- package/dist/cjs/modules/modality/index.js +206 -0
- package/dist/cjs/modules/modality/index.js.map +1 -0
- package/dist/cjs/modules/multiplyStyleLengthValue/index.js +28 -0
- package/dist/cjs/modules/multiplyStyleLengthValue/index.js.map +1 -0
- package/dist/cjs/modules/normalizeColor/index.js +31 -0
- package/dist/cjs/modules/normalizeColor/index.js.map +1 -0
- package/dist/cjs/modules/pick/index.js +23 -0
- package/dist/cjs/modules/pick/index.js.map +1 -0
- package/dist/cjs/modules/processColor/index.js +29 -0
- package/dist/cjs/modules/processColor/index.js.map +1 -0
- package/dist/cjs/modules/requestIdleCallback/index.js +34 -0
- package/dist/cjs/modules/requestIdleCallback/index.js.map +1 -0
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.js +68 -0
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.js.map +1 -0
- package/dist/cjs/modules/setValueForStyles/index.js +41 -0
- package/dist/cjs/modules/setValueForStyles/index.js.map +1 -0
- package/dist/cjs/modules/unitlessNumbers/index.js +79 -0
- package/dist/cjs/modules/unitlessNumbers/index.js.map +1 -0
- package/dist/cjs/modules/useElementLayout/index.js +22 -0
- package/dist/cjs/modules/useElementLayout/index.js.map +1 -0
- package/dist/cjs/modules/useEvent/index.js +51 -0
- package/dist/cjs/modules/useEvent/index.js.map +1 -0
- package/dist/cjs/modules/useHover/index.js +146 -0
- package/dist/cjs/modules/useHover/index.js.map +1 -0
- package/dist/cjs/modules/useLayoutEffect/index.js +18 -0
- package/dist/cjs/modules/useLayoutEffect/index.js.map +1 -0
- package/dist/cjs/modules/useLocale/index.js +36 -0
- package/dist/cjs/modules/useLocale/index.js.map +1 -0
- package/dist/cjs/modules/useLocale/isLocaleRTL.js +73 -0
- package/dist/cjs/modules/useLocale/isLocaleRTL.js.map +1 -0
- package/dist/cjs/modules/useMergeRefs/index.js +20 -0
- package/dist/cjs/modules/useMergeRefs/index.js.map +1 -0
- package/dist/cjs/modules/usePlatformMethods/index.js +30 -0
- package/dist/cjs/modules/usePlatformMethods/index.js.map +1 -0
- package/dist/cjs/modules/useStable/index.js +25 -0
- package/dist/cjs/modules/useStable/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/styleTypes.js +11 -0
- package/dist/cjs/styleTypes.js.map +1 -0
- package/dist/cjs/types.js +11 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.js +209 -0
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/hash.js +2 -0
- package/dist/esm/StyleSheet/compiler/hash.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.js +22 -0
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/index.js +403 -0
- package/dist/esm/StyleSheet/compiler/index.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/normalizeColor.js +32 -0
- package/dist/esm/StyleSheet/compiler/normalizeColor.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.js +33 -0
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.js.map +1 -0
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.js +24 -0
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.js.map +1 -0
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.js +39 -0
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.js.map +1 -0
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.js +160 -0
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.js.map +1 -0
- package/dist/esm/StyleSheet/dom/index.js +84 -0
- package/dist/esm/StyleSheet/dom/index.js.map +1 -0
- package/dist/esm/StyleSheet/index.js +70 -0
- package/dist/esm/StyleSheet/index.js.map +1 -0
- package/dist/esm/StyleSheet/preprocess.js +93 -0
- package/dist/esm/StyleSheet/preprocess.js.map +1 -0
- package/dist/esm/StyleSheet/validate.js +87 -0
- package/dist/esm/StyleSheet/validate.js.map +1 -0
- package/dist/esm/TextAncestorContext.js +11 -0
- package/dist/esm/TextAncestorContext.js.map +1 -0
- package/dist/esm/colorProps.js +13 -0
- package/dist/esm/colorProps.js.map +1 -0
- package/dist/esm/index.js +44 -45
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/index.js +17 -0
- package/dist/esm/modules/AccessibilityUtil/index.js.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/isDisabled.js +12 -0
- package/dist/esm/modules/AccessibilityUtil/isDisabled.js.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.js +48 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.js.map +1 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.js +32 -0
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.js.map +1 -0
- package/dist/esm/modules/AssetRegistry/index.js +18 -0
- package/dist/esm/modules/AssetRegistry/index.js.map +1 -0
- package/dist/esm/modules/ImageLoader/index.js +145 -0
- package/dist/esm/modules/ImageLoader/index.js.map +1 -0
- package/dist/esm/modules/InteractionManager.js +232 -0
- package/dist/esm/modules/InteractionManager.js.map +1 -0
- package/dist/esm/modules/Platform/index.js +15 -0
- package/dist/esm/modules/Platform/index.js.map +1 -0
- package/dist/esm/modules/TextInputState/index.js +58 -0
- package/dist/esm/modules/TextInputState/index.js.map +1 -0
- package/dist/esm/modules/UIManager/index.js +57 -0
- package/dist/esm/modules/UIManager/index.js.map +1 -0
- package/dist/esm/modules/canUseDOM.js +12 -0
- package/dist/esm/modules/canUseDOM.js.map +1 -0
- package/dist/esm/modules/createDOMProps/index.js +353 -0
- package/dist/esm/modules/createDOMProps/index.js.map +1 -0
- package/dist/esm/modules/createEventHandle/index.js +82 -0
- package/dist/esm/modules/createEventHandle/index.js.map +1 -0
- package/dist/esm/modules/dismissKeyboard/index.js +13 -0
- package/dist/esm/modules/dismissKeyboard/index.js.map +1 -0
- package/dist/esm/modules/forwardedProps/index.js +135 -0
- package/dist/esm/modules/forwardedProps/index.js.map +1 -0
- package/dist/esm/modules/getBoundingClientRect/index.js +17 -0
- package/dist/esm/modules/getBoundingClientRect/index.js.map +1 -0
- package/dist/esm/modules/invariant.js +22 -0
- package/dist/esm/modules/invariant.js.map +1 -0
- package/dist/esm/modules/isSelectionValid/index.js +20 -0
- package/dist/esm/modules/isSelectionValid/index.js.map +1 -0
- package/dist/esm/modules/isWebColor/index.js +13 -0
- package/dist/esm/modules/isWebColor/index.js.map +1 -0
- package/dist/esm/modules/mergeRefs/index.js +28 -0
- package/dist/esm/modules/mergeRefs/index.js.map +1 -0
- package/dist/esm/modules/modality/index.js +200 -0
- package/dist/esm/modules/modality/index.js.map +1 -0
- package/dist/esm/modules/multiplyStyleLengthValue/index.js +24 -0
- package/dist/esm/modules/multiplyStyleLengthValue/index.js.map +1 -0
- package/dist/esm/modules/normalizeColor/index.js +27 -0
- package/dist/esm/modules/normalizeColor/index.js.map +1 -0
- package/dist/esm/modules/pick/index.js +20 -0
- package/dist/esm/modules/pick/index.js.map +1 -0
- package/dist/esm/modules/processColor/index.js +24 -0
- package/dist/esm/modules/processColor/index.js.map +1 -0
- package/dist/esm/modules/requestIdleCallback/index.js +31 -0
- package/dist/esm/modules/requestIdleCallback/index.js.map +1 -0
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.js +65 -0
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.js.map +1 -0
- package/dist/esm/modules/setValueForStyles/index.js +38 -0
- package/dist/esm/modules/setValueForStyles/index.js.map +1 -0
- package/dist/esm/modules/unitlessNumbers/index.js +76 -0
- package/dist/esm/modules/unitlessNumbers/index.js.map +1 -0
- package/dist/esm/modules/useElementLayout/index.js +19 -0
- package/dist/esm/modules/useElementLayout/index.js.map +1 -0
- package/dist/esm/modules/useEvent/index.js +48 -0
- package/dist/esm/modules/useEvent/index.js.map +1 -0
- package/dist/esm/modules/useHover/index.js +143 -0
- package/dist/esm/modules/useHover/index.js.map +1 -0
- package/dist/esm/modules/useLayoutEffect/index.js +14 -0
- package/dist/esm/modules/useLayoutEffect/index.js.map +1 -0
- package/dist/esm/modules/useLocale/index.js +30 -0
- package/dist/esm/modules/useLocale/index.js.map +1 -0
- package/dist/esm/modules/useLocale/isLocaleRTL.js +70 -0
- package/dist/esm/modules/useLocale/isLocaleRTL.js.map +1 -0
- package/dist/esm/modules/useMergeRefs/index.js +16 -0
- package/dist/esm/modules/useMergeRefs/index.js.map +1 -0
- package/dist/esm/modules/usePlatformMethods/index.js +27 -0
- package/dist/esm/modules/usePlatformMethods/index.js.map +1 -0
- package/dist/esm/modules/useStable/index.js +21 -0
- package/dist/esm/modules/useStable/index.js.map +1 -0
- package/dist/esm/styleTypes.js +10 -0
- package/dist/esm/styleTypes.js.map +1 -0
- package/dist/esm/types.js +10 -0
- package/dist/esm/types.js.map +1 -0
- package/package.json +27 -19
- package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +1 -1
- package/src/StyleSheet/__tests__/compiler-test.tsx +2 -2
- package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +1 -1
- package/src/StyleSheet/__tests__/index-test.tsx +1 -1
- package/src/StyleSheet/__tests__/preprocess-test.tsx +1 -1
- package/src/StyleSheet/__tests__/validate-test.tsx +1 -1
- package/src/StyleSheet/compiler/createReactDOMStyle.tsx +2 -2
- package/src/StyleSheet/compiler/index.tsx +3 -3
- package/src/StyleSheet/compiler/normalizeColor.tsx +2 -2
- package/src/StyleSheet/compiler/normalizeValueWithProperty.tsx +2 -2
- package/src/StyleSheet/compiler/resolveShadowValue.tsx +2 -2
- package/src/StyleSheet/dom/createCSSStyleSheet.tsx +1 -1
- package/src/StyleSheet/dom/index.tsx +4 -4
- package/src/StyleSheet/preprocess.tsx +2 -2
- package/src/index.tsx +42 -42
- package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +1 -1
- package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +1 -1
- package/src/modules/AccessibilityUtil/index.tsx +3 -3
- package/src/modules/AccessibilityUtil/propsToAccessibilityComponent.tsx +1 -1
- package/src/modules/InteractionManager.tsx +2 -2
- package/src/modules/Platform/__tests__/index-test.tsx +1 -1
- package/src/modules/TextInputState/index.tsx +1 -1
- package/src/modules/UIManager/__tests__/index-test.tsx +1 -1
- package/src/modules/createDOMProps/__tests__/index-test.tsx +1 -1
- package/src/modules/createDOMProps/index.tsx +1 -1
- package/src/modules/createEventHandle/__tests__/index-test.tsx +1 -1
- package/src/modules/createEventHandle/index.tsx +1 -1
- package/src/modules/dismissKeyboard/index.tsx +1 -1
- package/src/modules/mergeRefs/__tests__/index-test.tsx +1 -1
- package/src/modules/modality/__tests__/index-test.tsx +5 -1
- package/src/modules/modality/index.tsx +2 -2
- package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +1 -1
- package/src/modules/normalizeColor/index.tsx +2 -2
- package/src/modules/processColor/__tests__/index-test.tsx +1 -1
- package/src/modules/requestIdleCallback/index.tsx +1 -1
- package/src/modules/setValueForStyles/dangerousStyleValue.tsx +2 -2
- package/src/modules/setValueForStyles/index.tsx +1 -1
- package/src/modules/useElementLayout/index.tsx +1 -1
- package/src/modules/useEvent/__tests__/index-test.tsx +1 -1
- package/src/modules/useEvent/index.tsx +3 -3
- package/src/modules/useHover/__tests__/index-test.tsx +2 -2
- package/src/modules/useHover/index.tsx +3 -3
- package/src/modules/useLayoutEffect/index.ts +1 -1
- package/src/modules/useLocale/index.tsx +1 -1
- package/src/modules/useMergeRefs/__tests__/index-test.tsx +1 -1
- package/src/modules/useMergeRefs/index.tsx +1 -1
- package/src/modules/usePlatformMethods/index.tsx +2 -2
- package/src/modules/useStable/__tests__/index-test.tsx +1 -1
- package/src/styleTypes.ts +1 -1
- package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -1
- package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -1
- package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -1
- package/types/StyleSheet/dom/index.d.ts +1 -1
- package/types/StyleSheet/dom/index.d.ts.map +1 -1
- package/types/StyleSheet/index.d.ts +15 -16
- package/types/StyleSheet/index.d.ts.map +1 -1
- package/types/StyleSheet/preprocess.d.ts +1 -1
- package/types/StyleSheet/preprocess.d.ts.map +1 -1
- package/types/colorProps.d.ts.map +1 -1
- package/types/index.d.ts +42 -42
- package/types/index.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/index.d.ts +6 -5
- package/types/modules/AccessibilityUtil/index.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -1
- package/types/modules/ImageLoader/index.d.ts +1 -1
- package/types/modules/ImageLoader/index.d.ts.map +1 -1
- package/types/modules/InteractionManager.d.ts +3 -3
- package/types/modules/InteractionManager.d.ts.map +1 -1
- package/types/modules/Platform/index.d.ts.map +1 -1
- package/types/modules/TextInputState/index.d.ts.map +1 -1
- package/types/modules/createDOMProps/index.d.ts.map +1 -1
- package/types/modules/forwardedProps/index.d.ts +70 -70
- package/types/modules/forwardedProps/index.d.ts.map +1 -1
- package/types/modules/getBoundingClientRect/index.d.ts.map +1 -1
- package/types/modules/isWebColor/index.d.ts.map +1 -1
- package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -1
- package/types/modules/normalizeColor/index.d.ts.map +1 -1
- package/types/modules/processColor/index.d.ts.map +1 -1
- package/types/modules/requestIdleCallback/index.d.ts +3 -1
- package/types/modules/requestIdleCallback/index.d.ts.map +1 -1
- package/types/modules/unitlessNumbers/index.d.ts.map +1 -1
- package/types/modules/useElementLayout/index.d.ts +1 -1
- package/types/modules/useElementLayout/index.d.ts.map +1 -1
- package/types/modules/useLayoutEffect/index.d.ts +1 -1
- package/types/modules/useLayoutEffect/index.d.ts.map +1 -1
- package/types/modules/usePlatformMethods/index.d.ts +1 -1
- package/types/modules/usePlatformMethods/index.d.ts.map +1 -1
- package/types/styleTypes.d.ts +1 -1
- package/types/styleTypes.d.ts.map +1 -1
- package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +0 -265
- package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +0 -419
- package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +0 -160
- package/dist/cjs/StyleSheet/__tests__/index-test.cjs +0 -436
- package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +0 -121
- package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +0 -51
- package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +0 -160
- package/dist/cjs/StyleSheet/compiler/hash.cjs +0 -28
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +0 -40
- package/dist/cjs/StyleSheet/compiler/index.cjs +0 -379
- package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +0 -36
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +0 -50
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +0 -52
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +0 -52
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +0 -135
- package/dist/cjs/StyleSheet/dom/index.cjs +0 -89
- package/dist/cjs/StyleSheet/index.cjs +0 -64
- package/dist/cjs/StyleSheet/preprocess.cjs +0 -114
- package/dist/cjs/StyleSheet/validate.cjs +0 -92
- package/dist/cjs/TextAncestorContext.cjs +0 -29
- package/dist/cjs/colorProps.cjs +0 -39
- package/dist/cjs/index.cjs +0 -105
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +0 -57
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +0 -46
- package/dist/cjs/modules/AccessibilityUtil/index.cjs +0 -35
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +0 -28
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +0 -64
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +0 -51
- package/dist/cjs/modules/AssetRegistry/index.cjs +0 -35
- package/dist/cjs/modules/ImageLoader/index.cjs +0 -157
- package/dist/cjs/modules/InteractionManager.cjs +0 -240
- package/dist/cjs/modules/Platform/__tests__/index-test.cjs +0 -56
- package/dist/cjs/modules/Platform/index.cjs +0 -32
- package/dist/cjs/modules/TextInputState/index.cjs +0 -70
- package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +0 -111
- package/dist/cjs/modules/UIManager/index.cjs +0 -65
- package/dist/cjs/modules/canUseDOM.cjs +0 -28
- package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +0 -177
- package/dist/cjs/modules/createDOMProps/index.cjs +0 -387
- package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +0 -422
- package/dist/cjs/modules/createEventHandle/index.cjs +0 -88
- package/dist/cjs/modules/dismissKeyboard/index.cjs +0 -31
- package/dist/cjs/modules/forwardedProps/index.cjs +0 -163
- package/dist/cjs/modules/getBoundingClientRect/index.cjs +0 -35
- package/dist/cjs/modules/invariant.cjs +0 -42
- package/dist/cjs/modules/isSelectionValid/index.cjs +0 -36
- package/dist/cjs/modules/isWebColor/index.cjs +0 -28
- package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +0 -48
- package/dist/cjs/modules/mergeRefs/index.cjs +0 -45
- package/dist/cjs/modules/modality/__tests__/index-test.cjs +0 -59
- package/dist/cjs/modules/modality/index.cjs +0 -212
- package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +0 -38
- package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +0 -41
- package/dist/cjs/modules/normalizeColor/index.cjs +0 -44
- package/dist/cjs/modules/pick/index.cjs +0 -38
- package/dist/cjs/modules/processColor/__tests__/index-test.cjs +0 -85
- package/dist/cjs/modules/processColor/index.cjs +0 -50
- package/dist/cjs/modules/requestIdleCallback/index.cjs +0 -46
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +0 -55
- package/dist/cjs/modules/setValueForStyles/index.cjs +0 -46
- package/dist/cjs/modules/unitlessNumbers/index.cjs +0 -89
- package/dist/cjs/modules/useElementLayout/index.cjs +0 -44
- package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +0 -490
- package/dist/cjs/modules/useEvent/index.cjs +0 -57
- package/dist/cjs/modules/useHover/__tests__/index-test.cjs +0 -382
- package/dist/cjs/modules/useHover/index.cjs +0 -140
- package/dist/cjs/modules/useLayoutEffect/index.cjs +0 -41
- package/dist/cjs/modules/useLocale/index.cjs +0 -69
- package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +0 -88
- package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +0 -125
- package/dist/cjs/modules/useMergeRefs/index.cjs +0 -45
- package/dist/cjs/modules/usePlatformMethods/index.cjs +0 -42
- package/dist/cjs/modules/useStable/__tests__/index-test.cjs +0 -122
- package/dist/cjs/modules/useStable/index.cjs +0 -47
- package/dist/cjs/styleTypes.cjs +0 -18
- package/dist/cjs/types.cjs +0 -18
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +0 -242
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +0 -420
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +0 -137
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/index-test.mjs +0 -413
- package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +0 -122
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs +0 -52
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +0 -134
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/hash.mjs +0 -3
- package/dist/esm/StyleSheet/compiler/hash.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +0 -15
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/index.mjs +0 -351
- package/dist/esm/StyleSheet/compiler/index.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +0 -11
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +0 -25
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +0 -27
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +0 -1
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +0 -27
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +0 -1
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +0 -110
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +0 -1
- package/dist/esm/StyleSheet/dom/index.mjs +0 -64
- package/dist/esm/StyleSheet/dom/index.mjs.map +0 -1
- package/dist/esm/StyleSheet/index.mjs +0 -38
- package/dist/esm/StyleSheet/index.mjs.map +0 -1
- package/dist/esm/StyleSheet/preprocess.mjs +0 -86
- package/dist/esm/StyleSheet/preprocess.mjs.map +0 -1
- package/dist/esm/StyleSheet/validate.mjs +0 -67
- package/dist/esm/StyleSheet/validate.mjs.map +0 -1
- package/dist/esm/TextAncestorContext.mjs +0 -4
- package/dist/esm/TextAncestorContext.mjs.map +0 -1
- package/dist/esm/colorProps.mjs +0 -14
- package/dist/esm/colorProps.mjs.map +0 -1
- package/dist/esm/index.mjs +0 -45
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +0 -34
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +0 -23
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/index.mjs +0 -10
- package/dist/esm/modules/AccessibilityUtil/index.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +0 -3
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +0 -39
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +0 -26
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +0 -1
- package/dist/esm/modules/AssetRegistry/index.mjs +0 -9
- package/dist/esm/modules/AssetRegistry/index.mjs.map +0 -1
- package/dist/esm/modules/ImageLoader/index.mjs +0 -131
- package/dist/esm/modules/ImageLoader/index.mjs.map +0 -1
- package/dist/esm/modules/InteractionManager.mjs +0 -215
- package/dist/esm/modules/InteractionManager.mjs.map +0 -1
- package/dist/esm/modules/Platform/__tests__/index-test.mjs +0 -33
- package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/Platform/index.mjs +0 -7
- package/dist/esm/modules/Platform/index.mjs.map +0 -1
- package/dist/esm/modules/TextInputState/index.mjs +0 -45
- package/dist/esm/modules/TextInputState/index.mjs.map +0 -1
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs +0 -88
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/UIManager/index.mjs +0 -40
- package/dist/esm/modules/UIManager/index.mjs.map +0 -1
- package/dist/esm/modules/canUseDOM.mjs +0 -3
- package/dist/esm/modules/canUseDOM.mjs.map +0 -1
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +0 -154
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createDOMProps/index.mjs +0 -361
- package/dist/esm/modules/createDOMProps/index.mjs.map +0 -1
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +0 -399
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createEventHandle/index.mjs +0 -61
- package/dist/esm/modules/createEventHandle/index.mjs.map +0 -1
- package/dist/esm/modules/dismissKeyboard/index.mjs +0 -6
- package/dist/esm/modules/dismissKeyboard/index.mjs.map +0 -1
- package/dist/esm/modules/forwardedProps/index.mjs +0 -128
- package/dist/esm/modules/forwardedProps/index.mjs.map +0 -1
- package/dist/esm/modules/getBoundingClientRect/index.mjs +0 -10
- package/dist/esm/modules/getBoundingClientRect/index.mjs.map +0 -1
- package/dist/esm/modules/invariant.mjs +0 -16
- package/dist/esm/modules/invariant.mjs.map +0 -1
- package/dist/esm/modules/isSelectionValid/index.mjs +0 -11
- package/dist/esm/modules/isSelectionValid/index.mjs.map +0 -1
- package/dist/esm/modules/isWebColor/index.mjs +0 -3
- package/dist/esm/modules/isWebColor/index.mjs.map +0 -1
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +0 -25
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/mergeRefs/index.mjs +0 -20
- package/dist/esm/modules/mergeRefs/index.mjs.map +0 -1
- package/dist/esm/modules/modality/__tests__/index-test.mjs +0 -60
- package/dist/esm/modules/modality/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/modality/index.mjs +0 -184
- package/dist/esm/modules/modality/index.mjs.map +0 -1
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +0 -15
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +0 -16
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +0 -1
- package/dist/esm/modules/normalizeColor/index.mjs +0 -19
- package/dist/esm/modules/normalizeColor/index.mjs.map +0 -1
- package/dist/esm/modules/pick/index.mjs +0 -13
- package/dist/esm/modules/pick/index.mjs.map +0 -1
- package/dist/esm/modules/processColor/__tests__/index-test.mjs +0 -62
- package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/processColor/index.mjs +0 -14
- package/dist/esm/modules/processColor/index.mjs.map +0 -1
- package/dist/esm/modules/requestIdleCallback/index.mjs +0 -20
- package/dist/esm/modules/requestIdleCallback/index.mjs.map +0 -1
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +0 -30
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +0 -1
- package/dist/esm/modules/setValueForStyles/index.mjs +0 -21
- package/dist/esm/modules/setValueForStyles/index.mjs.map +0 -1
- package/dist/esm/modules/unitlessNumbers/index.mjs +0 -64
- package/dist/esm/modules/unitlessNumbers/index.mjs.map +0 -1
- package/dist/esm/modules/useElementLayout/index.mjs +0 -19
- package/dist/esm/modules/useElementLayout/index.mjs.map +0 -1
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs +0 -467
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useEvent/index.mjs +0 -32
- package/dist/esm/modules/useEvent/index.mjs.map +0 -1
- package/dist/esm/modules/useHover/__tests__/index-test.mjs +0 -359
- package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useHover/index.mjs +0 -115
- package/dist/esm/modules/useHover/index.mjs.map +0 -1
- package/dist/esm/modules/useLayoutEffect/index.mjs +0 -5
- package/dist/esm/modules/useLayoutEffect/index.mjs.map +0 -1
- package/dist/esm/modules/useLocale/index.mjs +0 -31
- package/dist/esm/modules/useLocale/index.mjs.map +0 -1
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs +0 -63
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +0 -1
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +0 -102
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useMergeRefs/index.mjs +0 -9
- package/dist/esm/modules/useMergeRefs/index.mjs.map +0 -1
- package/dist/esm/modules/usePlatformMethods/index.mjs +0 -17
- package/dist/esm/modules/usePlatformMethods/index.mjs.map +0 -1
- package/dist/esm/modules/useStable/__tests__/index-test.mjs +0 -99
- package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useStable/index.mjs +0 -11
- package/dist/esm/modules/useStable/index.mjs.map +0 -1
- package/dist/esm/styleTypes.mjs +0 -2
- package/dist/esm/styleTypes.mjs.map +0 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.mjs.map +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Nicolas Gallagher.
|
|
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
|
+
* @flow
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createReactDOMStyle = exports.createTransformValue = void 0;
|
|
13
|
+
const canUseDOM_tsx_1 = require("../../modules/canUseDOM.js");
|
|
14
|
+
const normalizeValueWithProperty_tsx_1 = require("./normalizeValueWithProperty.js");
|
|
15
|
+
/**
|
|
16
|
+
* The browser implements the CSS cascade, where the order of properties is a
|
|
17
|
+
* factor in determining which styles to paint. React Native is different. It
|
|
18
|
+
* gives giving precedence to the more specific style property. For example,
|
|
19
|
+
* the value of `paddingTop` takes precedence over that of `padding`.
|
|
20
|
+
*
|
|
21
|
+
* This module creates mutally exclusive style declarations by expanding all of
|
|
22
|
+
* React Native's supported shortform properties (e.g. `padding`) to their
|
|
23
|
+
* longfrom equivalents.
|
|
24
|
+
*/
|
|
25
|
+
const emptyObject = {};
|
|
26
|
+
const supportsCSS3TextDecoration = !canUseDOM_tsx_1.canUseDOM ||
|
|
27
|
+
(window.CSS != null &&
|
|
28
|
+
window.CSS.supports != null &&
|
|
29
|
+
(window.CSS.supports('text-decoration-line', 'none') ||
|
|
30
|
+
window.CSS.supports('-webkit-text-decoration-line', 'none')));
|
|
31
|
+
const ignoredProps = {
|
|
32
|
+
elevation: true,
|
|
33
|
+
overlayColor: true,
|
|
34
|
+
resizeMode: true,
|
|
35
|
+
tintColor: true,
|
|
36
|
+
};
|
|
37
|
+
const MONOSPACE_FONT_STACK = 'monospace,monospace';
|
|
38
|
+
const SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
|
|
39
|
+
const STYLE_SHORT_FORM_EXPANSIONS = {
|
|
40
|
+
borderColor: [
|
|
41
|
+
'borderTopColor',
|
|
42
|
+
'borderRightColor',
|
|
43
|
+
'borderBottomColor',
|
|
44
|
+
'borderLeftColor',
|
|
45
|
+
],
|
|
46
|
+
borderRadius: [
|
|
47
|
+
'borderTopLeftRadius',
|
|
48
|
+
'borderTopRightRadius',
|
|
49
|
+
'borderBottomRightRadius',
|
|
50
|
+
'borderBottomLeftRadius',
|
|
51
|
+
],
|
|
52
|
+
borderStyle: [
|
|
53
|
+
'borderTopStyle',
|
|
54
|
+
'borderRightStyle',
|
|
55
|
+
'borderBottomStyle',
|
|
56
|
+
'borderLeftStyle',
|
|
57
|
+
],
|
|
58
|
+
borderWidth: [
|
|
59
|
+
'borderTopWidth',
|
|
60
|
+
'borderRightWidth',
|
|
61
|
+
'borderBottomWidth',
|
|
62
|
+
'borderLeftWidth',
|
|
63
|
+
],
|
|
64
|
+
marginHorizontal: ['marginRight', 'marginLeft'],
|
|
65
|
+
marginVertical: ['marginTop', 'marginBottom'],
|
|
66
|
+
overflow: ['overflowX', 'overflowY'],
|
|
67
|
+
overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],
|
|
68
|
+
paddingHorizontal: ['paddingRight', 'paddingLeft'],
|
|
69
|
+
paddingVertical: ['paddingTop', 'paddingBottom'],
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Transform
|
|
73
|
+
*/
|
|
74
|
+
// { scale: 2 } => 'scale(2)'
|
|
75
|
+
// { translateX: 20 } => 'translateX(20px)'
|
|
76
|
+
// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'
|
|
77
|
+
const mapTransform = (transform) => {
|
|
78
|
+
const type = Object.keys(transform)[0];
|
|
79
|
+
const value = transform[type];
|
|
80
|
+
if (type === 'matrix' || type === 'matrix3d') {
|
|
81
|
+
return `${type}(${value.join(',')})`;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const normalizedValue = (0, normalizeValueWithProperty_tsx_1.normalizeValueWithProperty)(value, type);
|
|
85
|
+
return `${type}(${normalizedValue})`;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const createTransformValue = (style) => {
|
|
89
|
+
let transform = style.transform;
|
|
90
|
+
if (Array.isArray(style.transform)) {
|
|
91
|
+
transform = style.transform.map(mapTransform).join(' ');
|
|
92
|
+
}
|
|
93
|
+
return transform;
|
|
94
|
+
};
|
|
95
|
+
exports.createTransformValue = createTransformValue;
|
|
96
|
+
/**
|
|
97
|
+
* Reducer
|
|
98
|
+
*/
|
|
99
|
+
const createReactDOMStyle = (style, isInline) => {
|
|
100
|
+
if (!style) {
|
|
101
|
+
return emptyObject;
|
|
102
|
+
}
|
|
103
|
+
const resolvedStyle = {};
|
|
104
|
+
for (const prop in style) {
|
|
105
|
+
const value = style[prop];
|
|
106
|
+
if (
|
|
107
|
+
// Ignore everything with a null value
|
|
108
|
+
value == null ||
|
|
109
|
+
// Ignore some React Native styles
|
|
110
|
+
ignoredProps[prop]) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (prop === 'aspectRatio') {
|
|
114
|
+
resolvedStyle[prop] = value.toString();
|
|
115
|
+
}
|
|
116
|
+
else if (prop === 'backgroundClip') {
|
|
117
|
+
// TODO: remove once this issue is fixed
|
|
118
|
+
// https://github.com/rofrischmann/inline-style-prefixer/issues/159
|
|
119
|
+
if (value === 'text') {
|
|
120
|
+
resolvedStyle.backgroundClip = value;
|
|
121
|
+
resolvedStyle.WebkitBackgroundClip = value;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (prop === 'flex') {
|
|
125
|
+
if (value === -1) {
|
|
126
|
+
resolvedStyle.flexGrow = 0;
|
|
127
|
+
resolvedStyle.flexShrink = 1;
|
|
128
|
+
resolvedStyle.flexBasis = 'auto';
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
resolvedStyle.flex = value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (prop === 'font') {
|
|
135
|
+
resolvedStyle[prop] = value.replace('System', SYSTEM_FONT_STACK);
|
|
136
|
+
}
|
|
137
|
+
else if (prop === 'fontFamily') {
|
|
138
|
+
if (value.indexOf('System') > -1) {
|
|
139
|
+
const stack = value.split(/,\s*/);
|
|
140
|
+
stack[stack.indexOf('System')] = SYSTEM_FONT_STACK;
|
|
141
|
+
resolvedStyle[prop] = stack.join(',');
|
|
142
|
+
}
|
|
143
|
+
else if (value === 'monospace') {
|
|
144
|
+
resolvedStyle[prop] = MONOSPACE_FONT_STACK;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
resolvedStyle[prop] = value;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else if (prop === 'fontVariant') {
|
|
151
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
152
|
+
resolvedStyle.fontVariant = value.join(' ');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (prop === 'textAlignVertical') {
|
|
156
|
+
resolvedStyle.verticalAlign = value === 'center' ? 'middle' : value;
|
|
157
|
+
}
|
|
158
|
+
else if (prop === 'textDecorationLine') {
|
|
159
|
+
// use 'text-decoration' for browsers that only support CSS2
|
|
160
|
+
// text-decoration (e.g., IE, Edge)
|
|
161
|
+
if (!supportsCSS3TextDecoration) {
|
|
162
|
+
resolvedStyle.textDecoration = value;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
resolvedStyle.textDecorationLine = value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else if (prop === 'transform' || prop === 'transformMatrix') {
|
|
169
|
+
resolvedStyle.transform = (0, exports.createTransformValue)(style);
|
|
170
|
+
}
|
|
171
|
+
else if (prop === 'writingDirection') {
|
|
172
|
+
resolvedStyle.direction = value;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const value = (0, normalizeValueWithProperty_tsx_1.normalizeValueWithProperty)(style[prop], prop);
|
|
176
|
+
const longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];
|
|
177
|
+
if (isInline && prop === 'margin') {
|
|
178
|
+
if (style.marginHorizontal == null) {
|
|
179
|
+
resolvedStyle.marginLeft = value;
|
|
180
|
+
resolvedStyle.marginRight = value;
|
|
181
|
+
}
|
|
182
|
+
if (style.marginVertical == null) {
|
|
183
|
+
resolvedStyle.marginTop = value;
|
|
184
|
+
resolvedStyle.marginBottom = value;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (isInline && prop === 'padding') {
|
|
188
|
+
if (style.paddingHorizontal == null) {
|
|
189
|
+
resolvedStyle.paddingLeft = value;
|
|
190
|
+
resolvedStyle.paddingRight = value;
|
|
191
|
+
}
|
|
192
|
+
if (style.paddingVertical == null) {
|
|
193
|
+
resolvedStyle.paddingTop = value;
|
|
194
|
+
resolvedStyle.paddingBottom = value;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else if (longFormProperties) {
|
|
198
|
+
longFormProperties.forEach((longForm, i) => {
|
|
199
|
+
// The value of any longform property in the original styles takes
|
|
200
|
+
// precedence over the shortform's value.
|
|
201
|
+
if (style[longForm] == null) {
|
|
202
|
+
resolvedStyle[longForm] = value;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
resolvedStyle[prop] = Array.isArray(value) ? value.join(',') : value;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return resolvedStyle;
|
|
212
|
+
};
|
|
213
|
+
exports.createReactDOMStyle = createReactDOMStyle;
|
|
214
|
+
//# sourceMappingURL=createReactDOMStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createReactDOMStyle.js","sourceRoot":"","sources":["../../../../src/StyleSheet/compiler/createReactDOMStyle.tsx"],"names":[],"mappings":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,aAAa,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;YACtE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAtGY,QAAA,mBAAmB,GAAnB,mBAAmB,CAsG/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
var simple_hash_1 = require("@hanzogui/simple-hash");
|
|
5
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return simple_hash_1.simpleHash; } });
|
|
6
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/StyleSheet/compiler/hash.tsx"],"names":[],"mappings":";;;AAAA,qDAA6D;AAApD,sGAAA,UAAU,OAAW"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Nicolas Gallagher.
|
|
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 strict
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.hyphenateStyleName = hyphenateStyleName;
|
|
12
|
+
const uppercasePattern = /[A-Z]/g;
|
|
13
|
+
const msPattern = /^ms-/;
|
|
14
|
+
const cache = {};
|
|
15
|
+
function toHyphenLower(match) {
|
|
16
|
+
return '-' + match.toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
function hyphenateStyleName(name) {
|
|
19
|
+
if (name in cache) {
|
|
20
|
+
return cache[name];
|
|
21
|
+
}
|
|
22
|
+
const hName = name.replace(uppercasePattern, toHyphenLower);
|
|
23
|
+
return (cache[name] = msPattern.test(hName) ? '-' + hName : hName);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=hyphenateStyleName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyphenateStyleName.js","sourceRoot":"","sources":["../../../../src/StyleSheet/compiler/hyphenateStyleName.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,MAAM,gBAAgB,GAAG,QAAQ,CAAA;AACjC,MAAM,SAAS,GAAG,MAAM,CAAA;AACxB,MAAM,KAAK,GAAG,EAAE,CAAA;AAEhB,SAAS,aAAa,CAAC,KAAK;IAC1B,OAAO,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAA;AAClC,CAAC;AAED,4BAAmC,IAAY;IAC7C,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA;IAC3D,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Nicolas Gallagher.
|
|
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
|
+
* @flow strict-local
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.atomic = atomic;
|
|
13
|
+
exports.classic = classic;
|
|
14
|
+
exports.inline = inline;
|
|
15
|
+
exports.stringifyValueWithProperty = stringifyValueWithProperty;
|
|
16
|
+
const simple_hash_1 = require("@hanzogui/simple-hash");
|
|
17
|
+
const createReactDOMStyle_tsx_1 = require("./createReactDOMStyle.js");
|
|
18
|
+
const hyphenateStyleName_tsx_1 = require("./hyphenateStyleName.js");
|
|
19
|
+
const normalizeValueWithProperty_tsx_1 = require("./normalizeValueWithProperty.js");
|
|
20
|
+
const cache = new Map();
|
|
21
|
+
const emptyObject = {};
|
|
22
|
+
const classicGroup = 1;
|
|
23
|
+
const atomicGroup = 2.2;
|
|
24
|
+
const customGroup = {
|
|
25
|
+
borderColor: 2,
|
|
26
|
+
borderRadius: 2,
|
|
27
|
+
borderStyle: 2,
|
|
28
|
+
borderWidth: 2,
|
|
29
|
+
display: 2,
|
|
30
|
+
flex: 2,
|
|
31
|
+
margin: 2,
|
|
32
|
+
overflow: 2,
|
|
33
|
+
overscrollBehavior: 2,
|
|
34
|
+
padding: 2,
|
|
35
|
+
marginHorizontal: 2.1,
|
|
36
|
+
marginVertical: 2.1,
|
|
37
|
+
paddingHorizontal: 2.1,
|
|
38
|
+
paddingVertical: 2.1,
|
|
39
|
+
};
|
|
40
|
+
const borderTopLeftRadius = 'borderTopLeftRadius';
|
|
41
|
+
const borderTopRightRadius = 'borderTopRightRadius';
|
|
42
|
+
const borderBottomLeftRadius = 'borderBottomLeftRadius';
|
|
43
|
+
const borderBottomRightRadius = 'borderBottomRightRadius';
|
|
44
|
+
const borderLeftColor = 'borderLeftColor';
|
|
45
|
+
const borderLeftStyle = 'borderLeftStyle';
|
|
46
|
+
const borderLeftWidth = 'borderLeftWidth';
|
|
47
|
+
const borderRightColor = 'borderRightColor';
|
|
48
|
+
const borderRightStyle = 'borderRightStyle';
|
|
49
|
+
const borderRightWidth = 'borderRightWidth';
|
|
50
|
+
const right = 'right';
|
|
51
|
+
const marginLeft = 'marginLeft';
|
|
52
|
+
const marginRight = 'marginRight';
|
|
53
|
+
const paddingLeft = 'paddingLeft';
|
|
54
|
+
const paddingRight = 'paddingRight';
|
|
55
|
+
const left = 'left';
|
|
56
|
+
// Map of LTR property names to their BiDi equivalent.
|
|
57
|
+
const PROPERTIES_FLIP = {
|
|
58
|
+
[borderTopLeftRadius]: borderTopRightRadius,
|
|
59
|
+
[borderTopRightRadius]: borderTopLeftRadius,
|
|
60
|
+
[borderBottomLeftRadius]: borderBottomRightRadius,
|
|
61
|
+
[borderBottomRightRadius]: borderBottomLeftRadius,
|
|
62
|
+
[borderLeftColor]: borderRightColor,
|
|
63
|
+
[borderLeftStyle]: borderRightStyle,
|
|
64
|
+
[borderLeftWidth]: borderRightWidth,
|
|
65
|
+
[borderRightColor]: borderLeftColor,
|
|
66
|
+
[borderRightStyle]: borderLeftStyle,
|
|
67
|
+
[borderRightWidth]: borderLeftWidth,
|
|
68
|
+
[left]: right,
|
|
69
|
+
[marginLeft]: marginRight,
|
|
70
|
+
[marginRight]: marginLeft,
|
|
71
|
+
[paddingLeft]: paddingRight,
|
|
72
|
+
[paddingRight]: paddingLeft,
|
|
73
|
+
[right]: left,
|
|
74
|
+
};
|
|
75
|
+
// Map of I18N property names to their LTR equivalent.
|
|
76
|
+
const PROPERTIES_I18N = {
|
|
77
|
+
borderTopStartRadius: borderTopLeftRadius,
|
|
78
|
+
borderTopEndRadius: borderTopRightRadius,
|
|
79
|
+
borderBottomStartRadius: borderBottomLeftRadius,
|
|
80
|
+
borderBottomEndRadius: borderBottomRightRadius,
|
|
81
|
+
borderStartColor: borderLeftColor,
|
|
82
|
+
borderStartStyle: borderLeftStyle,
|
|
83
|
+
borderStartWidth: borderLeftWidth,
|
|
84
|
+
borderEndColor: borderRightColor,
|
|
85
|
+
borderEndStyle: borderRightStyle,
|
|
86
|
+
borderEndWidth: borderRightWidth,
|
|
87
|
+
end: right,
|
|
88
|
+
marginStart: marginLeft,
|
|
89
|
+
marginEnd: marginRight,
|
|
90
|
+
paddingStart: paddingLeft,
|
|
91
|
+
paddingEnd: paddingRight,
|
|
92
|
+
start: left,
|
|
93
|
+
};
|
|
94
|
+
const PROPERTIES_VALUE = ['clear', 'float', 'textAlign'];
|
|
95
|
+
function atomic(style) {
|
|
96
|
+
const compiledStyle = { $$css: true };
|
|
97
|
+
const compiledRules = [];
|
|
98
|
+
function atomicCompile(prop, value) {
|
|
99
|
+
const valueString = stringifyValueWithProperty(value, prop);
|
|
100
|
+
const cacheKey = prop + valueString;
|
|
101
|
+
const cachedResult = cache.get(cacheKey);
|
|
102
|
+
let identifier;
|
|
103
|
+
if (cachedResult != null) {
|
|
104
|
+
identifier = cachedResult[0];
|
|
105
|
+
compiledRules.push(cachedResult[1]);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
identifier = createIdentifier('r', prop, value);
|
|
109
|
+
const order = customGroup[prop] || atomicGroup;
|
|
110
|
+
const rules = createAtomicRules(identifier, prop, value);
|
|
111
|
+
const orderedRules = [rules, order];
|
|
112
|
+
compiledRules.push(orderedRules);
|
|
113
|
+
cache.set(cacheKey, [identifier, orderedRules]);
|
|
114
|
+
}
|
|
115
|
+
return identifier;
|
|
116
|
+
}
|
|
117
|
+
Object.keys(style)
|
|
118
|
+
.sort()
|
|
119
|
+
.forEach((prop) => {
|
|
120
|
+
const value = style[prop];
|
|
121
|
+
if (value != null) {
|
|
122
|
+
let localizeableValue;
|
|
123
|
+
// BiDi flip values
|
|
124
|
+
if (PROPERTIES_VALUE.indexOf(prop) > -1) {
|
|
125
|
+
const left = atomicCompile(prop, 'left');
|
|
126
|
+
const right = atomicCompile(prop, 'right');
|
|
127
|
+
if (value === 'start') {
|
|
128
|
+
localizeableValue = [left, right];
|
|
129
|
+
}
|
|
130
|
+
else if (value === 'end') {
|
|
131
|
+
localizeableValue = [right, left];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// BiDi flip properties
|
|
135
|
+
const propPolyfill = PROPERTIES_I18N[prop];
|
|
136
|
+
if (propPolyfill != null) {
|
|
137
|
+
const ltr = atomicCompile(propPolyfill, value);
|
|
138
|
+
const rtl = atomicCompile(PROPERTIES_FLIP[propPolyfill], value);
|
|
139
|
+
localizeableValue = [ltr, rtl];
|
|
140
|
+
}
|
|
141
|
+
// BiDi flip transitionProperty value
|
|
142
|
+
if (prop === 'transitionProperty') {
|
|
143
|
+
const values = Array.isArray(value) ? value : [value];
|
|
144
|
+
const polyfillIndices = [];
|
|
145
|
+
for (let i = 0; i < values.length; i++) {
|
|
146
|
+
const val = values[i];
|
|
147
|
+
if (typeof val === 'string' && PROPERTIES_I18N[val] != null) {
|
|
148
|
+
polyfillIndices.push(i);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (polyfillIndices.length > 0) {
|
|
152
|
+
const ltrPolyfillValues = [...values];
|
|
153
|
+
const rtlPolyfillValues = [...values];
|
|
154
|
+
polyfillIndices.forEach((i) => {
|
|
155
|
+
const ltrVal = ltrPolyfillValues[i];
|
|
156
|
+
if (typeof ltrVal === 'string') {
|
|
157
|
+
const ltrPolyfill = PROPERTIES_I18N[ltrVal];
|
|
158
|
+
const rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
|
|
159
|
+
ltrPolyfillValues[i] = ltrPolyfill;
|
|
160
|
+
rtlPolyfillValues[i] = rtlPolyfill;
|
|
161
|
+
const ltr = atomicCompile(prop, ltrPolyfillValues);
|
|
162
|
+
const rtl = atomicCompile(prop, rtlPolyfillValues);
|
|
163
|
+
localizeableValue = [ltr, rtl];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (localizeableValue == null) {
|
|
169
|
+
localizeableValue = atomicCompile(prop, value);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
compiledStyle['$$css$localize'] = true;
|
|
173
|
+
}
|
|
174
|
+
compiledStyle[prop] = localizeableValue;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return [compiledStyle, compiledRules];
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Compile simple style object to classic CSS rules.
|
|
181
|
+
* No support for 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
|
182
|
+
*/
|
|
183
|
+
function classic(style, name) {
|
|
184
|
+
const compiledStyle = { $$css: true };
|
|
185
|
+
const compiledRules = [];
|
|
186
|
+
const { animationKeyframes, ...rest } = style;
|
|
187
|
+
const identifier = createIdentifier('css', name, style);
|
|
188
|
+
const selector = `.${identifier}`;
|
|
189
|
+
let animationName;
|
|
190
|
+
if (animationKeyframes != null) {
|
|
191
|
+
const [animationNames, keyframesRules] = processKeyframesValue(animationKeyframes);
|
|
192
|
+
animationName = animationNames.join(',');
|
|
193
|
+
compiledRules.push(...keyframesRules);
|
|
194
|
+
}
|
|
195
|
+
const block = createDeclarationBlock({ ...rest, animationName });
|
|
196
|
+
compiledRules.push(`${selector}${block}`);
|
|
197
|
+
compiledStyle[identifier] = identifier;
|
|
198
|
+
return [compiledStyle, [[compiledRules, classicGroup]]];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Compile simple style object to inline DOM styles.
|
|
202
|
+
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
|
203
|
+
*/
|
|
204
|
+
function inline(originalStyle, isRTL) {
|
|
205
|
+
const style = originalStyle || emptyObject;
|
|
206
|
+
const frozenProps = {};
|
|
207
|
+
const nextStyle = {};
|
|
208
|
+
for (const originalProp in style) {
|
|
209
|
+
const originalValue = style[originalProp];
|
|
210
|
+
let prop = originalProp;
|
|
211
|
+
let value = originalValue;
|
|
212
|
+
if (!Object.prototype.hasOwnProperty.call(style, originalProp) ||
|
|
213
|
+
originalValue == null) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
// BiDi flip values
|
|
217
|
+
if (PROPERTIES_VALUE.indexOf(originalProp) > -1) {
|
|
218
|
+
if (originalValue === 'start') {
|
|
219
|
+
value = isRTL ? 'right' : 'left';
|
|
220
|
+
}
|
|
221
|
+
else if (originalValue === 'end') {
|
|
222
|
+
value = isRTL ? 'left' : 'right';
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// BiDi flip properties
|
|
226
|
+
const propPolyfill = PROPERTIES_I18N[originalProp];
|
|
227
|
+
if (propPolyfill != null) {
|
|
228
|
+
prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill;
|
|
229
|
+
}
|
|
230
|
+
// BiDi flip transitionProperty value
|
|
231
|
+
if (originalProp === 'transitionProperty') {
|
|
232
|
+
// @ts-ignore
|
|
233
|
+
const originalValues = Array.isArray(originalValue)
|
|
234
|
+
? originalValue
|
|
235
|
+
: [originalValue];
|
|
236
|
+
originalValues.forEach((val, i) => {
|
|
237
|
+
if (typeof val === 'string') {
|
|
238
|
+
const valuePolyfill = PROPERTIES_I18N[val];
|
|
239
|
+
if (valuePolyfill != null) {
|
|
240
|
+
originalValues[i] = isRTL ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
// Create finalized style
|
|
246
|
+
if (!frozenProps[prop]) {
|
|
247
|
+
nextStyle[prop] = value;
|
|
248
|
+
}
|
|
249
|
+
if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {
|
|
250
|
+
frozenProps[prop] = true;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return (0, createReactDOMStyle_tsx_1.createReactDOMStyle)(nextStyle, true);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Create a value string that normalizes different input values with a common
|
|
257
|
+
* output.
|
|
258
|
+
*/
|
|
259
|
+
function stringifyValueWithProperty(value, property) {
|
|
260
|
+
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
|
|
261
|
+
const normalizedValue = (0, normalizeValueWithProperty_tsx_1.normalizeValueWithProperty)(value, property);
|
|
262
|
+
return typeof normalizedValue !== 'string'
|
|
263
|
+
? JSON.stringify(normalizedValue || '')
|
|
264
|
+
: normalizedValue;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Create the Atomic CSS rules needed for a given StyleSheet rule.
|
|
268
|
+
* Translates StyleSheet declarations to CSS.
|
|
269
|
+
*/
|
|
270
|
+
function createAtomicRules(identifier, property, value) {
|
|
271
|
+
const rules = [];
|
|
272
|
+
const selector = `.${identifier}`;
|
|
273
|
+
// Handle non-standard properties and object values that require multiple
|
|
274
|
+
// CSS rules to be created.
|
|
275
|
+
switch (property) {
|
|
276
|
+
case 'animationKeyframes': {
|
|
277
|
+
const [animationNames, keyframesRules] = processKeyframesValue(value);
|
|
278
|
+
const block = createDeclarationBlock({
|
|
279
|
+
animationName: animationNames.join(','),
|
|
280
|
+
});
|
|
281
|
+
rules.push(`${selector}${block}`, ...keyframesRules);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
// Equivalent to using '::placeholder'
|
|
285
|
+
case 'placeholderTextColor': {
|
|
286
|
+
const block = createDeclarationBlock({ color: value, opacity: 1 });
|
|
287
|
+
rules.push(`${selector}::-webkit-input-placeholder${block}`, `${selector}::-moz-placeholder${block}`, `${selector}:-ms-input-placeholder${block}`, `${selector}::placeholder${block}`);
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
// Polyfill for additional 'pointer-events' values
|
|
291
|
+
// See d13f78622b233a0afc0c7a200c0a0792c8ca9e58
|
|
292
|
+
case 'pointerEvents': {
|
|
293
|
+
let finalValue = value;
|
|
294
|
+
if (value === 'auto' || value === 'box-only') {
|
|
295
|
+
finalValue = 'auto!important';
|
|
296
|
+
if (value === 'box-only') {
|
|
297
|
+
const block = createDeclarationBlock({ pointerEvents: 'none' });
|
|
298
|
+
rules.push(`${selector}>*${block}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
else if (value === 'none' || value === 'box-none') {
|
|
302
|
+
finalValue = 'none!important';
|
|
303
|
+
if (value === 'box-none') {
|
|
304
|
+
const block = createDeclarationBlock({ pointerEvents: 'auto' });
|
|
305
|
+
rules.push(`${selector}>*${block}`);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const block = createDeclarationBlock({ pointerEvents: finalValue });
|
|
309
|
+
rules.push(`${selector}${block}`);
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
// Polyfill for draft spec
|
|
313
|
+
// https://drafts.csswg.org/css-scrollbars-1/
|
|
314
|
+
case 'scrollbarWidth': {
|
|
315
|
+
if (value === 'none') {
|
|
316
|
+
rules.push(`${selector}::-webkit-scrollbar{display:none}`);
|
|
317
|
+
}
|
|
318
|
+
const block = createDeclarationBlock({ scrollbarWidth: value });
|
|
319
|
+
rules.push(`${selector}${block}`);
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
default: {
|
|
323
|
+
const block = createDeclarationBlock({ [property]: value });
|
|
324
|
+
rules.push(`${selector}${block}`);
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return rules;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Creates a CSS declaration block from a StyleSheet object.
|
|
332
|
+
*/
|
|
333
|
+
function createDeclarationBlock(style) {
|
|
334
|
+
const domStyle = (0, createReactDOMStyle_tsx_1.createReactDOMStyle)(style);
|
|
335
|
+
const declarationsString = Object.keys(domStyle)
|
|
336
|
+
.map((property) => {
|
|
337
|
+
const value = domStyle[property];
|
|
338
|
+
const prop = (0, hyphenateStyleName_tsx_1.hyphenateStyleName)(property);
|
|
339
|
+
// The prefixer may return an array of values:
|
|
340
|
+
// { display: [ '-webkit-flex', 'flex' ] }
|
|
341
|
+
// to represent "fallback" declarations
|
|
342
|
+
// { display: -webkit-flex; display: flex; }
|
|
343
|
+
if (Array.isArray(value)) {
|
|
344
|
+
return value.map((v) => `${prop}:${v}`).join(';');
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
return `${prop}:${value}`;
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
// Once properties are hyphenated, this will put the vendor
|
|
351
|
+
// prefixed and short-form properties first in the list.
|
|
352
|
+
.sort()
|
|
353
|
+
.join(';');
|
|
354
|
+
return `{${declarationsString};}`;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* An identifier is associated with a unique set of styles.
|
|
358
|
+
*/
|
|
359
|
+
function createIdentifier(prefix, name, value) {
|
|
360
|
+
const hashedString = (0, simple_hash_1.simpleHash)(name + stringifyValueWithProperty(value, name));
|
|
361
|
+
return process.env.NODE_ENV !== 'production'
|
|
362
|
+
? `${prefix}-${name}-${hashedString}`
|
|
363
|
+
: `${prefix}-${hashedString}`;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Create individual CSS keyframes rules.
|
|
367
|
+
*/
|
|
368
|
+
function createKeyframes(keyframes) {
|
|
369
|
+
const prefixes = ['-webkit-', ''];
|
|
370
|
+
const identifier = createIdentifier('r', 'animation', keyframes);
|
|
371
|
+
const steps = '{' +
|
|
372
|
+
Object.keys(keyframes)
|
|
373
|
+
.map((stepName) => {
|
|
374
|
+
const rule = keyframes[stepName];
|
|
375
|
+
const block = createDeclarationBlock(rule);
|
|
376
|
+
return `${stepName}${block}`;
|
|
377
|
+
})
|
|
378
|
+
.join('') +
|
|
379
|
+
'}';
|
|
380
|
+
const rules = prefixes.map((prefix) => {
|
|
381
|
+
return `@${prefix}keyframes ${identifier}${steps}`;
|
|
382
|
+
});
|
|
383
|
+
return [identifier, rules];
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Create CSS keyframes rules and names from a StyleSheet keyframes object.
|
|
387
|
+
*/
|
|
388
|
+
function processKeyframesValue(keyframesValue) {
|
|
389
|
+
if (typeof keyframesValue === 'number') {
|
|
390
|
+
throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
|
|
391
|
+
}
|
|
392
|
+
const animationNames = [];
|
|
393
|
+
const rules = [];
|
|
394
|
+
const value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
|
|
395
|
+
value.forEach((keyframes) => {
|
|
396
|
+
if (typeof keyframes === 'string') {
|
|
397
|
+
// Support external animation libraries (identifiers only)
|
|
398
|
+
animationNames.push(keyframes);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
// Create rules for each of the keyframes
|
|
402
|
+
const [identifier, keyframesRules] = createKeyframes(keyframes);
|
|
403
|
+
animationNames.push(identifier);
|
|
404
|
+
rules.push(...keyframesRules);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
return [animationNames, rules];
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=index.js.map
|