From c57ae1c1dfb0d0fa789c8aaf771556a54822c1d6 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Dall'Agnol Date: Fri, 19 Aug 2022 00:20:40 -0300 Subject: [PATCH] UNDO THIS COMMIT --- Libraries/NativeComponent/BaseViewConfig.android.js | 1 + Libraries/NativeComponent/BaseViewConfig.ios.js | 1 + Libraries/StyleSheet/StyleSheetTypes.js | 6 ++++++ Libraries/StyleSheet/splitLayoutProps.js | 1 + React/Views/RCTShadowView.h | 1 + React/Views/RCTShadowView.m | 8 ++++++++ packages/rn-tester/js/components/RNTesterExampleFilter.js | 2 ++ 7 files changed, 20 insertions(+) diff --git a/Libraries/NativeComponent/BaseViewConfig.android.js b/Libraries/NativeComponent/BaseViewConfig.android.js index 6342ccf4ceb883..7e93e321276a0a 100644 --- a/Libraries/NativeComponent/BaseViewConfig.android.js +++ b/Libraries/NativeComponent/BaseViewConfig.android.js @@ -212,6 +212,7 @@ const validAttributesForNonEventProps = { marginStart: true, marginEnd: true, marginTop: true, + // marginBlockStart: true, marginBottom: true, marginLeft: true, marginRight: true, diff --git a/Libraries/NativeComponent/BaseViewConfig.ios.js b/Libraries/NativeComponent/BaseViewConfig.ios.js index 95cf5dee34f16a..dba9d8bb5b2a02 100644 --- a/Libraries/NativeComponent/BaseViewConfig.ios.js +++ b/Libraries/NativeComponent/BaseViewConfig.ios.js @@ -248,6 +248,7 @@ const validAttributesForNonEventProps = { // borderEndWidth: true, // borderWidth: true, + // marginBlockStart: true, marginTop: true, marginRight: true, marginBottom: true, diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 0ff1d26f64dd29..b5bbb3079e7826 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -189,6 +189,12 @@ type ____LayoutStyle_Internal = $ReadOnly<{ */ marginBottom?: DimensionValue, + /** `marginBlockStart` works like `margin-bottom` in CSS. + * See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom + * for more details. + */ + marginBlockStart?: DimensionValue, + /** * When direction is `ltr`, `marginEnd` is equivalent to `marginRight`. * When direction is `rtl`, `marginEnd` is equivalent to `marginLeft`. diff --git a/Libraries/StyleSheet/splitLayoutProps.js b/Libraries/StyleSheet/splitLayoutProps.js index 9fdf9e86c9e061..7c0b44366cf359 100644 --- a/Libraries/StyleSheet/splitLayoutProps.js +++ b/Libraries/StyleSheet/splitLayoutProps.js @@ -30,6 +30,7 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): { case 'marginVertical': case 'marginBottom': case 'marginTop': + // case 'marginBlockStart': case 'marginLeft': case 'marginRight': case 'flex': diff --git a/React/Views/RCTShadowView.h b/React/Views/RCTShadowView.h index 226672fb37635a..dfe7d87f15da0d 100644 --- a/React/Views/RCTShadowView.h +++ b/React/Views/RCTShadowView.h @@ -123,6 +123,7 @@ typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry @property (nonatomic, assign) YGValue marginBottom; @property (nonatomic, assign) YGValue marginRight; @property (nonatomic, assign) YGValue marginStart; +// @property (nonatomic, assign) YGValue marginBlockStart; @property (nonatomic, assign) YGValue marginEnd; /** diff --git a/React/Views/RCTShadowView.m b/React/Views/RCTShadowView.m index 016060a226c465..3a77762e67b2ff 100644 --- a/React/Views/RCTShadowView.m +++ b/React/Views/RCTShadowView.m @@ -30,6 +30,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) { META_PROP_VERTICAL, META_PROP_ALL, META_PROP_COUNT, + // META_PROP_BLOCK_START }; @implementation RCTShadowView { @@ -133,11 +134,17 @@ static void RCTProcessMetaPropsMargin(const YGValue metaProps[META_PROP_COUNT], RCT_SET_YGVALUE_AUTO(start, YGNodeStyleSetMargin, node, YGEdgeStart); RCT_SET_YGVALUE_AUTO(end, YGNodeStyleSetMargin, node, YGEdgeEnd); } + + NSLog(@"testee"); +// if(metaProps[META_PROP_BLOCK_START].unit == YGUnitUndefined){ +// NSLog(@"Caraiiiii"); +// } RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_TOP], YGNodeStyleSetMargin, node, YGEdgeTop); RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_BOTTOM], YGNodeStyleSetMargin, node, YGEdgeBottom); RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_HORIZONTAL], YGNodeStyleSetMargin, node, YGEdgeHorizontal); RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_VERTICAL], YGNodeStyleSetMargin, node, YGEdgeVertical); RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_ALL], YGNodeStyleSetMargin, node, YGEdgeAll); +// RCT_SET_YGVALUE_AUTO(metaProps[META_PROP_BLOCK_START], YGNodeStyleSetMargin, node, YGEdgeTop); } static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node) @@ -436,6 +443,7 @@ -(YGValue)margin##prop \ RCT_MARGIN_PROPERTY(Bottom, BOTTOM) RCT_MARGIN_PROPERTY(Right, RIGHT) RCT_MARGIN_PROPERTY(Start, START) +// RCT_MARGIN_PROPERTY(BlockStart, BLOCK_START) RCT_MARGIN_PROPERTY(End, END) // Padding diff --git a/packages/rn-tester/js/components/RNTesterExampleFilter.js b/packages/rn-tester/js/components/RNTesterExampleFilter.js index 03daeb35e11b45..62fe47e4bb9b8d 100644 --- a/packages/rn-tester/js/components/RNTesterExampleFilter.js +++ b/packages/rn-tester/js/components/RNTesterExampleFilter.js @@ -185,6 +185,8 @@ const styles = StyleSheet.create({ alignItems: 'center', position: 'relative', right: 10, + // backgroundColor: 'green', + // marginBlockStart: 100, }, searchIcon: { width: 20,