@react-native-ohos/react-native-svg 15.12.1-rc.1 → 15.12.1-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +21 -21
  2. package/README.OpenSource +10 -10
  3. package/README.md +13 -13
  4. package/css/package.json +5 -5
  5. package/harmony/svg/BuildProfile.ets +16 -16
  6. package/harmony/svg/build-profile.json5 +9 -9
  7. package/harmony/svg/hvigorfile.ts +1 -1
  8. package/harmony/svg/index.ets +6 -6
  9. package/harmony/svg/oh-package.json5 +13 -13
  10. package/harmony/svg/src/main/cpp/SVGPackage.h +4 -0
  11. package/harmony/svg/src/main/cpp/SvgArkUINode.cpp +3 -0
  12. package/harmony/svg/src/main/cpp/SvgArkUINode.h +15 -9
  13. package/harmony/svg/src/main/cpp/SvgFilter.cpp +505 -505
  14. package/harmony/svg/src/main/cpp/SvgFilter.h +112 -112
  15. package/harmony/svg/src/main/cpp/SvgForeignObjectNode.cpp +74 -0
  16. package/harmony/svg/src/main/cpp/SvgForeignObjectNode.h +54 -0
  17. package/harmony/svg/src/main/cpp/SvgForeignObjectNodeDelegate.h +30 -0
  18. package/harmony/svg/src/main/cpp/SvgNode.cpp +64 -0
  19. package/harmony/svg/src/main/cpp/SvgNode.h +17 -1
  20. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.cpp +40 -40
  21. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.h +48 -48
  22. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.cpp +33 -33
  23. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.h +48 -48
  24. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.cpp +39 -39
  25. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.h +55 -55
  26. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.cpp +33 -33
  27. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.h +49 -49
  28. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.cpp +34 -34
  29. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.h +48 -48
  30. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.cpp +35 -35
  31. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.h +45 -45
  32. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.cpp +198 -198
  33. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.h +48 -48
  34. package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.cpp +65 -0
  35. package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.h +50 -0
  36. package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h +8 -4
  37. package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp +4 -1
  38. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp +37 -0
  39. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h +10 -2
  40. package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.cpp +36 -15
  41. package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.h +6 -10
  42. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeBlendJSIBinder.h +26 -26
  43. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeColorMatrixJSIBinder.h +26 -26
  44. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeCompositeJSIBinder.h +30 -30
  45. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeFloodJSIBinder.h +26 -26
  46. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeGaussianBlurJSIBinder.h +26 -26
  47. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeOffsetJSIBinder.h +26 -26
  48. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFilterJSIBinder.h +44 -44
  49. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.cpp +977 -977
  50. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.h +1280 -1280
  51. package/harmony/svg/src/main/cpp/utils/DynamicUtils.h +55 -55
  52. package/harmony/svg/src/main/cpp/utils/FilterManager.h +190 -190
  53. package/harmony/svg/src/main/ets/RNSVGImageModule.ts +21 -21
  54. package/harmony/svg/src/main/ets/RNSVGRenderableModule.ts +16 -16
  55. package/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts +18 -18
  56. package/harmony/svg/src/main/ets/SvgPackage.ts +57 -57
  57. package/harmony/svg/src/main/module.json5 +7 -7
  58. package/harmony/svg/src/main/resources/base/element/string.json +8 -8
  59. package/harmony/svg/src/main/resources/en_US/element/string.json +8 -8
  60. package/harmony/svg/src/main/resources/zh_CN/element/string.json +8 -8
  61. package/harmony/svg/ts.ts +7 -7
  62. package/harmony/svg.har +0 -0
  63. package/lib/commonjs/css/index.js.map +1 -1
  64. package/lib/commonjs/index.js.map +1 -1
  65. package/lib/module/css/index.js.map +1 -1
  66. package/lib/module/index.js.map +1 -1
  67. package/package.json +53 -54
  68. package/src/css/index.tsx +19 -19
  69. package/src/index.tsx +2 -2
  70. package/tsconfig.json +11 -11
