@react-native-ohos/react-native-image-crop-picker 0.40.4-rc.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.
- package/ COMMITTERS.md +9 -0
- package/.github/FUNDING.yml +1 -0
- package/CODE_OF_CONDUCT.md +0 -0
- package/CONTRIBUTING.md +68 -0
- package/ISSUE_TEMPLATE.md +34 -0
- package/LICENSE +21 -0
- package/OAT.xml +75 -0
- package/README.OpenSource +11 -0
- package/README.md +13 -0
- package/harmony/image_crop_picker/build-profile.json5 +8 -0
- package/harmony/image_crop_picker/hvigorfile.ts +1 -0
- package/harmony/image_crop_picker/index.ets +6 -0
- package/harmony/image_crop_picker/oh-package.json5 +10 -0
- package/harmony/image_crop_picker/src/main/cpp/CMakeLists.txt +9 -0
- package/harmony/image_crop_picker/src/main/cpp/ImageCropPickerPackage.h +19 -0
- package/harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/BaseReactNativeImageCropPickerPackage.h +66 -0
- package/harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/turbo_modules/ImageCropPicker.cpp +20 -0
- package/harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/turbo_modules/ImageCropPicker.h +16 -0
- package/harmony/image_crop_picker/src/main/ets/ImageCropPickerPackage.ts +28 -0
- package/harmony/image_crop_picker/src/main/ets/ImageCropPickerTurboModule.ts +1041 -0
- package/harmony/image_crop_picker/src/main/ets/Logger.ts +38 -0
- package/harmony/image_crop_picker/src/main/ets/generated/components/ts.ts +5 -0
- package/harmony/image_crop_picker/src/main/ets/generated/index.ets +5 -0
- package/harmony/image_crop_picker/src/main/ets/generated/ts.ts +6 -0
- package/harmony/image_crop_picker/src/main/ets/generated/turboModules/ImageCropPicker.ts +30 -0
- package/harmony/image_crop_picker/src/main/ets/generated/turboModules/ts.ts +5 -0
- package/harmony/image_crop_picker/src/main/ets/pages/ImageEditInfo.ets +862 -0
- package/harmony/image_crop_picker/src/main/ets/utils/Constants.ets +14 -0
- package/harmony/image_crop_picker/src/main/ets/utils/CropModel.ets +73 -0
- package/harmony/image_crop_picker/src/main/ets/utils/DecodeAndEncodeUtil.ets +54 -0
- package/harmony/image_crop_picker/src/main/ets/utils/EncodeUtil.ets +33 -0
- package/harmony/image_crop_picker/src/main/ets/utils/jul.ts +7 -0
- package/harmony/image_crop_picker/src/main/ets/utils/types.ets +94 -0
- package/harmony/image_crop_picker/src/main/ets/viewmodel/viewAndModel.ets +38 -0
- package/harmony/image_crop_picker/src/main/module.json5 +9 -0
- package/harmony/image_crop_picker/src/main/resources/base/element/string.json +20 -0
- package/harmony/image_crop_picker/src/main/resources/base/media/ic_anti_clockwise.png +0 -0
- package/harmony/image_crop_picker/src/main/resources/base/media/ic_clockwise.png +0 -0
- package/harmony/image_crop_picker/src/main/resources/base/media/ic_reset.png +0 -0
- package/harmony/image_crop_picker/src/main/resources/base/media/ic_save.png +0 -0
- package/harmony/image_crop_picker/src/main/resources/base/media/icon.png +0 -0
- package/harmony/image_crop_picker/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/image_crop_picker/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/image_crop_picker/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/image_crop_picker/ts.ts +17 -0
- package/harmony/image_crop_picker.har +0 -0
- package/index.d.ts +512 -0
- package/js/NativeRNCImageCropPicker.ts +108 -0
- package/js/index.js +31 -0
- package/package.json +48 -0
- package/svg.svg +122 -0
package/ COMMITTERS.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Committers列表
|
|
2
|
+
## 以下是此项目的committer人员
|
|
3
|
+
不区分先后顺序
|
|
4
|
+
|
|
5
|
+
- [MaDiXin](https://gitee.com/MaDiXin)
|
|
6
|
+
- [xiafeng_xf_admin](https://gitee.com/xiafeng_xf_admin)
|
|
7
|
+
- [chenLixi](https://gitee.com/Louis-C7)
|
|
8
|
+
- [LinJiacheng](https://gitee.com/LLLLLLin)
|
|
9
|
+
- [ZhengJinshou](https://gitee.com/longziz)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
open_collective: react-native-image-crop-picker
|
|
File without changes
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Contribute
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
First, thank you for considering contributing to react-native-image-crop-picker! It's people like you that make the open source community such a great community! 😊
|
|
6
|
+
|
|
7
|
+
We welcome any type of contribution, not only code. You can help with
|
|
8
|
+
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
|
|
9
|
+
- **Marketing**: writing blog posts, howto's, printing stickers, ...
|
|
10
|
+
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
|
|
11
|
+
- **Code**: take a look at the [open issues](https://github.com/ivpusic/react-native-image-crop-picker/issues). Even if you can't write code, commenting on them, showing that you care about a given
|
|
12
|
+
matters. It helps us triage them.
|
|
13
|
+
- **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/react-native-image-crop-picker).
|
|
14
|
+
|
|
15
|
+
## Your First Contribution
|
|
16
|
+
|
|
17
|
+
Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
|
|
18
|
+
|
|
19
|
+
## Submitting code
|
|
20
|
+
|
|
21
|
+
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
|
|
22
|
+
|
|
23
|
+
## Code review process
|
|
24
|
+
|
|
25
|
+
The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
|
|
26
|
+
It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?
|
|
27
|
+
|
|
28
|
+
## Financial contributions
|
|
29
|
+
|
|
30
|
+
We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/react-native-image-crop-picker).
|
|
31
|
+
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
|
|
32
|
+
|
|
33
|
+
## Questions
|
|
34
|
+
|
|
35
|
+
If you have any questions, create an [issue](https://github.com/ivpusic/react-native-image-crop-picker/issues) (protip: do a quick search first to see if someone else didn't ask the same question before!).
|
|
36
|
+
You can also reach us at hello@react-native-image-crop-picker.opencollective.com.
|
|
37
|
+
|
|
38
|
+
## Credits
|
|
39
|
+
|
|
40
|
+
### Contributors
|
|
41
|
+
|
|
42
|
+
Thank you to all the people who have already contributed to react-native-image-crop-picker!
|
|
43
|
+
<a href="graphs/contributors"><img src="https://opencollective.com/react-native-image-crop-picker/contributors.svg?width=890" /></a>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Backers
|
|
47
|
+
|
|
48
|
+
Thank you to all our backers! [[Become a backer](https://opencollective.com/react-native-image-crop-picker#backer)]
|
|
49
|
+
|
|
50
|
+
<a href="https://opencollective.com/react-native-image-crop-picker#backers" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/backers.svg?width=890"></a>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Sponsors
|
|
54
|
+
|
|
55
|
+
Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/react-native-image-crop-picker#sponsor))
|
|
56
|
+
|
|
57
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/0/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/0/avatar.svg"></a>
|
|
58
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/1/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/1/avatar.svg"></a>
|
|
59
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/2/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/2/avatar.svg"></a>
|
|
60
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/3/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/3/avatar.svg"></a>
|
|
61
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/4/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/4/avatar.svg"></a>
|
|
62
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/5/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/5/avatar.svg"></a>
|
|
63
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/6/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/6/avatar.svg"></a>
|
|
64
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/7/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/7/avatar.svg"></a>
|
|
65
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/8/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/8/avatar.svg"></a>
|
|
66
|
+
<a href="https://opencollective.com/react-native-image-crop-picker/sponsor/9/website" target="_blank"><img src="https://opencollective.com/react-native-image-crop-picker/sponsor/9/avatar.svg"></a>
|
|
67
|
+
|
|
68
|
+
<!-- This `CONTRIBUTING.md` is based on @nayafia's template https://github.com/nayafia/contributing-template -->
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
### Version
|
|
2
|
+
Tell us which versions you are using:
|
|
3
|
+
|
|
4
|
+
- react-native-image-crop-picker v0.?.?
|
|
5
|
+
- react-native v0.?.?
|
|
6
|
+
|
|
7
|
+
### Platform
|
|
8
|
+
Tell us to which platform this issue is related
|
|
9
|
+
|
|
10
|
+
- iOS
|
|
11
|
+
- Android
|
|
12
|
+
|
|
13
|
+
### Expected behaviour
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Actual behaviour
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Steps to reproduce
|
|
22
|
+
|
|
23
|
+
1.
|
|
24
|
+
|
|
25
|
+
2.
|
|
26
|
+
|
|
27
|
+
3.
|
|
28
|
+
|
|
29
|
+
### Attachments
|
|
30
|
+
|
|
31
|
+
// stacktrace or any other useful debug info
|
|
32
|
+
|
|
33
|
+
Love react-native-image-crop-picker? Please consider supporting our collective:
|
|
34
|
+
👉 https://opencollective.com/react-native-image-crop-picker/donate
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Ivan Pusic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/OAT.xml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<oatconfig>
|
|
4
|
+
<licensefile>LICENSE</licensefile>
|
|
5
|
+
<policylist>
|
|
6
|
+
<policy name="projectPolicy" desc="">
|
|
7
|
+
<policyitem type="license" name="MIT" path=".*" desc="license under the MIT"/>
|
|
8
|
+
</policy>
|
|
9
|
+
<policy name="projectPolicy" desc="">
|
|
10
|
+
<policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/>
|
|
11
|
+
<policyitem type="compatibility" name="Apache-2.0" path=".*" desc="不影响兼容性"/>
|
|
12
|
+
<policyitem type="compatibility" name="BSDStyleLicense" path=".*" desc="不影响兼容性" />
|
|
13
|
+
<policyitem type="compatibility" name="MIT" path=".*" desc="不影响兼容性" />
|
|
14
|
+
<policyitem type="compatibility" name="GPLStyleLicense" path=".*" desc="不影响兼容性" />
|
|
15
|
+
</policy>
|
|
16
|
+
</policylist>
|
|
17
|
+
<filefilterlist>
|
|
18
|
+
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
19
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不手动修改"/>
|
|
20
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
21
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/turbo_modules/.*" desc="codegen自动生成,不手动修改"/>
|
|
22
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
23
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
24
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/components/.*" desc="codegen自动生成,不手动修改"/>
|
|
25
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/turboMoudules/.*" desc="codegen自动生成,不手动修改"/>
|
|
26
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/test/.*" desc="DevEco Studio自动生成,不手动修改"/>
|
|
27
|
+
<filteritem type="filename" name="*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
|
|
28
|
+
<filteritem type="filename" name="*/*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
|
|
29
|
+
<filteritem type="filename" name="LICENSE" desc="版权文件,不添加版权头"/>
|
|
30
|
+
<filteritem type="filename" name="NOTICE" desc="NOTICE文件,不添加版权头"/>
|
|
31
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
32
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
33
|
+
<filteritem type="filepath" name="src/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
|
|
34
|
+
<filteritem type="filepath" name="index.*" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
|
|
35
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
36
|
+
<filteritem type="filepath" name="hvigor/hvigor-config.json5" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
37
|
+
<filteritem type="filepath" name="js/index.js" desc="js代码源库没加版权头与源库保持一直,以防有修改版权风险"/>
|
|
38
|
+
<filteritem type="filepath" name="js/NativeRNCImageCropPicker.ts" desc="js代码源库没加版权头与源库保持一直,以防有修改版权风险"/>
|
|
39
|
+
</filefilter>
|
|
40
|
+
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
41
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不手动修改"/>
|
|
42
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
43
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/turbo_modules/.*" desc="codegen自动生成,不手动修改"/>
|
|
44
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/cpp/generated/RNOH/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
45
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/.*" desc="codegen自动生成,不手动修改"/>
|
|
46
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/components/.*" desc="codegen自动生成,不手动修改"/>
|
|
47
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/ets/generated/turboMoudules/.*" desc="codegen自动生成,不手动修改"/>
|
|
48
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/test/.*" desc="DevEco Studio自动生成,不手动修改"/>
|
|
49
|
+
<filteritem type="filename" name="*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
|
|
50
|
+
<filteritem type="filename" name="*/*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
|
|
51
|
+
<filteritem type="filename" name="LICENSE" desc="版权文件,不添加许可证头"/>
|
|
52
|
+
<filteritem type="filename" name="NOTICE" desc="NOTICE文件,不添加许可证头"/>
|
|
53
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不添加许可证头"/>
|
|
54
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不添加许可证头"/>
|
|
55
|
+
<filteritem type="filepath" name="src/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
|
|
56
|
+
<filteritem type="filepath" name="index.*" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
|
|
57
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不添加许可证头"/>
|
|
58
|
+
<filteritem type="filepath" name="js/NativeRNCImageCropPicker.ts" desc="与源库保持一致,不添加许可证头"/>
|
|
59
|
+
<filteritem type="filepath" name="js/index.js" desc="与源库保持一致,不添加许可证头"/>
|
|
60
|
+
<filteritem type="filepath" name="hvigor/hvigor-config.json5" desc="工程模板,不添加许可证头,以防有修改版权风险"/>
|
|
61
|
+
</filefilter>
|
|
62
|
+
|
|
63
|
+
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for copyright header policies">
|
|
64
|
+
<filteritem type="filename" name="icon.png" desc="项目工程默认图片文件"/>
|
|
65
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/app_icon.png" desc="项目工程默认图片文件"/>
|
|
66
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/ic_anti_clockwise.png" desc="项目工程默认图片文件"/>
|
|
67
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/ic_clockwise.png" desc="项目工程默认图片文件"/>
|
|
68
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/ic_reset.png" desc="项目工程默认图片文件"/>
|
|
69
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/ic_save.png" desc="项目工程默认图片文件"/>
|
|
70
|
+
<filteritem type="filepath" name="harmony/image_crop_picker/src/main/resources/base/media/.*" desc="项目工程默认图片文件"/>
|
|
71
|
+
<filteritem type="filepath" name="harmony/image_crop_picker.har" desc="项目打包文件"/>
|
|
72
|
+
</filefilter>
|
|
73
|
+
</filefilterlist>
|
|
74
|
+
</oatconfig>
|
|
75
|
+
</configuration>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"Name": "react-native-image-crop-picker",
|
|
4
|
+
"License": "MIT License",
|
|
5
|
+
"License File": "https://github.com/ivpusic/react-native-image-crop-picker/blob/master/LICENSE",
|
|
6
|
+
"Version Number": "0.40.3",
|
|
7
|
+
"Owner" : "xiafeng@huawei.com",
|
|
8
|
+
"Upstream URL": "https://github.com/ivpusic/react-native-image-crop-picker",
|
|
9
|
+
"Description": "Select single or multiple images, with cropping option"
|
|
10
|
+
}
|
|
11
|
+
]
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @react-native-ohos/react-native-image-crop-picker
|
|
2
|
+
|
|
3
|
+
This project is based on [react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker)
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
[中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-image-crop-picker.md)
|
|
8
|
+
|
|
9
|
+
[English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-image-crop-picker.md)
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
|
+
This library is licensed under The [MIT License (MIT)](https://github.com/ivpusic/react-native-image-crop-picker/blob/master/LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { harTasks } from "@ohos/hvigor-ohos-plugin";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
name: '@react-native-ohos/react-native-image-crop-picker',
|
|
3
|
+
"description": "Please describe the basic information.",
|
|
4
|
+
main: 'index.ets',
|
|
5
|
+
type: 'module',
|
|
6
|
+
version: '0.40.4-rc.1',
|
|
7
|
+
dependencies: {
|
|
8
|
+
"@rnoh/react-native-openharmony": "^0.72.38"
|
|
9
|
+
},
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
|
2
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
3
|
+
|
|
4
|
+
set(rnoh_image_crop_picker_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
5
|
+
file(GLOB_RECURSE rnoh_image_crop_picker_generated_SRC "${rnoh_image_crop_picker_generated_dir}/**/*.cpp")
|
|
6
|
+
file(GLOB rnoh_image_crop_picker_SRC CONFIGURE_DEPENDS *.cpp)
|
|
7
|
+
add_library(rnoh_image_crop_picker SHARED ${rnoh_image_crop_picker_SRC} ${rnoh_image_crop_picker_generated_SRC})
|
|
8
|
+
target_include_directories(rnoh_image_crop_picker PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_image_crop_picker_generated_dir} ${CMAKE_CURRENT_SOURCE_DIR}/generated/RNOH/generated)
|
|
9
|
+
target_link_libraries(rnoh_image_crop_picker PUBLIC rnoh)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#ifndef IMAGECROPPICKERPACKAGE_H
|
|
6
|
+
#define IMAGECROPPICKERPACKAGE_H
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#include "generated/RNOH/generated/BaseReactNativeImageCropPickerPackage.h"
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
namespace rnoh {
|
|
14
|
+
class ImageCropPickerPackage : public BaseReactNativeImageCropPickerPackage {
|
|
15
|
+
using Super = BaseReactNativeImageCropPickerPackage;
|
|
16
|
+
using Super::Super;
|
|
17
|
+
};
|
|
18
|
+
} // namespace rnoh
|
|
19
|
+
#endif //IMAGECROPPICKERPACKAGE_H
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "RNOH/Package.h"
|
|
8
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
9
|
+
#include "RNOH/generated/turbo_modules/ImageCropPicker.h"
|
|
10
|
+
|
|
11
|
+
namespace rnoh {
|
|
12
|
+
|
|
13
|
+
class BaseReactNativeImageCropPickerPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
14
|
+
public:
|
|
15
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
16
|
+
if (name == "ImageCropPicker") {
|
|
17
|
+
return std::make_shared<ImageCropPicker>(ctx, name);
|
|
18
|
+
}
|
|
19
|
+
return nullptr;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
class BaseReactNativeImageCropPickerPackageEventEmitRequestHandler : public EventEmitRequestHandler {
|
|
24
|
+
public:
|
|
25
|
+
void handleEvent(Context const &ctx) override {
|
|
26
|
+
auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
|
|
27
|
+
if (eventEmitter == nullptr) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::vector<std::string> supportedEventNames = {
|
|
32
|
+
};
|
|
33
|
+
if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
|
|
34
|
+
eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class BaseReactNativeImageCropPickerPackage : public Package {
|
|
41
|
+
public:
|
|
42
|
+
BaseReactNativeImageCropPickerPackage(Package::Context ctx) : Package(ctx){};
|
|
43
|
+
|
|
44
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
45
|
+
return std::make_unique<BaseReactNativeImageCropPickerPackageTurboModuleFactoryDelegate>();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
|
49
|
+
return {
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ComponentJSIBinderByString createComponentJSIBinderByName() override {
|
|
54
|
+
return {
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
|
59
|
+
return {
|
|
60
|
+
std::make_shared<BaseReactNativeImageCropPickerPackageEventEmitRequestHandler>(),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace rnoh
|
|
66
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include "ImageCropPicker.h"
|
|
6
|
+
|
|
7
|
+
namespace rnoh {
|
|
8
|
+
using namespace facebook;
|
|
9
|
+
|
|
10
|
+
ImageCropPicker::ImageCropPicker(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
|
|
11
|
+
methodMap_ = {
|
|
12
|
+
ARK_ASYNC_METHOD_METADATA(openPicker, 1),
|
|
13
|
+
ARK_ASYNC_METHOD_METADATA(openCamera, 1),
|
|
14
|
+
ARK_ASYNC_METHOD_METADATA(openCropper, 1),
|
|
15
|
+
ARK_ASYNC_METHOD_METADATA(clean, 0),
|
|
16
|
+
ARK_ASYNC_METHOD_METADATA(cleanSingle, 1),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
8
|
+
|
|
9
|
+
namespace rnoh {
|
|
10
|
+
|
|
11
|
+
class JSI_EXPORT ImageCropPicker : public ArkTSTurboModule {
|
|
12
|
+
public:
|
|
13
|
+
ImageCropPicker(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
|
|
6
|
+
import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
|
|
7
|
+
import { ImageCropPickerTurboModule } from './ImageCropPickerTurboModule';
|
|
8
|
+
|
|
9
|
+
class ImageCropPickerTurboModulesFactory extends TurboModulesFactory {
|
|
10
|
+
|
|
11
|
+
createTurboModule(name: string): TurboModule | null {
|
|
12
|
+
if (name === 'ImageCropPicker') {
|
|
13
|
+
return new ImageCropPickerTurboModule(this.ctx);
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
hasTurboModule(name: string): boolean {
|
|
19
|
+
return name === 'ImageCropPicker';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ImageCropPickerPackage extends RNPackage {
|
|
25
|
+
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
26
|
+
return new ImageCropPickerTurboModulesFactory(ctx);
|
|
27
|
+
}
|
|
28
|
+
}
|