@react-native-ohos/react-native-pager-view 6.2.4-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/harmony/pager_view/LICENSE +21 -0
  4. package/harmony/pager_view/NOTICE +33 -0
  5. package/harmony/pager_view/README.OpenSource +11 -0
  6. package/harmony/pager_view/build-profile.json5 +9 -0
  7. package/harmony/pager_view/consumer-rules.txt +0 -0
  8. package/harmony/pager_view/hvigorfile.ts +6 -0
  9. package/harmony/pager_view/index.ets +26 -0
  10. package/harmony/pager_view/obfuscation-rules.txt +18 -0
  11. package/harmony/pager_view/oh-package.json5 +14 -0
  12. package/harmony/pager_view/src/main/cpp/CMakeLists.txt +9 -0
  13. package/harmony/pager_view/src/main/cpp/RNCViewPagerTurbomodule.cpp +42 -0
  14. package/harmony/pager_view/src/main/cpp/RNCViewPagerTurbomodule.h +37 -0
  15. package/harmony/pager_view/src/main/cpp/SwiperNode.cpp +403 -0
  16. package/harmony/pager_view/src/main/cpp/SwiperNode.h +120 -0
  17. package/harmony/pager_view/src/main/cpp/ViewPagerComponentInstance.cpp +247 -0
  18. package/harmony/pager_view/src/main/cpp/ViewPagerComponentInstance.h +106 -0
  19. package/harmony/pager_view/src/main/cpp/ViewPagerPackage.h +64 -0
  20. package/harmony/pager_view/src/main/cpp/generated/RNOH/generated/BaseReactNativePagerViewPackage.h +70 -0
  21. package/harmony/pager_view/src/main/cpp/generated/RNOH/generated/components/BaseRNCViewPagerComponentInstance.h +16 -0
  22. package/harmony/pager_view/src/main/cpp/generated/RNOH/generated/components/RNCViewPagerJSIBinder.h +41 -0
  23. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/ComponentDescriptors.h +22 -0
  24. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/EventEmitters.cpp +43 -0
  25. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/EventEmitters.h +47 -0
  26. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/Props.cpp +38 -0
  27. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/Props.h +139 -0
  28. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/ShadowNodes.cpp +19 -0
  29. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/ShadowNodes.h +34 -0
  30. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/States.cpp +16 -0
  31. package/harmony/pager_view/src/main/cpp/generated/react/renderer/components/react_native_pager_view/States.h +38 -0
  32. package/harmony/pager_view/src/main/ets/Logger.ets +64 -0
  33. package/harmony/pager_view/src/main/ets/RNCViewPager.ets +281 -0
  34. package/harmony/pager_view/src/main/ets/RNCViewPagerManager.ets +58 -0
  35. package/harmony/pager_view/src/main/ets/ViewPagerModule.ts +34 -0
  36. package/harmony/pager_view/src/main/ets/ViewPagerPackage.ets +57 -0
  37. package/harmony/pager_view/src/main/module.json5 +7 -0
  38. package/harmony/pager_view/src/main/resources/base/element/string.json +8 -0
  39. package/harmony/pager_view/src/main/resources/en_US/element/string.json +8 -0
  40. package/harmony/pager_view/src/main/resources/zh_CN/element/string.json +8 -0
  41. package/harmony/pager_view/ts.ets +26 -0
  42. package/harmony/pager_view.har +0 -0
  43. package/lib/commonjs/PagerView.js +145 -0
  44. package/lib/commonjs/PagerView.js.map +1 -0
  45. package/lib/commonjs/PagerViewNativeComponent.js +14 -0
  46. package/lib/commonjs/PagerViewNativeComponent.js.map +1 -0
  47. package/lib/commonjs/index.js +9 -0
  48. package/lib/commonjs/index.js.map +1 -0
  49. package/lib/commonjs/utils.js +28 -0
  50. package/lib/commonjs/utils.js.map +1 -0
  51. package/lib/module/PagerView.js +138 -0
  52. package/lib/module/PagerView.js.map +1 -0
  53. package/lib/module/PagerViewNativeComponent.js +7 -0
  54. package/lib/module/PagerViewNativeComponent.js.map +1 -0
  55. package/lib/module/index.js +3 -0
  56. package/lib/module/index.js.map +1 -0
  57. package/lib/module/utils.js +20 -0
  58. package/lib/module/utils.js.map +1 -0
  59. package/lib/typescript/PagerView.d.ts +70 -0
  60. package/lib/typescript/PagerViewNativeComponent.d.ts +36 -0
  61. package/lib/typescript/index.d.ts +8 -0
  62. package/lib/typescript/utils.d.ts +2 -0
  63. package/package.json +142 -0
  64. package/src/PagerView.tsx +163 -0
  65. package/src/PagerViewNativeComponent.ts +67 -0
  66. package/src/index.tsx +26 -0
  67. package/src/utils.tsx +19 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Callstack
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/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @react-native-ohos/react-native-pager-view
2
+
3
+ This project is based on [react-native-pager-view@7.0.2](https://github.com/callstack/react-native-pager-view/tree/v7.0.2)
4
+
5
+ ## Documentation
6
+
7
+ [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-pager-view.md)
8
+
9
+ [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-pager-view.md)
10
+
11
+
12
+ ## License
13
+
14
+ This library is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-pager-view/blob/sig/LICENSE).
15
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Callstack
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.
@@ -0,0 +1,33 @@
1
+ OPEN SOURCE SOFTWARE NOTICE
2
+
3
+ Please note we provide an open source software notice for the third party open source software along with this software and/or this software component (in the following just “this SOFTWARE”). The open source software licenses are granted by the respective right holders.
4
+
5
+ Warranty Disclaimer
6
+ THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
7
+
8
+ Copyright Notice and License Texts
9
+
10
+ ----------------------------------------------------------------------
11
+ Software: react-native-pager-view V6.2.2
12
+
13
+ MIT License
14
+
15
+ Copyright (c) 2021 Callstack
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the "Software"), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ [
2
+ {
3
+ "Name": "react-native-pager-view",
4
+ "License": "MIT License",
5
+ "License File": "https://github.com/callstack/react-native-pager-view/blob/master/LICENSE",
6
+ "Version Number": "6.2.2",
7
+ "Owner" : "troZee <hello@callstack.com>",
8
+ "Upstream URL": "https://github.com/callstack/react-native-pager-view",
9
+ "Description": "React Native wrapper for Android, iOS, Harmony ViewPager"
10
+ }
11
+ ]
@@ -0,0 +1,9 @@
1
+ {
2
+ "apiType": "stageMode",
3
+ "targets": [
4
+ {
5
+ "name": "default",
6
+ "runtimeOS": "HarmonyOS"
7
+ }
8
+ ]
9
+ }
File without changes
@@ -0,0 +1,6 @@
1
+ import { harTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 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
+ import { ViewPagerPackage } from './src/main/ets/ViewPagerPackage'
25
+ export default ViewPagerPackage
26
+ export * from './ts'
@@ -0,0 +1,18 @@
1
+ # Define project specific obfuscation rules here.
2
+ # You can include the obfuscation configuration files in the current module's build-profile.json5.
3
+ #
4
+ # For more details, see
5
+ # https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6
+
7
+ # Obfuscation options:
8
+ # -disable-obfuscation: disable all obfuscations
9
+ # -enable-property-obfuscation: obfuscate the property names
10
+ # -enable-toplevel-obfuscation: obfuscate the names in the global scope
11
+ # -compact: remove unnecessary blank spaces and all line feeds
12
+ # -remove-log: remove all console.* statements
13
+ # -print-namecache: print the name cache that contains the mapping from the old names to new names
14
+ # -apply-namecache: reuse the given cache file
15
+
16
+ # Keep options:
17
+ # -keep-property-name: specifies property names that you want to keep
18
+ # -keep-global-name: specifies names that you want to keep in the global scope
@@ -0,0 +1,14 @@
1
+ {
2
+ "license": "Apache-2.0",
3
+ "devDependencies": {
4
+
5
+ },
6
+ "author": "",
7
+ "name": "@react-native-ohos/react-native-pager-view",
8
+ "description": "React Native wrapper for HarmonyOS ViewPager",
9
+ "main": "index.ets",
10
+ "version": "6.2.4-rc.4",
11
+ "dependencies": {
12
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony"
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ cmake_minimum_required(VERSION 3.13)
2
+ set(CMAKE_VERBOSE_MAKEFILE on)
3
+
4
+ set(rnoh_pager_view_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
5
+ file(GLOB_RECURSE rnoh_pager_view_generated_SRC "${rnoh_pager_view_generated_dir}/**/*.cpp")
6
+ file(GLOB rnoh_pager_view_SRC CONFIGURE_DEPENDS *.cpp)
7
+ add_library(rnoh_pager_view SHARED ${rnoh_pager_view_generated_SRC} ${rnoh_pager_view_SRC})
8
+ target_include_directories(rnoh_pager_view PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_pager_view_generated_dir})
9
+ target_link_libraries(rnoh_pager_view PUBLIC rnoh)
@@ -0,0 +1,42 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 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
+ #include "RNCViewPagerTurbomodule.h"
26
+
27
+ using namespace rnoh;
28
+ using namespace facebook;
29
+
30
+ static jsi::Value hostFunction_RNCViewPagerTurbomodule_keyboardDismiss(jsi::Runtime &rt,
31
+ react::TurboModule &turboModule,
32
+ const jsi::Value *args, size_t count)
33
+ {
34
+ return static_cast<ArkTSTurboModule &>(turboModule).call(rt, "keyboardDismiss", args, count);
35
+ }
36
+
37
+ RNCViewPagerTurbomodule::RNCViewPagerTurbomodule(const ArkTSTurboModule::Context ctx,
38
+ const std::string name)
39
+ : ArkTSTurboModule(ctx, name)
40
+ {
41
+ methodMap_["keyboardDismiss"] = MethodMetadata{0, hostFunction_RNCViewPagerTurbomodule_keyboardDismiss};
42
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (C) 2023 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
+ #ifndef RNCVIEWPAGERTURBOMODULE_H
25
+ #define RNCVIEWPAGERTURBOMODULE_H
26
+ #pragma once
27
+
28
+ #include <ReactCommon/TurboModule.h>
29
+ #include "RNOH/ArkTSTurboModule.h"
30
+
31
+ namespace rnoh {
32
+ class JSI_EXPORT RNCViewPagerTurbomodule : public ArkTSTurboModule {
33
+ public:
34
+ RNCViewPagerTurbomodule(const ArkTSTurboModule::Context ctx, const std::string name);
35
+ };
36
+ } // namespace rnoh
37
+ #endif