@@ -1,34 +1,34 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
- * Use of this source code is governed by a MIT license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- #include "RNSVGFeGaussianBlurComponentInstance.h"
8
- #include "utils/DynamicUtils.h"
9
- #include <glog/logging.h>
10
-
11
- namespace rnoh {
12
- namespace svg {
13
-
14
- RNSVGFeGaussianBlurComponentInstance::RNSVGFeGaussianBlurComponentInstance(Context context)
15
- : RNSVGBaseComponentInstance(std::move(context)) {}
16
-
17
- void RNSVGFeGaussianBlurComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
18
- if (props) {
19
- x_ = DynamicUtils::DynamicToString(props->x);
20
- y_ = DynamicUtils::DynamicToString(props->y);
21
- width_ = DynamicUtils::DynamicToString(props->width);
22
- height_ = DynamicUtils::DynamicToString(props->height);
23
- in_ = props->in1;
24
- stdDeviationX_ = props->stdDeviationX;
25
- stdDeviationY_ = props->stdDeviationY;
26
- edgeMode_ = facebook::react::toString(props->edgeMode);
27
- result_ = props->result;
28
- }
29
- }
30
-
31
- void RNSVGFeGaussianBlurComponentInstance::UpdateElementProps() {}
32
-
33
- } // namespace svg
34
- } // namespace rnoh
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ #include "RNSVGFeGaussianBlurComponentInstance.h"
8
+ #include "utils/DynamicUtils.h"
9
+ #include <glog/logging.h>
10
+
11
+ namespace rnoh {
12
+ namespace svg {
13
+
14
+ RNSVGFeGaussianBlurComponentInstance::RNSVGFeGaussianBlurComponentInstance(Context context)
15
+ : RNSVGBaseComponentInstance(std::move(context)) {}
16
+
17
+ void RNSVGFeGaussianBlurComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
18
+ if (props) {
19
+ x_ = DynamicUtils::DynamicToString(props->x);
20
+ y_ = DynamicUtils::DynamicToString(props->y);
21
+ width_ = DynamicUtils::DynamicToString(props->width);
22
+ height_ = DynamicUtils::DynamicToString(props->height);
23
+ in_ = props->in1;
24
+ stdDeviationX_ = props->stdDeviationX;
25
+ stdDeviationY_ = props->stdDeviationY;
26
+ edgeMode_ = facebook::react::toString(props->edgeMode);
27
+ result_ = props->result;
28
+ }
29
+ }
30
+
31
+ void RNSVGFeGaussianBlurComponentInstance::UpdateElementProps() {}
32
+
33
+ } // namespace svg
34
+ } // namespace rnoh
@@ -1,48 +1,48 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
- * Use of this source code is governed by a MIT license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- #pragma once
8
-
9
- #include "RNSVGBaseComponentInstance.h"
10
- #include <react/renderer/components/react_native_svg/ShadowNodes.h>
11
-
12
-
13
- namespace rnoh {
14
- namespace svg {
15
-
16
- class RNSVGFeGaussianBlurComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeGaussianBlurShadowNode> {
17
- public:
18
- using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeGaussianBlurProps>;
19
-
20
- RNSVGFeGaussianBlurComponentInstance(Context context);
21
-
22
- void onPropsChanged(SharedConcreteProps const &props) override;
23
- void UpdateElementProps() override;
24
-
25
- std::string getIn() const { return in_; }
26
- float getStdDeviationX() const { return stdDeviationX_; }
27
- float getStdDeviationY() const { return stdDeviationY_; }
28
- std::string getEdgeMode() const { return edgeMode_; }
29
- std::string getResult() const { return result_; }
30
- std::string getX() const { return x_; }
31
- std::string getY() const { return y_; }
32
- std::string getWidth() const { return width_; }
33
- std::string getHeight() const { return height_; }
34
-
35
- private:
36
- std::string x_ = "0";
37
- std::string y_ = "0";
38
- std::string width_ = "0";
39
- std::string height_ = "0";
40
- std::string in_ = "";
41
- float stdDeviationX_ = 0.0f;
42
- float stdDeviationY_ = 0.0f;
43
- std::string edgeMode_ = "";
44
- std::string result_ = "";
45
- };
46
-
47
- } // namespace svg
48
- } // namespace rnoh
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ #pragma once
8
+
9
+ #include "RNSVGBaseComponentInstance.h"
10
+ #include <react/renderer/components/react_native_svg/ShadowNodes.h>
11
+
12
+
13
+ namespace rnoh {
14
+ namespace svg {
15
+
16
+ class RNSVGFeGaussianBlurComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeGaussianBlurShadowNode> {
17
+ public:
18
+ using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeGaussianBlurProps>;
19
+
20
+ RNSVGFeGaussianBlurComponentInstance(Context context);
21
+
22
+ void onPropsChanged(SharedConcreteProps const &props) override;
23
+ void UpdateElementProps() override;
24
+
25
+ std::string getIn() const { return in_; }
26
+ float getStdDeviationX() const { return stdDeviationX_; }
27
+ float getStdDeviationY() const { return stdDeviationY_; }
28
+ std::string getEdgeMode() const { return edgeMode_; }
29
+ std::string getResult() const { return result_; }
30
+ std::string getX() const { return x_; }
31
+ std::string getY() const { return y_; }
32
+ std::string getWidth() const { return width_; }
33
+ std::string getHeight() const { return height_; }
34
+
35
+ private:
36
+ std::string x_ = "0";
37
+ std::string y_ = "0";
38
+ std::string width_ = "0";
39
+ std::string height_ = "0";
40
+ std::string in_ = "";
41
+ float stdDeviationX_ = 0.0f;
42
+ float stdDeviationY_ = 0.0f;
43
+ std::string edgeMode_ = "";
44
+ std::string result_ = "";
45
+ };
46
+
47
+ } // namespace svg
48
+ } // namespace rnoh
@@ -1,35 +1,35 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
- * Use of this source code is governed by a MIT license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- #include "RNSVGFeOffsetComponentInstance.h"
8
- #include "utils/DynamicUtils.h"
9
- #include <glog/logging.h>
10
-
11
- namespace rnoh {
12
- namespace svg {
13
-
14
- RNSVGFeOffsetComponentInstance::RNSVGFeOffsetComponentInstance(Context context)
15
- : RNSVGBaseComponentInstance(std::move(context)) {}
16
-
17
- void RNSVGFeOffsetComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
18
- if (props) {
19
- x_ = DynamicUtils::DynamicToString(props->x);
20
- y_ = DynamicUtils::DynamicToString(props->y);
21
- width_ = DynamicUtils::DynamicToString(props->width);
22
- height_ = DynamicUtils::DynamicToString(props->height);
23
- in_ = props->in1;
24
- std::string dxStr = DynamicUtils::DynamicToString(props->dx);
25
- std::string dyStr = DynamicUtils::DynamicToString(props->dy);
26
- dx_ = dxStr.empty() ? 0.0f : std::stof(dxStr);
27
- dy_ = dyStr.empty() ? 0.0f : std::stof(dyStr);
28
- result_ = props->result;
29
- }
30
- }
31
-
32
- void RNSVGFeOffsetComponentInstance::UpdateElementProps() {}
33
-
34
- } // namespace svg
35
- } // namespace rnoh
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ #include "RNSVGFeOffsetComponentInstance.h"
8
+ #include "utils/DynamicUtils.h"
9
+ #include <glog/logging.h>
10
+
11
+ namespace rnoh {
12
+ namespace svg {
13
+
14
+ RNSVGFeOffsetComponentInstance::RNSVGFeOffsetComponentInstance(Context context)
15
+ : RNSVGBaseComponentInstance(std::move(context)) {}
16
+
17
+ void RNSVGFeOffsetComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
18
+ if (props) {
19
+ x_ = DynamicUtils::DynamicToString(props->x);
20
+ y_ = DynamicUtils::DynamicToString(props->y);
21
+ width_ = DynamicUtils::DynamicToString(props->width);
22
+ height_ = DynamicUtils::DynamicToString(props->height);
23
+ in_ = props->in1;
24
+ std::string dxStr = DynamicUtils::DynamicToString(props->dx);
25
+ std::string dyStr = DynamicUtils::DynamicToString(props->dy);
26
+ dx_ = dxStr.empty() ? 0.0f : std::stof(dxStr);
27
+ dy_ = dyStr.empty() ? 0.0f : std::stof(dyStr);
28
+ result_ = props->result;
29
+ }
30
+ }
31
+
32
+ void RNSVGFeOffsetComponentInstance::UpdateElementProps() {}
33
+
34
+ } // namespace svg
35
+ } // namespace rnoh
@@ -1,46 +1,46 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
- * Use of this source code is governed by a MIT license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- #pragma once
8
-
9
- #include "RNSVGBaseComponentInstance.h"
10
- #include <react/renderer/components/react_native_svg/ShadowNodes.h>
11
-
12
-
13
- namespace rnoh {
14
- namespace svg {
15
-
16
- class RNSVGFeOffsetComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeOffsetShadowNode> {
17
- public:
18
- using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeOffsetProps>;
19
-
20
- RNSVGFeOffsetComponentInstance(Context context);
21
-
22
- void onPropsChanged(SharedConcreteProps const &props) override;
23
- void UpdateElementProps() override;
24
-
25
- std::string getIn() const { return in_; }
26
- std::string getResult() const { return result_; }
27
- float getDx() const { return dx_; }
28
- float getDy() const { return dy_; }
29
- std::string getX() const { return x_; }
30
- std::string getY() const { return y_; }
31
- std::string getWidth() const { return width_; }
32
- std::string getHeight() const { return height_; }
33
-
34
- private:
35
- std::string x_ = "0";
36
- std::string y_ = "0";
37
- std::string width_ = "0";
38
- std::string height_ = "0";
39
- std::string in_ = "";
40
- std::string result_ = "";
41
- float dx_ = 0.0f;
42
- float dy_ = 0.0f;
43
- };
44
-
45
- } // namespace svg
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ #pragma once
8
+
9
+ #include "RNSVGBaseComponentInstance.h"
10
+ #include <react/renderer/components/react_native_svg/ShadowNodes.h>
11
+
12
+
13
+ namespace rnoh {
14
+ namespace svg {
15
+
16
+ class RNSVGFeOffsetComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeOffsetShadowNode> {
17
+ public:
18
+ using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeOffsetProps>;
19
+
20
+ RNSVGFeOffsetComponentInstance(Context context);
21
+
22
+ void onPropsChanged(SharedConcreteProps const &props) override;
23
+ void UpdateElementProps() override;
24
+
25
+ std::string getIn() const { return in_; }
26
+ std::string getResult() const { return result_; }
27
+ float getDx() const { return dx_; }
28
+ float getDy() const { return dy_; }
29
+ std::string getX() const { return x_; }
30
+ std::string getY() const { return y_; }
31
+ std::string getWidth() const { return width_; }
32
+ std::string getHeight() const { return height_; }
33
+
34
+ private:
35
+ std::string x_ = "0";
36
+ std::string y_ = "0";
37
+ std::string width_ = "0";
38
+ std::string height_ = "0";
39
+ std::string in_ = "";
40
+ std::string result_ = "";
41
+ float dx_ = 0.0f;
42
+ float dy_ = 0.0f;
43
+ };
44
+
45
+ } // namespace svg
46
46
  } // namespace rnoh