@hanzogui/web 7.3.2 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -0
- package/dist/cjs/_withStableStyle.cjs +2 -2
- package/dist/cjs/_withStableStyle.native.js +2 -2
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +18 -10
- package/dist/cjs/config.native.js +19 -10
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +1 -1
- package/dist/cjs/constants/constants.native.js +1 -1
- package/dist/cjs/constants/constants.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +68 -28
- package/dist/cjs/createComponent.native.js +75 -30
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createGui.cjs +1 -1
- package/dist/cjs/createGui.native.js +1 -1
- package/dist/cjs/createGui.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +2 -2
- package/dist/cjs/eventHandling.native.js +73 -54
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +2 -2
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +46 -5
- package/dist/cjs/helpers/expandStyle.native.js +36 -30
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.cjs +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +76 -31
- package/dist/cjs/helpers/getSplitStyles.native.js +140 -85
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getTokenForKey.cjs +5 -5
- package/dist/cjs/helpers/getTokenForKey.native.js +5 -5
- package/dist/cjs/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +7 -3
- package/dist/cjs/helpers/getVariantExtras.native.js +7 -3
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +4 -4
- package/dist/cjs/helpers/insertStyleRule.native.js +3 -3
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +32 -4
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +22 -1
- package/dist/cjs/helpers/normalizeStyle.native.js +41 -1
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/platformResolveValue.cjs +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js +1 -1
- package/dist/cjs/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/cjs/helpers/pointerEvents.native.js +26 -20
- package/dist/cjs/helpers/pointerEvents.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +31 -7
- package/dist/cjs/helpers/propMapper.native.js +70 -20
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.native.js +1 -1
- package/dist/cjs/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/cjs/helpers/styleOriginalValues.cjs +28 -0
- package/dist/cjs/helpers/styleOriginalValues.native.js +31 -0
- package/dist/cjs/helpers/styleOriginalValues.native.js.map +1 -0
- package/dist/cjs/helpers/styleProvenance.cjs +43 -0
- package/dist/cjs/helpers/styleProvenance.native.js +46 -0
- package/dist/cjs/helpers/styleProvenance.native.js.map +1 -0
- package/dist/cjs/helpers/wrapStyleTags.cjs +35 -11
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js +4 -4
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +29 -3
- package/dist/cjs/hooks/useComponentState.native.js +30 -4
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +107 -42
- package/dist/cjs/hooks/useMedia.native.js +149 -60
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +18 -5
- package/dist/cjs/hooks/useTheme.native.js +19 -5
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +143 -72
- package/dist/cjs/hooks/useThemeState.native.js +155 -74
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/opacityModifier.test-d.cjs +36 -0
- package/dist/cjs/opacityModifier.test-d.native.js +39 -0
- package/dist/cjs/opacityModifier.test-d.native.js.map +1 -0
- package/dist/cjs/styledNonStyleProps.test-d.cjs +63 -0
- package/dist/cjs/styledNonStyleProps.test-d.native.js +66 -0
- package/dist/cjs/styledNonStyleProps.test-d.native.js.map +1 -0
- package/dist/cjs/views/GuiProvider.cjs +2 -2
- package/dist/cjs/views/Text.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +1 -1
- package/dist/cjs/views/Theme.native.js +1 -1
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +2 -2
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +2 -2
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +18 -11
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +19 -11
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +1 -1
- package/dist/esm/constants/constants.native.js +1 -1
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +74 -35
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +90 -42
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createGui.mjs +6 -6
- package/dist/esm/createGui.mjs.map +1 -1
- package/dist/esm/createGui.native.js +6 -6
- package/dist/esm/createGui.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +2 -2
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +74 -55
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +2 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +1 -2
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/esm/helpers/expandStyle.mjs +47 -8
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -30
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.mjs +1 -1
- package/dist/esm/helpers/getGroupPropParts.mjs.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +86 -45
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +146 -98
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.mjs +5 -5
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js +5 -5
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +7 -3
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +7 -3
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +4 -6
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +0 -26
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +32 -4
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +22 -1
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +41 -1
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs +1 -1
- package/dist/esm/helpers/platformResolveValue.mjs.map +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js +1 -1
- package/dist/esm/helpers/platformResolveValue.native.js.map +1 -1
- package/dist/esm/helpers/pointerEvents.native.js +26 -20
- package/dist/esm/helpers/pointerEvents.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +32 -11
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +71 -22
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.native.js +1 -1
- package/dist/esm/helpers/resolveSafeArea.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleOriginalValues.mjs +3 -0
- package/dist/esm/helpers/styleOriginalValues.mjs.map +1 -0
- package/dist/esm/helpers/styleOriginalValues.native.js +3 -0
- package/dist/esm/helpers/styleOriginalValues.native.js.map +1 -0
- package/dist/esm/helpers/styleProvenance.mjs +16 -0
- package/dist/esm/helpers/styleProvenance.mjs.map +1 -0
- package/dist/esm/helpers/styleProvenance.native.js +16 -0
- package/dist/esm/helpers/styleProvenance.native.js.map +1 -0
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +35 -11
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +0 -2
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +2 -5
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +5 -5
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +31 -5
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +32 -6
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +108 -43
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +150 -61
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +18 -5
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +19 -5
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +141 -70
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +154 -73
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +4 -4
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +0 -1
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/opacityModifier.test-d.mjs +37 -0
- package/dist/esm/opacityModifier.test-d.mjs.map +1 -0
- package/dist/esm/opacityModifier.test-d.native.js +37 -0
- package/dist/esm/opacityModifier.test-d.native.js.map +1 -0
- package/dist/esm/styledNonStyleProps.test-d.mjs +64 -0
- package/dist/esm/styledNonStyleProps.test-d.mjs.map +1 -0
- package/dist/esm/styledNonStyleProps.test-d.native.js +64 -0
- package/dist/esm/styledNonStyleProps.test-d.native.js.map +1 -0
- package/dist/esm/views/GuiProvider.mjs +2 -2
- package/dist/esm/views/GuiProvider.mjs.map +1 -1
- package/dist/esm/views/GuiProvider.native.js +6 -6
- package/dist/esm/views/GuiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +1 -0
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +1 -0
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +1 -1
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +2 -4
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/inject-styles/index.cjs +2 -0
- package/inject-styles/index.js +2 -0
- package/package.json +27 -40
- package/src/_withStableStyle.tsx +9 -3
- package/src/config.ts +24 -14
- package/src/constants/accessibilityDirectMap.tsx +1 -1
- package/src/constants/constants.ts +1 -1
- package/src/createComponent.tsx +161 -26
- package/src/createGui.ts +2 -2
- package/src/eventHandling.native.ts +143 -52
- package/src/eventHandling.ts +4 -2
- package/src/helpers/createDesignSystem.ts +2 -2
- package/src/helpers/createMediaStyle.ts +1 -1
- package/src/helpers/defaultAnimationDriver.tsx +1 -1
- package/src/helpers/expandStyle.ts +108 -40
- package/src/helpers/getGroupPropParts.ts +1 -1
- package/src/helpers/getSplitStyles.tsx +178 -72
- package/src/helpers/getTokenForKey.ts +5 -5
- package/src/helpers/getVariantExtras.tsx +5 -4
- package/src/helpers/insertStyleRule.tsx +7 -7
- package/src/helpers/mainThreadPressEvents.native.ts +42 -2
- package/src/helpers/mergeProps.ts +1 -1
- package/src/helpers/normalizeStyle.ts +23 -1
- package/src/helpers/platformResolveValue.native.ts +4 -1
- package/src/helpers/platformResolveValue.ts +5 -1
- package/src/helpers/pointerEvents.native.ts +26 -19
- package/src/helpers/propMapper.ts +61 -6
- package/src/helpers/resolveSafeArea.native.ts +1 -1
- package/src/helpers/styleOriginalValues.ts +2 -0
- package/src/helpers/styleProvenance.ts +49 -0
- package/src/helpers/wrapStyleTags.tsx +63 -20
- package/src/hooks/getThemeProxied.ts +14 -8
- package/src/hooks/useComponentState.ts +56 -4
- package/src/hooks/useMedia.tsx +156 -43
- package/src/hooks/useTheme.tsx +28 -6
- package/src/hooks/useThemeState.ts +284 -142
- package/src/index.ts +9 -1
- package/src/interfaces/GuiComponentPropsBaseBase.tsx +2 -2
- package/src/opacityModifier.test-d.ts +65 -0
- package/src/styled.tsx +1 -1
- package/src/styledNonStyleProps.test-d.ts +106 -0
- package/src/types.tsx +120 -22
- package/src/views/GuiProvider.tsx +2 -2
- package/src/views/Text.tsx +1 -0
- package/src/views/Theme.tsx +4 -1
- package/tsconfig.json +44 -0
- package/tsconfig.test.json +9 -0
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/config.d.ts +3 -1
- package/types/config.d.ts.map +1 -1
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/constants.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/eventHandling.d.ts +2 -2
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts +3 -3
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +2 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +4 -2
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.d.ts.map +1 -1
- package/types/helpers/platformResolveValue.native.d.ts.map +1 -1
- package/types/helpers/pointerEvents.native.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/styleOriginalValues.d.ts +2 -0
- package/types/helpers/styleOriginalValues.d.ts.map +1 -0
- package/types/helpers/styleProvenance.d.ts +11 -0
- package/types/helpers/styleProvenance.d.ts.map +1 -0
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +2 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +3 -3
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts +2 -2
- package/types/types.d.ts +33 -16
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts +1 -2
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/GuiProvider.d.ts +1 -2
- package/types/views/GuiProvider.d.ts.map +1 -1
- package/types/views/GuiRoot.d.ts +1 -1
- package/types/views/GuiRoot.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/vitest.config.d.ts +3 -0
- package/vitest.config.d.ts.map +1 -0
- package/vitest.config.ts +14 -0
- package/LICENSE +0 -42
|
@@ -9,6 +9,39 @@ import { Platform, View } from 'react-native'
|
|
|
9
9
|
import { useMainThreadPressEvents } from './helpers/mainThreadPressEvents'
|
|
10
10
|
import type { StaticConfig, GuiComponentStateRef } from './types'
|
|
11
11
|
|
|
12
|
+
const isFabric = !!(globalThis as any).nativeFabricUIManager
|
|
13
|
+
|
|
14
|
+
// Android (new arch + RNGH 2.30) freezes the JS thread when many pressStyle
|
|
15
|
+
// components each attach a Gesture.Manual()...onTouchesDown observer (e.g. a
|
|
16
|
+
// sheet with several buttons / inputs). Each handler opts into RNGH's
|
|
17
|
+
// pointer-data pipeline (needsPointerData), and the combined coordination
|
|
18
|
+
// cost recreates the same setJSResponder freeze c345b5fc28 was supposed to
|
|
19
|
+
// have killed. iOS Fabric absorbs the cost; Android Fabric doesn't.
|
|
20
|
+
// Skip the observer + wrap on Android — pressStyle visuals fall through to
|
|
21
|
+
// the standard responder path via the synthesized event handlers.
|
|
22
|
+
// computed lazily: the native core bundle is also loaded by the compiler for
|
|
23
|
+
// static extraction, where Platform's init runs after this module's. A
|
|
24
|
+
// top-level read of Platform.OS sees Platform === undefined and crashes the
|
|
25
|
+
// loader. Reading on first call defers until after all module inits complete.
|
|
26
|
+
let isAndroidCache: boolean | undefined
|
|
27
|
+
const getIsAndroid = () => {
|
|
28
|
+
if (isAndroidCache === undefined) {
|
|
29
|
+
isAndroidCache = Platform?.OS === 'android'
|
|
30
|
+
}
|
|
31
|
+
return isAndroidCache
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let isNativeDesktopCache: boolean | undefined
|
|
35
|
+
const getIsNativeDesktop = () => {
|
|
36
|
+
if (isNativeDesktopCache === undefined) {
|
|
37
|
+
isNativeDesktopCache = Platform?.OS === 'macos' || Platform?.OS === 'windows'
|
|
38
|
+
}
|
|
39
|
+
return isNativeDesktopCache
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const responderClaim = () => true
|
|
43
|
+
const responderWrapperStyle = { display: 'contents' } as const
|
|
44
|
+
|
|
12
45
|
// web events not used on native
|
|
13
46
|
export function getWebEvents() {
|
|
14
47
|
return {}
|
|
@@ -21,7 +54,8 @@ export function useEvents(
|
|
|
21
54
|
staticConfig: StaticConfig,
|
|
22
55
|
isHOC?: boolean,
|
|
23
56
|
isInsideNativeMenu?: boolean,
|
|
24
|
-
debugName?: string | null
|
|
57
|
+
debugName?: string | null,
|
|
58
|
+
hasRealPressEvents?: boolean
|
|
25
59
|
) {
|
|
26
60
|
// focus/blur events always attached directly
|
|
27
61
|
if (events) {
|
|
@@ -31,23 +65,34 @@ export function useEvents(
|
|
|
31
65
|
if (events.onBlur) {
|
|
32
66
|
viewProps['onBlur'] = events.onBlur
|
|
33
67
|
}
|
|
68
|
+
if (getIsNativeDesktop()) {
|
|
69
|
+
if (events.onMouseEnter) {
|
|
70
|
+
viewProps['onMouseEnter'] = events.onMouseEnter
|
|
71
|
+
}
|
|
72
|
+
if (events.onMouseLeave) {
|
|
73
|
+
viewProps['onMouseLeave'] = events.onMouseLeave
|
|
74
|
+
}
|
|
75
|
+
}
|
|
34
76
|
}
|
|
35
77
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
78
|
+
// hasPressEvents includes events.onPress synthesized just for pressStyle
|
|
79
|
+
// visuals; hasRealPressEvents is true only when the caller passed a real
|
|
80
|
+
// handler. the distinction matters for arbitration: pressStyle-only gestures
|
|
81
|
+
// must not steal ownership from a real-handler ancestor (e.g. Link asChild's
|
|
82
|
+
// navigate handler merged onto a child View by Slot).
|
|
83
|
+
const hasPressEvents = events?.onPress
|
|
42
84
|
|
|
43
85
|
const gh = getGestureHandler()
|
|
44
86
|
|
|
45
|
-
// track
|
|
87
|
+
// track whether this component has ever had press events to keep hooks
|
|
88
|
+
// ordering stable across renders (gesture is created once per mount).
|
|
46
89
|
if (hasPressEvents) {
|
|
47
90
|
stateRef.current.hasHadEvents = true
|
|
48
91
|
}
|
|
92
|
+
if (hasRealPressEvents) {
|
|
93
|
+
stateRef.current.hasRealPressEvents = true
|
|
94
|
+
}
|
|
49
95
|
|
|
50
|
-
// avoid hooks/reparenting
|
|
51
96
|
const everEnabled = Boolean(hasPressEvents || stateRef.current.hasHadEvents)
|
|
52
97
|
const isUsingRNGH = gh.isEnabled
|
|
53
98
|
|
|
@@ -108,6 +153,22 @@ export function useEvents(
|
|
|
108
153
|
const callbacksRef = useRef<any>(isUsingRNGH ? {} : null)
|
|
109
154
|
const gestureRef = useRef<any>(null)
|
|
110
155
|
|
|
156
|
+
// Real press handlers use the responder system for delivery even when RNGH
|
|
157
|
+
// is configured. RNGH Tap begin/end ordering is not stable enough for
|
|
158
|
+
// nested Gui press arbitration, and Fabric can mount a stale Tap that
|
|
159
|
+
// claims responder but never finalizes. The responder path is the source of
|
|
160
|
+
// truth RN already uses for innermost press ownership.
|
|
161
|
+
//
|
|
162
|
+
// Android pressStyle-only fallback: wire synthesized press handlers to the
|
|
163
|
+
// responder system on viewProps instead of an RNGH Manual observer (which
|
|
164
|
+
// freezes Android — see top-of-file isAndroid comment). Hook is called
|
|
165
|
+
// unconditionally here for stable hooks order; useMainThreadPressEvents
|
|
166
|
+
// no-ops when enabled is false.
|
|
167
|
+
const useResponderFallback =
|
|
168
|
+
!isInsideNativeMenu &&
|
|
169
|
+
Boolean(hasRealPressEvents || (getIsAndroid() && hasPressEvents))
|
|
170
|
+
useMainThreadPressEvents(events, viewProps, useResponderFallback, debugName)
|
|
171
|
+
|
|
111
172
|
if (everEnabled) {
|
|
112
173
|
// store callbacks in refs so gesture doesn't need to be recreated on every render
|
|
113
174
|
callbacksRef.current = hasPressEvents
|
|
@@ -119,13 +180,22 @@ export function useEvents(
|
|
|
119
180
|
}
|
|
120
181
|
: {}
|
|
121
182
|
|
|
183
|
+
if (hasRealPressEvents && !isInsideNativeMenu) {
|
|
184
|
+
// Real handlers are delivered by useMainThreadPressEvents above. Clear
|
|
185
|
+
// any cached pressStyle observer from an earlier render so it cannot
|
|
186
|
+
// double-fire after onPress appears dynamically.
|
|
187
|
+
gestureRef.current = null
|
|
188
|
+
return null
|
|
189
|
+
}
|
|
190
|
+
|
|
122
191
|
// only create gesture once, callbacks are read from ref
|
|
123
192
|
if (!gestureRef.current) {
|
|
193
|
+
const { Gesture } = gh.state
|
|
194
|
+
|
|
124
195
|
if (isInsideNativeMenu) {
|
|
125
196
|
// Inside native menus on Android: use Manual gesture with manualActivation
|
|
126
197
|
// so it never goes ACTIVE (which would send ACTION_CANCEL to MenuView).
|
|
127
198
|
// Press callbacks fire via onTouchesDown/Up instead.
|
|
128
|
-
const { Gesture } = gh.state
|
|
129
199
|
const manual = Gesture.Manual()
|
|
130
200
|
.runOnJS(true)
|
|
131
201
|
.manualActivation(true)
|
|
@@ -140,16 +210,27 @@ export function useEvents(
|
|
|
140
210
|
callbacksRef.current.onPressOut?.({})
|
|
141
211
|
})
|
|
142
212
|
gestureRef.current = manual
|
|
143
|
-
} else {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
213
|
+
} else if (!getIsAndroid()) {
|
|
214
|
+
// pressStyle-only (events.onPress was synthesized to drive pressStyle
|
|
215
|
+
// visuals, no user handler): use Manual + manualActivation. Touch
|
|
216
|
+
// observation runs on the UI thread for fast pressStyle feedback,
|
|
217
|
+
// but the gesture never activates → never claims responder/ownership,
|
|
218
|
+
// so a real-handler ancestor still wins arbitration. This is the fix
|
|
219
|
+
// for nested press scenarios like <Link asChild><View><Button/></View></Link>
|
|
220
|
+
// where the View carries the merged navigate onPress and the inner
|
|
221
|
+
// pressStyled Button must not steal the press.
|
|
222
|
+
//
|
|
223
|
+
// Android: skipped — see isAndroid comment at top. Synthesized
|
|
224
|
+
// pressStyle handlers fall through to viewProps responder events.
|
|
225
|
+
gestureRef.current = Gesture.Manual()
|
|
226
|
+
.runOnJS(true)
|
|
227
|
+
.manualActivation(true)
|
|
228
|
+
.onTouchesDown((e: any) => callbacksRef.current.onPressIn?.(e))
|
|
229
|
+
.onTouchesUp((e: any) => {
|
|
230
|
+
callbacksRef.current.onPress?.(e)
|
|
231
|
+
callbacksRef.current.onPressOut?.(e)
|
|
232
|
+
})
|
|
233
|
+
.onTouchesCancelled((e: any) => callbacksRef.current.onPressOut?.(e))
|
|
153
234
|
}
|
|
154
235
|
}
|
|
155
236
|
// TODO update viewProps.hitSlop / events.delayLongPress!
|
|
@@ -168,9 +249,10 @@ export function useEvents(
|
|
|
168
249
|
export function wrapWithGestureDetector(
|
|
169
250
|
content: any,
|
|
170
251
|
gesture: any,
|
|
171
|
-
|
|
252
|
+
_stateRef: { current: GuiComponentStateRef },
|
|
172
253
|
isHOC?: boolean,
|
|
173
|
-
isCompositeComponent?: boolean
|
|
254
|
+
isCompositeComponent?: boolean,
|
|
255
|
+
hasRealPressEvents?: boolean
|
|
174
256
|
) {
|
|
175
257
|
// Skip wrapping for HOC and composite components - they pass press events
|
|
176
258
|
// to the inner component via props instead of using GestureDetector
|
|
@@ -179,49 +261,58 @@ export function wrapWithGestureDetector(
|
|
|
179
261
|
}
|
|
180
262
|
|
|
181
263
|
const gh = getGestureHandler()
|
|
182
|
-
const { GestureDetector
|
|
183
|
-
|
|
184
|
-
// avoid re-parenting: only wrap if we ever had press events
|
|
185
|
-
const shouldWrap = stateRef.current.hasHadEvents
|
|
264
|
+
const { GestureDetector } = gh.state
|
|
186
265
|
|
|
187
|
-
|
|
266
|
+
// Only wrap when useEvents actually produced an RNGH gesture. Real press
|
|
267
|
+
// handlers are responder-delivered; wrapping them in a no-op GestureDetector
|
|
268
|
+
// recreates the same stale Tap/dead-zone failure mode this path avoids.
|
|
269
|
+
if (!GestureDetector || !gesture) {
|
|
188
270
|
return content
|
|
189
271
|
}
|
|
190
272
|
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
273
|
+
// pressStyle-only observers (Manual + manualActivation gesture) must never
|
|
274
|
+
// claim the responder — otherwise a nested pressStyle Gui child would
|
|
275
|
+
// preempt a real-handler ancestor (e.g. <Link asChild><View><Button/></View></Link>
|
|
276
|
+
// where the View carries the merged navigate handler and the inner Button
|
|
277
|
+
// has only pressStyle). The Manual gesture observes touches on the UI thread
|
|
278
|
+
// for fast pressStyle visuals without participating in arbitration.
|
|
279
|
+
if (!hasRealPressEvents) {
|
|
280
|
+
return React.createElement(GestureDetector, { gesture }, content)
|
|
196
281
|
}
|
|
197
282
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
283
|
+
if (isFabric) {
|
|
284
|
+
// attach responder claim directly to the gesture target. on Fabric this
|
|
285
|
+
// does not conflict with RNGH because the responder path goes through
|
|
286
|
+
// nativeFabricUIManager.setIsJSResponder, not UIManager.setJSResponder
|
|
287
|
+
// (which RNGH intercepts on Paper). avoids a wrapper view, so layout is
|
|
288
|
+
// unchanged and we don't trip Fabric's display:contents -> ForceFlattenView.
|
|
289
|
+
// The claim is what blocks a parent RN Pressable from firing when a press
|
|
290
|
+
// lands on this Gui component (NestedPressExclusive).
|
|
291
|
+
//
|
|
292
|
+
// Do NOT also set onResponderTerminationRequest: false here — that would
|
|
293
|
+
// refuse to release the responder when a parent ScrollView's pan tries to
|
|
294
|
+
// take over, leaving the press stuck "down" for the whole scroll and
|
|
295
|
+
// firing onPress on release. The default (allow termination) lets the
|
|
296
|
+
// ScrollView scroll naturally while the start-claim still blocks parent
|
|
297
|
+
// Pressables from receiving the touch.
|
|
298
|
+
const claimed = React.cloneElement(content, {
|
|
299
|
+
onStartShouldSetResponder: responderClaim,
|
|
300
|
+
})
|
|
301
|
+
return React.createElement(GestureDetector, { gesture }, claimed)
|
|
302
|
+
}
|
|
203
303
|
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
// globally — when the claimant is one of its own gesture targets it
|
|
210
|
-
// creates a coordination conflict, especially at scale on first mount).
|
|
304
|
+
// Paper: keep the hoisted display:contents wrapper. claiming on the gesture
|
|
305
|
+
// target itself triggers RNGH's setJSResponder coordination conflict and
|
|
306
|
+
// freezes long lists (c345b5fc28). Same as Fabric, only claim on start —
|
|
307
|
+
// don't deny termination, or parent ScrollViews can't take the responder
|
|
308
|
+
// back when the user starts scrolling.
|
|
211
309
|
return React.createElement(
|
|
212
310
|
View,
|
|
213
311
|
{
|
|
214
312
|
collapsable: false,
|
|
215
|
-
// display: contents keeps the wrapper transparent to layout (new arch /
|
|
216
|
-
// Fabric) so it doesn't become an extra flex child and shift siblings.
|
|
217
313
|
style: responderWrapperStyle,
|
|
218
314
|
onStartShouldSetResponder: responderClaim,
|
|
219
|
-
onResponderTerminationRequest: responderDeny,
|
|
220
315
|
},
|
|
221
|
-
|
|
316
|
+
React.createElement(GestureDetector, { gesture }, content)
|
|
222
317
|
)
|
|
223
318
|
}
|
|
224
|
-
|
|
225
|
-
const responderClaim = () => true
|
|
226
|
-
const responderDeny = () => false
|
|
227
|
-
const responderWrapperStyle = { display: 'contents' } as const
|
package/src/eventHandling.ts
CHANGED
|
@@ -27,7 +27,8 @@ export function wrapWithGestureDetector(
|
|
|
27
27
|
_gesture: any,
|
|
28
28
|
_stateRef: { current: any },
|
|
29
29
|
_isHOC?: boolean,
|
|
30
|
-
_isCompositeComponent?: boolean
|
|
30
|
+
_isCompositeComponent?: boolean,
|
|
31
|
+
_hasRealPressEvents?: boolean
|
|
31
32
|
) {
|
|
32
33
|
return content
|
|
33
34
|
}
|
|
@@ -40,7 +41,8 @@ export function useEvents(
|
|
|
40
41
|
_staticConfig: any,
|
|
41
42
|
_isHOC?: boolean,
|
|
42
43
|
_isInsideNativeMenu?: boolean,
|
|
43
|
-
_debugName?: string | null
|
|
44
|
+
_debugName?: string | null,
|
|
45
|
+
_hasRealPressEvents?: boolean
|
|
44
46
|
) {
|
|
45
47
|
return null
|
|
46
48
|
}
|
|
@@ -249,8 +249,8 @@ export function getCSS(
|
|
|
249
249
|
@scope (.is_Text) to (.is_View) { .is_Text { white-space: inherit; word-wrap: inherit; } }
|
|
250
250
|
._dsp_contents {display:contents;}
|
|
251
251
|
._no_backdrop::backdrop {display: none;}
|
|
252
|
-
.is_Input::selection, .is_TextArea::selection {background-color: var(--
|
|
253
|
-
.is_Input::placeholder, .is_TextArea::placeholder {color: var(--
|
|
252
|
+
.is_Input::selection, .is_TextArea::selection {background-color: var(--t_selectionColor);}
|
|
253
|
+
.is_Input::placeholder, .is_TextArea::placeholder {color: var(--t_placeholderColor);}
|
|
254
254
|
${pointerEventsCSS}
|
|
255
255
|
${hideScrollBarsCSS}
|
|
256
256
|
${autoVarCSS}
|
|
@@ -3,7 +3,7 @@ import { mediaObjectToString } from './mediaObjectToString'
|
|
|
3
3
|
import type { IsMediaType, MediaQueries, MediaStyleObject, StyleObject } from '../types'
|
|
4
4
|
import { getGroupPropParts, type GroupParts } from './getGroupPropParts'
|
|
5
5
|
|
|
6
|
-
// TODO have this be used by extractMediaStyle in
|
|
6
|
+
// TODO have this be used by extractMediaStyle in hanzogui static
|
|
7
7
|
// not synced to static/constants for now
|
|
8
8
|
export const MEDIA_SEP = '_'
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@ import type { AnimationDriver } from '../types'
|
|
|
2
2
|
|
|
3
3
|
const noAnimationDriver = (method: string): any => {
|
|
4
4
|
console.warn(
|
|
5
|
-
`No animation driver configured. To use ${method}, you must pass \`animations\` to createGui. See: https://
|
|
5
|
+
`No animation driver configured. To use ${method}, you must pass \`animations\` to createGui. See: https://hanzogui.dev/docs/core/animations`
|
|
6
6
|
)
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { isAndroid, isWeb } from '@hanzogui/constants'
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { getStyleCompat, type StyleCompat } from '../config'
|
|
9
9
|
import type { PropMappedValue } from '../types'
|
|
10
10
|
import { parseBorderShorthand } from './parseBorderShorthand'
|
|
11
11
|
import { parseOutlineShorthand } from './parseOutlineShorthand'
|
|
@@ -16,17 +16,66 @@ const neg1Flex = [
|
|
|
16
16
|
['flexBasis', 'auto'],
|
|
17
17
|
] satisfies PropMappedValue
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function expandFlex(value: unknown, compat: StyleCompat): PropMappedValue {
|
|
20
|
+
if (typeof value === 'string') {
|
|
21
|
+
return [['flex', value]]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof value !== 'number') {
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (value === -1) {
|
|
29
|
+
return neg1Flex
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
switch (compat) {
|
|
33
|
+
case 'legacy':
|
|
34
|
+
return [
|
|
35
|
+
['flexGrow', value],
|
|
36
|
+
['flexShrink', 1],
|
|
37
|
+
['flexBasis', 'auto'],
|
|
38
|
+
]
|
|
39
|
+
case 'react-native':
|
|
40
|
+
if (value > 0) {
|
|
41
|
+
return [
|
|
42
|
+
['flexGrow', value],
|
|
43
|
+
['flexShrink', 0],
|
|
44
|
+
['flexBasis', 0],
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
if (value === 0) {
|
|
48
|
+
return [
|
|
49
|
+
['flexGrow', 0],
|
|
50
|
+
['flexShrink', 0],
|
|
51
|
+
['flexBasis', 'auto'],
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
['flexGrow', 0],
|
|
56
|
+
['flexShrink', -value],
|
|
57
|
+
['flexBasis', 'auto'],
|
|
58
|
+
]
|
|
59
|
+
case 'web':
|
|
60
|
+
if (value < 0) {
|
|
61
|
+
return [['flex', value]]
|
|
24
62
|
}
|
|
25
63
|
return [
|
|
26
64
|
['flexGrow', value],
|
|
27
65
|
['flexShrink', 1],
|
|
28
|
-
['flexBasis',
|
|
66
|
+
['flexBasis', 0],
|
|
29
67
|
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function expandStyle(
|
|
72
|
+
key: string,
|
|
73
|
+
value: any,
|
|
74
|
+
styleCompat: StyleCompat = getStyleCompat()
|
|
75
|
+
): PropMappedValue {
|
|
76
|
+
if (process.env.GUI_TARGET === 'web') {
|
|
77
|
+
if (key === 'flex') {
|
|
78
|
+
return expandFlex(value, styleCompat)
|
|
30
79
|
}
|
|
31
80
|
|
|
32
81
|
switch (key) {
|
|
@@ -91,12 +140,21 @@ export function expandStyle(key: string, value: any): PropMappedValue {
|
|
|
91
140
|
}
|
|
92
141
|
}
|
|
93
142
|
|
|
94
|
-
// native-only
|
|
95
|
-
|
|
96
|
-
|
|
143
|
+
// native-only logical expansions (RTL-aware inline props output RN-style
|
|
144
|
+
// names like marginStart/borderEndColor that aren't valid CSS on web)
|
|
145
|
+
if (key in nativeInlineExpansions) {
|
|
146
|
+
return nativeInlineExpansions[key].map((k) => [k, value])
|
|
97
147
|
}
|
|
98
148
|
}
|
|
99
149
|
|
|
150
|
+
// universal logical expansions — applied on both targets so atomic CSS
|
|
151
|
+
// generates one class per longhand. Otherwise `inset: 0` becomes a single
|
|
152
|
+
// `_inset-0px` class controlling four sub-properties, which silently breaks
|
|
153
|
+
// dedup/override against `top`/`left`/etc.
|
|
154
|
+
if (key in universalExpansions) {
|
|
155
|
+
return universalExpansions[key].map((k) => [k, value])
|
|
156
|
+
}
|
|
157
|
+
|
|
100
158
|
if (key in EXPANSIONS) {
|
|
101
159
|
return EXPANSIONS[key].map((k) => [k, value])
|
|
102
160
|
}
|
|
@@ -153,52 +211,62 @@ for (const parent in EXPANSIONS) {
|
|
|
153
211
|
EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`)
|
|
154
212
|
}
|
|
155
213
|
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
214
|
+
// Logical expansions whose targets are physical longhands valid on both
|
|
215
|
+
// targets. Applied unconditionally so atomic CSS stays one-class-per-longhand:
|
|
216
|
+
// without this, `inset: 0` emits `_inset-0px` (one class, four sub-properties)
|
|
217
|
+
// and silently breaks dedup/override against `top`/`left`/etc.
|
|
218
|
+
const universalExpansions: Record<string, string[]> = {
|
|
219
|
+
// inset
|
|
220
|
+
inset: ['top', 'right', 'bottom', 'left'],
|
|
221
|
+
insetBlock: ['top', 'bottom'],
|
|
222
|
+
insetBlockStart: ['top'],
|
|
223
|
+
insetBlockEnd: ['bottom'],
|
|
224
|
+
// block-axis margin/padding
|
|
225
|
+
marginBlock: ['marginTop', 'marginBottom'],
|
|
226
|
+
marginBlockStart: ['marginTop'],
|
|
227
|
+
marginBlockEnd: ['marginBottom'],
|
|
228
|
+
paddingBlock: ['paddingTop', 'paddingBottom'],
|
|
229
|
+
paddingBlockStart: ['paddingTop'],
|
|
230
|
+
paddingBlockEnd: ['paddingBottom'],
|
|
231
|
+
// block-axis border
|
|
159
232
|
borderBlockColor: ['borderTopColor', 'borderBottomColor'],
|
|
160
|
-
borderInlineColor: ['borderEndColor', 'borderStartColor'],
|
|
161
233
|
borderBlockWidth: ['borderTopWidth', 'borderBottomWidth'],
|
|
162
|
-
borderInlineWidth: ['borderEndWidth', 'borderStartWidth'],
|
|
163
234
|
borderBlockStyle: ['borderTopStyle', 'borderBottomStyle'],
|
|
164
|
-
borderInlineStyle: ['borderEndStyle', 'borderStartStyle'],
|
|
165
235
|
borderBlockStartColor: ['borderTopColor'],
|
|
166
236
|
borderBlockEndColor: ['borderBottomColor'],
|
|
167
|
-
borderInlineStartColor: ['borderStartColor'],
|
|
168
|
-
borderInlineEndColor: ['borderEndColor'],
|
|
169
237
|
borderBlockStartWidth: ['borderTopWidth'],
|
|
170
238
|
borderBlockEndWidth: ['borderBottomWidth'],
|
|
171
|
-
borderInlineStartWidth: ['borderStartWidth'],
|
|
172
|
-
borderInlineEndWidth: ['borderEndWidth'],
|
|
173
239
|
borderBlockStartStyle: ['borderTopStyle'],
|
|
174
240
|
borderBlockEndStyle: ['borderBottomStyle'],
|
|
241
|
+
// logical sizing → physical width/height
|
|
242
|
+
minBlockSize: ['minHeight'],
|
|
243
|
+
maxBlockSize: ['maxHeight'],
|
|
244
|
+
minInlineSize: ['minWidth'],
|
|
245
|
+
maxInlineSize: ['maxWidth'],
|
|
246
|
+
blockSize: ['height'],
|
|
247
|
+
inlineSize: ['width'],
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Inline-axis logical expansions are native-only: their targets are RN-style
|
|
251
|
+
// RTL-aware names (marginStart/borderEndColor/etc.) which web's CSS hyphenator
|
|
252
|
+
// would emit as invalid CSS. On web these props pass through as native CSS
|
|
253
|
+
// logical properties, which the browser handles RTL-aware.
|
|
254
|
+
const nativeInlineExpansions: Record<string, string[]> = {
|
|
255
|
+
borderInlineColor: ['borderEndColor', 'borderStartColor'],
|
|
256
|
+
borderInlineWidth: ['borderEndWidth', 'borderStartWidth'],
|
|
257
|
+
borderInlineStyle: ['borderEndStyle', 'borderStartStyle'],
|
|
258
|
+
borderInlineStartColor: ['borderStartColor'],
|
|
259
|
+
borderInlineEndColor: ['borderEndColor'],
|
|
260
|
+
borderInlineStartWidth: ['borderStartWidth'],
|
|
261
|
+
borderInlineEndWidth: ['borderEndWidth'],
|
|
175
262
|
borderInlineStartStyle: ['borderStartStyle'],
|
|
176
263
|
borderInlineEndStyle: ['borderEndStyle'],
|
|
177
|
-
// logical margin/padding
|
|
178
|
-
marginBlock: ['marginTop', 'marginBottom'],
|
|
179
264
|
marginInline: ['marginEnd', 'marginStart'],
|
|
180
|
-
paddingBlock: ['paddingTop', 'paddingBottom'],
|
|
181
|
-
paddingInline: ['paddingEnd', 'paddingStart'],
|
|
182
|
-
marginBlockStart: ['marginTop'],
|
|
183
|
-
marginBlockEnd: ['marginBottom'],
|
|
184
265
|
marginInlineStart: ['marginStart'],
|
|
185
266
|
marginInlineEnd: ['marginEnd'],
|
|
186
|
-
|
|
187
|
-
paddingBlockEnd: ['paddingBottom'],
|
|
267
|
+
paddingInline: ['paddingEnd', 'paddingStart'],
|
|
188
268
|
paddingInlineStart: ['paddingStart'],
|
|
189
269
|
paddingInlineEnd: ['paddingEnd'],
|
|
190
|
-
// logical sizing
|
|
191
|
-
minBlockSize: ['minHeight'],
|
|
192
|
-
maxBlockSize: ['maxHeight'],
|
|
193
|
-
minInlineSize: ['minWidth'],
|
|
194
|
-
maxInlineSize: ['maxWidth'],
|
|
195
|
-
blockSize: ['height'],
|
|
196
|
-
inlineSize: ['width'],
|
|
197
|
-
// inset
|
|
198
|
-
inset: ['top', 'right', 'bottom', 'left'],
|
|
199
|
-
insetBlock: ['top', 'bottom'],
|
|
200
|
-
insetBlockStart: ['top'],
|
|
201
|
-
insetBlockEnd: ['bottom'],
|
|
202
270
|
insetInlineStart: ['left'],
|
|
203
271
|
insetInlineEnd: ['right'],
|
|
204
272
|
}
|
|
@@ -36,7 +36,7 @@ export function getGroupPropParts(groupProp: string): GroupParts {
|
|
|
36
36
|
if (pseudoCandidate && !isValidPseudo(pseudoCandidate)) {
|
|
37
37
|
if (process.env.NODE_ENV === 'development') {
|
|
38
38
|
console.warn(
|
|
39
|
-
`Unknown group prop part "${pseudoCandidate}" in "${groupProp}". If this is a media query, ensure it's defined in your
|
|
39
|
+
`Unknown group prop part "${pseudoCandidate}" in "${groupProp}". If this is a media query, ensure it's defined in your hanzogui config.`
|
|
40
40
|
)
|
|
41
41
|
}
|
|
42
42
|
pseudoCandidate = undefined
|