@react-native-ohos/react-native-svg 15.12.1-rc.2 → 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.
- package/harmony/svg/BuildProfile.ets +1 -1
- package/harmony/svg/oh-package.json5 +1 -1
- package/harmony/svg/src/main/cpp/SVGPackage.h +4 -0
- package/harmony/svg/src/main/cpp/SvgArkUINode.cpp +3 -0
- package/harmony/svg/src/main/cpp/SvgArkUINode.h +15 -9
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.cpp +74 -0
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.h +54 -0
- package/harmony/svg/src/main/cpp/SvgForeignObjectNodeDelegate.h +30 -0
- package/harmony/svg/src/main/cpp/SvgNode.cpp +64 -0
- package/harmony/svg/src/main/cpp/SvgNode.h +17 -1
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.cpp +65 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.h +50 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h +8 -4
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp +37 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h +10 -2
- package/harmony/svg.har +0 -0
- package/lib/commonjs/css/index.js +54 -54
- package/lib/commonjs/css/index.js.map +1 -1
- package/lib/commonjs/index.js +25 -25
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/css/index.js +3 -3
- package/lib/module/css/index.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +8 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/example/babel.config.d.ts +3 -0
- package/lib/typescript/example/babel.config.d.ts.map +1 -0
- package/lib/typescript/example/contexts.d.ts +3 -0
- package/lib/typescript/example/contexts.d.ts.map +1 -0
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts +2 -0
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts.map +1 -0
- package/lib/typescript/example/harmony/hvigorfile.d.ts +2 -0
- package/lib/typescript/example/harmony/hvigorfile.d.ts.map +1 -0
- package/lib/typescript/example/index.d.ts +2 -0
- package/lib/typescript/example/index.d.ts.map +1 -0
- package/lib/typescript/example/jest.config.d.ts +3 -0
- package/lib/typescript/example/jest.config.d.ts.map +1 -0
- package/lib/typescript/example/metro.config.d.ts +3 -0
- package/lib/typescript/example/metro.config.d.ts.map +1 -0
- package/lib/typescript/example/react-native.config.d.ts +3 -0
- package/lib/typescript/example/react-native.config.d.ts.map +1 -0
- package/lib/typescript/example/scripts/create-build-profile.d.ts +2 -0
- package/lib/typescript/example/scripts/create-build-profile.d.ts.map +1 -0
- package/lib/typescript/example/src/index.d.ts +3 -0
- package/lib/typescript/example/src/index.d.ts.map +1 -0
- package/lib/typescript/src/css/index.d.ts +4 -0
- package/lib/typescript/src/css/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +5 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
3
3
|
*/
|
|
4
|
-
export const HAR_VERSION = '15.12.
|
|
4
|
+
export const HAR_VERSION = '15.12.1-rc.2';
|
|
5
5
|
export const BUILD_MODE_NAME = 'debug';
|
|
6
6
|
export const DEBUG = true;
|
|
7
7
|
export const TARGET_NAME = 'default';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
name: '@react-native-ohos/react-native-svg',
|
|
7
7
|
type: 'module',
|
|
8
8
|
main: 'index.ets',
|
|
9
|
-
version: '15.12.1-rc.
|
|
9
|
+
version: '15.12.1-rc.3',
|
|
10
10
|
dependencies: {
|
|
11
11
|
"@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
|
|
12
12
|
},
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
#include "RNOH/Package.h"
|
|
10
10
|
#include <glog/logging.h>
|
|
11
|
+
#include "componentInstances/RNSVGForeignObjectComponentInstance.h"
|
|
11
12
|
#include "componentInstances/RNSVGSvgViewComponentInstance.h"
|
|
12
13
|
#include "componentInstances/RNSVGCircleComponentInstance.h"
|
|
13
14
|
#include "componentInstances/RNSVGGroupComponentInstance.h"
|
|
@@ -51,6 +52,9 @@ public:
|
|
|
51
52
|
if (ctx.componentName == "RNSVGSvgView") {
|
|
52
53
|
return std::make_shared<RNSVGSvgViewComponentInstance>(std::move(ctx));
|
|
53
54
|
}
|
|
55
|
+
if (ctx.componentName == "RNSVGForeignObject") {
|
|
56
|
+
return std::make_shared<RNSVGForeignObjectComponentInstance>(std::move(ctx));
|
|
57
|
+
}
|
|
54
58
|
if (ctx.componentName == "RNSVGCircle") {
|
|
55
59
|
return std::make_shared<RNSVGCircleComponentInstance>(std::move(ctx));
|
|
56
60
|
}
|
|
@@ -55,6 +55,9 @@ SvgArkUINode::~SvgArkUINode() {
|
|
|
55
55
|
userCallback_ = nullptr;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
void SvgArkUINode::AddChild(ArkUINode &node) {
|
|
59
|
+
maybeThrow(NativeNodeApi::getInstance()->addChild(m_nodeHandle, node.getArkUINodeHandle()));
|
|
60
|
+
}
|
|
58
61
|
void SvgArkUINode::OnDraw(ArkUI_NodeCustomEvent *event) {
|
|
59
62
|
auto *drawContext = OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(event);
|
|
60
63
|
auto *drawingHandle = reinterpret_cast<OH_Drawing_Canvas *>(OH_ArkUI_DrawContext_GetCanvas(drawContext));
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
#pragma once
|
|
8
8
|
|
|
9
|
-
#include "SvgNode.h"
|
|
10
|
-
#include "SvgHost.h"
|
|
11
9
|
#include "RNOH/arkui/ArkUINode.h"
|
|
10
|
+
#include "SvgForeignObjectNodeDelegate.h"
|
|
11
|
+
#include "SvgHost.h"
|
|
12
|
+
#include "SvgNode.h"
|
|
12
13
|
#include "arkui/native_node.h"
|
|
13
14
|
|
|
14
15
|
namespace rnoh {
|
|
@@ -26,18 +27,23 @@ private:
|
|
|
26
27
|
std::weak_ptr<SvgNode> root_;
|
|
27
28
|
ArkUI_NativeNodeAPI_1 *nativeModule_ = nullptr;
|
|
28
29
|
UserCallback *userCallback_ = nullptr;
|
|
30
|
+
std::weak_ptr<SvgNode> _groupNode;
|
|
31
|
+
std::vector<ForeignProps> foreignPropsArray;
|
|
29
32
|
void (*eventReceiver)(ArkUI_NodeCustomEvent *event);
|
|
30
|
-
|
|
33
|
+
|
|
31
34
|
public:
|
|
32
35
|
SvgArkUINode();
|
|
33
36
|
~SvgArkUINode() override;
|
|
34
37
|
|
|
35
|
-
void SetSvgNode(const std::weak_ptr<SvgNode
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
void
|
|
40
|
-
|
|
38
|
+
void SetSvgNode(const std::weak_ptr<SvgNode> &node) { root_ = node; }
|
|
39
|
+
void SetGroupNode(const std::weak_ptr<SvgNode> &node) { _groupNode = node; }
|
|
40
|
+
void ResetNodeHandle() {}
|
|
41
|
+
void AddChild(ArkUINode &node);
|
|
42
|
+
void SetForeignObject(OH_PixelmapNative *pixelMap, float w, float h, float x, float y) {
|
|
43
|
+
ForeignProps foreignProps = {std::move(pixelMap), w, h, x, y};
|
|
44
|
+
if (auto groupNode = _groupNode.lock()) {
|
|
45
|
+
groupNode->SetForeignObject(std::move(foreignProps));
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
};
|
|
43
49
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 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
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#include "SvgForeignObjectNode.h"
|
|
23
|
+
#include "RNOH/arkui/NativeNodeApi.h"
|
|
24
|
+
namespace rnoh {
|
|
25
|
+
namespace svg {
|
|
26
|
+
SvgForeignObjectNode::SvgForeignObjectNode()
|
|
27
|
+
: ArkUINode(NativeNodeApi::getInstance()->createNode(ArkUI_NodeType::ARKUI_NODE_STACK)) {
|
|
28
|
+
mStackNode.setVisibility(ArkUI_Visibility::ARKUI_VISIBILITY_HIDDEN);
|
|
29
|
+
mStackNode.setClip(true);
|
|
30
|
+
maybeThrow(NativeNodeApi::getInstance()->addChild(m_nodeHandle, mStackNode.getArkUINodeHandle()));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
SvgForeignObjectNode::~SvgForeignObjectNode() {
|
|
34
|
+
if (m_NodeDelegate) {
|
|
35
|
+
m_NodeDelegate = nullptr;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
void SvgForeignObjectNode::insertChild(ArkUINode &child, std::size_t index) { mStackNode.insertChild(child, index); }
|
|
39
|
+
|
|
40
|
+
void SvgForeignObjectNode::SetSnapHeight(float height) { _height = height; }
|
|
41
|
+
|
|
42
|
+
void SvgForeignObjectNode::SetSnapWidth(float width) { _width = width; }
|
|
43
|
+
|
|
44
|
+
void SvgForeignObjectNode::SetSnapPosition(float x, float y) {
|
|
45
|
+
_positionX = x;
|
|
46
|
+
_positionY = y;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
void SvgForeignObjectNode::onNodeEvent(ArkUI_NodeEventType eventType, EventArgs &eventArgs) {
|
|
50
|
+
if (eventType == ArkUI_NodeEventType::NODE_EVENT_ON_AREA_CHANGE) {
|
|
51
|
+
if (m_NodeDelegate) {
|
|
52
|
+
OH_PixelmapNative *pixelMap = GetNodePixelMap();
|
|
53
|
+
if (!pixelMap) {
|
|
54
|
+
LOG(ERROR) << "[svgForeignNode] get node snapshot pixelMap is null";
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
m_NodeDelegate->onDrawForeignImage(pixelMap, _width, _height, _positionX, _positionY);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
OH_PixelmapNative *SvgForeignObjectNode::GetNodePixelMap() {
|
|
63
|
+
OH_PixelmapNative *pixelMap;
|
|
64
|
+
ArkUI_SnapshotOptions *options = OH_ArkUI_CreateSnapshotOptions();
|
|
65
|
+
OH_ArkUI_SnapshotOptions_SetScale(options, 1);
|
|
66
|
+
int32_t code = OH_ArkUI_GetNodeSnapshot(mStackNode.getArkUINodeHandle(), options, &pixelMap);
|
|
67
|
+
if (code == ARKUI_ERROR_CODE_NO_ERROR) {
|
|
68
|
+
return pixelMap;
|
|
69
|
+
}
|
|
70
|
+
return nullptr;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
} // namespace svg
|
|
74
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 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
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef HARMONY_SVGFOREIGNOBJECTNODE_H
|
|
23
|
+
#define HARMONY_SVGFOREIGNOBJECTNODE_H
|
|
24
|
+
#include "RNOH/arkui/ArkUINode.h"
|
|
25
|
+
#include "RNOH/arkui/StackNode.h"
|
|
26
|
+
#include "SvgForeignObjectNodeDelegate.h"
|
|
27
|
+
|
|
28
|
+
namespace rnoh {
|
|
29
|
+
namespace svg {
|
|
30
|
+
class SvgForeignObjectNode : public ArkUINode {
|
|
31
|
+
public:
|
|
32
|
+
SvgForeignObjectNode();
|
|
33
|
+
~SvgForeignObjectNode() override;
|
|
34
|
+
void onNodeEvent(ArkUI_NodeEventType eventType, EventArgs &eventArgs) override;
|
|
35
|
+
StackNode &getSnapNode() { return mStackNode; }
|
|
36
|
+
void insertChild(ArkUINode &child, std::size_t index);
|
|
37
|
+
void SetSnapPosition(float x, float y);
|
|
38
|
+
void SetSnapWidth(float width);
|
|
39
|
+
void SetSnapHeight(float height);
|
|
40
|
+
OH_PixelmapNative *GetNodePixelMap();
|
|
41
|
+
void SetForeignNodeDelegate(SvgForeignObjectNodeDelegate *delegate) { m_NodeDelegate = delegate; };
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
StackNode mStackNode;
|
|
45
|
+
SvgForeignObjectNodeDelegate *m_NodeDelegate;
|
|
46
|
+
float _width{0};
|
|
47
|
+
float _height{0};
|
|
48
|
+
float _positionX{0};
|
|
49
|
+
float _positionY{0};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace svg
|
|
53
|
+
} // namespace rnoh
|
|
54
|
+
#endif // HARMONY_SVGFOREIGNOBJECTNODE_H
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 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
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef HARMONY_SVGFOREIGNOBJECTNODEDELEGATE_H
|
|
23
|
+
#define HARMONY_SVGFOREIGNOBJECTNODEDELEGATE_H
|
|
24
|
+
#include <multimedia/image_framework/image/pixelmap_native.h>
|
|
25
|
+
class SvgForeignObjectNodeDelegate {
|
|
26
|
+
public:
|
|
27
|
+
virtual ~SvgForeignObjectNodeDelegate() = default;
|
|
28
|
+
virtual void onDrawForeignImage(OH_PixelmapNative *foreignPixelMap,float width,float height,float x,float y){};
|
|
29
|
+
};
|
|
30
|
+
#endif //HARMONY_SVGFOREIGNOBJECTNODEDELEGATE_H
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
#include "utils/SvgUtils.h"
|
|
24
24
|
#include "SvgGradient.h"
|
|
25
25
|
#include "SvgPattern.h"
|
|
26
|
+
#include "properties/ViewBox.h"
|
|
26
27
|
#include "SvgFilter.h"
|
|
27
28
|
#include <native_drawing/drawing_matrix.h>
|
|
28
29
|
#include <native_drawing/drawing_path.h>
|
|
29
30
|
#include <regex>
|
|
30
31
|
#include <string>
|
|
32
|
+
#include <native_drawing/drawing_pixel_map.h>
|
|
31
33
|
|
|
32
34
|
namespace rnoh {
|
|
33
35
|
namespace svg {
|
|
@@ -204,6 +206,13 @@ void SvgNode::Draw(OH_Drawing_Canvas *canvas) {
|
|
|
204
206
|
// on marker
|
|
205
207
|
|
|
206
208
|
OnDrawTraversed(canvas);
|
|
209
|
+
|
|
210
|
+
if (_foreignPropsArray.size() > 0) {
|
|
211
|
+
for (ForeignProps _foreignProps : _foreignPropsArray) {
|
|
212
|
+
DrawForeignPixelMap(canvas, _foreignProps);
|
|
213
|
+
}
|
|
214
|
+
_foreignPropsArray.clear();
|
|
215
|
+
}
|
|
207
216
|
OH_Drawing_CanvasRestoreToCount(canvas, count);
|
|
208
217
|
}
|
|
209
218
|
|
|
@@ -285,5 +294,60 @@ double SvgNode::getCanvasDiagonal() {
|
|
|
285
294
|
canvasDiagonal_ = sqrt(powX + powY) * M_SQRT1_2l;
|
|
286
295
|
return canvasDiagonal_;
|
|
287
296
|
}
|
|
297
|
+
|
|
298
|
+
void SvgNode::DrawForeignPixelMap(OH_Drawing_Canvas *canvas, ForeignProps _foreignProps) {
|
|
299
|
+
if (!_foreignProps.foreignPixelMap) {
|
|
300
|
+
DLOG(INFO) << "[svgForeignNode] foreignPixelMap is null";
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
DLOG(INFO) << "[svgForeignNode] DrawForeignPixelMap start , width:" << _foreignProps.width;
|
|
304
|
+
OH_Pixelmap_ImageInfo *imageInfo;
|
|
305
|
+
OH_PixelmapImageInfo_Create(&imageInfo);
|
|
306
|
+
|
|
307
|
+
OH_PixelmapNative_GetImageInfo(_foreignProps.foreignPixelMap, imageInfo);
|
|
308
|
+
uint32_t originalWidth = 0, originalHeight = 0;
|
|
309
|
+
OH_PixelmapImageInfo_GetWidth(imageInfo, &originalWidth);
|
|
310
|
+
OH_PixelmapImageInfo_GetHeight(imageInfo, &originalHeight);
|
|
311
|
+
OH_PixelmapImageInfo_Release(imageInfo);
|
|
312
|
+
|
|
313
|
+
if (originalWidth == 0 || originalHeight == 0) {
|
|
314
|
+
DLOG(WARNING) << "[svgForeignNode] Invalid pixelmap size";
|
|
315
|
+
OH_PixelmapNative_Release(_foreignProps.foreignPixelMap);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
OH_Drawing_PixelMap *ohPixelMap = OH_Drawing_PixelMapGetFromOhPixelMapNative(_foreignProps.foreignPixelMap);
|
|
320
|
+
if (!ohPixelMap) {
|
|
321
|
+
DLOG(WARNING) << "[svgForeignNode] Failed to get OH_Drawing_PixelMap";
|
|
322
|
+
OH_PixelmapNative_Release(_foreignProps.foreignPixelMap);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
OH_Drawing_CanvasSave(canvas);
|
|
327
|
+
|
|
328
|
+
OH_Drawing_CanvasTranslate(canvas, _foreignProps.x, _foreignProps.y);
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
float scaleX = static_cast<float>(_foreignProps.width) / originalWidth;
|
|
332
|
+
float scaleY = static_cast<float>(_foreignProps.height) / originalHeight;
|
|
333
|
+
OH_Drawing_CanvasScale(canvas, 1, 1);
|
|
334
|
+
|
|
335
|
+
OH_Drawing_Rect *srcRect = OH_Drawing_RectCreate(0, 0, originalWidth, originalHeight);
|
|
336
|
+
OH_Drawing_Rect *dstRect = OH_Drawing_RectCreate(0, 0, originalWidth, originalHeight);
|
|
337
|
+
OH_Drawing_SamplingOptions *sampling = OH_Drawing_SamplingOptionsCreate(FILTER_MODE_LINEAR, MIPMAP_MODE_LINEAR);
|
|
338
|
+
OH_Drawing_CanvasDrawPixelMapRect(canvas, ohPixelMap, srcRect, dstRect, sampling);
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
OH_Drawing_CanvasRestore(canvas);
|
|
342
|
+
OH_Drawing_PixelMapDissolve(ohPixelMap);
|
|
343
|
+
OH_PixelmapNative_Release(_foreignProps.foreignPixelMap);
|
|
344
|
+
OH_Drawing_RectDestroy(srcRect);
|
|
345
|
+
OH_Drawing_RectDestroy(dstRect);
|
|
346
|
+
OH_Drawing_SamplingOptionsDestroy(sampling);
|
|
347
|
+
|
|
348
|
+
_foreignProps.foreignPixelMap = nullptr;
|
|
349
|
+
DLOG(INFO) << "[svgForeignNode] DrawForeignPixelMap end";
|
|
350
|
+
}
|
|
351
|
+
|
|
288
352
|
} // namespace svg
|
|
289
353
|
} // namespace rnoh
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
#include "utils/StringUtils.h"
|
|
37
37
|
#include "utils/SvgAttributesParser.h"
|
|
38
38
|
#include <glog/logging.h>
|
|
39
|
+
#include <multimedia/image_framework/image/pixelmap_native.h>
|
|
39
40
|
#include <native_drawing/drawing_canvas.h>
|
|
40
41
|
#include <native_drawing/drawing_rect.h>
|
|
41
42
|
#include "utils/DynamicUtils.h"
|
|
@@ -43,6 +44,15 @@
|
|
|
43
44
|
namespace rnoh {
|
|
44
45
|
namespace svg {
|
|
45
46
|
|
|
47
|
+
struct ForeignProps {
|
|
48
|
+
OH_PixelmapNative *foreignPixelMap{nullptr};
|
|
49
|
+
float width;
|
|
50
|
+
float height;
|
|
51
|
+
float x;
|
|
52
|
+
float y;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
|
|
46
56
|
constexpr int INHERIT_TYPE = 2;
|
|
47
57
|
|
|
48
58
|
class SvgNode : public std::enable_shared_from_this<SvgNode> {
|
|
@@ -275,6 +285,10 @@ public:
|
|
|
275
285
|
double getCanvasHeight();
|
|
276
286
|
double getCanvasDiagonal();
|
|
277
287
|
|
|
288
|
+
void SetForeignObject(ForeignProps foreignProps) {
|
|
289
|
+
_foreignPropsArray.emplace_back(foreignProps);
|
|
290
|
+
}
|
|
291
|
+
|
|
278
292
|
protected:
|
|
279
293
|
// override as need by derived class
|
|
280
294
|
// called by function AppendChild
|
|
@@ -296,7 +310,7 @@ protected:
|
|
|
296
310
|
std::optional<Gradient> GetGradient(const std::string &href);
|
|
297
311
|
|
|
298
312
|
std::shared_ptr<PatternAttr> GetPatternAttr(const std::string &href);
|
|
299
|
-
|
|
313
|
+
void DrawForeignPixelMap(OH_Drawing_Canvas *canvas,ForeignProps _foreignProps);
|
|
300
314
|
void InitNoneFlag() {
|
|
301
315
|
hrefFill_ = false;
|
|
302
316
|
hrefRender_ = false;
|
|
@@ -341,6 +355,8 @@ protected:
|
|
|
341
355
|
Provide enough digits for the 128-bit IEEE quad (36 significant digits).
|
|
342
356
|
*/
|
|
343
357
|
const double M_SQRT1_2l = 0.707106781186547524400844362104849039;
|
|
358
|
+
|
|
359
|
+
std::vector<ForeignProps> _foreignPropsArray;
|
|
344
360
|
};
|
|
345
361
|
|
|
346
362
|
} // namespace svg
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 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
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#include "RNSVGForeignObjectComponentInstance.h"
|
|
23
|
+
namespace rnoh {
|
|
24
|
+
namespace svg {
|
|
25
|
+
|
|
26
|
+
RNSVGForeignObjectComponentInstance::RNSVGForeignObjectComponentInstance(Context context)
|
|
27
|
+
: CppComponentInstance(std::move(context)) {
|
|
28
|
+
DLOG(INFO) << "RNSVGForeignObjectComponentInstance";
|
|
29
|
+
NativeNodeApi::getInstance()->registerNodeEvent(mForeignStackNode.getArkUINodeHandle(), NODE_EVENT_ON_AREA_CHANGE,
|
|
30
|
+
NODE_EVENT_ON_AREA_CHANGE, this);
|
|
31
|
+
mForeignStackNode.insertChild(node, 0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
RNSVGForeignObjectComponentInstance::~RNSVGForeignObjectComponentInstance() {
|
|
36
|
+
NativeNodeApi::getInstance()->unregisterNodeEvent(mForeignStackNode.getArkUINodeHandle(), NODE_EVENT_ON_AREA_CHANGE);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void RNSVGForeignObjectComponentInstance::onFinalizeUpdates() {
|
|
40
|
+
ComponentInstance::onFinalizeUpdates();
|
|
41
|
+
if (m_props) {
|
|
42
|
+
float pointScaleFactor = getLayoutMetrics().pointScaleFactor;
|
|
43
|
+
;
|
|
44
|
+
mForeignStackNode.SetSnapPosition(pointScaleFactor * std::stof(DynamicUtils::DynamicToString(m_props->x)),
|
|
45
|
+
pointScaleFactor * std::stof(DynamicUtils::DynamicToString(m_props->y)));
|
|
46
|
+
mForeignStackNode.SetSnapWidth(pointScaleFactor * std::stof(DynamicUtils::DynamicToString(m_props->width)));
|
|
47
|
+
mForeignStackNode.SetSnapHeight(pointScaleFactor * std::stof(DynamicUtils::DynamicToString(m_props->height)));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
void RNSVGForeignObjectComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
|
|
52
|
+
std::size_t index) {
|
|
53
|
+
CppComponentInstance::onChildInserted(childComponentInstance, index);
|
|
54
|
+
node.insertChild(childComponentInstance->getLocalRootArkUINode(), index);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
void RNSVGForeignObjectComponentInstance::onChildRemoved(ComponentInstance::Shared const &childComponentInstance) {
|
|
58
|
+
CppComponentInstance::onChildRemoved(childComponentInstance);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
SvgForeignObjectNode &RNSVGForeignObjectComponentInstance::getLocalRootArkUINode() { return mForeignStackNode; }
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
} // namespace svg
|
|
65
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 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
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef RNSVG_FOREIGN_OBJECT_COMPONENT_INSTANCE_H
|
|
23
|
+
#define RNSVG_FOREIGN_OBJECT_COMPONENT_INSTANCE_H
|
|
24
|
+
#include "RNOH/CppComponentInstance.h"
|
|
25
|
+
#include "SvgForeignObjectNode.h"
|
|
26
|
+
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
27
|
+
#include "RNOH/arkui/ColumnNode.h"
|
|
28
|
+
#include "RNOH/arkui/NativeNodeApi.h"
|
|
29
|
+
#include "utils/DynamicUtils.h"
|
|
30
|
+
namespace rnoh {
|
|
31
|
+
namespace svg {
|
|
32
|
+
class RNSVGForeignObjectComponentInstance : public CppComponentInstance<facebook::react::RNSVGForeignObjectShadowNode> {
|
|
33
|
+
public:
|
|
34
|
+
RNSVGForeignObjectComponentInstance(Context context);
|
|
35
|
+
~RNSVGForeignObjectComponentInstance();
|
|
36
|
+
|
|
37
|
+
void onFinalizeUpdates() override;
|
|
38
|
+
void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
|
|
39
|
+
|
|
40
|
+
void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override;
|
|
41
|
+
|
|
42
|
+
SvgForeignObjectNode &getLocalRootArkUINode() override;
|
|
43
|
+
|
|
44
|
+
private:
|
|
45
|
+
SvgForeignObjectNode mForeignStackNode;
|
|
46
|
+
ColumnNode node;
|
|
47
|
+
};
|
|
48
|
+
} // namespace svg
|
|
49
|
+
} // namespace rnoh
|
|
50
|
+
#endif // RNSVG_FOREIGN_OBJECT_COMPONENT_INSTANCE_H
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Use of this source code is governed by a MIT license that can be
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
#ifndef RNSVG_GROUP_COMPONENT_INSTANCE_H
|
|
7
|
+
#define RNSVG_GROUP_COMPONENT_INSTANCE_H
|
|
7
8
|
#pragma once
|
|
8
9
|
|
|
9
10
|
#include "RNSVGBaseComponentInstance.h"
|
|
@@ -15,13 +16,16 @@ namespace svg {
|
|
|
15
16
|
class RNSVGGroupComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGGroupShadowNode> {
|
|
16
17
|
public:
|
|
17
18
|
explicit RNSVGGroupComponentInstance(Context context);
|
|
18
|
-
|
|
19
|
+
std::shared_ptr<SvgGroup> getNode(){
|
|
20
|
+
return m_svgGroup;
|
|
21
|
+
}
|
|
19
22
|
protected:
|
|
20
23
|
void UpdateElementProps() override;
|
|
21
|
-
|
|
24
|
+
|
|
22
25
|
private:
|
|
23
26
|
std::shared_ptr<SvgGroup> m_svgGroup = std::make_shared<SvgGroup>();
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
} // namespace svg
|
|
27
|
-
} // namespace rnoh
|
|
30
|
+
} // namespace rnoh
|
|
31
|
+
#endif // RNSVG_GROUP_COMPONENT_INSTANCE_H
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#include "RNSVGSvgViewComponentInstance.h"
|
|
8
8
|
#include "utils/DynamicUtils.h"
|
|
9
9
|
#include <glog/logging.h>
|
|
10
|
+
#include "RNSVGGroupComponentInstance.h"
|
|
10
11
|
|
|
11
12
|
namespace rnoh {
|
|
12
13
|
namespace svg {
|
|
@@ -45,9 +46,45 @@ void RNSVGSvgViewComponentInstance::onFinalizeUpdates() {
|
|
|
45
46
|
getLocalRootArkUINode().markDirty();
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
void RNSVGSvgViewComponentInstance::onDrawForeignImage(OH_PixelmapNative *foreignPixelMap, float width, float height,
|
|
50
|
+
float x, float y) {
|
|
51
|
+
if (foreignPixelMap) {
|
|
52
|
+
DLOG(INFO) << "[svgForeignNode] RNSVGSvgViewComponentInstance OH_PixelmapNative is not null, position:{ x:" << x
|
|
53
|
+
<< ",y:" << y << "},width:" << width << ";height:" << height;
|
|
54
|
+
m_svgArkUINode.SetForeignObject(foreignPixelMap, width, height, x, y);
|
|
55
|
+
m_svgArkUINode.markDirty();
|
|
56
|
+
} else {
|
|
57
|
+
DLOG(INFO) << "RNSVGSvgViewComponentInstance OH_PixelmapNative is null";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
48
60
|
void RNSVGSvgViewComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
|
|
49
61
|
std::size_t index) {
|
|
50
62
|
CppComponentInstance::onChildInserted(childComponentInstance, index);
|
|
63
|
+
if (childComponentInstance->getComponentName() == "RNSVGGroup") {
|
|
64
|
+
auto childInstance = childComponentInstance->getChildren();
|
|
65
|
+
for (ComponentInstance::Shared c : childInstance) {
|
|
66
|
+
if (c->getComponentName().find("SVG") == std::string::npos) {
|
|
67
|
+
NativeNodeApi::getInstance()->insertChildAt(m_svgArkUINode.getArkUINodeHandle(),
|
|
68
|
+
c->getLocalRootArkUINode().getArkUINodeHandle(), index);
|
|
69
|
+
}
|
|
70
|
+
auto groupChildInstance = c->getChildren();
|
|
71
|
+
for (ComponentInstance::Shared c1 : groupChildInstance) {
|
|
72
|
+
if (c1->getComponentName() == "RNSVGForeignObject") {
|
|
73
|
+
auto m_foreignComponentInstance =
|
|
74
|
+
std::dynamic_pointer_cast<RNSVGForeignObjectComponentInstance>(c1);
|
|
75
|
+
if (m_foreignComponentInstance) {
|
|
76
|
+
auto groupInstance =
|
|
77
|
+
std::dynamic_pointer_cast<RNSVGGroupComponentInstance>(c1->getParent().lock());
|
|
78
|
+
m_svgArkUINode.SetGroupNode(groupInstance->getNode());
|
|
79
|
+
m_svgArkUINode.AddChild(m_foreignComponentInstance->getLocalRootArkUINode());
|
|
80
|
+
m_foreignComponentInstance->getLocalRootArkUINode().SetForeignNodeDelegate(this);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
51
88
|
OnChildInsertCommon(std::dynamic_pointer_cast<SvgHost>(childComponentInstance));
|
|
52
89
|
}
|
|
53
90
|
|
|
@@ -12,18 +12,26 @@
|
|
|
12
12
|
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
13
13
|
#include "SvgViewManager.h"
|
|
14
14
|
#include "SvgSvg.h"
|
|
15
|
+
#include "RNSVGForeignObjectComponentInstance.h"
|
|
16
|
+
|
|
17
|
+
namespace rnoh {
|
|
18
|
+
namespace svg {
|
|
19
|
+
class RNSVGGroupComponentInstance;
|
|
20
|
+
} // namespace svg
|
|
21
|
+
} // namespace rnoh
|
|
22
|
+
|
|
15
23
|
|
|
16
24
|
namespace rnoh {
|
|
17
25
|
namespace svg {
|
|
18
26
|
|
|
19
27
|
class RNSVGSvgViewComponentInstance : public CppComponentInstance<facebook::react::RNSVGSvgViewShadowNode>,
|
|
20
|
-
public SvgHost {
|
|
28
|
+
public SvgHost , public SvgForeignObjectNodeDelegate {
|
|
21
29
|
public:
|
|
22
30
|
explicit RNSVGSvgViewComponentInstance(Context context);
|
|
23
31
|
~RNSVGSvgViewComponentInstance();
|
|
24
32
|
|
|
25
33
|
void onFinalizeUpdates() override;
|
|
26
|
-
|
|
34
|
+
void onDrawForeignImage(OH_PixelmapNative *foreignPixelMap,float width,float height,float x,float y) override;
|
|
27
35
|
// get SvgNode from childComponentInstance and set it to root_
|
|
28
36
|
void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override;
|
|
29
37
|
|
package/harmony/svg.har
CHANGED
|
Binary file
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "LocalSvg", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _css.LocalSvg;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "SvgCss", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _css.SvgCss;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "SvgCssUri", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _css.SvgCssUri;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "SvgWithCss", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _css.SvgWithCss;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "SvgWithCssUri", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _css.SvgWithCssUri;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "WithLocalSvg", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _css.WithLocalSvg;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "inlineStyles", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _css.inlineStyles;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "loadLocalRawResource", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _css.loadLocalRawResource;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var _css = require("react-native-svg/css");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "LocalSvg", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _css.LocalSvg;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SvgCss", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _css.SvgCss;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "SvgCssUri", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _css.SvgCssUri;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "SvgWithCss", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _css.SvgWithCss;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "SvgWithCssUri", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _css.SvgWithCssUri;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "WithLocalSvg", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _css.WithLocalSvg;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "inlineStyles", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _css.inlineStyles;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "loadLocalRawResource", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _css.loadLocalRawResource;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var _css = require("react-native-svg/css");
|
|
55
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_css","require"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["_css","require"],"sourceRoot":"..\\..\\..\\src","sources":["css/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {};
|
|
7
|
-
Object.defineProperty(exports, "default", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _ReactNativeSVG.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _ReactNativeSVG = _interopRequireWildcard(require("react-native-svg/src/ReactNativeSVG"));
|
|
14
|
-
Object.keys(_ReactNativeSVG).forEach(function (key) {
|
|
15
|
-
if (key === "default" || key === "__esModule") return;
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] === _ReactNativeSVG[key]) return;
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ReactNativeSVG[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _ReactNativeSVG.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _ReactNativeSVG = _interopRequireWildcard(require("react-native-svg/src/ReactNativeSVG"));
|
|
14
|
+
Object.keys(_ReactNativeSVG).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
+
if (key in exports && exports[key] === _ReactNativeSVG[key]) return;
|
|
18
|
+
Object.defineProperty(exports, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _ReactNativeSVG[key];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ReactNativeSVG","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["_ReactNativeSVG","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAJ,eAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,eAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,eAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAAoD,SAAAL,wBAAAc,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAc,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAP,GAAA,CAAAC,CAAA,GAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAR,cAAA,CAAAC,IAAA,CAAAM,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAlB,MAAA,CAAAS,cAAA,KAAAT,MAAA,CAAAyB,wBAAA,CAAAb,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAR,GAAA,IAAAQ,CAAA,CAAAK,GAAA,IAAAN,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
|
package/lib/module/css/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles } from 'react-native-svg/css';
|
|
2
|
-
import { LocalSvg, WithLocalSvg, loadLocalRawResource } from 'react-native-svg/css';
|
|
3
|
-
export { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles, LocalSvg, WithLocalSvg, loadLocalRawResource };
|
|
1
|
+
import { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles } from 'react-native-svg/css';
|
|
2
|
+
import { LocalSvg, WithLocalSvg, loadLocalRawResource } from 'react-native-svg/css';
|
|
3
|
+
export { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles, LocalSvg, WithLocalSvg, loadLocalRawResource };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SvgCss","SvgCssUri","SvgWithCss","SvgWithCssUri","inlineStyles","LocalSvg","WithLocalSvg","loadLocalRawResource"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["SvgCss","SvgCssUri","SvgWithCss","SvgWithCssUri","inlineStyles","LocalSvg","WithLocalSvg","loadLocalRawResource"],"sourceRoot":"..\\..\\..\\src","sources":["css/index.tsx"],"mappings":"AAAA,SACIA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,aAAa,EACbC,YAAY,QACP,sBAAsB;AAE7B,SAASC,QAAQ,EAAEC,YAAY,EAAEC,oBAAoB,QAAQ,sBAAsB;AAEnF,SACEP,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,YAAY,EACZC,oBAAoB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from 'react-native-svg/src/ReactNativeSVG';
|
|
2
|
-
export { default } from 'react-native-svg/src/ReactNativeSVG';
|
|
1
|
+
export * from 'react-native-svg/src/ReactNativeSVG';
|
|
2
|
+
export { default } from 'react-native-svg/src/ReactNativeSVG';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["default"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA,cAAc,qCAAqC;AAEnD,SAASA,OAAO,QAAQ,qCAAqC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../babel.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../example/babel.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../example/contexts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,gBAAgB,0BAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hvigorfile.d.ts","sourceRoot":"","sources":["../../../../../example/harmony/entry/hvigorfile.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hvigorfile.d.ts","sourceRoot":"","sources":["../../../../example/harmony/hvigorfile.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../example/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../../example/jest.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metro.config.d.ts","sourceRoot":"","sources":["../../../example/metro.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.config.d.ts","sourceRoot":"","sources":["../../../example/react-native.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-build-profile.d.ts","sourceRoot":"","sources":["../../../../example/scripts/create-build-profile.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../example/src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,OAAO,UAAU,GAAG,sBAQ1B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles } from 'react-native-svg/css';
|
|
2
|
+
import { LocalSvg, WithLocalSvg, loadLocalRawResource } from 'react-native-svg/css';
|
|
3
|
+
export { SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, inlineStyles, LocalSvg, WithLocalSvg, loadLocalRawResource, };
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/css/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,oBAAoB,GACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-svg",
|
|
3
|
-
"version": "15.12.1-rc.
|
|
3
|
+
"version": "15.12.1-rc.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"react-native": "src/index",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
8
8
|
"types": "lib/typescript/index.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
|
+
"prepack": "bob build",
|
|
11
|
+
"prepublishOnly": "npm run prepack",
|
|
10
12
|
"update_version": "node ./scripts/update-version.js",
|
|
11
13
|
"deploy": "node ./scripts/deploy.js",
|
|
12
14
|
"codegen-lib": "react-native codegen-lib-harmony --no-safety-check --npm-package-name react-native-svg --cpp-output-path ./harmony/svg/src/main/cpp/generated --ets-output-path ./harmony/svg/src/main/ets/generated --cpp-components-spec-paths ./node_modules/react-native-svg/src/fabric"
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
"react-native-svg": "15.12.0"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
|
-
"@rnoh/react-native-harmony-cli": "./packages/
|
|
24
|
+
"@rnoh/react-native-harmony-cli": "./packages/react-native-oh-react-native-harmony-cli-0.77.18.tgz",
|
|
23
25
|
"@react-native-community/cli": "15.0.1",
|
|
24
26
|
"@tsconfig/react-native": "^3.0.0",
|
|
25
27
|
"@types/jest": "^29.5.1",
|
|
@@ -45,8 +47,7 @@
|
|
|
45
47
|
"output": "lib",
|
|
46
48
|
"targets": [
|
|
47
49
|
"commonjs",
|
|
48
|
-
"module"
|
|
49
|
-
"typescript"
|
|
50
|
+
"module"
|
|
50
51
|
]
|
|
51
52
|
}
|
|
52
53
|
}
|