@hanzogui/react-native-web-internals 8.3.0 → 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 +21 -18
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useElementLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,gBAAgB,IAAI,mBAAmB,GACxC,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAkB,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAG1D,MAAM,UAAU,gBAAgB,CAC9B,GAAmB,EACnB,QAA4C;IAE5C,+BAA+B;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP,IAAI,IAAI;oBACN,OAAO,GAAG,CAAC,OAAO,CAAA;gBACpB,CAAC;aACF;SACF,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAET,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,CAAA;IACV,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,mBAAmB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
*/
|
|
9
|
+
import { createEventHandle } from '../createEventHandle/index.js';
|
|
10
|
+
import { useLayoutEffectImpl as useLayoutEffect } from '../useLayoutEffect/index.js';
|
|
11
|
+
import { useStable } from '../useStable/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* This can be used with any event type include custom events.
|
|
14
|
+
*
|
|
15
|
+
* const click = useEvent('click', options);
|
|
16
|
+
* useEffect(() => {
|
|
17
|
+
* click.setListener(target, onClick);
|
|
18
|
+
* return () => click.clear();
|
|
19
|
+
* }).
|
|
20
|
+
*/
|
|
21
|
+
export function useEvent(event, options) {
|
|
22
|
+
const targetListeners = useStable(() => new Map());
|
|
23
|
+
const addListener = useStable(() => {
|
|
24
|
+
const addEventListener = createEventHandle(event, options);
|
|
25
|
+
return (target, callback) => {
|
|
26
|
+
const removeTargetListener = targetListeners.get(target);
|
|
27
|
+
if (removeTargetListener != null) {
|
|
28
|
+
removeTargetListener();
|
|
29
|
+
}
|
|
30
|
+
if (callback == null) {
|
|
31
|
+
targetListeners.delete(target);
|
|
32
|
+
}
|
|
33
|
+
const removeEventListener = addEventListener(target, callback);
|
|
34
|
+
targetListeners.set(target, removeEventListener);
|
|
35
|
+
return removeEventListener;
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
useLayoutEffect(() => {
|
|
39
|
+
return () => {
|
|
40
|
+
targetListeners.forEach((removeListener) => {
|
|
41
|
+
removeListener();
|
|
42
|
+
});
|
|
43
|
+
targetListeners.clear();
|
|
44
|
+
};
|
|
45
|
+
}, [targetListeners]);
|
|
46
|
+
return addListener;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useEvent/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAAgC,CAAA;AAClE,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAwB,CAAA;AAQlD;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAa,EACb,OAGQ;IAER,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IAElD,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,EAAE;QACjC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC1D,OAAO,CAAC,MAAmB,EAAE,QAAkB,EAAE,EAAE;YACjD,MAAM,oBAAoB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACxD,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;gBACjC,oBAAoB,EAAE,CAAA;YACxB,CAAC;YACD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;gBACrB,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChC,CAAC;YACD,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC9D,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;YAChD,OAAO,mBAAmB,CAAA;QAC5B,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,eAAe,CAAC,GAAG,EAAE;QACnB,OAAO,GAAG,EAAE;YACV,eAAe,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;gBACzC,cAAc,EAAE,CAAA;YAClB,CAAC,CAAC,CAAA;YACF,eAAe,CAAC,KAAK,EAAE,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAA;IAErB,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
*/
|
|
9
|
+
import { getModality } from '../modality/index.js';
|
|
10
|
+
import { useEvent } from '../useEvent/index.js';
|
|
11
|
+
import { useLayoutEffectImpl as useLayoutEffect } from '../useLayoutEffect/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* Implementation
|
|
14
|
+
*/
|
|
15
|
+
const emptyObject = {};
|
|
16
|
+
const opts = { passive: true };
|
|
17
|
+
const lockEventType = 'react-gui:hover:lock';
|
|
18
|
+
const unlockEventType = 'react-gui:hover:unlock';
|
|
19
|
+
const supportsPointerEvent = () => !!(typeof window !== 'undefined' && window.PointerEvent != null);
|
|
20
|
+
function dispatchCustomEvent(target, type, payload) {
|
|
21
|
+
const event = document.createEvent('CustomEvent');
|
|
22
|
+
const { bubbles = true, cancelable = true, detail } = payload || emptyObject;
|
|
23
|
+
event.initCustomEvent(type, bubbles, cancelable, detail);
|
|
24
|
+
target.dispatchEvent(event);
|
|
25
|
+
}
|
|
26
|
+
// This accounts for the non-PointerEvent fallback events.
|
|
27
|
+
function getPointerType(event) {
|
|
28
|
+
const { pointerType } = event;
|
|
29
|
+
return pointerType != null ? pointerType : getModality();
|
|
30
|
+
}
|
|
31
|
+
export function useHover(targetRef, config) {
|
|
32
|
+
const { contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd } = config;
|
|
33
|
+
const canUsePE = supportsPointerEvent();
|
|
34
|
+
const addMoveListener = useEvent(canUsePE ? 'pointermove' : 'mousemove', opts);
|
|
35
|
+
const addEnterListener = useEvent(canUsePE ? 'pointerenter' : 'mouseenter', opts);
|
|
36
|
+
const addLeaveListener = useEvent(canUsePE ? 'pointerleave' : 'mouseleave', opts);
|
|
37
|
+
// These custom events are used to implement the "contain" prop.
|
|
38
|
+
const addLockListener = useEvent(lockEventType, opts);
|
|
39
|
+
const addUnlockListener = useEvent(unlockEventType, opts);
|
|
40
|
+
useLayoutEffect(() => {
|
|
41
|
+
const target = targetRef.current;
|
|
42
|
+
if (target !== null) {
|
|
43
|
+
/**
|
|
44
|
+
* End the hover gesture
|
|
45
|
+
*/
|
|
46
|
+
const hoverEnd = function (e) {
|
|
47
|
+
if (onHoverEnd != null) {
|
|
48
|
+
onHoverEnd(e);
|
|
49
|
+
}
|
|
50
|
+
if (onHoverChange != null) {
|
|
51
|
+
onHoverChange(false);
|
|
52
|
+
}
|
|
53
|
+
// Remove the listeners once finished.
|
|
54
|
+
addMoveListener(target, null);
|
|
55
|
+
addLeaveListener(target, null);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Leave element
|
|
59
|
+
*/
|
|
60
|
+
const leaveListener = function (e) {
|
|
61
|
+
const target = targetRef.current;
|
|
62
|
+
if (target != null && getPointerType(e) !== 'touch') {
|
|
63
|
+
if (contain) {
|
|
64
|
+
dispatchCustomEvent(target, unlockEventType);
|
|
65
|
+
}
|
|
66
|
+
hoverEnd(e);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Move within element
|
|
71
|
+
*/
|
|
72
|
+
const moveListener = function (e) {
|
|
73
|
+
if (getPointerType(e) !== 'touch') {
|
|
74
|
+
if (onHoverUpdate != null) {
|
|
75
|
+
// Not all browsers have these properties
|
|
76
|
+
if (e.x == null) {
|
|
77
|
+
e.x = e.clientX;
|
|
78
|
+
}
|
|
79
|
+
if (e.y == null) {
|
|
80
|
+
e.y = e.clientY;
|
|
81
|
+
}
|
|
82
|
+
onHoverUpdate(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Start the hover gesture
|
|
88
|
+
*/
|
|
89
|
+
const hoverStart = function (e) {
|
|
90
|
+
if (onHoverStart != null) {
|
|
91
|
+
onHoverStart(e);
|
|
92
|
+
}
|
|
93
|
+
if (onHoverChange != null) {
|
|
94
|
+
onHoverChange(true);
|
|
95
|
+
}
|
|
96
|
+
// Set the listeners needed for the rest of the hover gesture.
|
|
97
|
+
if (onHoverUpdate != null) {
|
|
98
|
+
addMoveListener(target, !disabled ? moveListener : null);
|
|
99
|
+
}
|
|
100
|
+
addLeaveListener(target, !disabled ? leaveListener : null);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Enter element
|
|
104
|
+
*/
|
|
105
|
+
const enterListener = function (e) {
|
|
106
|
+
const target = targetRef.current;
|
|
107
|
+
if (target != null && getPointerType(e) !== 'touch') {
|
|
108
|
+
if (contain) {
|
|
109
|
+
dispatchCustomEvent(target, lockEventType);
|
|
110
|
+
}
|
|
111
|
+
hoverStart(e);
|
|
112
|
+
const lockListener = function (lockEvent) {
|
|
113
|
+
if (lockEvent.target !== target) {
|
|
114
|
+
hoverEnd(e);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const unlockListener = function (lockEvent) {
|
|
118
|
+
if (lockEvent.target !== target) {
|
|
119
|
+
hoverStart(e);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
addLockListener(target, !disabled ? lockListener : null);
|
|
123
|
+
addUnlockListener(target, !disabled ? unlockListener : null);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
addEnterListener(target, !disabled ? enterListener : null);
|
|
127
|
+
}
|
|
128
|
+
}, [
|
|
129
|
+
addEnterListener,
|
|
130
|
+
addMoveListener,
|
|
131
|
+
addLeaveListener,
|
|
132
|
+
addLockListener,
|
|
133
|
+
addUnlockListener,
|
|
134
|
+
contain,
|
|
135
|
+
disabled,
|
|
136
|
+
onHoverStart,
|
|
137
|
+
onHoverChange,
|
|
138
|
+
onHoverUpdate,
|
|
139
|
+
onHoverEnd,
|
|
140
|
+
targetRef,
|
|
141
|
+
]);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useHover/index.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'; /**
|
|
2
|
+
* Copyright (c) Nicolas Gallagher.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* useLayoutEffect throws an error on the server. On the few occasions where is
|
|
8
|
+
* problematic, use this hook.
|
|
9
|
+
*
|
|
10
|
+
* @flow
|
|
11
|
+
*/
|
|
12
|
+
import { canUseDOM } from '../canUseDOM.js';
|
|
13
|
+
export const useLayoutEffectImpl = canUseDOM ? React.useLayoutEffect : React.useEffect;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useLayoutEffect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA,CAAC;;;;;;;;;;GAUvB;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAkB,CAAA;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react'; /**
|
|
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
|
+
import { isLocaleRTL } from './isLocaleRTL.js';
|
|
11
|
+
const defaultLocale = {
|
|
12
|
+
direction: 'ltr',
|
|
13
|
+
locale: 'en-US',
|
|
14
|
+
};
|
|
15
|
+
const LocaleContext = React.createContext(defaultLocale);
|
|
16
|
+
export function getLocaleDirection(locale) {
|
|
17
|
+
return isLocaleRTL(locale) ? 'rtl' : 'ltr';
|
|
18
|
+
}
|
|
19
|
+
export function LocaleProvider(props) {
|
|
20
|
+
const { direction, locale, children } = props;
|
|
21
|
+
const needsContext = direction || locale;
|
|
22
|
+
return needsContext ? (_jsx(LocaleContext.Provider, { value: {
|
|
23
|
+
direction: locale ? getLocaleDirection(locale) : direction,
|
|
24
|
+
locale,
|
|
25
|
+
}, children: children })) : (children);
|
|
26
|
+
}
|
|
27
|
+
export function useLocaleContext() {
|
|
28
|
+
return React.useContext(LocaleContext);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useLocale/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA,CAAC;;;;;;;GAOvB;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAA;AAgB/C,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,OAAO;CAChB,CAAA;AAED,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAc,aAAoB,CAAC,CAAA;AAE5E,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC7C,MAAM,YAAY,GAAG,SAAS,IAAI,MAAM,CAAA;IAExC,OAAO,YAAY,CAAC,CAAC,CAAC,CACpB,KAAC,aAAa,CAAC,QAAQ,IACrB,KAAK,EAAE;YACL,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;YAC1D,MAAM;SACP,YAEA,QAAQ,GACc,CAC1B,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Nicolas Gallagher.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
*/
|
|
9
|
+
const rtlScripts = new Set([
|
|
10
|
+
'Arab',
|
|
11
|
+
'Syrc',
|
|
12
|
+
'Samr',
|
|
13
|
+
'Mand',
|
|
14
|
+
'Thaa',
|
|
15
|
+
'Mend',
|
|
16
|
+
'Nkoo',
|
|
17
|
+
'Adlm',
|
|
18
|
+
'Rohg',
|
|
19
|
+
'Hebr',
|
|
20
|
+
]);
|
|
21
|
+
const rtlLangs = new Set([
|
|
22
|
+
'ae', // Avestan
|
|
23
|
+
'ar', // Arabic
|
|
24
|
+
'arc', // Aramaic
|
|
25
|
+
'bcc', // Southern Balochi
|
|
26
|
+
'bqi', // Bakthiari
|
|
27
|
+
'ckb', // Sorani
|
|
28
|
+
'dv', // Dhivehi
|
|
29
|
+
'fa',
|
|
30
|
+
'far', // Persian
|
|
31
|
+
'glk', // Gilaki
|
|
32
|
+
'he',
|
|
33
|
+
'iw', // Hebrew
|
|
34
|
+
'khw', // Khowar
|
|
35
|
+
'ks', // Kashmiri
|
|
36
|
+
'ku', // Kurdish
|
|
37
|
+
'mzn', // Mazanderani
|
|
38
|
+
'nqo', // N'Ko
|
|
39
|
+
'pnb', // Western Punjabi
|
|
40
|
+
'ps', // Pashto
|
|
41
|
+
'sd', // Sindhi
|
|
42
|
+
'ug', // Uyghur
|
|
43
|
+
'ur', // Urdu
|
|
44
|
+
'yi', // Yiddish
|
|
45
|
+
]);
|
|
46
|
+
const cache = new Map();
|
|
47
|
+
/**
|
|
48
|
+
* Determine the writing direction of a locale
|
|
49
|
+
*/
|
|
50
|
+
export function isLocaleRTL(locale) {
|
|
51
|
+
const cachedRTL = cache.get(locale);
|
|
52
|
+
if (cachedRTL) {
|
|
53
|
+
return cachedRTL;
|
|
54
|
+
}
|
|
55
|
+
let isRTL = false;
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
if (Intl.Locale) {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
const script = new Intl.Locale(locale).maximize().script;
|
|
60
|
+
isRTL = rtlScripts.has(script);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// Fallback to inferring from language
|
|
64
|
+
const lang = locale.split('-')[0];
|
|
65
|
+
isRTL = rtlLangs.has(lang);
|
|
66
|
+
}
|
|
67
|
+
cache.set(locale, isRTL);
|
|
68
|
+
return isRTL;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=isLocaleRTL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isLocaleRTL.js","sourceRoot":"","sources":["../../../../src/modules/useLocale/isLocaleRTL.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC,CAAA;AAEF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI;IACJ,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,SAAS;IAChB,IAAI;IACJ,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,UAAU;CACjB,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAA;AAEvB;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACnC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,aAAa;IACb,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,aAAa;QACb,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAA;QACxD,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,MAAa,CAAC,CAAA;IACvC,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { mergeRefs } from '../mergeRefs/index.js';
|
|
11
|
+
export function useMergeRefs(...args) {
|
|
12
|
+
return React.useMemo(() => mergeRefs(...args),
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
[...args]);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useMergeRefs/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAwB,CAAA;AAElD,MAAM,UAAU,YAAY,CAC1B,GAAG,IAAmC;IAEtC,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACxB,2BAA2B;IAC3B,CAAC,GAAG,IAAI,CAAC,CACV,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Nicolas Gallagher.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
*/
|
|
9
|
+
import { createMeasure, createMeasureInWindow, createMeasureLayout, } from '@hanzogui/use-element-layout';
|
|
10
|
+
import { useStable } from '../useStable/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Adds non-standard methods to the hode element. This is temporarily until an
|
|
13
|
+
* API like `ReactNative.measure(hostRef, callback)` is added to React Native.
|
|
14
|
+
*/
|
|
15
|
+
export function usePlatformMethods({ pointerEvents, style, }) {
|
|
16
|
+
// Avoid creating a new ref on every render. The props only need to be
|
|
17
|
+
// available to 'setNativeProps' when it is called.
|
|
18
|
+
const ref = useStable(() => (hostNode) => {
|
|
19
|
+
if (hostNode != null) {
|
|
20
|
+
hostNode.measure = createMeasure(hostNode);
|
|
21
|
+
hostNode.measureLayout = createMeasureLayout(hostNode);
|
|
22
|
+
hostNode.measureInWindow = createMeasureInWindow(hostNode);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return ref;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/usePlatformMethods/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAwB,CAAA;AAElD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,aAAa,EACb,KAAK,GAIN;IACC,sEAAsE;IACtE,mDAAmD;IACnD,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,QAAa,EAAE,EAAE;QAC5C,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,QAAQ,CAAC,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;YAC1C,QAAQ,CAAC,aAAa,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;YACtD,QAAQ,CAAC,eAAe,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
const UNINITIALIZED = typeof Symbol === 'function' && typeof Symbol() === 'symbol'
|
|
11
|
+
? Symbol()
|
|
12
|
+
: Object.freeze({});
|
|
13
|
+
export function useStable(getInitialValue) {
|
|
14
|
+
const ref = React.useRef(UNINITIALIZED);
|
|
15
|
+
if (ref.current === UNINITIALIZED) {
|
|
16
|
+
ref.current = getInitialValue();
|
|
17
|
+
}
|
|
18
|
+
// @ts-ignore (#64650789) Trouble refining types where `Symbol` is concerned.
|
|
19
|
+
return ref.current;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/useStable/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,aAAa,GACjB,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,EAAE,KAAK,QAAQ;IAC1D,CAAC,CAAC,MAAM,EAAE;IACV,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAEvB,MAAM,UAAU,SAAS,CAAI,eAAwB;IACnD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAM,aAAa,CAAC,CAAA;IAC5C,IAAI,GAAG,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;QAClC,GAAG,CAAC,OAAO,GAAG,eAAe,EAAE,CAAA;IACjC,CAAC;IACD,8EAA8E;IAC9E,OAAO,GAAG,CAAC,OAAO,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleTypes.js","sourceRoot":"","sources":["../../src/styleTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/react-native-web-internals",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"description": "React Native for Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -16,17 +16,20 @@
|
|
|
16
16
|
],
|
|
17
17
|
"type": "module",
|
|
18
18
|
"sideEffects": false,
|
|
19
|
-
"main": "dist/cjs",
|
|
20
|
-
"module": "dist/esm",
|
|
19
|
+
"main": "./dist/cjs/index.js",
|
|
20
|
+
"module": "./dist/esm/index.js",
|
|
21
|
+
"types": "./types/index.d.ts",
|
|
21
22
|
"typings": "./types/index.d.ts",
|
|
22
23
|
"exports": {
|
|
23
24
|
"./package.json": "./package.json",
|
|
24
25
|
".": {
|
|
25
26
|
"types": "./types/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"react-native": "./dist/esm/index.js",
|
|
28
|
+
"browser": "./dist/esm/index.js",
|
|
29
|
+
"module": "./dist/esm/index.js",
|
|
30
|
+
"import": "./dist/esm/index.js",
|
|
31
|
+
"require": "./dist/cjs/index.js",
|
|
32
|
+
"default": "./dist/esm/index.js"
|
|
30
33
|
}
|
|
31
34
|
},
|
|
32
35
|
"scripts": {
|
|
@@ -36,21 +39,21 @@
|
|
|
36
39
|
"clean:build": "hanzogui-build clean:build"
|
|
37
40
|
},
|
|
38
41
|
"dependencies": {
|
|
39
|
-
"@hanzogui/normalize-css-color": "8.3.
|
|
40
|
-
"@hanzogui/react-native-use-pressable": "8.3.
|
|
41
|
-
"@hanzogui/react-native-use-responder-events": "8.3.
|
|
42
|
-
"@hanzogui/simple-hash": "8.3.
|
|
43
|
-
"@hanzogui/use-element-layout": "8.3.
|
|
44
|
-
"@hanzogui/web": "8.3.
|
|
42
|
+
"@hanzogui/normalize-css-color": "8.3.2",
|
|
43
|
+
"@hanzogui/react-native-use-pressable": "8.3.2",
|
|
44
|
+
"@hanzogui/react-native-use-responder-events": "8.3.2",
|
|
45
|
+
"@hanzogui/simple-hash": "8.3.2",
|
|
46
|
+
"@hanzogui/use-element-layout": "8.3.2",
|
|
47
|
+
"@hanzogui/web": "8.3.2"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@hanzogui/build": "8.3.
|
|
48
|
-
"react": "
|
|
49
|
-
"react-dom": "
|
|
50
|
+
"@hanzogui/build": "8.3.2",
|
|
51
|
+
"react": "19.2.8",
|
|
52
|
+
"react-dom": "19.2.8"
|
|
50
53
|
},
|
|
51
54
|
"peerDependencies": {
|
|
52
|
-
"react": ">=19",
|
|
53
|
-
"react-dom": "
|
|
55
|
+
"react": ">=19.2.8",
|
|
56
|
+
"react-dom": ">=19.2.8"
|
|
54
57
|
},
|
|
55
58
|
"tags": [
|
|
56
59
|
"react"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import createReactDOMStyle from '../compiler/createReactDOMStyle'
|
|
8
|
+
import createReactDOMStyle from '../compiler/createReactDOMStyle.tsx'
|
|
9
9
|
|
|
10
10
|
const reactNativeStyle = {
|
|
11
11
|
boxShadow: '1px 1px 1px 1px #000',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { atomic, classic, inline } from '../compiler'
|
|
8
|
+
import { atomic, classic, inline } from '../compiler/index.tsx'
|
|
9
9
|
|
|
10
10
|
describe('StyleSheet/compile', () => {
|
|
11
11
|
describe('atomic', () => {
|
|
@@ -82,7 +82,7 @@ describe('StyleSheet/compile', () => {
|
|
|
82
82
|
],
|
|
83
83
|
[
|
|
84
84
|
[
|
|
85
|
-
".r-fontFamily-1qd0xha{font-family
|
|
85
|
+
".r-fontFamily-1qd0xha{font-family:Zen, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}",
|
|
86
86
|
],
|
|
87
87
|
2.2,
|
|
88
88
|
],
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import createOrderedCSSStyleSheet from '../dom/createOrderedCSSStyleSheet'
|
|
8
|
+
import createOrderedCSSStyleSheet from '../dom/createOrderedCSSStyleSheet.tsx'
|
|
9
9
|
|
|
10
10
|
const insertStyleElement = () => {
|
|
11
11
|
const element = document.createElement('style')
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { preprocess } from '../preprocess'
|
|
8
|
+
import { preprocess } from '../preprocess.tsx'
|
|
9
9
|
|
|
10
10
|
describe('StyleSheet/preprocess', () => {
|
|
11
11
|
describe('preprocesses multiple shadow styles into a single declaration', () => {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @flow
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { canUseDOM } from '../../modules/canUseDOM'
|
|
12
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
11
|
+
import { canUseDOM } from '../../modules/canUseDOM.tsx'
|
|
12
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty.tsx'
|
|
13
13
|
|
|
14
14
|
type Style = {
|
|
15
15
|
[K in string]: any
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
import { simpleHash } from '@hanzogui/simple-hash'
|
|
12
12
|
|
|
13
|
-
import { createReactDOMStyle } from './createReactDOMStyle'
|
|
14
|
-
import { hyphenateStyleName } from './hyphenateStyleName'
|
|
15
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
13
|
+
import { createReactDOMStyle } from './createReactDOMStyle.tsx'
|
|
14
|
+
import { hyphenateStyleName } from './hyphenateStyleName.tsx'
|
|
15
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty.tsx'
|
|
16
16
|
|
|
17
17
|
type Value = object | Array<any> | string | number
|
|
18
18
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @flow
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { isWebColor } from '../../modules/isWebColor'
|
|
11
|
-
import { processColor } from '../../modules/processColor'
|
|
10
|
+
import { isWebColor } from '../../modules/isWebColor/index.tsx'
|
|
11
|
+
import { processColor } from '../../modules/processColor/index.tsx'
|
|
12
12
|
|
|
13
13
|
export const normalizeColor = (color?: number | string, opacity = 1): void | string => {
|
|
14
14
|
if (color == null) return
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @flow strict-local
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { unitlessNumbers } from '../../modules/unitlessNumbers/index'
|
|
11
|
-
import { normalizeColor } from './normalizeColor'
|
|
10
|
+
import { unitlessNumbers } from '../../modules/unitlessNumbers/index.tsx'
|
|
11
|
+
import { normalizeColor } from './normalizeColor.tsx'
|
|
12
12
|
|
|
13
13
|
const colorProps = {
|
|
14
14
|
backgroundColor: true,
|