@shopify/react-native-skia 0.1.163 → 0.1.164

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/cpp/api/JsiSkPaint.h +6 -0
  2. package/cpp/jsi/JsiHostObject.h +25 -25
  3. package/cpp/rnskia/dom/base/DrawingContext.cpp +24 -9
  4. package/cpp/rnskia/dom/base/DrawingContext.h +3 -2
  5. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
  6. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
  7. package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
  8. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
  9. package/cpp/rnskia/dom/base/NodeProp.h +2 -1
  10. package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
  11. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
  12. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
  13. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
  14. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
  15. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -3
  16. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
  17. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +1 -2
  18. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
  19. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
  20. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +19 -37
  21. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  22. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
  23. package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
  24. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
  25. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
  26. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
  27. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
  28. package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
  29. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
  30. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
  31. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
  32. package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
  33. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
  34. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
  35. package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
  36. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
  37. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
  38. package/cpp/rnskia/dom/props/PaintProps.h +1 -2
  39. package/cpp/rnskia/dom/props/TransformProp.h +0 -2
  40. package/cpp/utils/RNSkLog.h +1 -1
  41. package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
  42. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  43. package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
  44. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  45. package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
  46. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  47. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
  48. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  49. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
  50. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  51. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
  52. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  53. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
  54. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  55. package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
  56. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  57. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  58. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  59. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  60. package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
  61. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  62. package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
  63. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  64. package/lib/module/dom/nodes/RenderNode.js +12 -16
  65. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  66. package/lib/module/dom/nodes/datatypes/index.js +0 -1
  67. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  68. package/lib/module/dom/nodes/drawings/Box.js +6 -5
  69. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  70. package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
  71. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  72. package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
  73. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  74. package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
  75. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  76. package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
  77. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  78. package/lib/module/dom/nodes/paint/Shaders.js +1 -2
  79. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  80. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  81. package/lib/module/renderer/DrawingContext.js.map +1 -1
  82. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  83. package/lib/module/skia/web/JsiSkPaint.js +4 -0
  84. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  85. package/lib/module/web/LoadSkiaWeb.js +1 -1
  86. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  87. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
  88. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
  89. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
  90. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
  91. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
  92. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
  93. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  94. package/package.json +1 -1
  95. package/src/dom/nodes/RenderNode.ts +11 -21
  96. package/src/dom/nodes/datatypes/index.ts +0 -1
  97. package/src/dom/nodes/drawings/Box.ts +7 -4
  98. package/src/dom/nodes/drawings/PatchNode.ts +4 -18
  99. package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
  100. package/src/dom/nodes/paint/ColorFilters.ts +1 -2
  101. package/src/dom/nodes/paint/ImageFilters.ts +2 -2
  102. package/src/dom/nodes/paint/Shaders.ts +1 -2
  103. package/src/dom/types/DrawingContext.ts +0 -1
  104. package/src/renderer/DrawingContext.ts +5 -5
  105. package/src/skia/types/Paint/Paint.ts +5 -0
  106. package/src/skia/web/JsiSkPaint.ts +4 -0
  107. package/src/web/LoadSkiaWeb.tsx +1 -1
  108. package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
  109. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
  110. package/lib/module/dom/nodes/datatypes/Color.js +0 -11
  111. package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
  112. package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
  113. package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -77,8 +77,7 @@ protected:
77
77
 
78
78
  void defineProperties(NodePropsContainer *container) override {
79
79
  JsiBaseDomDeclarationNode::defineProperties(container);
80
- _matrixProp = container->defineProperty(
81
- std::make_shared<NodeProp>(JsiPropId::get("matrix")));
80
+ _matrixProp = container->defineProperty<NodeProp>("matrix");
82
81
  _matrixProp->require();
83
82
  }
84
83
 
@@ -103,10 +102,8 @@ protected:
103
102
 
