@react-native-ohos/react-native-clippathview 1.2.1-beta.1 → 1.3.0-beta.1

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.
@@ -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 = '1.2.1-beta.1';
4
+ export const HAR_VERSION = '1.3.0-beta.1';
5
5
  export const BUILD_MODE_NAME = 'debug';
6
6
  export const DEBUG = true;
7
7
  export const TARGET_NAME = 'default';
@@ -12,4 +12,6 @@
12
12
  * See the License for the specific language governing permissions and
13
13
  * limitations under the License.
14
14
  */
15
+ import { ClipPathPackage } from './src/main/ets/ClipPathPackage'
16
+ export default ClipPathPackage;
15
17
  export * from './ts'
@@ -6,7 +6,7 @@
6
6
  "name": "@react-native-ohos/react-native-clippathview",
7
7
  "description": "Please describe the basic information.",
8
8
  "main": "index.ets",
9
- "version": "1.2.1-beta.1",
9
+ "version": "1.3.0-beta.1",
10
10
  "dependencies": {
11
11
  "@rnoh/react-native-openharmony": "file:../react_native_openharmony"
12
12
  },
@@ -4,6 +4,21 @@
4
4
  // Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
5
5
  // please include "napi/native_api.h".
6
6
 
7
+ /*
8
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
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,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+
7
22
  #pragma once
8
23
  #include "ModUtil.h"
9
24
  #include <native_drawing/drawing_path.h>
@@ -3,7 +3,20 @@
3
3
  //
4
4
  // Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
5
5
  // please include "napi/native_api.h".
6
-
6
+ /*
7
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
7
20
  #include "ModUtil.h"
8
21
  #include "RNOH/arkui/NativeNodeApi.h"
9
22
  #include "ClipPathViewNoneNode.h"
@@ -107,8 +120,8 @@ void ClipPathViewNoneNode::setPanStyleMode(OH_Drawing_Canvas *canvas, int type)
107
120
 
108
121
  void ClipPathViewNoneNode::OnDraw(ArkUI_NodeCustomEvent *event) {
109
122
  if (mD.empty()) {
110
- return;
111
- }
123
+ return;
124
+ }
112
125
  auto *drawContext = OH_ArkUI_NodeCustomEvent_GetDrawContextInDraw(event);
113
126
  canvas = reinterpret_cast<OH_Drawing_Canvas *>(OH_ArkUI_DrawContext_GetCanvas(drawContext));
114
127
  auto width_ = OH_Drawing_CanvasGetWidth(canvas);
@@ -3,6 +3,20 @@
3
3
  //
4
4
  // Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
5
5
  // please include "napi/native_api.h".
6
+ /*
7
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
6
20
  #pragma once
7
21
 
8
22
  #include "RNOH/arkui/ArkUINode.h"
@@ -61,9 +61,9 @@ namespace rnoh {
61
61
 
62
62
  std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
63
63
  return {
64
- facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewNoneComponentDescriptor>(),
65
- facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewComponentDescriptor>()
66
- };
64
+ facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewNoneComponentDescriptor>(),
65
+ facebook::react::concreteComponentDescriptorProvider<facebook::react::RNCClipPathViewComponentDescriptor>()
66
+ };
67
67
  }
68
68
 
69
69
  std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
@@ -4,6 +4,20 @@
4
4
  // Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
5
5
  // please include "napi/native_api.h".
6
6
 
7
+ /*
8
+ * Copyright (C) 2022 Huawei Device Co., Ltd.
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
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,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
7
21
  typedef enum {
8
22
  CLIP_PEN_STYLE_FILL = 1 << 0,
9
23
  CLIP_PEN_STYLE_STROKE = 1 << 1,
@@ -22,7 +22,8 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
25
+ import { TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
26
+ import { RNOHPackage } from '@rnoh/react-native-openharmony'
26
27
  import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
27
28
  import { ClipPathTurboModule } from './ClipPathTurboModule';
28
29
 
@@ -39,7 +40,7 @@ class ClipPathTurboModulesFactory extends TurboModulesFactory {
39
40
  }
40
41
  }
41
42
 
42
- export class ClipPathPackage extends RNPackage {
43
+ export class ClipPathPackage extends RNOHPackage {
43
44
  createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
44
45
  return new ClipPathTurboModulesFactory(ctx);
45
46
  }
@@ -22,10 +22,14 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { TurboModule } from "@rnoh/react-native-openharmony/ts";
25
+ import { TurboModule, TurboModuleContext } from "@rnoh/react-native-openharmony/ts";
26
26
  import display from '@ohos.display';
27
27
 
28
28
  export class ClipPathTurboModule extends TurboModule {
29
+ constructor(ctx: TurboModuleContext) {
30
+ super(ctx);
31
+ }
32
+
29
33
  getDensity(): number {
30
34
  return display.getDefaultDisplaySync().densityPixels;
31
35
  }
Binary file
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import ClipPathViewNoneHarmony from './src/ClipPathH.harmony.js'
2
- import ClipPathViewHarmony from './src/ClipPath.harmony.js'
3
- export const ClipPathView = ClipPathViewHarmony;
4
- export const ClipPathViewH = ClipPathViewNoneHarmony;
1
+ import {Platfotm} from 'react-native'
2
+ import ClipPathViewNoneAndroid from './src/ClipPathH.android.js'
3
+ import ClipPathViewAndroid from './src/ClipPath.android.js'
4
+ export const ClipPathView = ClipPathViewAndroid;
5
+ export const ClipPathViewH = ClipPathViewNoneAndroid;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-clippathview",
3
3
  "title": "React Native ClipPath",
4
- "version": "1.2.1-beta.1",
4
+ "version": "1.3.0-beta.1",
5
5
  "description": "ClipPath Android Web IOS Harmony",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
@@ -55,6 +55,12 @@
55
55
  "svgpath": "^2.3.1"
56
56
  },
57
57
  "harmony": {
58
- "alias": "react-native-clippathview"
58
+ "alias": "react-native-clippathview",
59
+ "autolinking": {
60
+ "etsPackageClassName":"ClipPathPackage",
61
+ "cppPackageClassName":"ClipPathViewPackage",
62
+ "cmakeLibraryTargetName": "rnoh_clip_path",
63
+ "ohPackageName": "@react-native-ohos/react-native-clippathview"
64
+ }
59
65
  }
60
66
  }
@@ -1,29 +0,0 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (C) 2026 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import ClipPathMobileN from './ClipPathMobileN'
26
-
27
- const ClipPath = ClipPathMobileN
28
-
29
- export default ClipPath
@@ -1,29 +0,0 @@
1
- /**
2
- * MIT License
3
- *
4
- * Copyright (C) 2026 Huawei Device Co., Ltd.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import ClipPathMobile from './ClipPathMobile'
26
-
27
- const ClipPathH = ClipPathMobile
28
-
29
- export default ClipPathH
File without changes