Add YGGutter Enum

Summary:
This adds the YGGutter enum, used to choose between row/column gap variants (row-gap, column-gap, gap).

This used later in changes from https://github.com/facebook/yoga/pull/1116, in the APIs which deal with setting gap on style on yoga node.

Note the original PR called this `YGGap`, but this ending up leading to a couple public method signatures that could appear ambiguous:
1. `SetGap(YGGap gap, float gapLength)`: Enums like `YGAlign` are the vaues for an `align` prop. `YGGap` controls the variant of the gap (like `YGEdge` does for left/right/top/bottom variants). So the enum reads as if it is the `gapValue`, and it looks like we have two of the same parameter.
2. `SetGap(YGGap gapDirection, float gap)`: This is misleading, because the direction gaps flow is the cross-axis of flex-direction.
3. `GetGap(YGGap gap)`: `gap` is the variant, but looks like an out param.

The [CSS Box Alignment](https://www.w3.org/TR/css-align-3/#column-row-gap) spec refers to these gaps as "Gutters", which removes the ambiguity.

Changelog:
[General][Added] - Add YGGutter Enum

Reviewed By: yungsters

Differential Revision: D39922412

fbshipit-source-id: 4b0baf800fecb3d03560a4267c7fb4c4330fd39e
This commit is contained in:
Nick Gerleman
2022-09-29 22:25:24 -07:00
committed by Facebook GitHub Bot
parent 5a18ccdbe2
commit 206bf414ec
6 changed files with 82 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ ENUMS = {
"WebFlexBasis"
],
"PrintOptions": [("Layout", 1), ("Style", 2), ("Children", 4)],
"Gutter": ["Column", "Row", "All"],
}
# Generated Java enums used to emit @DoNotStrip, but D17519844 removed them