104
103
  void defineProperties(NodePropsContainer *container) override {
105
104
  JsiBaseDomDeclarationNode::defineProperties(container);
106
- _blendModeProp = container->defineProperty(
107
- std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
108
- _colorProp = container->defineProperty(
109
- std::make_shared<ColorProp>(JsiPropId::get("color")));
105
+ _blendModeProp = container->defineProperty<BlendModeProp>("mode");
106
+ _colorProp = container->defineProperty<ColorProp>("color");
110
107
 
111
108
  _blendModeProp->require();
112
109
  _colorProp->require();
@@ -180,8 +177,7 @@ protected:
180
177
 
181
178
  void defineProperties(NodePropsContainer *container) override {
182
179
  JsiBaseDomDeclarationNode::defineProperties(container);
183
- _tProp = container->defineProperty(
184
- std::make_shared<NodeProp>(JsiPropId::get("t")));
180
+ _tProp = container->defineProperty<NodeProp>("t");
185
181
  _tProp->require();
186
182
  }
187
183
 
@@ -100,8 +100,7 @@ protected:
100
100
  std::bind(&JsiCustomDrawingNode::notifyPictureNeeded, this,
101
101
  std::placeholders::_1);
102
102
 
103
- _drawingProp = container->defineProperty(
104
- std::make_shared<DrawingProp>(JsiPropId::get("drawing"), cb));
103
+ _drawingProp = container->defineProperty<DrawingProp>("drawing", cb);
105
104
  }
106
105
 
107
106
  private:
@@ -7,9 +7,6 @@
7
7
 
8
8
  namespace RNSkia {
9
9
 
10
- static PropId PropNameInner = JsiPropId::get("inner");
11
- static PropId PropNameOuter = JsiPropId::get("outer");
12
-
13
10
  class JsiDiffRectNode : public JsiDomDrawingNode,
14
11
  public JsiDomNodeCtor<JsiDiffRectNode> {
15
12
  public:
@@ -25,10 +22,8 @@ protected:
25
22
 
26
23
  void defineProperties(NodePropsContainer *container) override {
27
24
  JsiDomDrawingNode::defineProperties(container);
28
- _innerRectProp =
29
- container->defineProperty(std::make_shared<RRectProp>(PropNameInner));
30
- _outerRectProp =
31
- container->defineProperty(std::make_shared<RRectProp>(PropNameOuter));
25
+ _innerRectProp = container->defineProperty<RRectProp>("inner");
26
+ _outerRectProp = container->defineProperty<RRectProp>("outer");
32
27
 
33
28
  _innerRectProp->require();
34
29
  _outerRectProp->require();
@@ -31,14 +31,10 @@ protected:
31
31
  void defineProperties(NodePropsContainer *container) override {
32
32
  JsiDomDrawingNode::defineProperties(container);
33
33
 
34
- _fontProp = container->defineProperty(
35
- std::make_shared<FontProp>(JsiPropId::get("font")));
36
- _glyphsProp = container->defineProperty(
37
- std::make_shared<GlyphsProp>(JsiPropId::get("glyphs")));
38
- _xProp = container->defineProperty(
39
- std::make_shared<NodeProp>(JsiPropId::get("x")));
40
- _yProp = container->defineProperty(
41
- std::make_shared<NodeProp>(JsiPropId::get("y")));
34
+ _fontProp = container->defineProperty<FontProp>("font");
35
+ _glyphsProp = container->defineProperty<GlyphsProp>("glyphs");
36
+ _xProp = container->defineProperty<NodeProp>("x");
37
+ _yProp = container->defineProperty<NodeProp>("y");
42
38
 
43
39
  _fontProp->require();
44
40
  _glyphsProp->require();
@@ -94,8 +94,7 @@ protected:
94
94
 
95
95
  void defineProperties(NodePropsContainer *container) override {
96
96
  JsiBaseDomDeclarationNode::defineProperties(container);
97
- _blendModeProp = container->defineProperty(
98
- std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
97
+ _blendModeProp = container->defineProperty<BlendModeProp>("mode");
99
98
  _blendModeProp->require();
100
99
  }
101
100
 
@@ -154,19 +153,13 @@ protected:
154
153
 
155
154
  void defineProperties(NodePropsContainer *container) override {
156
155
  JsiBaseDomDeclarationNode::defineProperties(container);
157
- _dxProp = container->defineProperty(
158
- std::make_shared<NodeProp>(JsiPropId::get("dx")));
159
- _dyProp = container->defineProperty(
160
- std::make_shared<NodeProp>(JsiPropId::get("dy")));
161
- _blurProp = container->defineProperty(
162
- std::make_shared<NodeProp>(JsiPropId::get("blur")));
163
- _colorProp = container->defineProperty(
164
- std::make_shared<ColorProp>(JsiPropId::get("color")));
165
-
166
- _innerProp = container->defineProperty(
167
- std::make_shared<NodeProp>(JsiPropId::get("inner")));
168
- _shadowOnlyProp = container->defineProperty(
169
- std::make_shared<NodeProp>(JsiPropId::get("shadowOnly")));
156
+ _dxProp = container->defineProperty<NodeProp>("dx");
157
+ _dyProp = container->defineProperty<NodeProp>("dy");
158
+ _blurProp = container->defineProperty<NodeProp>("blur");
159
+ _colorProp = container->defineProperty<ColorProp>("color");
160
+
161
+ _innerProp = container->defineProperty<NodeProp>("inner");
162
+ _shadowOnlyProp = container->defineProperty<NodeProp>("shadowOnly");
170
163
 
171
164
  _dxProp->require();
172
165
  _dyProp->require();
@@ -212,12 +205,9 @@ protected:
212
205
 
213
206
  void defineProperties(NodePropsContainer *container) override {
214
207
  JsiBaseDomDeclarationNode::defineProperties(container);
215
- _channelXProp = container->defineProperty(
216
- std::make_shared<NodeProp>(JsiPropId::get("channelX")));
217
- _channelYProp = container->defineProperty(
218
- std::make_shared<NodeProp>(JsiPropId::get("channelY")));
219
- _scaleProp = container->defineProperty(
220
- std::make_shared<NodeProp>(JsiPropId::get("scale")));
208
+ _channelXProp = container->defineProperty<NodeProp>("channelX");
209
+ _channelYProp = container->defineProperty<NodeProp>("channelY");
210
+ _scaleProp = container->defineProperty<NodeProp>("scale");
221
211
 
222
212
  _channelXProp->require();
223
213
  _channelYProp->require();
@@ -266,10 +256,8 @@ protected:
266
256
 
267
257
  void defineProperties(NodePropsContainer *container) override {
268
258
  JsiBaseDomDeclarationNode::defineProperties(container);
269
- _blurProp = container->defineProperty(
270
- std::make_shared<RadiusProp>(JsiPropId::get("blur")));
271
- _tileModeProp = container->defineProperty(
272
- std::make_shared<TileModeProp>(JsiPropId::get("mode")));
259
+ _blurProp = container->defineProperty<RadiusProp>("blur");
260
+ _tileModeProp = container->defineProperty<TileModeProp>("mode");
273
261
 
274
262
  _blurProp->require();
275
263
  }
@@ -302,10 +290,8 @@ protected:
302
290
 
303
291
  void defineProperties(NodePropsContainer *container) override {
304
292
  JsiBaseDomDeclarationNode::defineProperties(container);
305
- _xProp = container->defineProperty(
306
- std::make_shared<NodeProp>(JsiPropId::get("x")));
307
- _yProp = container->defineProperty(
308
- std::make_shared<NodeProp>(JsiPropId::get("y")));
293
+ _xProp = container->defineProperty<NodeProp>("x");
294
+ _yProp = container->defineProperty<NodeProp>("y");
309
295
 
310
296
  _xProp->require();
311
297
  _yProp->require();
@@ -346,10 +332,8 @@ protected:
346
332
 
347
333
  void defineProperties(NodePropsContainer *container) override {
348
334
  JsiBaseDomDeclarationNode::defineProperties(container);
349
- _operatorProp = container->defineProperty(
350
- std::make_shared<NodeProp>(JsiPropId::get("operator")));
351
- _radiusProp = container->defineProperty(
352
- std::make_shared<RadiusProp>(JsiPropId::get("radius")));
335
+ _operatorProp = container->defineProperty<NodeProp>("operator");
336
+ _radiusProp = container->defineProperty<RadiusProp>("radius");
353
337
 
354
338
  _operatorProp->require();
355
339
  _radiusProp->require();
@@ -398,11 +382,9 @@ protected:
398
382
 
399
383
  void defineProperties(NodePropsContainer *container) override {
400
384
  JsiBaseDomDeclarationNode::defineProperties(container);
401
- _sourceProp = container->defineProperty(
402
- std::make_shared<NodeProp>(JsiPropId::get("source")));
385
+ _sourceProp = container->defineProperty<NodeProp>("source");
403
386
  _uniformsProp =
404
- container->defineProperty(std::make_shared<SimpleUniformsProp>(
405
- JsiPropId::get("uniforms"), _sourceProp));
387
+ container->defineProperty<SimpleUniformsProp>("uniforms", _sourceProp);
406
388
 
407
389
  _sourceProp->require();
408
390
  }
@@ -23,7 +23,7 @@ protected:
23
23
 
24
24
  void defineProperties(NodePropsContainer *container) override {
25
25
  JsiDomDrawingNode::defineProperties(container);
26
- _imageProps = container->defineProperty(std::make_shared<ImageProps>());
26
+ _imageProps = container->defineProperty<ImageProps>();
27
27
  _imageProps->require();
28
28
  }
29
29
 
@@ -28,10 +28,8 @@ protected:
28
28
 
29
29
  void defineProperties(NodePropsContainer *container) override {
30
30
  JsiDomDrawingNode::defineProperties(container);
31
- _svgDomProp = container->defineProperty(
32
- std::make_shared<SvgProp>(JsiPropId::get("svg")));
33
- _rectProp = container->defineProperty(
34
- std::make_shared<RectProps>(JsiPropId::get("rect")));
31
+ _svgDomProp = container->defineProperty<SvgProp>("svg");
32
+ _rectProp = container->defineProperty<RectProps>("rect");
35
33
 
36
34
  _svgDomProp->require();
37
35
  }
@@ -7,9 +7,6 @@
7
7
 
8
8
  namespace RNSkia {
9
9
 
10
- static PropId PropNamePoint1 = JsiPropId::get("p1");
11
- static PropId PropNamePoint2 = JsiPropId::get("p2");
12
-
13
10
  class JsiLineNode : public JsiDomDrawingNode,
14
11
  public JsiDomNodeCtor<JsiLineNode> {
15
12
  public:
@@ -26,10 +23,8 @@ protected:
26
23
 
27
24
  void defineProperties(NodePropsContainer *container) override {
28
25
  JsiDomDrawingNode::defineProperties(container);
29
- _p1Prop =
30
- container->defineProperty(std::make_shared<PointProp>(PropNamePoint1));
31
- _p2Prop =
32
- container->defineProperty(std::make_shared<PointProp>(PropNamePoint2));
26
+ _p1Prop = container->defineProperty<PointProp>("p1");
27
+ _p2Prop = container->defineProperty<PointProp>("p2");
33
28
 
34
29
  _p1Prop->require();
35
30
  _p2Prop->require();
@@ -15,15 +15,13 @@ public:
15
15
 
16
16
  protected:
17
17
  void draw(DrawingContext *context) override {
18
- RNSkLogger::logToConsole(context->getDebugDescription());
19
18
  context->getCanvas()->drawOval(*_rectProp->getDerivedValue(),
20
19
  *context->getPaint());
21
20
  }
22
21
 
23
22
  void defineProperties(NodePropsContainer *container) override {
24
23
  JsiDomDrawingNode::defineProperties(container);
25
- _rectProp =
26
- container->defineProperty(std::make_shared<RectProps>(PropNameRect));
24
+ _rectProp = container->defineProperty<RectProps>("rect");
27
25
  _rectProp->require();
28
26
  }
29
27
 
@@ -64,9 +64,8 @@ protected:
64
64
  void defineProperties(NodePropsContainer *container) override {
65
65
  JsiBaseDomDeclarationNode::defineProperties(container);
66
66
 
67
- _paintProps = container->defineProperty(std::make_shared<PaintProps>());
68
- _opacityProp =
69
- container->defineProperty(std::make_shared<NodeProp>(PropNameOpacity));
67
+ _paintProps = container->defineProperty<PaintProps>();
68
+ _opacityProp = container->defineProperty<NodeProp>("opacity");
70
69
  }
71
70
 
72
71
  private:
@@ -32,14 +32,10 @@ protected:
32
32
 
33
33
  void defineProperties(NodePropsContainer *container) override {
34
34
  JsiDomDrawingNode::defineProperties(container);
35
- _colorsProp = container->defineProperty(
36
- std::make_shared<ColorsProp>(JsiPropId::get("colors")));
37
- _textureProp = container->defineProperty(
38
- std::make_shared<PointsProp>(JsiPropId::get("texture")));
39
- _blendModeProp = container->defineProperty(
40
- std::make_shared<BlendModeProp>(JsiPropId::get("blendMode")));
41
- _patchProp = container->defineProperty(
42
- std::make_shared<BezierProp>(JsiPropId::get("patch")));
35
+ _colorsProp = container->defineProperty<ColorsProp>("colors");
36
+ _textureProp = container->defineProperty<PointsProp>("texture");
37
+ _blendModeProp = container->defineProperty<BlendModeProp>("blendMode");
38
+ _patchProp = container->defineProperty<BezierProp>("patch");
43
39
 
44
40
  _patchProp->require();
45
41
  }
@@ -85,10 +85,8 @@ protected:
85
85
  void defineProperties(NodePropsContainer *container) override {
86
86
  JsiBaseDomDeclarationNode::defineProperties(container);
87
87
 
88
- _intervals = container->defineProperty(
89
- std::make_shared<NodeProp>(JsiPropId::get("intervals")));
90
- _phase = container->defineProperty(
91
- std::make_shared<NodeProp>(JsiPropId::get("phase")));
88
+ _intervals = container->defineProperty<NodeProp>("intervals");
89
+ _phase = container->defineProperty<NodeProp>("phase");
92
90
 
93
91
  _intervals->require();
94
92
  }
@@ -123,12 +121,9 @@ protected:
123
121
  void defineProperties(NodePropsContainer *container) override {
124
122
  JsiBaseDomDeclarationNode::defineProperties(container);
125
123
 
126
- _lengthProp = container->defineProperty(
127
- std::make_shared<NodeProp>(JsiPropId::get("length")));
128
- _deviationProp = container->defineProperty(
129
- std::make_shared<NodeProp>(JsiPropId::get("deviation")));
130
- _seedProp = container->defineProperty(
131
- std::make_shared<NodeProp>(JsiPropId::get("seed")));
124
+ _lengthProp = container->defineProperty<NodeProp>("length");
125
+ _deviationProp = container->defineProperty<NodeProp>("deviation");
126
+ _seedProp = container->defineProperty<NodeProp>("seed");
132
127
 
133
128
  _lengthProp->require();
134
129
  _deviationProp->require();
@@ -161,8 +156,7 @@ protected:
161
156
  void defineProperties(NodePropsContainer *container) override {
162
157
  JsiBaseDomDeclarationNode::defineProperties(container);
163
158
 
164
- _rProp = container->defineProperty(
165
- std::make_shared<NodeProp>(JsiPropId::get("r")));
159
+ _rProp = container->defineProperty<NodeProp>("r");
166
160
  _rProp->require();
167
161
  }
168
162
 
@@ -193,14 +187,10 @@ protected:
193
187
  void defineProperties(NodePropsContainer *container) override {
194
188
  JsiBaseDomDeclarationNode::defineProperties(container);
195
189
 
196
- _phaseProp = container->defineProperty(
197
- std::make_shared<NodeProp>(JsiPropId::get("phase")));
198
- _advanceProp = container->defineProperty(
199
- std::make_shared<NodeProp>(JsiPropId::get("advance")));
200
- _pathProp = container->defineProperty(
201
- std::make_shared<PathProp>(JsiPropId::get("path")));
202
- _styleProp = container->defineProperty(
203
- std::make_shared<NodeProp>(JsiPropId::get("style")));
190
+ _phaseProp = container->defineProperty<NodeProp>("phase");
191
+ _advanceProp = container->defineProperty<NodeProp>("advance");
192
+ _pathProp = container->defineProperty<PathProp>("path");
193
+ _styleProp = container->defineProperty<NodeProp>("style");
204
194
 
205
195
  _phaseProp->require();
206
196
  _advanceProp->require();
@@ -248,10 +238,8 @@ protected:
248
238
  void defineProperties(NodePropsContainer *container) override {
249
239
  JsiBaseDomDeclarationNode::defineProperties(container);
250
240
 
251
- _matrixProp = container->defineProperty(
252
- std::make_shared<MatrixProp>(JsiPropId::get("matrix")));
253
- _pathProp = container->defineProperty(
254
- std::make_shared<PathProp>(JsiPropId::get("path")));
241
+ _matrixProp = container->defineProperty<MatrixProp>("matrix");
242
+ _pathProp = container->defineProperty<PathProp>("path");
255
243
 
256
244
  _matrixProp->require();
257
245
  _pathProp->require();
@@ -283,10 +271,8 @@ protected:
283
271
  void defineProperties(NodePropsContainer *container) override {
284
272
  JsiBaseDomDeclarationNode::defineProperties(container);
285
273
 
286
- _matrixProp = container->defineProperty(
287
- std::make_shared<MatrixProp>(JsiPropId::get("matrix")));
288
- _widthProp = container->defineProperty(
289
- std::make_shared<NodeProp>(JsiPropId::get("width")));
274
+ _matrixProp = container->defineProperty<MatrixProp>("matrix");
275
+ _widthProp = container->defineProperty<NodeProp>("width");
290
276
 
291
277
  _matrixProp->require();
292
278
  _widthProp->require();
@@ -15,12 +15,7 @@
15
15
 
16
16
  namespace RNSkia {
17
17
 
18
- static PropId PropNamePath = JsiPropId::get("path");
19
- static PropId PropNameStart = JsiPropId::get("start");
20
- static PropId PropNameEnd = JsiPropId::get("end");
21
- static PropId PropNameFillType = JsiPropId::get("fillType");
22
18
  static PropId PropNameMiterLimit = JsiPropId::get("miter_limit");
23
- static PropId PropNameStroke = JsiPropId::get("stroke");
24
19
  static PropId PropNamePrecision = JsiPropId::get("precision");
25
20
 
26
21
  class JsiPathNode : public JsiDomDrawingNode,
@@ -132,16 +127,11 @@ protected:
132
127
 
133
128
  void defineProperties(NodePropsContainer *container) override {
134
129
  JsiDomDrawingNode::defineProperties(container);
135
- _pathProp =
136
- container->defineProperty(std::make_shared<PathProp>(PropNamePath));
137
- _startProp =
138
- container->defineProperty(std::make_shared<NodeProp>(PropNameStart));
139
- _endProp =
140
- container->defineProperty(std::make_shared<NodeProp>(PropNameEnd));
141
- _fillTypeProp =
142
- container->defineProperty(std::make_shared<NodeProp>(PropNameFillType));
143
- _strokeOptsProp =
144
- container->defineProperty(std::make_shared<NodeProp>(PropNameStroke));
130
+ _pathProp = container->defineProperty<PathProp>("path");
131
+ _startProp = container->defineProperty<NodeProp>("start");
132
+ _endProp = container->defineProperty<NodeProp>("end");
133
+ _fillTypeProp = container->defineProperty<NodeProp>("fillType");
134
+ _strokeOptsProp = container->defineProperty<NodeProp>("stroke");
145
135
 
146
136
  _pathProp->require();
147
137
  }
@@ -173,7 +163,7 @@ private:
173
163
  class StrokeOptsProps : public BaseDerivedProp {
174
164
  public:
175
165
  StrokeOptsProps() : BaseDerivedProp() {
176
- _strokeProp = addProperty(std::make_shared<NodeProp>(PropNameStroke));
166
+ _strokeProp = addProperty(std::make_shared<NodeProp>("stroke"));
177
167
  }
178
168
 
179
169
  private:
@@ -20,8 +20,7 @@ protected:
20
20
 
21
21
  void defineProperties(NodePropsContainer *container) override {
22
22
  JsiDomDrawingNode::defineProperties(container);
23
- _pictureProp = container->defineProperty(
24
- std::make_shared<PictureProp>(JsiPropId::get("picture")));
23
+ _pictureProp = container->defineProperty<PictureProp>("picture");
25
24
  _pictureProp->require();
26
25
  }
27
26
 
@@ -14,7 +14,6 @@
14
14
 
15
15
  namespace RNSkia {
16
16
 
17
- static PropId PropNamePoints = JsiPropId::get("points");
18
17
  static PropId PropNamePointsMode = JsiPropId::get("mode");
19
18
 
20
19
  class JsiPointsNode : public JsiDomDrawingNode,
@@ -34,10 +33,8 @@ protected:
34
33
 
35
34
  void defineProperties(NodePropsContainer *container) override {
36
35
  JsiDomDrawingNode::defineProperties(container);
37
- _pointModeProp = container->defineProperty(
38
- std::make_shared<PointModeProp>(PropNamePointsMode));
39
- _pointsProp =
40
- container->defineProperty(std::make_shared<PointsProp>(PropNamePoints));
36
+ _pointModeProp = container->defineProperty<PointModeProp>("mode");
37
+ _pointsProp = container->defineProperty<PointsProp>("points");
41
38
 
42
39
  _pointsProp->require();
43
40
  _pointModeProp->require();
@@ -22,8 +22,7 @@ protected:
22
22
  void defineProperties(NodePropsContainer *container) override {
23
23
  JsiDomDrawingNode::defineProperties(container);
24
24
 
25
- _rrectProp =
26
- container->defineProperty(std::make_shared<RRectProps>(PropNameRect));
25
+ _rrectProp = container->defineProperty<RRectProps>("rect");
27
26
  _rrectProp->require();
28
27
  }
29
28
 
@@ -22,8 +22,7 @@ protected:
22
22
  void defineProperties(NodePropsContainer *container) override {
23
23
  JsiDomDrawingNode::defineProperties(container);
24
24
 
25
- _rectProp =
26
- container->defineProperty(std::make_shared<RectProps>(PropNameRect));
25
+ _rectProp = container->defineProperty<RectProps>("rect");
27
26
  _rectProp->require();
28
27
  }
29
28
 
@@ -89,12 +89,10 @@ protected:
89
89
 
90
90
  void defineProperties(NodePropsContainer *container) override {
91
91
  JsiBaseDomDeclarationNode::defineProperties(container);
92
- _sourceProp = container->defineProperty(
93
- std::make_shared<NodeProp>(JsiPropId::get("source")));
94
- _uniformsProp = container->defineProperty(std::make_shared<UniformsProp>(
95
- JsiPropId::get("uniforms"), _sourceProp));
96
- _transformProp = container->defineProperty(
97
- std::make_shared<TransformProp>(JsiPropId::get("transform")));
92
+ _sourceProp = container->defineProperty<NodeProp>("source");
93
+ _uniformsProp =
94
+ container->defineProperty<UniformsProp>("uniforms", _sourceProp);
95
+ _transformProp = container->defineProperty<TransformProp>("transform");
98
96
 
99
97
  _sourceProp->require();
100
98
  }
@@ -141,18 +139,13 @@ protected:
141
139
 
142
140
  void defineProperties(NodePropsContainer *container) override {
143
141
  JsiBaseDomDeclarationNode::defineProperties(container);
144
- _txProp = container->defineProperty(
145
- std::make_shared<TileModeProp>(JsiPropId::get("tx")));
146
- _tyProp = container->defineProperty(
147
- std::make_shared<TileModeProp>(JsiPropId::get("ty")));
148
- _filterModeProp = container->defineProperty(
149
- std::make_shared<NodeProp>(JsiPropId::get("fm")));
150
- _mipmapModeProp = container->defineProperty(
151
- std::make_shared<NodeProp>(JsiPropId::get("mm")));
152
-
153
- _imageProps = container->defineProperty(std::make_shared<ImageProps>());
154
- _transformProp = container->defineProperty(
155
- std::make_shared<TransformProp>(JsiPropId::get("transform")));
142
+ _txProp = container->defineProperty<TileModeProp>("tx");
143
+ _tyProp = container->defineProperty<TileModeProp>("ty");
144
+ _filterModeProp = container->defineProperty<NodeProp>("fm");
145
+ _mipmapModeProp = container->defineProperty<NodeProp>("mm");
146
+
147
+ _imageProps = container->defineProperty<ImageProps>();
148
+ _transformProp = container->defineProperty<TransformProp>("transform");
156
149
 
157
150
  _txProp->require();
158
151
  _tyProp->require();
@@ -161,10 +154,8 @@ protected:
161
154
 
162
155
  _transformProp->require();
163
156
 
164
- // Just require the image
165
- container
166
- ->defineProperty(std::make_shared<NodeProp>(JsiPropId::get("image")))
167
- ->require();
157
+ // Add and require the image
158
+ container->defineProperty<NodeProp>("image")->require();
168
159
  }
169
160
 
170
161
  private:
@@ -221,8 +212,7 @@ protected:
221
212
 
222
213
  void defineProperties(NodePropsContainer *container) override {
223
214
  JsiBaseDomDeclarationNode::defineProperties(container);
224
- _colorProp = container->defineProperty(
225
- std::make_shared<ColorProp>(JsiPropId::get("color")));
215
+ _colorProp = container->defineProperty<ColorProp>("color");
226
216
  _colorProp->require();
227
217
  }
228
218
 
@@ -239,18 +229,12 @@ public:
239
229
  protected:
240
230
  void defineProperties(NodePropsContainer *container) override {
241
231
  JsiBaseDomDeclarationNode::defineProperties(container);
242
- _freqXProp = container->defineProperty(
243
- std::make_shared<NodeProp>(JsiPropId::get("freqX")));
244
- _freqYProp = container->defineProperty(
245
- std::make_shared<NodeProp>(JsiPropId::get("freqY")));
246
- _octavesProp = container->defineProperty(
247
- std::make_shared<NodeProp>(JsiPropId::get("octaves")));
248
- _seedProp = container->defineProperty(
249
- std::make_shared<NodeProp>(JsiPropId::get("seed")));
250
- _tileWidthProp = container->defineProperty(
251
- std::make_shared<NodeProp>(JsiPropId::get("tileWidth")));
252
- _tileHeightProp = container->defineProperty(
253
- std::make_shared<NodeProp>(JsiPropId::get("tileHeight")));
232
+ _freqXProp = container->defineProperty<NodeProp>("freqX");
233
+ _freqYProp = container->defineProperty<NodeProp>("freqY");
234
+ _octavesProp = container->defineProperty<NodeProp>("octaves");
235
+ _seedProp = container->defineProperty<NodeProp>("seed");
236
+ _tileWidthProp = container->defineProperty<NodeProp>("tileWidth");
237
+ _tileHeightProp = container->defineProperty<NodeProp>("tileHeight");
254
238
 
255
239
  _freqXProp->require();
256
240
  _freqYProp->require();
@@ -317,17 +301,12 @@ public:
317
301
 
318
302
  void defineProperties(NodePropsContainer *container) override {
319
303
  JsiBaseDomDeclarationNode::defineProperties(container);
320
- _transformsProps =
321
- container->defineProperty(std::make_shared<TransformsProps>());
322
-
323
- _colorsProp = container->defineProperty(
324
- std::make_shared<ColorsProp>(JsiPropId::get("colors")));
325
- _positionsProp = container->defineProperty(
326
- std::make_shared<NumbersProp>(JsiPropId::get("positions")));
327
- _modeProp = container->defineProperty(
328
- std::make_shared<TileModeProp>(JsiPropId::get("mode")));
329
- _flagsProp = container->defineProperty(
330
- std::make_shared<NodeProp>(JsiPropId::get("flags")));
304
+ _transformsProps = container->defineProperty<TransformsProps>();
305
+
306
+ _colorsProp = container->defineProperty<ColorsProp>("colors");
307
+ _positionsProp = container->defineProperty<NumbersProp>("positions");
308
+ _modeProp = container->defineProperty<TileModeProp>("mode");
309
+ _flagsProp = container->defineProperty<NodeProp>("flags");
331
310
 
332
311
  _colorsProp->require();
333
312
  }
@@ -385,10 +364,8 @@ protected:
385
364
 
386
365
  void defineProperties(NodePropsContainer *container) override {
387
366
  JsiBaseGradientNode::defineProperties(container);
388
- _startProp = container->defineProperty(
389
- std::make_shared<PointProp>(JsiPropId::get("start")));
390
- _endProp = container->defineProperty(
391
- std::make_shared<PointProp>(JsiPropId::get("end")));
367
+ _startProp = container->defineProperty<PointProp>("start");
368
+ _endProp = container->defineProperty<PointProp>("end");
392
369
 
393
370
  _startProp->require();
394
371
  _endProp->require();
@@ -420,10 +397,8 @@ protected:
420
397
 
421
398
  void defineProperties(NodePropsContainer *container) override {
422
399
  JsiBaseGradientNode::defineProperties(container);
423
- _centerProp = container->defineProperty(
424
- std::make_shared<PointProp>(JsiPropId::get("c")));
425
- _radiusProp = container->defineProperty(
426
- std::make_shared<NodeProp>(JsiPropId::get("r")));
400
+ _centerProp = container->defineProperty<PointProp>("c");
401
+ _radiusProp = container->defineProperty<NodeProp>("r");
427
402
 
428
403
  _centerProp->require();
429
404
  _radiusProp->require();
@@ -457,12 +432,9 @@ protected:
457
432
 
458
433
  void defineProperties(NodePropsContainer *container) override {
459
434
  JsiBaseGradientNode::defineProperties(container);
460
- _startProp = container->defineProperty(
461
- std::make_shared<NodeProp>(JsiPropId::get("start")));
462
- _endProp = container->defineProperty(
463
- std::make_shared<NodeProp>(JsiPropId::get("end")));
464
- _centerProp = container->defineProperty(
465
- std::make_shared<PointProp>(JsiPropId::get("c")));
435
+ _startProp = container->defineProperty<NodeProp>("start");
436
+ _endProp = container->defineProperty<NodeProp>("end");
437
+ _centerProp = container->defineProperty<PointProp>("c");
466
438
  }
467
439
 
468
440
  private:
@@ -497,14 +469,10 @@ protected:
497
469
 
498
470
  void defineProperties(NodePropsContainer *container) override {
499
471
  JsiBaseGradientNode::defineProperties(container);
500
- _startProp = container->defineProperty(
501
- std::make_shared<PointProp>(JsiPropId::get("start")));
502
- _startRProp = container->defineProperty(
503
- std::make_shared<NodeProp>(JsiPropId::get("startR")));
504
- _endProp = container->defineProperty(
505
- std::make_shared<PointProp>(JsiPropId::get("end")));
506
- _endRProp = container->defineProperty(
507
- std::make_shared<NodeProp>(JsiPropId::get("endR")));
472
+ _startProp = container->defineProperty<PointProp>("start");
473
+ _startRProp = container->defineProperty<NodeProp>("startR");
474
+ _endProp = container->defineProperty<PointProp>("end");
475
+ _endRProp = container->defineProperty<NodeProp>("endR");
508
476
  }
509
477
 
510
478
  private: