feat: transfer specs to ts and remove unnecessary props (#1865)

PR transfering Fabric specs to TS, removing unnecessary @ReactProp adnotations, unifying inheritance hierarchy across platforms, adding custom types for color and image source props so they are parsed by react-native.
This commit is contained in:
Wojciech Lewicki
2022-09-14 12:01:35 +02:00
committed by GitHub
parent f16a08f40f
commit ee6e5da195
112 changed files with 1644 additions and 2137 deletions

View File

@@ -14,7 +14,6 @@ import android.graphics.Paint;
import android.graphics.Path;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class CircleView extends RenderableView {
@@ -26,7 +25,6 @@ class CircleView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "cx")
public void setCx(Dynamic cx) {
mCx = SVGLength.from(cx);
invalidate();
@@ -37,7 +35,6 @@ class CircleView extends RenderableView {
invalidate();
}
@ReactProp(name = "cy")
public void setCy(Dynamic cy) {
mCy = SVGLength.from(cy);
invalidate();
@@ -48,7 +45,6 @@ class CircleView extends RenderableView {
invalidate();
}
@ReactProp(name = "r")
public void setR(Dynamic r) {
mR = SVGLength.from(r);
invalidate();

View File

@@ -15,7 +15,6 @@ import android.graphics.Path;
import android.graphics.RectF;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class EllipseView extends RenderableView {
@@ -28,7 +27,6 @@ class EllipseView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "cx")
public void setCx(Dynamic cx) {
mCx = SVGLength.from(cx);
invalidate();
@@ -39,7 +37,6 @@ class EllipseView extends RenderableView {
invalidate();
}
@ReactProp(name = "cy")
public void setCy(Dynamic cy) {
mCy = SVGLength.from(cy);
invalidate();
@@ -50,7 +47,6 @@ class EllipseView extends RenderableView {
invalidate();
}
@ReactProp(name = "rx")
public void setRx(Dynamic rx) {
mRx = SVGLength.from(rx);
invalidate();
@@ -61,7 +57,6 @@ class EllipseView extends RenderableView {
invalidate();
}
@ReactProp(name = "ry")
public void setRy(Dynamic ry) {
mRy = SVGLength.from(ry);
invalidate();

View File

@@ -17,7 +17,6 @@ import android.view.View;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class ForeignObjectView extends GroupView {
@@ -48,7 +47,6 @@ class ForeignObjectView extends GroupView {
invalidate();
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -59,7 +57,6 @@ class ForeignObjectView extends GroupView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -70,7 +67,6 @@ class ForeignObjectView extends GroupView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -81,7 +77,6 @@ class ForeignObjectView extends GroupView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();

View File

@@ -20,7 +20,6 @@ import android.os.Build;
import android.view.View;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -32,7 +31,6 @@ class GroupView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "font")
public void setFont(@Nullable ReadableMap font) {
mFont = font;
invalidate();

View File

@@ -30,7 +30,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.views.imagehelper.ImageSource;
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -54,7 +53,6 @@ class ImageView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -65,7 +63,6 @@ class ImageView extends RenderableView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -76,7 +73,6 @@ class ImageView extends RenderableView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -87,7 +83,6 @@ class ImageView extends RenderableView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
@@ -98,7 +93,6 @@ class ImageView extends RenderableView {
invalidate();
}
@ReactProp(name = "src")
public void setSrc(@Nullable ReadableMap src) {
if (src != null) {
uriString = src.getString("uri");
@@ -122,13 +116,11 @@ class ImageView extends RenderableView {
}
}
@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}
@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();

View File

@@ -14,7 +14,6 @@ import android.graphics.Paint;
import android.graphics.Path;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class LineView extends RenderableView {
@@ -27,7 +26,6 @@ class LineView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "x1")
public void setX1(Dynamic x1) {
mX1 = SVGLength.from(x1);
invalidate();
@@ -38,7 +36,6 @@ class LineView extends RenderableView {
invalidate();
}
@ReactProp(name = "y1")
public void setY1(Dynamic y1) {
mY1 = SVGLength.from(y1);
invalidate();
@@ -49,7 +46,6 @@ class LineView extends RenderableView {
invalidate();
}
@ReactProp(name = "x2")
public void setX2(Dynamic x2) {
mX2 = SVGLength.from(x2);
invalidate();
@@ -60,7 +56,6 @@ class LineView extends RenderableView {
invalidate();
}
@ReactProp(name = "y2")
public void setY2(Dynamic y2) {
mY2 = SVGLength.from(y2);
invalidate();

View File

@@ -15,7 +15,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -40,7 +39,6 @@ class LinearGradientView extends DefinitionView {
super(reactContext);
}
@ReactProp(name = "x1")
public void setX1(Dynamic x1) {
mX1 = SVGLength.from(x1);
invalidate();
@@ -51,7 +49,6 @@ class LinearGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "y1")
public void setY1(Dynamic y1) {
mY1 = SVGLength.from(y1);
invalidate();
@@ -62,7 +59,6 @@ class LinearGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "x2")
public void setX2(Dynamic x2) {
mX2 = SVGLength.from(x2);
invalidate();
@@ -73,7 +69,6 @@ class LinearGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "y2")
public void setY2(Dynamic y2) {
mY2 = SVGLength.from(y2);
invalidate();
@@ -84,13 +79,11 @@ class LinearGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "gradient")
public void setGradient(ReadableArray gradient) {
mGradient = gradient;
invalidate();
}
@ReactProp(name = "gradientUnits")
public void setGradientUnits(int gradientUnits) {
switch (gradientUnits) {
case 0:
@@ -103,7 +96,6 @@ class LinearGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "gradientTransform")
public void setGradientTransform(@Nullable ReadableArray matrixArray) {
if (matrixArray != null) {
int matrixSize = PropHelper.toMatrixData(matrixArray, sRawMatrix, mScale);

View File

@@ -16,7 +16,6 @@ import android.graphics.RectF;
import android.view.View;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class MarkerView extends GroupView {
@@ -41,7 +40,6 @@ class MarkerView extends GroupView {
super(reactContext);
}
@ReactProp(name = "refX")
public void setRefX(Dynamic refX) {
mRefX = SVGLength.from(refX);
invalidate();
@@ -52,7 +50,6 @@ class MarkerView extends GroupView {
invalidate();
}
@ReactProp(name = "refY")
public void setRefY(Dynamic refY) {
mRefY = SVGLength.from(refY);
invalidate();
@@ -63,7 +60,6 @@ class MarkerView extends GroupView {
invalidate();
}
@ReactProp(name = "markerWidth")
public void setMarkerWidth(Dynamic markerWidth) {
mMarkerWidth = SVGLength.from(markerWidth);
invalidate();
@@ -74,7 +70,6 @@ class MarkerView extends GroupView {
invalidate();
}
@ReactProp(name = "markerHeight")
public void setMarkerHeight(Dynamic markerHeight) {
mMarkerHeight = SVGLength.from(markerHeight);
invalidate();
@@ -85,49 +80,41 @@ class MarkerView extends GroupView {
invalidate();
}
@ReactProp(name = "markerUnits")
public void setMarkerUnits(String markerUnits) {
mMarkerUnits = markerUnits;
invalidate();
}
@ReactProp(name = "orient")
public void setOrient(String orient) {
mOrient = orient;
invalidate();
}
@ReactProp(name = "minX")
public void setMinX(float minX) {
mMinX = minX;
invalidate();
}
@ReactProp(name = "minY")
public void setMinY(float minY) {
mMinY = minY;
invalidate();
}
@ReactProp(name = "vbWidth")
public void setVbWidth(float vbWidth) {
mVbWidth = vbWidth;
invalidate();
}
@ReactProp(name = "vbHeight")
public void setVbHeight(float vbHeight) {
mVbHeight = vbHeight;
invalidate();
}
@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}
@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();

View File

@@ -15,7 +15,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -45,7 +44,6 @@ class MaskView extends GroupView {
super(reactContext);
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -56,7 +54,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -67,7 +64,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -78,7 +74,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
@@ -89,7 +84,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "maskUnits")
public void setMaskUnits(int maskUnits) {
switch (maskUnits) {
case 0:
@@ -102,7 +96,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "maskContentUnits")
public void setMaskContentUnits(int maskContentUnits) {
switch (maskContentUnits) {
case 0:
@@ -115,7 +108,6 @@ class MaskView extends GroupView {
invalidate();
}
@ReactProp(name = "maskTransform")
public void setMaskTransform(@Nullable ReadableArray matrixArray) {
if (matrixArray != null) {
int matrixSize = PropHelper.toMatrixData(matrixArray, sRawMatrix, mScale);

View File

@@ -13,7 +13,6 @@ import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class PathView extends RenderableView {
@@ -25,7 +24,6 @@ class PathView extends RenderableView {
mPath = new Path();
}
@ReactProp(name = "d")
public void setD(String d) {
mPath = PathParser.parse(d);
elements = PathParser.elements;

View File

@@ -16,7 +16,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -48,7 +47,6 @@ class PatternView extends GroupView {
super(reactContext);
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -59,7 +57,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -70,7 +67,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -81,7 +77,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
@@ -92,7 +87,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "patternUnits")
public void setPatternUnits(int patternUnits) {
switch (patternUnits) {
case 0:
@@ -105,7 +99,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "patternContentUnits")
public void setPatternContentUnits(int patternContentUnits) {
switch (patternContentUnits) {
case 0:
@@ -118,7 +111,6 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "patternTransform")
public void setPatternTransform(@Nullable ReadableArray matrixArray) {
if (matrixArray != null) {
int matrixSize = PropHelper.toMatrixData(matrixArray, sRawMatrix, mScale);
@@ -137,37 +129,31 @@ class PatternView extends GroupView {
invalidate();
}
@ReactProp(name = "minX")
public void setMinX(float minX) {
mMinX = minX;
invalidate();
}
@ReactProp(name = "minY")
public void setMinY(float minY) {
mMinY = minY;
invalidate();
}
@ReactProp(name = "vbWidth")
public void setVbWidth(float vbWidth) {
mVbWidth = vbWidth;
invalidate();
}
@ReactProp(name = "vbHeight")
public void setVbHeight(float vbHeight) {
mVbHeight = vbHeight;
invalidate();
}
@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}
@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();

View File

@@ -15,7 +15,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -41,7 +40,6 @@ class RadialGradientView extends DefinitionView {
super(reactContext);
}
@ReactProp(name = "fx")
public void setFx(Dynamic fx) {
mFx = SVGLength.from(fx);
invalidate();
@@ -52,7 +50,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "fy")
public void setFy(Dynamic fy) {
mFy = SVGLength.from(fy);
invalidate();
@@ -63,7 +60,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "rx")
public void setRx(Dynamic rx) {
mRx = SVGLength.from(rx);
invalidate();
@@ -74,7 +70,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "ry")
public void setRy(Dynamic ry) {
mRy = SVGLength.from(ry);
invalidate();
@@ -85,7 +80,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "cx")
public void setCx(Dynamic cx) {
mCx = SVGLength.from(cx);
invalidate();
@@ -96,7 +90,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "cy")
public void setCy(Dynamic cy) {
mCy = SVGLength.from(cy);
invalidate();
@@ -107,13 +100,11 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "gradient")
public void setGradient(ReadableArray gradient) {
mGradient = gradient;
invalidate();
}
@ReactProp(name = "gradientUnits")
public void setGradientUnits(int gradientUnits) {
switch (gradientUnits) {
case 0:
@@ -126,7 +117,6 @@ class RadialGradientView extends DefinitionView {
invalidate();
}
@ReactProp(name = "gradientTransform")
public void setGradientTransform(@Nullable ReadableArray matrixArray) {
if (matrixArray != null) {
int matrixSize = PropHelper.toMatrixData(matrixArray, sRawMatrix, mScale);

View File

@@ -16,7 +16,6 @@ import android.graphics.RectF;
import android.os.Build;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class RectView extends RenderableView {
@@ -31,7 +30,6 @@ class RectView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -42,7 +40,6 @@ class RectView extends RenderableView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -53,7 +50,6 @@ class RectView extends RenderableView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -64,7 +60,6 @@ class RectView extends RenderableView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();
@@ -75,7 +70,6 @@ class RectView extends RenderableView {
invalidate();
}
@ReactProp(name = "rx")
public void setRx(Dynamic rx) {
mRx = SVGLength.from(rx);
invalidate();
@@ -86,7 +80,6 @@ class RectView extends RenderableView {
invalidate();
}
@ReactProp(name = "ry")
public void setRy(Dynamic ry) {
mRy = SVGLength.from(ry);
invalidate();

View File

@@ -28,7 +28,6 @@ import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.uimanager.PointerEvents;
import com.facebook.react.uimanager.annotations.ReactProp;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.regex.Matcher;
@@ -101,13 +100,11 @@ public abstract class RenderableView extends VirtualView {
RenderableViewManager.setRenderableView(id, this);
}
@ReactProp(name = "vectorEffect")
public void setVectorEffect(int vectorEffect) {
this.vectorEffect = vectorEffect;
invalidate();
}
@ReactProp(name = "fill")
public void setFill(@Nullable Dynamic fill) {
if (fill == null || fill.isNull()) {
this.fill = null;
@@ -163,13 +160,11 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "fillOpacity", defaultFloat = 1f)
public void setFillOpacity(float fillOpacity) {
this.fillOpacity = fillOpacity;
invalidate();
}
@ReactProp(name = "fillRule", defaultInt = FILL_RULE_NONZERO)
public void setFillRule(int fillRule) {
switch (fillRule) {
case FILL_RULE_EVENODD:
@@ -184,7 +179,6 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "stroke")
public void setStroke(@Nullable Dynamic strokeColors) {
if (strokeColors == null || strokeColors.isNull()) {
stroke = null;
@@ -241,13 +235,11 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "strokeOpacity", defaultFloat = 1f)
public void setStrokeOpacity(float strokeOpacity) {
this.strokeOpacity = strokeOpacity;
invalidate();
}
@ReactProp(name = "strokeDasharray")
public void setStrokeDasharray(@Nullable ReadableArray strokeDasharray) {
if (strokeDasharray != null) {
int fromSize = strokeDasharray.size();
@@ -261,13 +253,11 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "strokeDashoffset")
public void setStrokeDashoffset(float strokeDashoffset) {
this.strokeDashoffset = strokeDashoffset * mScale;
invalidate();
}
@ReactProp(name = "strokeWidth")
public void setStrokeWidth(Dynamic strokeWidth) {
this.strokeWidth = SVGLength.from(strokeWidth);
invalidate();
@@ -278,13 +268,11 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "strokeMiterlimit", defaultFloat = 4f)
public void setStrokeMiterlimit(float strokeMiterlimit) {
this.strokeMiterlimit = strokeMiterlimit;
invalidate();
}
@ReactProp(name = "strokeLinecap", defaultInt = CAP_ROUND)
public void setStrokeLinecap(int strokeLinecap) {
switch (strokeLinecap) {
case CAP_BUTT:
@@ -303,7 +291,6 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "strokeLinejoin", defaultInt = JOIN_ROUND)
public void setStrokeLinejoin(int strokeLinejoin) {
switch (strokeLinejoin) {
case JOIN_MITER:
@@ -322,7 +309,6 @@ public abstract class RenderableView extends VirtualView {
invalidate();
}
@ReactProp(name = "propList")
public void setPropList(@Nullable ReadableArray propList) {
if (propList != null) {
mPropList = mAttributeList = new ArrayList<>();

View File

@@ -1000,16 +1000,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setImagewidth(ImageView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setImageheight(ImageView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setWidth(ImageView view, @Nullable String value) {
view.setWidth(value);
@@ -1020,7 +1010,7 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setHeight(value);
}
@ReactProp(name = "src")
@ReactProp(name = "src", customType = "ImageSource")
public void setSrc(ImageView node, @Nullable ReadableMap src) {
node.setSrc(src);
}
@@ -1243,16 +1233,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setRectheight(RectView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setRectwidth(RectView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setHeight(RectView view, @Nullable String value) {
view.setHeight(value);
@@ -1332,16 +1312,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setUseheight(UseView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setUsewidth(UseView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setHeight(UseView view, @Nullable String value) {
view.setHeight(value);
@@ -1460,16 +1430,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setPatternheight(PatternView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setPatternwidth(PatternView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setHeight(PatternView view, @Nullable String value) {
view.setHeight(value);
@@ -1569,16 +1529,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setMaskheight(MaskView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setMaskwidth(MaskView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setHeight(MaskView view, @Nullable String value) {
view.setHeight(value);
@@ -1648,16 +1598,6 @@ class RenderableViewManager<T extends RenderableView> extends VirtualViewManager
view.setY(value);
}
@Override
public void setForeignObjectheight(ForeignObjectView view, @Nullable String value) {
view.setHeight(value);
}
@Override
public void setForeignObjectwidth(ForeignObjectView view, @Nullable String value) {
view.setWidth(value);
}
@Override
public void setHeight(ForeignObjectView view, @Nullable String value) {
view.setHeight(value);

View File

@@ -19,13 +19,11 @@ import android.graphics.Typeface;
import android.util.Base64;
import android.view.View;
import android.view.ViewParent;
import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.ReactCompoundView;
import com.facebook.react.uimanager.ReactCompoundViewGroup;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.views.view.ReactViewGroup;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
@@ -187,57 +185,36 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
}
}
@ReactProp(name = "tintColor")
public void setTintColor(@Nullable Dynamic tintColor) {
switch (tintColor.getType()) {
case Map:
mTintColor = ColorPropConverter.getColor(tintColor.asMap(), getContext());
break;
case Number:
mTintColor = tintColor.asInt();
break;
default:
mTintColor = 0;
}
invalidate();
clearChildCache();
}
public void setTintColor(@Nullable Integer tintColor) {
public void setTintColor(Integer tintColor) {
mTintColor = tintColor;
invalidate();
clearChildCache();
}
@ReactProp(name = "minX")
public void setMinX(float minX) {
mMinX = minX;
invalidate();
clearChildCache();
}
@ReactProp(name = "minY")
public void setMinY(float minY) {
mMinY = minY;
invalidate();
clearChildCache();
}
@ReactProp(name = "vbWidth")
public void setVbWidth(float vbWidth) {
mVbWidth = vbWidth;
invalidate();
clearChildCache();
}
@ReactProp(name = "vbHeight")
public void setVbHeight(float vbHeight) {
mVbHeight = vbHeight;
invalidate();
clearChildCache();
}
@ReactProp(name = "bbWidth")
public void setBbWidth(Dynamic bbWidth) {
mbbWidth = SVGLength.from(bbWidth);
invalidate();
@@ -250,7 +227,6 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
clearChildCache();
}
@ReactProp(name = "bbHeight")
public void setBbHeight(Dynamic bbHeight) {
mbbHeight = SVGLength.from(bbHeight);
invalidate();
@@ -263,14 +239,12 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
clearChildCache();
}
@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
clearChildCache();
}
@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();

View File

@@ -87,13 +87,15 @@ class SvgViewManager extends ReactViewManager implements RNSVGSvgViewManagerInte
return true;
}
@ReactProp(name = "tintColor")
public void setTintColor(SvgView node, @Nullable Dynamic tintColor) {
@ReactProp(name = "tintColor", customType = "Color")
@Override
public void setTintColor(SvgView node, Integer tintColor) {
node.setTintColor(tintColor);
}
@ReactProp(name = "color")
public void setColor(SvgView node, @Nullable Dynamic color) {
@ReactProp(name = "color", customType = "Color")
@Override
public void setColor(SvgView node, Integer color) {
node.setTintColor(color);
}
@@ -143,16 +145,6 @@ class SvgViewManager extends ReactViewManager implements RNSVGSvgViewManagerInte
node.setMeetOrSlice(meetOrSlice);
}
@Override
public void setTintColor(SvgView view, @Nullable Integer value) {
view.setTintColor(value);
}
@Override
public void setColor(SvgView view, @Nullable Integer value) {
view.setTintColor(value);
}
@Override
public void setBbWidth(SvgView view, @Nullable String value) {
view.setBbWidth(value);

View File

@@ -14,7 +14,6 @@ import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class SymbolView extends GroupView {
@@ -30,37 +29,31 @@ class SymbolView extends GroupView {
super(reactContext);
}
@ReactProp(name = "minX")
public void setMinX(float minX) {
mMinX = minX;
invalidate();
}
@ReactProp(name = "minY")
public void setMinY(float minY) {
mMinY = minY;
invalidate();
}
@ReactProp(name = "vbWidth")
public void setVbWidth(float vbWidth) {
mVbWidth = vbWidth;
invalidate();
}
@ReactProp(name = "vbHeight")
public void setVbHeight(float vbHeight) {
mVbHeight = vbHeight;
invalidate();
}
@ReactProp(name = "align")
public void setAlign(String align) {
mAlign = align;
invalidate();
}
@ReactProp(name = "meetOrSlice")
public void setMeetOrSlice(int meetOrSlice) {
mMeetOrSlice = meetOrSlice;
invalidate();

View File

@@ -39,7 +39,6 @@ import android.view.View;
import android.view.ViewParent;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.views.text.ReactFontManager;
import java.text.Bidi;
import java.util.ArrayList;
@@ -66,7 +65,6 @@ class TSpanView extends TextView {
assets = mContext.getResources().getAssets();
}
@ReactProp(name = "content")
public void setContent(@Nullable String content) {
mContent = content;
invalidate();

View File

@@ -16,7 +16,6 @@ import android.graphics.Paint;
import android.graphics.Path;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
import javax.annotation.Nullable;
@SuppressLint("ViewConstructor")
@@ -33,13 +32,11 @@ class TextPathView extends TextView {
super(reactContext);
}
@ReactProp(name = "href")
public void setHref(String href) {
mHref = href;
invalidate();
}
@ReactProp(name = "startOffset")
public void setStartOffset(Dynamic startOffset) {
mStartOffset = SVGLength.from(startOffset);
invalidate();
@@ -50,25 +47,21 @@ class TextPathView extends TextView {
invalidate();
}
@ReactProp(name = "method")
public void setMethod(@Nullable String method) {
mMethod = TextPathMethod.valueOf(method);
invalidate();
}
@ReactProp(name = "spacing")
public void setSpacing(@Nullable String spacing) {
mSpacing = TextPathSpacing.valueOf(spacing);
invalidate();
}
@ReactProp(name = "side")
public void setSide(@Nullable String side) {
mSide = TextPathSide.valueOf(side);
invalidate();
}
@ReactProp(name = "midLine")
public void setSharp(@Nullable String midLine) {
mMidLine = TextPathMidLine.valueOf(midLine);
invalidate();

View File

@@ -21,7 +21,6 @@ import android.view.ViewParent;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.annotations.ReactProp;
import java.util.ArrayList;
import javax.annotation.Nullable;
@@ -57,7 +56,6 @@ class TextView extends GroupView {
super.clearCache();
}
@ReactProp(name = "inlineSize")
public void setInlineSize(Dynamic inlineSize) {
mInlineSize = SVGLength.from(inlineSize);
invalidate();
@@ -68,7 +66,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "textLength")
public void setTextLength(Dynamic length) {
mTextLength = SVGLength.from(length);
invalidate();
@@ -79,19 +76,16 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "lengthAdjust")
public void setLengthAdjust(@Nullable String adjustment) {
mLengthAdjust = TextLengthAdjust.valueOf(adjustment);
invalidate();
}
@ReactProp(name = "alignmentBaseline")
public void setMethod(@Nullable String alignment) {
mAlignmentBaseline = AlignmentBaseline.getEnum(alignment);
invalidate();
}
@ReactProp(name = "baselineShift")
public void setBaselineShift(Dynamic baselineShift) {
mBaselineShift = SVGLength.toString(baselineShift);
invalidate();
@@ -102,7 +96,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "verticalAlign")
public void setVerticalAlign(@Nullable String verticalAlign) {
if (verticalAlign != null) {
verticalAlign = verticalAlign.trim();
@@ -124,7 +117,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "rotate")
public void setRotate(Dynamic rotate) {
mRotate = SVGLength.arrayFrom(rotate);
invalidate();
@@ -135,7 +127,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "dx")
public void setDeltaX(Dynamic deltaX) {
mDeltaX = SVGLength.arrayFrom(deltaX);
invalidate();
@@ -146,7 +137,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "dy")
public void setDeltaY(Dynamic deltaY) {
mDeltaY = SVGLength.arrayFrom(deltaY);
invalidate();
@@ -157,7 +147,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "x")
public void setPositionX(Dynamic positionX) {
mPositionX = SVGLength.arrayFrom(positionX);
invalidate();
@@ -168,7 +157,6 @@ class TextView extends GroupView {
invalidate();
}
@ReactProp(name = "y")
public void setPositionY(Dynamic positionY) {
mPositionY = SVGLength.arrayFrom(positionY);
invalidate();

View File

@@ -17,7 +17,6 @@ import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.annotations.ReactProp;
@SuppressLint("ViewConstructor")
class UseView extends RenderableView {
@@ -31,13 +30,11 @@ class UseView extends RenderableView {
super(reactContext);
}
@ReactProp(name = "href")
public void setHref(String href) {
mHref = href;
invalidate();
}
@ReactProp(name = "x")
public void setX(Dynamic x) {
mX = SVGLength.from(x);
invalidate();
@@ -48,7 +45,6 @@ class UseView extends RenderableView {
invalidate();
}
@ReactProp(name = "y")
public void setY(Dynamic y) {
mY = SVGLength.from(y);
invalidate();
@@ -59,7 +55,6 @@ class UseView extends RenderableView {
invalidate();
}
@ReactProp(name = "width")
public void setWidth(Dynamic width) {
mW = SVGLength.from(width);
invalidate();
@@ -70,7 +65,6 @@ class UseView extends RenderableView {
invalidate();
}
@ReactProp(name = "height")
public void setHeight(Dynamic height) {
mH = SVGLength.from(height);
invalidate();

View File

@@ -21,7 +21,6 @@ import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.OnLayoutEvent;
import com.facebook.react.uimanager.PointerEvents;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.react.views.view.ReactViewGroup;
import java.util.ArrayList;
@@ -240,68 +239,57 @@ public abstract class VirtualView extends ReactViewGroup {
canvas.restoreToCount(count);
}
@ReactProp(name = "name")
public void setName(String name) {
mName = name;
invalidate();
}
@ReactProp(name = "display")
public void setDisplay(String display) {
mDisplay = display;
invalidate();
}
@ReactProp(name = "onLayout")
public void setOnLayout(boolean onLayout) {
mOnLayout = onLayout;
invalidate();
}
@ReactProp(name = "mask")
public void setMask(String mask) {
mMask = mask;
invalidate();
}
@ReactProp(name = "markerStart")
public void setMarkerStart(String markerStart) {
mMarkerStart = markerStart;
invalidate();
}
@ReactProp(name = "markerMid")
public void setMarkerMid(String markerMid) {
mMarkerMid = markerMid;
invalidate();
}
@ReactProp(name = "markerEnd")
public void setMarkerEnd(String markerEnd) {
mMarkerEnd = markerEnd;
invalidate();
}
@ReactProp(name = "clipPath")
public void setClipPath(String clipPath) {
mCachedClipPath = null;
mClipPath = clipPath;
invalidate();
}
@ReactProp(name = "clipRule", defaultInt = CLIP_RULE_NONZERO)
public void setClipRule(int clipRule) {
mClipRule = clipRule;
invalidate();
}
@ReactProp(name = "opacity", defaultFloat = 1f)
public void setOpacity(float opacity) {
mOpacity = opacity;
invalidate();
}
@ReactProp(name = "matrix")
public void setMatrix(Dynamic matrixArray) {
ReadableType type = matrixArray.getType();
if (!matrixArray.isNull() && type.equals(ReadableType.Array)) {
@@ -332,7 +320,6 @@ public abstract class VirtualView extends ReactViewGroup {
clearParentCache();
}
@ReactProp(name = "responsible")
public void setResponsible(boolean responsible) {
mResponsible = responsible;
invalidate();

View File

@@ -12,6 +12,7 @@ package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;
@@ -55,6 +56,54 @@ public class RNSVGClipPathManagerDelegate<T extends View, U extends BaseViewMana
case "display":
mViewManager.setDisplay(view, value == null ? null : (String) value);
break;
case "fill":
mViewManager.setFill(view, (ReadableMap) value);
break;
case "fillOpacity":
mViewManager.setFillOpacity(view, value == null ? 1f : ((Double) value).floatValue());
break;
case "fillRule":
mViewManager.setFillRule(view, value == null ? 1 : ((Double) value).intValue());
break;
case "stroke":
mViewManager.setStroke(view, (ReadableMap) value);
break;
case "strokeOpacity":
mViewManager.setStrokeOpacity(view, value == null ? 1f : ((Double) value).floatValue());
break;
case "strokeWidth":
mViewManager.setStrokeWidth(view, value == null ? "1" : (String) value);
break;
case "strokeLinecap":
mViewManager.setStrokeLinecap(view, value == null ? 0 : ((Double) value).intValue());
break;
case "strokeLinejoin":
mViewManager.setStrokeLinejoin(view, value == null ? 0 : ((Double) value).intValue());
break;
case "strokeDasharray":
mViewManager.setStrokeDasharray(view, (ReadableArray) value);
break;
case "strokeDashoffset":
mViewManager.setStrokeDashoffset(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "strokeMiterlimit":
mViewManager.setStrokeMiterlimit(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "vectorEffect":
mViewManager.setVectorEffect(view, value == null ? 0 : ((Double) value).intValue());
break;
case "propList":
mViewManager.setPropList(view, (ReadableArray) value);
break;
case "fontSize":
mViewManager.setFontSize(view, value == null ? null : (String) value);
break;
case "fontWeight":
mViewManager.setFontWeight(view, value == null ? null : (String) value);
break;
case "font":
mViewManager.setFont(view, (ReadableMap) value);
break;
default:
super.setProperty(view, propName, value);
}

View File

@@ -12,6 +12,7 @@ package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
public interface RNSVGClipPathManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
@@ -25,4 +26,20 @@ public interface RNSVGClipPathManagerInterface<T extends View> {
void setClipRule(T view, int value);
void setResponsible(T view, boolean value);
void setDisplay(T view, @Nullable String value);
void setFill(T view, @Nullable ReadableMap value);
void setFillOpacity(T view, float value);
void setFillRule(T view, int value);
void setStroke(T view, @Nullable ReadableMap value);
void setStrokeOpacity(T view, float value);
void setStrokeWidth(T view, @Nullable String value);
void setStrokeLinecap(T view, int value);
void setStrokeLinejoin(T view, int value);
void setStrokeDasharray(T view, @Nullable ReadableArray value);
void setStrokeDashoffset(T view, float value);
void setStrokeMiterlimit(T view, float value);
void setVectorEffect(T view, int value);
void setPropList(T view, @Nullable ReadableArray value);
void setFontSize(T view, @Nullable String value);
void setFontWeight(T view, @Nullable String value);
void setFont(T view, @Nullable ReadableMap value);
}

View File

@@ -11,6 +11,7 @@ package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;
@@ -20,6 +21,42 @@ public class RNSVGDefsManagerDelegate<T extends View, U extends BaseViewManagerI
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
super.setProperty(view, propName, value);
switch (propName) {
case "name":
mViewManager.setName(view, value == null ? null : (String) value);
break;
case "opacity":
mViewManager.setOpacity(view, value == null ? 1f : ((Double) value).floatValue());
break;
case "matrix":
mViewManager.setMatrix(view, (ReadableArray) value);
break;
case "mask":
mViewManager.setMask(view, value == null ? null : (String) value);
break;
case "markerStart":
mViewManager.setMarkerStart(view, value == null ? null : (String) value);
break;
case "markerMid":
mViewManager.setMarkerMid(view, value == null ? null : (String) value);
break;
case "markerEnd":
mViewManager.setMarkerEnd(view, value == null ? null : (String) value);
break;
case "clipPath":
mViewManager.setClipPath(view, value == null ? null : (String) value);
break;
case "clipRule":
mViewManager.setClipRule(view, value == null ? 0 : ((Double) value).intValue());
break;
case "responsible":
mViewManager.setResponsible(view, value == null ? false : (boolean) value);
break;
case "display":
mViewManager.setDisplay(view, value == null ? null : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}

View File

@@ -10,7 +10,19 @@
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
public interface RNSVGDefsManagerInterface<T extends View> {
// No props
void setName(T view, @Nullable String value);
void setOpacity(T view, float value);
void setMatrix(T view, @Nullable ReadableArray value);
void setMask(T view, @Nullable String value);
void setMarkerStart(T view, @Nullable String value);
void setMarkerMid(T view, @Nullable String value);
void setMarkerEnd(T view, @Nullable String value);
void setClipPath(T view, @Nullable String value);
void setClipRule(T view, int value);
void setResponsible(T view, boolean value);
void setDisplay(T view, @Nullable String value);
}

View File

@@ -110,12 +110,6 @@ public class RNSVGForeignObjectManagerDelegate<T extends View, U extends BaseVie
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "foreignObjectheight":
mViewManager.setForeignObjectheight(view, value == null ? null : (String) value);
break;
case "foreignObjectwidth":
mViewManager.setForeignObjectwidth(view, value == null ? null : (String) value);
break;
case "height":
mViewManager.setHeight(view, value == null ? null : (String) value);
break;

View File

@@ -44,8 +44,6 @@ public interface RNSVGForeignObjectManagerInterface<T extends View> {
void setFont(T view, @Nullable ReadableMap value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setForeignObjectheight(T view, @Nullable String value);
void setForeignObjectwidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
}

View File

@@ -101,12 +101,6 @@ public class RNSVGImageManagerDelegate<T extends View, U extends BaseViewManager
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "imagewidth":
mViewManager.setImagewidth(view, value == null ? null : (String) value);
break;
case "imageheight":
mViewManager.setImageheight(view, value == null ? null : (String) value);
break;
case "width":
mViewManager.setWidth(view, value == null ? null : (String) value);
break;

View File

@@ -41,8 +41,6 @@ public interface RNSVGImageManagerInterface<T extends View> {
void setPropList(T view, @Nullable ReadableArray value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setImagewidth(T view, @Nullable String value);
void setImageheight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setSrc(T view, @Nullable ReadableMap value);

View File

@@ -110,12 +110,6 @@ public class RNSVGMaskManagerDelegate<T extends View, U extends BaseViewManagerI
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "maskheight":
mViewManager.setMaskheight(view, value == null ? null : (String) value);
break;
case "maskwidth":
mViewManager.setMaskwidth(view, value == null ? null : (String) value);
break;
case "height":
mViewManager.setHeight(view, value == null ? null : (String) value);
break;

View File

@@ -44,8 +44,6 @@ public interface RNSVGMaskManagerInterface<T extends View> {
void setFont(T view, @Nullable ReadableMap value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setMaskheight(T view, @Nullable String value);
void setMaskwidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
void setMaskUnits(T view, int value);

View File

@@ -110,12 +110,6 @@ public class RNSVGPatternManagerDelegate<T extends View, U extends BaseViewManag
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "patternheight":
mViewManager.setPatternheight(view, value == null ? null : (String) value);
break;
case "patternwidth":
mViewManager.setPatternwidth(view, value == null ? null : (String) value);
break;
case "height":
mViewManager.setHeight(view, value == null ? null : (String) value);
break;

View File

@@ -44,8 +44,6 @@ public interface RNSVGPatternManagerInterface<T extends View> {
void setFont(T view, @Nullable ReadableMap value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setPatternheight(T view, @Nullable String value);
void setPatternwidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
void setPatternUnits(T view, int value);

View File

@@ -101,12 +101,6 @@ public class RNSVGRectManagerDelegate<T extends View, U extends BaseViewManagerI
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "rectheight":
mViewManager.setRectheight(view, value == null ? null : (String) value);
break;
case "rectwidth":
mViewManager.setRectwidth(view, value == null ? null : (String) value);
break;
case "height":
mViewManager.setHeight(view, value == null ? null : (String) value);
break;

View File

@@ -41,8 +41,6 @@ public interface RNSVGRectManagerInterface<T extends View> {
void setPropList(T view, @Nullable ReadableArray value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setRectheight(T view, @Nullable String value);
void setRectwidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
void setRx(T view, @Nullable String value);

View File

@@ -104,21 +104,12 @@ public class RNSVGTSpanManagerDelegate<T extends View, U extends BaseViewManager
case "font":
mViewManager.setFont(view, (ReadableMap) value);
break;
case "textAnchor":
mViewManager.setTextAnchor(view, value == null ? null : (String) value);
break;
case "dx":
mViewManager.setDx(view, (ReadableArray) value);
break;
case "dy":
mViewManager.setDy(view, (ReadableArray) value);
break;
case "positionX":
mViewManager.setPositionX(view, (ReadableArray) value);
break;
case "positionY":
mViewManager.setPositionY(view, (ReadableArray) value);
break;
case "x":
mViewManager.setX(view, (ReadableArray) value);
break;
@@ -143,6 +134,9 @@ public class RNSVGTSpanManagerDelegate<T extends View, U extends BaseViewManager
case "alignmentBaseline":
mViewManager.setAlignmentBaseline(view, value == null ? null : (String) value);
break;
case "verticalAlign":
mViewManager.setVerticalAlign(view, value == null ? null : (String) value);
break;
case "content":
mViewManager.setContent(view, value == null ? null : (String) value);
break;

View File

@@ -42,11 +42,8 @@ public interface RNSVGTSpanManagerInterface<T extends View> {
void setFontSize(T view, @Nullable String value);
void setFontWeight(T view, @Nullable String value);
void setFont(T view, @Nullable ReadableMap value);
void setTextAnchor(T view, @Nullable String value);
void setDx(T view, @Nullable ReadableArray value);
void setDy(T view, @Nullable ReadableArray value);
void setPositionX(T view, @Nullable ReadableArray value);
void setPositionY(T view, @Nullable ReadableArray value);
void setX(T view, @Nullable ReadableArray value);
void setY(T view, @Nullable ReadableArray value);
void setRotate(T view, @Nullable ReadableArray value);
@@ -55,5 +52,6 @@ public interface RNSVGTSpanManagerInterface<T extends View> {
void setBaselineShift(T view, @Nullable String value);
void setLengthAdjust(T view, @Nullable String value);
void setAlignmentBaseline(T view, @Nullable String value);
void setVerticalAlign(T view, @Nullable String value);
void setContent(T view, @Nullable String value);
}

View File

@@ -104,21 +104,12 @@ public class RNSVGTextManagerDelegate<T extends View, U extends BaseViewManagerI
case "font":
mViewManager.setFont(view, (ReadableMap) value);
break;
case "textAnchor":
mViewManager.setTextAnchor(view, value == null ? null : (String) value);
break;
case "dx":
mViewManager.setDx(view, (ReadableArray) value);
break;
case "dy":
mViewManager.setDy(view, (ReadableArray) value);
break;
case "positionX":
mViewManager.setPositionX(view, (ReadableArray) value);
break;
case "positionY":
mViewManager.setPositionY(view, (ReadableArray) value);
break;
case "x":
mViewManager.setX(view, (ReadableArray) value);
break;
@@ -143,6 +134,9 @@ public class RNSVGTextManagerDelegate<T extends View, U extends BaseViewManagerI
case "alignmentBaseline":
mViewManager.setAlignmentBaseline(view, value == null ? null : (String) value);
break;
case "verticalAlign":
mViewManager.setVerticalAlign(view, value == null ? null : (String) value);
break;
default:
super.setProperty(view, propName, value);
}

View File

@@ -42,11 +42,8 @@ public interface RNSVGTextManagerInterface<T extends View> {
void setFontSize(T view, @Nullable String value);
void setFontWeight(T view, @Nullable String value);
void setFont(T view, @Nullable ReadableMap value);
void setTextAnchor(T view, @Nullable String value);
void setDx(T view, @Nullable ReadableArray value);
void setDy(T view, @Nullable ReadableArray value);
void setPositionX(T view, @Nullable ReadableArray value);
void setPositionY(T view, @Nullable ReadableArray value);
void setX(T view, @Nullable ReadableArray value);
void setY(T view, @Nullable ReadableArray value);
void setRotate(T view, @Nullable ReadableArray value);
@@ -55,4 +52,5 @@ public interface RNSVGTextManagerInterface<T extends View> {
void setBaselineShift(T view, @Nullable String value);
void setLengthAdjust(T view, @Nullable String value);
void setAlignmentBaseline(T view, @Nullable String value);
void setVerticalAlign(T view, @Nullable String value);
}

View File

@@ -95,6 +95,48 @@ public class RNSVGTextPathManagerDelegate<T extends View, U extends BaseViewMana
case "propList":
mViewManager.setPropList(view, (ReadableArray) value);
break;
case "fontSize":
mViewManager.setFontSize(view, value == null ? null : (String) value);
break;
case "fontWeight":
mViewManager.setFontWeight(view, value == null ? null : (String) value);
break;
case "font":
mViewManager.setFont(view, (ReadableMap) value);
break;
case "dx":
mViewManager.setDx(view, (ReadableArray) value);
break;
case "dy":
mViewManager.setDy(view, (ReadableArray) value);
break;
case "x":
mViewManager.setX(view, (ReadableArray) value);
break;
case "y":
mViewManager.setY(view, (ReadableArray) value);
break;
case "rotate":
mViewManager.setRotate(view, (ReadableArray) value);
break;
case "inlineSize":
mViewManager.setInlineSize(view, value == null ? null : (String) value);
break;
case "textLength":
mViewManager.setTextLength(view, value == null ? null : (String) value);
break;
case "baselineShift":
mViewManager.setBaselineShift(view, value == null ? null : (String) value);
break;
case "lengthAdjust":
mViewManager.setLengthAdjust(view, value == null ? null : (String) value);
break;
case "alignmentBaseline":
mViewManager.setAlignmentBaseline(view, value == null ? null : (String) value);
break;
case "verticalAlign":
mViewManager.setVerticalAlign(view, value == null ? null : (String) value);
break;
case "href":
mViewManager.setHref(view, value == null ? null : (String) value);
break;

View File

@@ -39,6 +39,20 @@ public interface RNSVGTextPathManagerInterface<T extends View> {
void setStrokeMiterlimit(T view, float value);
void setVectorEffect(T view, int value);
void setPropList(T view, @Nullable ReadableArray value);
void setFontSize(T view, @Nullable String value);
void setFontWeight(T view, @Nullable String value);
void setFont(T view, @Nullable ReadableMap value);
void setDx(T view, @Nullable ReadableArray value);
void setDy(T view, @Nullable ReadableArray value);
void setX(T view, @Nullable ReadableArray value);
void setY(T view, @Nullable ReadableArray value);
void setRotate(T view, @Nullable ReadableArray value);
void setInlineSize(T view, @Nullable String value);
void setTextLength(T view, @Nullable String value);
void setBaselineShift(T view, @Nullable String value);
void setLengthAdjust(T view, @Nullable String value);
void setAlignmentBaseline(T view, @Nullable String value);
void setVerticalAlign(T view, @Nullable String value);
void setHref(T view, @Nullable String value);
void setSide(T view, @Nullable String value);
void setMethod(T view, @Nullable String value);

View File

@@ -104,12 +104,6 @@ public class RNSVGUseManagerDelegate<T extends View, U extends BaseViewManagerIn
case "y":
mViewManager.setY(view, value == null ? null : (String) value);
break;
case "useheight":
mViewManager.setUseheight(view, value == null ? null : (String) value);
break;
case "usewidth":
mViewManager.setUsewidth(view, value == null ? null : (String) value);
break;
case "height":
mViewManager.setHeight(view, value == null ? null : (String) value);
break;

View File

@@ -42,8 +42,6 @@ public interface RNSVGUseManagerInterface<T extends View> {
void setHref(T view, @Nullable String value);
void setX(T view, @Nullable String value);
void setY(T view, @Nullable String value);
void setUseheight(T view, @Nullable String value);
void setUsewidth(T view, @Nullable String value);
void setHeight(T view, @Nullable String value);
void setWidth(T view, @Nullable String value);
}

View File

@@ -49,12 +49,6 @@ using namespace facebook::react;
self.y = RCTNSStringFromStringNilIfEmpty(newProps.y)
? [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)]
: nil;
if (RCTNSStringFromStringNilIfEmpty(newProps.foreignObjectheight)) {
self.foreignObjectheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.foreignObjectheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.foreignObjectwidth)) {
self.foreignObjectwidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.foreignObjectwidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.foreignObjectheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}

View File

@@ -18,7 +18,7 @@
@interface RNSVGImage : RNSVGRenderable
@property (nonatomic, weak) RCTBridge *bridge;
@property (nonatomic, assign) id src;
@property (nonatomic, assign) RCTImageSource *src;
@property (nonatomic, strong) RNSVGLength *x;
@property (nonatomic, strong) RNSVGLength *y;
@property (nonatomic, strong) RNSVGLength *imagewidth;

View File

@@ -74,12 +74,6 @@ using namespace facebook::react;
self.x = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)];
self.y = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)];
if (RCTNSStringFromStringNilIfEmpty(newProps.imageheight)) {
self.imageheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.imageheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.imagewidth)) {
self.imagewidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.imagewidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.imageheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}
@@ -121,7 +115,7 @@ using namespace facebook::react;
}
#endif // RN_FABRIC_ENABLED
- (void)setSrc:(id)src
- (void)setImageSrc:(RCTImageSource *)src request:(NSURLRequest *)request
{
if (src == _src) {
return;
@@ -129,36 +123,8 @@ using namespace facebook::react;
_src = src;
CGImageRelease(_image);
_image = nil;
RCTImageSource *source = [RCTConvert RCTImageSource:src];
if (source.size.width != 0 && source.size.height != 0) {
_imageSize = source.size;
} else {
_imageSize = CGSizeMake(0, 0);
}
RCTImageLoaderCancellationBlock previousCancellationBlock = _reloadImageCancellationBlock;
if (previousCancellationBlock) {
previousCancellationBlock();
_reloadImageCancellationBlock = nil;
}
_reloadImageCancellationBlock = [[self.bridge moduleForName:@"ImageLoader"]
loadImageWithURLRequest:[RCTConvert NSURLRequest:src]
callback:^(NSError *error, UIImage *image) {
dispatch_async(dispatch_get_main_queue(), ^{
self->_image = CGImageRetain(image.CGImage);
self->_imageSize = CGSizeMake(CGImageGetWidth(self->_image), CGImageGetHeight(self->_image));
[self invalidate];
});
}];
}
- (void)setImageSrc:(RCTImageSource *)source request:(NSURLRequest *)request
{
CGImageRelease(_image);
_image = nil;
if (source.size.width != 0 && source.size.height != 0) {
_imageSize = source.size;
if (src.size.width != 0 && src.size.height != 0) {
_imageSize = src.size;
} else {
_imageSize = CGSizeMake(0, 0);
}
@@ -184,6 +150,11 @@ using namespace facebook::react;
}];
}
- (void)setSrc:(RCTImageSource *)src
{
[self setImageSrc:src request:src.request];
}
- (void)setX:(RNSVGLength *)x
{
if ([x isEqualTo:_x]) {

View File

@@ -45,12 +45,6 @@ using namespace facebook::react;
self.x = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)];
self.y = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)];
if (RCTNSStringFromStringNilIfEmpty(newProps.maskheight)) {
self.maskheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.maskheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.maskwidth)) {
self.maskwidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.maskwidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.maskheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}

View File

@@ -45,12 +45,6 @@ using namespace facebook::react;
self.x = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)];
self.y = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)];
if (RCTNSStringFromStringNilIfEmpty(newProps.patternheight)) {
self.patternheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.patternheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.patternwidth)) {
self.patternwidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.patternwidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.patternheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}

View File

@@ -44,12 +44,6 @@ using namespace facebook::react;
self.x = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)];
self.y = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)];
if (RCTNSStringFromStringNilIfEmpty(newProps.useheight)) {
self.useheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.useheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.usewidth)) {
self.usewidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.usewidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.useheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}

View File

@@ -44,12 +44,6 @@ using namespace facebook::react;
self.x = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)];
self.y = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.y)];
if (RCTNSStringFromStringNilIfEmpty(newProps.rectheight)) {
self.rectheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.rectheight)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.rectwidth)) {
self.rectwidth = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.rectwidth)];
}
if (RCTNSStringFromStringNilIfEmpty(newProps.height)) {
self.rectheight = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.height)];
}

View File

@@ -60,30 +60,9 @@ using namespace facebook::react;
{
const auto &newProps = *std::static_pointer_cast<const RNSVGTSpanProps>(props);
// textAnchor is in props of VM but not available on component
self.deltaX = createLengthArrayFromStrings(newProps.dx);
self.deltaY = createLengthArrayFromStrings(newProps.dy);
if (!newProps.positionX.empty()) {
self.positionX = createLengthArrayFromStrings(newProps.positionX);
}
if (!newProps.positionY.empty()) {
self.positionY = createLengthArrayFromStrings(newProps.positionY);
}
if (!newProps.x.empty()) {
self.positionX = createLengthArrayFromStrings(newProps.x);
}
if (!newProps.y.empty()) {
self.positionY = createLengthArrayFromStrings(newProps.y);
}
self.rotate = createLengthArrayFromStrings(newProps.rotate);
self.inlineSize = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.inlineSize)];
self.textLength = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.textLength)];
self.baselineShift = RCTNSStringFromStringNilIfEmpty(newProps.baselineShift);
self.lengthAdjust = RCTNSStringFromStringNilIfEmpty(newProps.lengthAdjust);
self.alignmentBaseline = RCTNSStringFromStringNilIfEmpty(newProps.alignmentBaseline);
self.content = RCTNSStringFromStringNilIfEmpty(newProps.content);
setCommonGroupProps(newProps, self);
setCommonTextProps(newProps, self);
}
- (void)prepareForRecycle

View File

@@ -51,29 +51,7 @@ using namespace facebook::react;
{
const auto &newProps = *std::static_pointer_cast<const RNSVGTextProps>(props);
// textAnchor is in props of VM but not available on component
self.deltaX = createLengthArrayFromStrings(newProps.dx);
self.deltaY = createLengthArrayFromStrings(newProps.dy);
if (!newProps.positionX.empty()) {
self.positionX = createLengthArrayFromStrings(newProps.positionX);
}
if (!newProps.positionY.empty()) {
self.positionY = createLengthArrayFromStrings(newProps.positionY);
}
if (!newProps.x.empty()) {
self.positionX = createLengthArrayFromStrings(newProps.x);
}
if (!newProps.y.empty()) {
self.positionY = createLengthArrayFromStrings(newProps.y);
}
self.rotate = createLengthArrayFromStrings(newProps.rotate);
self.inlineSize = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.inlineSize)];
self.textLength = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.textLength)];
self.baselineShift = RCTNSStringFromStringNilIfEmpty(newProps.baselineShift);
self.lengthAdjust = RCTNSStringFromStringNilIfEmpty(newProps.lengthAdjust);
self.alignmentBaseline = RCTNSStringFromStringNilIfEmpty(newProps.alignmentBaseline);
setCommonGroupProps(newProps, self);
setCommonTextProps(newProps, self);
}
- (void)prepareForRecycle

View File

@@ -48,7 +48,7 @@ using namespace facebook::react;
self.spacing = RCTNSStringFromStringNilIfEmpty(newProps.spacing);
self.startOffset = [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.startOffset)];
setCommonRenderableProps(newProps, self);
setCommonTextProps(newProps, self);
}
- (void)prepareForRecycle

View File

@@ -4,6 +4,7 @@
#import "RNSVGPainterBrush.h"
#import "RNSVGRenderable.h"
#import "RNSVGSolidColorBrush.h"
#import "RNSVGText.h"
#import "RNSVGVBMOS.h"
#import <React/RCTConversions.h>
@@ -177,6 +178,26 @@ void setCommonGroupProps(T groupProps, RNSVGGroup *groupNode)
}
}
template <typename T>
void setCommonTextProps(T textProps, RNSVGText *textNode)
{
setCommonGroupProps(textProps, textNode);
textNode.deltaX = createLengthArrayFromStrings(textProps.dx);
textNode.deltaY = createLengthArrayFromStrings(textProps.dy);
if (!textProps.x.empty()) {
textNode.positionX = createLengthArrayFromStrings(textProps.x);
}
if (!textProps.y.empty()) {
textNode.positionY = createLengthArrayFromStrings(textProps.y);
}
textNode.rotate = createLengthArrayFromStrings(textProps.rotate);
textNode.inlineSize = [RNSVGLength lengthWithString:RCTNSStringFromString(textProps.inlineSize)];
textNode.textLength = [RNSVGLength lengthWithString:RCTNSStringFromString(textProps.textLength)];
textNode.baselineShift = RCTNSStringFromStringNilIfEmpty(textProps.baselineShift);
textNode.lengthAdjust = RCTNSStringFromStringNilIfEmpty(textProps.lengthAdjust);
textNode.alignmentBaseline = RCTNSStringFromStringNilIfEmpty(textProps.alignmentBaseline);
}
static RNSVGVBMOS intToRNSVGVBMOS(int value)
{
switch (value) {

View File

@@ -6,8 +6,8 @@
* LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNodeManager.h"
#import "RNSVGGroupManager.h"
@interface RNSVGClipPathManager : RNSVGNodeManager
@interface RNSVGClipPathManager : RNSVGGroupManager
@end

View File

@@ -6,10 +6,8 @@
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTViewManager.h>
#import "RNSVGNodeManager.h"
@interface RNSVGDefsManager : RCTViewManager
@interface RNSVGDefsManager : RNSVGNodeManager
@end
#import "RNSVGNode.h"

View File

@@ -20,8 +20,6 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(foreignObjectheight, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(foreignObjectwidth, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGForeignObject)
{
view.foreignObjectheight = [RCTConvert RNSVGLength:json];

View File

@@ -25,8 +25,6 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(imagewidth, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(imageheight, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(width, id, RNSVGImage)
{
view.imagewidth = [RCTConvert RNSVGLength:json];
@@ -35,7 +33,7 @@ RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGImage)
{
view.imageheight = [RCTConvert RNSVGLength:json];
}
RCT_EXPORT_VIEW_PROPERTY(src, id)
RCT_EXPORT_VIEW_PROPERTY(src, RCTImageSource)
RCT_EXPORT_VIEW_PROPERTY(align, NSString)
RCT_EXPORT_VIEW_PROPERTY(meetOrSlice, RNSVGVBMOS)

View File

@@ -20,8 +20,6 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(maskheight, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(maskwidth, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGMask)
{
view.maskheight = [RCTConvert RNSVGLength:json];

View File

@@ -20,8 +20,6 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(patternheight, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(patternwidth, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGPattern)
{
view.patternheight = [RCTConvert RNSVGLength:json];

View File

@@ -22,8 +22,6 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(rectheight, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(rectwidth, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGRect)
{
view.rectheight = [RCTConvert RNSVGLength:json];

View File

@@ -29,14 +29,8 @@ RCT_EXPORT_VIEW_PROPERTY(vbWidth, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(vbHeight, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(align, NSString)
RCT_EXPORT_VIEW_PROPERTY(meetOrSlice, RNSVGVBMOS)
RCT_CUSTOM_VIEW_PROPERTY(tintColor, id, RNSVGSvgView)
{
view.tintColor = [RCTConvert UIColor:json];
}
RCT_CUSTOM_VIEW_PROPERTY(color, id, RNSVGSvgView)
{
view.tintColor = [RCTConvert UIColor:json];
}
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)
RCT_REMAP_VIEW_PROPERTY(color, tintColor, UIColor)
- (void)toDataURL:(nonnull NSNumber *)reactTag
options:(NSDictionary *)options

View File

@@ -20,7 +20,6 @@ RCT_EXPORT_MODULE()
return [RNSVGText new];
}
RCT_EXPORT_VIEW_PROPERTY(textAnchor, RNSVGTextAnchor)
RCT_CUSTOM_VIEW_PROPERTY(dx, id, RNSVGText)
{
view.deltaX = [RCTConvert RNSVGLengthArray:json];
@@ -29,15 +28,6 @@ RCT_CUSTOM_VIEW_PROPERTY(dy, id, RNSVGText)
{
view.deltaY = [RCTConvert RNSVGLengthArray:json];
}
RCT_CUSTOM_VIEW_PROPERTY(positionX, id, RNSVGText)
{
view.positionX = [RCTConvert RNSVGLengthArray:json];
}
RCT_CUSTOM_VIEW_PROPERTY(positionY, id, RNSVGText)
{
view.positionY = [RCTConvert RNSVGLengthArray:json];
}
RCT_CUSTOM_VIEW_PROPERTY(x, id, RNSVGText)
{
view.positionX = [RCTConvert RNSVGLengthArray:json];
@@ -71,6 +61,7 @@ RCT_CUSTOM_VIEW_PROPERTY(baselineShift, id, RNSVGText)
}
RCT_EXPORT_VIEW_PROPERTY(lengthAdjust, NSString)
RCT_EXPORT_VIEW_PROPERTY(alignmentBaseline, NSString)
RCT_EXPORT_VIEW_PROPERTY(verticalAlign, NSString) // unused on iOS
RCT_CUSTOM_VIEW_PROPERTY(fontSize, id, RNSVGText)
{

View File

@@ -8,6 +8,6 @@
#import "RNSVGTextManager.h"
@interface RNSVGTextPathManager : RNSVGRenderableManager
@interface RNSVGTextPathManager : RNSVGTextManager
@end

View File

@@ -27,8 +27,6 @@ RCT_CUSTOM_VIEW_PROPERTY(y, id, RNSVGUse)
{
view.y = [RCTConvert RNSVGLength:json];
}
RCT_EXPORT_VIEW_PROPERTY(useheight, RNSVGLength *)
RCT_EXPORT_VIEW_PROPERTY(usewidth, RNSVGLength *)
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGUse)
{
view.useheight = [RCTConvert RNSVGLength:json];

View File

@@ -78,7 +78,7 @@
"@types/jest": "^27.5.2",
"@types/node": "*",
"@types/react": "~18.0.15",
"@types/react-native": "^0.69.3",
"@types/react-native": "^0.70.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^28.1.0",
"clang-format": "^1.8.0",

View File

@@ -1,73 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
cx?: string,
cy?: string,
r?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGCircle',
{},
): ComponentType);

View File

@@ -0,0 +1,55 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
cx?: string;
cy?: string;
r?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGCircle');

View File

@@ -1,47 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGClipPath',
{},
): ComponentType);

View File

@@ -0,0 +1,75 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ColorValue, ViewProps } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {}
export default codegenNativeComponent<NativeProps>('RNSVGClipPath');

View File

@@ -1,19 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
type NativeProps = $ReadOnly<{|
...ViewProps,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGDefs',
{},
): ComponentType);

View File

@@ -0,0 +1,26 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native';
import {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
interface NativeProps extends ViewProps, SvgNodeCommonProps {}
export default codegenNativeComponent<NativeProps>('RNSVGDefs');

View File

@@ -1,74 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
cx?: string,
cy?: string,
rx?: string,
ry?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGEllipse',
{},
): ComponentType);

View File

@@ -0,0 +1,56 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
cx?: string;
cy?: string;
rx?: string;
ry?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGEllipse');

View File

@@ -1,103 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
// for some reason the parser doesn't allow to put flow types in another file
// import type { SvgNodeCommonProps } from './svgNodeCommonProps';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>,
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type FontObject = $ReadOnly<{|
fontStyle?: string,
fontVariant?: string,
fontWeight?: string,
fontStretch?: string,
fontSize?: string,
fontFamily?: string,
textAnchor?: string,
textDecoration?: string,
letterSpacing?: string,
wordSpacing?: string,
kerning?: string,
fontFeatureSettings?: string,
fontVariantLigatures?: string,
fontVariationSettings?: string,
|}>;
type SvgGroupCommonProps = $ReadOnly<{|
fontSize?: string,
fontWeight?: string,
font?: FontObject,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
...SvgGroupCommonProps,
x?: string,
y?: string,
foreignObjectheight?: string,
foreignObjectwidth?: string,
height?: string,
width?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGForeignObject',
{},
): ComponentType);

View File

@@ -0,0 +1,80 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {
x?: string;
y?: string;
height?: string;
width?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGForeignObject');

View File

@@ -1,97 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
// for some reason the parser doesn't allow to put flow types in another file
// import type { SvgNodeCommonProps } from './svgNodeCommonProps';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>,
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type FontObject = $ReadOnly<{|
fontStyle?: string,
fontVariant?: string,
fontWeight?: string,
fontStretch?: string,
fontSize?: string,
fontFamily?: string,
textAnchor?: string,
textDecoration?: string,
letterSpacing?: string,
wordSpacing?: string,
kerning?: string,
fontFeatureSettings?: string,
fontVariantLigatures?: string,
fontVariationSettings?: string,
|}>;
type SvgGroupCommonProps = $ReadOnly<{|
fontSize?: string,
fontWeight?: string,
font?: FontObject,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
...SvgGroupCommonProps,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGGroup',
{},
): ComponentType);

View File

@@ -0,0 +1,75 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {}
export default codegenNativeComponent<NativeProps>('RNSVGGroup');

View File

@@ -1,79 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
x?: string,
y?: string,
imagewidth?: string,
imageheight?: string,
width?: string,
height?: string,
src?: ImageSource,
align?: string,
meetOrSlice?: Int32,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGImage',
{},
): ComponentType);

View File

@@ -0,0 +1,64 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
// TODO: import ImageSource from codegen types when it is available
import type {
ViewProps,
ColorValue,
ImageSourcePropType as ImageSource,
} from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
x?: string;
y?: string;
width?: string;
height?: string;
src?: ImageSource;
align?: string;
meetOrSlice?: Int32;
}
export default codegenNativeComponent<NativeProps>('RNSVGImage');

View File

@@ -1,74 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
x1?: string,
y1?: string,
x2?: string,
y2?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGLine',
{},
): ComponentType);

View File

@@ -0,0 +1,56 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
x1?: string;
y1?: string;
x2?: string;
y2?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGLine');

View File

@@ -1,56 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type Units = 'userSpaceOnUse' | 'objectBoundingBox';
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
x1?: string,
y1?: string,
x2?: string,
y2?: string,
gradient?: $ReadOnlyArray<Float>,
gradientUnits?: Int32,
gradientTransform?: $ReadOnlyArray<Float>, //CGAffineTransform,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGLinearGradient',
{},
): ComponentType);

View File

@@ -0,0 +1,34 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
interface NativeProps extends ViewProps, SvgNodeCommonProps {
x1?: string;
y1?: string;
x2?: string;
y2?: string;
gradient?: ReadonlyArray<Float>;
gradientUnits?: Int32;
gradientTransform?: ReadonlyArray<Float>;
}
export default codegenNativeComponent<NativeProps>('RNSVGLinearGradient');

View File

@@ -1,109 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
// for some reason the parser doesn't allow to put flow types in another file
// import type { SvgNodeCommonProps } from './svgNodeCommonProps';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>,
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type FontObject = $ReadOnly<{|
fontStyle?: string,
fontVariant?: string,
fontWeight?: string,
fontStretch?: string,
fontSize?: string,
fontFamily?: string,
textAnchor?: string,
textDecoration?: string,
letterSpacing?: string,
wordSpacing?: string,
kerning?: string,
fontFeatureSettings?: string,
fontVariantLigatures?: string,
fontVariationSettings?: string,
|}>;
type SvgGroupCommonProps = $ReadOnly<{|
fontSize?: string,
fontWeight?: string,
font?: FontObject,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
...SvgGroupCommonProps,
refX?: string,
refY?: string,
markerHeight?: string,
markerWidth?: string,
markerUnits?: string,
orient?: string,
minX?: Float,
minY?: Float,
vbWidth?: Float,
vbHeight?: Float,
align?: string,
meetOrSlice?: Int32,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGMarker',
{},
): ComponentType);

View File

@@ -0,0 +1,88 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {
refX?: string;
refY?: string;
markerHeight?: string;
markerWidth?: string;
markerUnits?: string;
orient?: string;
minX?: Float;
minY?: Float;
vbWidth?: Float;
vbHeight?: Float;
align?: string;
meetOrSlice?: Int32;
}
export default codegenNativeComponent<NativeProps>('RNSVGMarker');

View File

@@ -1,106 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
// for some reason the parser doesn't allow to put flow types in another file
// import type { SvgNodeCommonProps } from './svgNodeCommonProps';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>,
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type FontObject = $ReadOnly<{|
fontStyle?: string,
fontVariant?: string,
fontWeight?: string,
fontStretch?: string,
fontSize?: string,
fontFamily?: string,
textAnchor?: string,
textDecoration?: string,
letterSpacing?: string,
wordSpacing?: string,
kerning?: string,
fontFeatureSettings?: string,
fontVariantLigatures?: string,
fontVariationSettings?: string,
|}>;
type SvgGroupCommonProps = $ReadOnly<{|
fontSize?: string,
fontWeight?: string,
font?: FontObject,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
...SvgGroupCommonProps,
x?: string,
y?: string,
maskheight?: string,
maskwidth?: string,
height?: string,
width?: string,
maskUnits?: Int32,
maskContentUnits?: Int32,
maskTransform?: $ReadOnlyArray<Float>, //CGAffineTransform,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGMask',
{},
): ComponentType);

View File

@@ -0,0 +1,83 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {
x?: string;
y?: string;
height?: string;
width?: string;
maskUnits?: Int32;
maskContentUnits?: Int32;
maskTransform?: ReadonlyArray<Float>;
}
export default codegenNativeComponent<NativeProps>('RNSVGMask');

View File

@@ -1,71 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
d?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGPath',
{},
): ComponentType);

View File

@@ -0,0 +1,53 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
d?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGPath');

View File

@@ -1,112 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
// for some reason the parser doesn't allow to put flow types in another file
// import type { SvgNodeCommonProps } from './svgNodeCommonProps';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>,
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type FontObject = $ReadOnly<{|
fontStyle?: string,
fontVariant?: string,
fontWeight?: string,
fontStretch?: string,
fontSize?: string,
fontFamily?: string,
textAnchor?: string,
textDecoration?: string,
letterSpacing?: string,
wordSpacing?: string,
kerning?: string,
fontFeatureSettings?: string,
fontVariantLigatures?: string,
fontVariationSettings?: string,
|}>;
type SvgGroupCommonProps = $ReadOnly<{|
fontSize?: string,
fontWeight?: string,
font?: FontObject,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
...SvgGroupCommonProps,
x?: string,
y?: string,
patternheight?: string,
patternwidth?: string,
height?: string,
width?: string,
patternUnits?: Int32,
patternContentUnits?: Int32,
patternTransform?: $ReadOnlyArray<Float>, //CGAffineTransform,
minX?: Float,
minY?: Float,
vbWidth?: Float,
vbHeight?: Float,
align?: string,
meetOrSlice?: Int32,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGPattern',
{},
): ComponentType);

View File

@@ -0,0 +1,89 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
type FontObject = Readonly<{
fontStyle?: string;
fontVariant?: string;
fontWeight?: string;
fontStretch?: string;
fontSize?: string;
fontFamily?: string;
textAnchor?: string;
textDecoration?: string;
letterSpacing?: string;
wordSpacing?: string;
kerning?: string;
fontFeatureSettings?: string;
fontVariantLigatures?: string;
fontVariationSettings?: string;
}>;
interface SvgGroupCommonProps {
fontSize?: string;
fontWeight?: string;
font?: FontObject;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps,
SvgGroupCommonProps {
x?: string;
y?: string;
height?: string;
width?: string;
patternUnits?: Int32;
patternContentUnits?: Int32;
patternTransform?: ReadonlyArray<Float>;
minX?: Float;
minY?: Float;
vbWidth?: Float;
vbHeight?: Float;
align?: string;
meetOrSlice?: Int32;
}
export default codegenNativeComponent<NativeProps>('RNSVGPattern');

View File

@@ -1,58 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type Units = 'userSpaceOnUse' | 'objectBoundingBox';
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
fx?: string,
fy?: string,
cx?: string,
cy?: string,
rx?: string,
ry?: string,
gradient?: $ReadOnlyArray<Float>,
gradientUnits?: Int32,
gradientTransform?: $ReadOnlyArray<Float>, //CGAffineTransform,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGRadialGradient',
{},
): ComponentType);

View File

@@ -0,0 +1,36 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
interface NativeProps extends ViewProps, SvgNodeCommonProps {
fx?: string;
fy?: string;
cx?: string;
cy?: string;
rx?: string;
ry?: string;
gradient?: ReadonlyArray<Float>;
gradientUnits?: Int32;
gradientTransform?: ReadonlyArray<Float>;
}
export default codegenNativeComponent<NativeProps>('RNSVGRadialGradient');

View File

@@ -1,78 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { ColorValue } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type LayoutEvent = $ReadOnly<{|
layout: $ReadOnly<{|
x: Float,
y: Float,
width: Float,
height: Float,
|}>,
|}>;
type SvgNodeCommonProps = $ReadOnly<{|
name?: string,
opacity?: WithDefault<Float, 1.0>,
matrix?: $ReadOnlyArray<Float>, //CGAffineTransform,
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string,
markerStart?: string,
markerMid?: string,
markerEnd?: string,
clipPath?: string,
clipRule?: WithDefault<Int32, 0>,
responsible?: boolean,
onLayout?: ?DirectEventHandler<LayoutEvent>, // not working for now
display?: string,
|}>;
type ColorStruct = $ReadOnly<{|
type?: WithDefault<Int32, -1>,
value?: ColorValue,
brushRef?: string,
|}>;
type SvgRenderableCommonProps = $ReadOnly<{|
fill?: ColorStruct,
fillOpacity?: WithDefault<Float, 1.0>,
fillRule?: WithDefault<Int32, 1>,
stroke?: ColorStruct,
strokeOpacity?: WithDefault<Float, 1.0>,
strokeWidth?: WithDefault<string, '1'>,
strokeLinecap?: WithDefault<Int32, 0>,
strokeLinejoin?: WithDefault<Int32, 0>,
strokeDasharray?: $ReadOnlyArray<string>,
strokeDashoffset?: Float,
strokeMiterlimit?: Float,
vectorEffect?: WithDefault<Int32, 0>,
propList?: $ReadOnlyArray<string>,
|}>;
type NativeProps = $ReadOnly<{|
...ViewProps,
...SvgNodeCommonProps,
...SvgRenderableCommonProps,
x?: string,
y?: string,
rectheight?: string,
rectwidth?: string,
height?: string,
width?: string,
rx?: string,
ry?: string,
|}>;
type ComponentType = HostComponent<NativeProps>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGRect',
{},
): ComponentType);

View File

@@ -0,0 +1,58 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type {
Float,
Int32,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
interface SvgNodeCommonProps {
name?: string;
opacity?: WithDefault<Float, 1.0>;
matrix?: ReadonlyArray<Float>;
// transform?: ____TransformStyle_Internal, // CATransform3D, custom handling
mask?: string;
markerStart?: string;
markerMid?: string;
markerEnd?: string;
clipPath?: string;
clipRule?: WithDefault<Int32, 0>;
responsible?: boolean;
display?: string;
}
type ColorStruct = Readonly<{
type?: WithDefault<Int32, -1>;
value?: ColorValue;
brushRef?: string;
}>;
interface SvgRenderableCommonProps {
fill?: ColorStruct;
fillOpacity?: WithDefault<Float, 1.0>;
fillRule?: WithDefault<Int32, 1>;
stroke?: ColorStruct;
strokeOpacity?: WithDefault<Float, 1.0>;
strokeWidth?: WithDefault<string, '1'>;
strokeLinecap?: WithDefault<Int32, 0>;
strokeLinejoin?: WithDefault<Int32, 0>;
strokeDasharray?: ReadonlyArray<string>;
strokeDashoffset?: Float;
strokeMiterlimit?: Float;
vectorEffect?: WithDefault<Int32, 0>;
propList?: ReadonlyArray<string>;
}
interface NativeProps
extends ViewProps,
SvgNodeCommonProps,
SvgRenderableCommonProps {
x?: string;
y?: string;
height?: string;
width?: string;
rx?: string;
ry?: string;
}
export default codegenNativeComponent<NativeProps>('RNSVGRect');

View File

@@ -1,25 +0,0 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
type NativeProps = $ReadOnly<{|
...ViewProps,
bbWidth: string,
bbHeight: string,
minX: Float,
minY: Float,
vbWidth: Float,
vbHeight: Float,
align: string,
meetOrSlice: Int32,
tintColor: ColorValue,
color: ColorValue,
|}>;
export default (codegenNativeComponent<NativeProps>(
'RNSVGSvgView',
{},
): ComponentType);

View File

@@ -0,0 +1,18 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, ColorValue } from 'react-native';
import type { Float, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
interface NativeProps extends ViewProps {
bbWidth: string;
bbHeight: string;
minX: Float;
minY: Float;
vbWidth: Float;
vbHeight: Float;
align: string;
meetOrSlice: Int32;
tintColor: ColorValue;
color: ColorValue;
}
export default codegenNativeComponent<NativeProps>('RNSVGSvgView');

Some files were not shown because too many files have changed in this diff Show More