@react-native-ohos/react-native-svg 15.12.1-rc.13 → 15.12.1-rc.14
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/oh-package.json5 +1 -1
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.cpp +24 -13
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.h +5 -0
- package/package.json +2 -3
- package/harmony/svg.har +0 -0
- package/lib/typescript/babel.config.d.ts +0 -8
- package/lib/typescript/babel.config.d.ts.map +0 -1
- package/lib/typescript/example/babel.config.d.ts +0 -3
- package/lib/typescript/example/babel.config.d.ts.map +0 -1
- package/lib/typescript/example/contexts.d.ts +0 -3
- package/lib/typescript/example/contexts.d.ts.map +0 -1
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts +0 -2
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts.map +0 -1
- package/lib/typescript/example/harmony/hvigorfile.d.ts +0 -2
- package/lib/typescript/example/harmony/hvigorfile.d.ts.map +0 -1
- package/lib/typescript/example/index.d.ts +0 -2
- package/lib/typescript/example/index.d.ts.map +0 -1
- package/lib/typescript/example/jest.config.d.ts +0 -3
- package/lib/typescript/example/jest.config.d.ts.map +0 -1
- package/lib/typescript/example/metro.config.d.ts +0 -3
- package/lib/typescript/example/metro.config.d.ts.map +0 -1
- package/lib/typescript/example/react-native.config.d.ts +0 -3
- package/lib/typescript/example/react-native.config.d.ts.map +0 -1
- package/lib/typescript/example/scripts/create-build-profile.d.ts +0 -2
- package/lib/typescript/example/scripts/create-build-profile.d.ts.map +0 -1
- package/lib/typescript/example/src/index.d.ts +0 -3
- package/lib/typescript/example/src/index.d.ts.map +0 -1
- package/lib/typescript/src/css/index.d.ts +0 -4
- package/lib/typescript/src/css/index.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.d.ts.map +0 -1
|
@@ -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.14',
|
|
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
|
},
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
* License for the specific language governing permissions and limitations
|
|
19
19
|
* under the License.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
#include <dlfcn.h>
|
|
22
22
|
#include "SvgForeignObjectNode.h"
|
|
23
23
|
#include "RNOH/arkui/NativeNodeApi.h"
|
|
24
|
-
|
|
25
|
-
#include <info/application_target_sdk_version.h>
|
|
24
|
+
|
|
26
25
|
namespace rnoh {
|
|
27
26
|
namespace svg {
|
|
28
27
|
SvgForeignObjectNode::SvgForeignObjectNode()
|
|
@@ -66,19 +65,31 @@ void SvgForeignObjectNode::onNodeEvent(ArkUI_NodeEventType eventType, EventArgs
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
OH_PixelmapNative *SvgForeignObjectNode::GetNodePixelMap() {
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
68
|
+
high_lib_handle = dlopen("libace_ndk.z.so", RTLD_LAZY);
|
|
69
|
+
if (high_lib_handle == NULL) {
|
|
70
|
+
DLOG(INFO) << "[svgForeignNode] libace_ndk.z.so not existed";
|
|
71
|
+
dlclose(high_lib_handle);
|
|
72
72
|
return nullptr;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
createSnapshotOptionsMethod = (ArkUI_SnapshotOptions*(*)())dlsym(high_lib_handle, "OH_ArkUI_CreateSnapshotOptions");
|
|
75
|
+
snapshotOptionsSetScaleMethod = (int32_t(*)(ArkUI_SnapshotOptions*, float))dlsym(high_lib_handle, "OH_ArkUI_SnapshotOptions_SetScale");
|
|
76
|
+
getNodeSnapshotMethod = (int32_t(*)(ArkUI_NodeHandle, ArkUI_SnapshotOptions*, OH_PixelmapNative** ))dlsym(high_lib_handle, "OH_ArkUI_GetNodeSnapshot");
|
|
77
|
+
|
|
78
|
+
bool isCreateSnapshotOptionsMethodExisted = createSnapshotOptionsMethod != NULL;
|
|
79
|
+
bool isSnapshotOptionsSetScaleMethodExisted = snapshotOptionsSetScaleMethod != NULL;
|
|
80
|
+
bool isGetNodeSnapshotMethodExisted = getNodeSnapshotMethod != NULL;
|
|
81
|
+
if (isCreateSnapshotOptionsMethodExisted && isSnapshotOptionsSetScaleMethodExisted && isGetNodeSnapshotMethodExisted) {
|
|
82
|
+
DLOG(INFO) << "[svgForeignNode] method existed";
|
|
83
|
+
OH_PixelmapNative *pixelMap;
|
|
84
|
+
ArkUI_SnapshotOptions *options = createSnapshotOptionsMethod();
|
|
85
|
+
snapshotOptionsSetScaleMethod(options, 1);
|
|
86
|
+
int32_t code = getNodeSnapshotMethod(mStackNode.getArkUINodeHandle(), options, &pixelMap);
|
|
87
|
+
if (code == ARKUI_ERROR_CODE_NO_ERROR) {
|
|
88
|
+
dlclose(high_lib_handle);
|
|
89
|
+
return pixelMap;
|
|
90
|
+
}
|
|
80
91
|
}
|
|
81
|
-
|
|
92
|
+
dlclose(high_lib_handle);
|
|
82
93
|
return nullptr;
|
|
83
94
|
}
|
|
84
95
|
|
|
@@ -74,6 +74,11 @@ private:
|
|
|
74
74
|
int _clipRule{0};
|
|
75
75
|
float pointScaleFactor_{0};
|
|
76
76
|
bool _isGeneratedPixelMap{false}; //防止快照生成多次,导致性能影响
|
|
77
|
+
void *high_lib_handle = NULL;
|
|
78
|
+
ArkUI_SnapshotOptions* (*createSnapshotOptionsMethod)();
|
|
79
|
+
int32_t (*snapshotOptionsSetScaleMethod)(ArkUI_SnapshotOptions* snapshotOptions, float scale);
|
|
80
|
+
int32_t (*getNodeSnapshotMethod)(ArkUI_NodeHandle node, ArkUI_SnapshotOptions* snapshotOptions,
|
|
81
|
+
OH_PixelmapNative** pixelmap);
|
|
77
82
|
};
|
|
78
83
|
|
|
79
84
|
} // namespace svg
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-svg",
|
|
3
|
-
"version": "15.12.1-rc.
|
|
3
|
+
"version": "15.12.1-rc.14",
|
|
4
4
|
"description": "",
|
|
5
5
|
"react-native": "src/index",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -46,8 +46,7 @@
|
|
|
46
46
|
"output": "lib",
|
|
47
47
|
"targets": [
|
|
48
48
|
"commonjs",
|
|
49
|
-
"module"
|
|
50
|
-
"typescript"
|
|
49
|
+
"module"
|
|
51
50
|
]
|
|
52
51
|
}
|
|
53
52
|
}
|
package/harmony/svg.har
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../babel.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../example/babel.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hvigorfile.d.ts","sourceRoot":"","sources":["../../../../../example/harmony/entry/hvigorfile.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hvigorfile.d.ts","sourceRoot":"","sources":["../../../../example/harmony/hvigorfile.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../example/index.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../../example/jest.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metro.config.d.ts","sourceRoot":"","sources":["../../../example/metro.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.config.d.ts","sourceRoot":"","sources":["../../../example/react-native.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-build-profile.d.ts","sourceRoot":"","sources":["../../../../example/scripts/create-build-profile.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|