react-native-list 1.0.1 → 2.0.0-alpha.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/README.md +188 -32
- package/ReactNativeList.podspec +39 -0
- package/android/CMakeLists.txt +48 -0
- package/android/build.gradle +151 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/JHybridUiListModule.cpp +192 -0
- package/android/src/main/cpp/JHybridUiListModule.h +50 -0
- package/android/src/main/cpp/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/hannojg/reactnativelist/ReactNativeListPackage.kt +27 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridNativeListDataSource.kt +146 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridNativeListLayout.kt +86 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridUiListModule.kt +116 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridUiListView.kt +410 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridViewHolder.kt +9 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/NativeListAdapter.kt +217 -0
- package/ios/DataSource/HybridNativeListDataSource.swift +213 -0
- package/ios/HybridObjects/HybridUiListModule.swift +49 -0
- package/ios/HybridObjects/HybridViewHolder.swift +16 -0
- package/ios/Layout/HybridNativeListLayout.swift +128 -0
- package/ios/Utils/ErrorUtils.h +26 -0
- package/ios/Utils/HybridIOSWorkletsModuleProxyHolder.swift +10 -0
- package/ios/Utils/SurfaceHelper.h +20 -0
- package/ios/Utils/SurfaceHelper.mm +144 -0
- package/ios/Utils/SurfacePresenterRegistry.h +17 -0
- package/ios/Utils/SurfacePresenterRegistry.m +31 -0
- package/ios/Utils/TurboModuleInstaller.h +18 -0
- package/ios/Utils/TurboModuleInstaller.mm +267 -0
- package/ios/Views/HostCell.swift +216 -0
- package/ios/Views/HybridUiListView.swift +695 -0
- package/metro/RendererProxyThreadSwitch.js +66 -0
- package/metro-config.d.ts +1 -0
- package/metro-config.js +52 -0
- package/nitro.json +47 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/ReactNativeList+autolinking.cmake +99 -0
- package/nitrogen/generated/android/ReactNativeList+autolinking.gradle +27 -0
- package/nitrogen/generated/android/ReactNativeListOnLoad.cpp +156 -0
- package/nitrogen/generated/android/ReactNativeListOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_bool_NativeListItem_NativeListItem.hpp +83 -0
- package/nitrogen/generated/android/c++/JFunc_bool_double_NativeListItem_double.hpp +83 -0
- package/nitrogen/generated/android/c++/JFunc_double_std__string.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridIOSWorkletsModuleProxyHolderSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridIOSWorkletsModuleProxyHolderSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridNativeLinearListLayoutSpec.cpp +63 -0
- package/nitrogen/generated/android/c++/JHybridNativeLinearListLayoutSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNativeListDataSourceSpec.cpp +101 -0
- package/nitrogen/generated/android/c++/JHybridNativeListDataSourceSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JHybridNativeListLayoutSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridNativeListLayoutSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridUiListModuleSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridUiListModuleSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridUiListViewSpec.cpp +92 -0
- package/nitrogen/generated/android/c++/JHybridUiListViewSpec.hpp +67 -0
- package/nitrogen/generated/android/c++/JHybridViewHolderSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridViewHolderSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JNativeItemSizeEstimate.hpp +61 -0
- package/nitrogen/generated/android/c++/JNativeLinearListLayoutConfig.hpp +81 -0
- package/nitrogen/generated/android/c++/JNativeLinearListLayoutIOSConfig.hpp +59 -0
- package/nitrogen/generated/android/c++/JNativeListItem.hpp +76 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.hpp +72 -0
- package/nitrogen/generated/android/c++/views/JHybridUiListViewStateUpdater.cpp +53 -0
- package/nitrogen/generated/android/c++/views/JHybridUiListViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridViewHolderStateUpdater.cpp +53 -0
- package/nitrogen/generated/android/c++/views/JHybridViewHolderStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_bool_NativeListItem_NativeListItem.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_bool_double_NativeListItem_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_double_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridIOSWorkletsModuleProxyHolderSpec.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeLinearListLayoutSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeListDataSourceSpec.kt +87 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeListLayoutSpec.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridUiListModuleSpec.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridUiListViewSpec.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridViewHolderSpec.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeItemSizeEstimate.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeLinearListLayoutConfig.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeLinearListLayoutIOSConfig.kt +51 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeListItem.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/ReactNativeListOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Variant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridUiListViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridUiListViewStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridViewHolderManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridViewHolderStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/ReactNativeList+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Bridge.cpp +162 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Bridge.hpp +368 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Umbrella.hpp +92 -0
- package/nitrogen/generated/ios/ReactNativeListAutolinking.mm +83 -0
- package/nitrogen/generated/ios/ReactNativeListAutolinking.swift +86 -0
- package/nitrogen/generated/ios/c++/HybridIOSWorkletsModuleProxyHolderSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridIOSWorkletsModuleProxyHolderSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/HybridNativeLinearListLayoutSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeLinearListLayoutSpecSwift.hpp +92 -0
- package/nitrogen/generated/ios/c++/HybridNativeListDataSourceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeListDataSourceSpecSwift.hpp +132 -0
- package/nitrogen/generated/ios/c++/HybridNativeListLayoutSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeListLayoutSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/HybridUiListModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridUiListModuleSpecSwift.hpp +93 -0
- package/nitrogen/generated/ios/c++/HybridUiListViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridUiListViewSpecSwift.hpp +121 -0
- package/nitrogen/generated/ios/c++/HybridViewHolderSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridViewHolderSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/views/HybridUiListViewComponent.mm +118 -0
- package/nitrogen/generated/ios/c++/views/HybridViewHolderComponent.mm +118 -0
- package/nitrogen/generated/ios/swift/Func_bool_NativeListItem_NativeListItem.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_bool_double_NativeListItem_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_double_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridIOSWorkletsModuleProxyHolderSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridIOSWorkletsModuleProxyHolderSpec_cxx.swift +128 -0
- package/nitrogen/generated/ios/swift/HybridNativeLinearListLayoutSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNativeLinearListLayoutSpec_cxx.swift +140 -0
- package/nitrogen/generated/ios/swift/HybridNativeListDataSourceSpec.swift +62 -0
- package/nitrogen/generated/ios/swift/HybridNativeListDataSourceSpec_cxx.swift +222 -0
- package/nitrogen/generated/ios/swift/HybridNativeListLayoutSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNativeListLayoutSpec_cxx.swift +128 -0
- package/nitrogen/generated/ios/swift/HybridUiListModuleSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridUiListModuleSpec_cxx.swift +175 -0
- package/nitrogen/generated/ios/swift/HybridUiListViewSpec.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridUiListViewSpec_cxx.swift +227 -0
- package/nitrogen/generated/ios/swift/HybridViewHolderSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridViewHolderSpec_cxx.swift +147 -0
- package/nitrogen/generated/ios/swift/NativeItemSizeEstimate.swift +60 -0
- package/nitrogen/generated/ios/swift/NativeLinearListLayoutConfig.swift +60 -0
- package/nitrogen/generated/ios/swift/NativeLinearListLayoutIOSConfig.swift +35 -0
- package/nitrogen/generated/ios/swift/NativeListItem.swift +75 -0
- package/nitrogen/generated/ios/swift/Variant_NullType__any_HybridIOSWorkletsModuleProxyHolderSpec_.swift +30 -0
- package/nitrogen/generated/shared/c++/HybridIOSWorkletsModuleProxyHolderSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridIOSWorkletsModuleProxyHolderSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNativeLinearListLayoutSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNativeLinearListLayoutSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridNativeListDataSourceSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridNativeListDataSourceSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridNativeListLayoutSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNativeListLayoutSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridUiListModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridUiListModuleSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridUiListViewSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridUiListViewSpec.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridUiManagerHelperSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridUiManagerHelperSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridViewHolderSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridViewHolderSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/NativeItemSizeEstimate.hpp +87 -0
- package/nitrogen/generated/shared/c++/NativeLinearListLayoutConfig.hpp +105 -0
- package/nitrogen/generated/shared/c++/NativeLinearListLayoutIOSConfig.hpp +85 -0
- package/nitrogen/generated/shared/c++/NativeListItem.hpp +101 -0
- package/nitrogen/generated/shared/c++/views/HybridUiListViewComponent.cpp +72 -0
- package/nitrogen/generated/shared/c++/views/HybridUiListViewComponent.hpp +109 -0
- package/nitrogen/generated/shared/c++/views/HybridViewHolderComponent.cpp +72 -0
- package/nitrogen/generated/shared/c++/views/HybridViewHolderComponent.hpp +109 -0
- package/nitrogen/generated/shared/json/UiListViewConfig.json +9 -0
- package/nitrogen/generated/shared/json/ViewHolderConfig.json +9 -0
- package/package.json +152 -5
- package/react-native.config.js +16 -0
- package/src/ListDataSource.ts +232 -0
- package/src/ListLayout.ts +95 -0
- package/src/UiListModule.ts +5 -0
- package/src/hooks/useChangeEffect.ts +50 -0
- package/src/index.tsx +49 -0
- package/src/privateGlobals.ts +20 -0
- package/src/renderer/fabric/RenderHelper.ts +29 -0
- package/src/renderer/fabric/UiManagerHelper.ts +5 -0
- package/src/renderer/react/ReactFabricMirror.bundle.js +1984 -0
- package/src/renderer/react/ReactFabricMirror.ts +766 -0
- package/src/renderer/react/ReactFabricRenderer.ts +11 -0
- package/src/specs/IOSWorkletsModuleProxyHolder.nitro.ts +6 -0
- package/src/specs/NativeLinearListLayout.nitro.ts +23 -0
- package/src/specs/NativeListDataSource.nitro.ts +28 -0
- package/src/specs/NativeListLayout.nitro.ts +6 -0
- package/src/specs/UIListModule.nitro.ts +13 -0
- package/src/specs/UIManagerHelper.nitro.ts +34 -0
- package/src/specs/UiListView.nitro.ts +31 -0
- package/src/specs/ViewHolder.nitro.ts +11 -0
- package/src/views/List.tsx +525 -0
- package/src/views/UiListHostComponent.ts +8 -0
- package/FillRateHelper.js +0 -179
- package/FlatList.js +0 -494
- package/LICENSE.md +0 -31
- package/MetroListView.js +0 -166
- package/SectionList.js +0 -291
- package/ViewabilityHelper.js +0 -260
- package/VirtualizeUtils.js +0 -163
- package/VirtualizedList.js +0 -861
- package/VirtualizedSectionList.js +0 -397
- package/index.js +0 -5
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeListItem.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <optional>
|
|
35
|
+
#include <NitroModules/AnyMap.hpp>
|
|
36
|
+
|
|
37
|
+
namespace margelo::nitro::reactnativelist {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A struct which can be represented as a JavaScript object (NativeListItem).
|
|
41
|
+
*/
|
|
42
|
+
struct NativeListItem final {
|
|
43
|
+
public:
|
|
44
|
+
std::string key SWIFT_PRIVATE;
|
|
45
|
+
std::string type SWIFT_PRIVATE;
|
|
46
|
+
std::optional<double> width SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> height SWIFT_PRIVATE;
|
|
48
|
+
std::shared_ptr<AnyMap> data SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
NativeListItem() = default;
|
|
52
|
+
explicit NativeListItem(std::string key, std::string type, std::optional<double> width, std::optional<double> height, std::shared_ptr<AnyMap> data): key(key), type(type), width(width), height(height), data(data) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const NativeListItem& lhs, const NativeListItem& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::reactnativelist
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ NativeListItem <> JS NativeListItem (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::reactnativelist::NativeListItem> final {
|
|
65
|
+
static inline margelo::nitro::reactnativelist::NativeListItem fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::reactnativelist::NativeListItem(
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "key"))),
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
70
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width"))),
|
|
71
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height"))),
|
|
72
|
+
JSIConverter<std::shared_ptr<AnyMap>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "data")))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativelist::NativeListItem& arg) {
|
|
76
|
+
jsi::Object obj(runtime);
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "key"), JSIConverter<std::string>::toJSI(runtime, arg.key));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<std::string>::toJSI(runtime, arg.type));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "width"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.width));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "height"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.height));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "data"), JSIConverter<std::shared_ptr<AnyMap>>::toJSI(runtime, arg.data));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "key")))) return false;
|
|
93
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width")))) return false;
|
|
95
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))) return false;
|
|
96
|
+
if (!JSIConverter<std::shared_ptr<AnyMap>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "data")))) return false;
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridUiListViewComponent.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridUiListViewComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
16
|
+
#include <react/renderer/core/RawValue.h>
|
|
17
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
18
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
19
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::reactnativelist::views {
|
|
22
|
+
|
|
23
|
+
extern const char HybridUiListViewComponentName[] = "UiListView";
|
|
24
|
+
|
|
25
|
+
HybridUiListViewProps::HybridUiListViewProps(const react::PropsParserContext& context,
|
|
26
|
+
const HybridUiListViewProps& sourceProps,
|
|
27
|
+
const react::RawProps& rawProps):
|
|
28
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
29
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridUiListViewSpec>& /* ref */)>>> {
|
|
30
|
+
try {
|
|
31
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
32
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
33
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
34
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridUiListViewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.hybridRef);
|
|
35
|
+
} catch (const std::exception& exc) {
|
|
36
|
+
throw std::runtime_error(std::string("UiListView.hybridRef: ") + exc.what());
|
|
37
|
+
}
|
|
38
|
+
}()) { }
|
|
39
|
+
|
|
40
|
+
bool HybridUiListViewProps::filterObjectKeys(const std::string& propName) {
|
|
41
|
+
switch (hashString(propName)) {
|
|
42
|
+
case hashString("hybridRef"): return true;
|
|
43
|
+
default: return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
HybridUiListViewComponentDescriptor::HybridUiListViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
48
|
+
: ConcreteComponentDescriptor(parameters,
|
|
49
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
50
|
+
|
|
51
|
+
std::shared_ptr<const react::Props> HybridUiListViewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
52
|
+
const std::shared_ptr<const react::Props>& props,
|
|
53
|
+
react::RawProps rawProps) const {
|
|
54
|
+
// 1. Prepare raw props parser
|
|
55
|
+
rawProps.parse(rawPropsParser_);
|
|
56
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
57
|
+
return HybridUiListViewShadowNode::Props(context, /* & */ rawProps, props);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#ifdef ANDROID
|
|
61
|
+
void HybridUiListViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
62
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
63
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
64
|
+
auto& concreteShadowNode = static_cast<HybridUiListViewShadowNode&>(shadowNode);
|
|
65
|
+
const std::shared_ptr<const HybridUiListViewProps>& constProps = concreteShadowNode.getConcreteSharedProps();
|
|
66
|
+
const std::shared_ptr<HybridUiListViewProps>& props = std::const_pointer_cast<HybridUiListViewProps>(constProps);
|
|
67
|
+
HybridUiListViewState state{props};
|
|
68
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
69
|
+
}
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::reactnativelist::views
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridUiListViewComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <optional>
|
|
11
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
12
|
+
#include <NitroModules/NitroHash.hpp>
|
|
13
|
+
#include <NitroModules/CachedProp.hpp>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
18
|
+
|
|
19
|
+
#include <memory>
|
|
20
|
+
#include "HybridUiListViewSpec.hpp"
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <optional>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::reactnativelist::views {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The name of the actual native View.
|
|
30
|
+
*/
|
|
31
|
+
extern const char HybridUiListViewComponentName[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for the "UiListView" View.
|
|
35
|
+
*/
|
|
36
|
+
class HybridUiListViewProps final: public react::ViewProps {
|
|
37
|
+
public:
|
|
38
|
+
HybridUiListViewProps() = default;
|
|
39
|
+
HybridUiListViewProps(const react::PropsParserContext& context,
|
|
40
|
+
const HybridUiListViewProps& sourceProps,
|
|
41
|
+
const react::RawProps& rawProps);
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridUiListViewSpec>& /* ref */)>>> hybridRef;
|
|
45
|
+
|
|
46
|
+
private:
|
|
47
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* State for the "UiListView" View.
|
|
52
|
+
*/
|
|
53
|
+
class HybridUiListViewState final {
|
|
54
|
+
public:
|
|
55
|
+
HybridUiListViewState() = default;
|
|
56
|
+
explicit HybridUiListViewState(const std::shared_ptr<HybridUiListViewProps>& props):
|
|
57
|
+
_props(props) {}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
[[nodiscard]]
|
|
61
|
+
const std::shared_ptr<HybridUiListViewProps>& getProps() const {
|
|
62
|
+
return _props;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
#ifdef ANDROID
|
|
67
|
+
HybridUiListViewState(const HybridUiListViewState& /* previousState */, folly::dynamic /* data */) {}
|
|
68
|
+
folly::dynamic getDynamic() const {
|
|
69
|
+
throw std::runtime_error("HybridUiListViewState does not support folly!");
|
|
70
|
+
}
|
|
71
|
+
react::MapBuffer getMapBuffer() const {
|
|
72
|
+
throw std::runtime_error("HybridUiListViewState does not support MapBuffer!");
|
|
73
|
+
};
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
std::shared_ptr<HybridUiListViewProps> _props;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The Shadow Node for the "UiListView" View.
|
|
82
|
+
*/
|
|
83
|
+
using HybridUiListViewShadowNode = react::ConcreteViewShadowNode<HybridUiListViewComponentName /* "HybridUiListView" */,
|
|
84
|
+
HybridUiListViewProps /* custom props */,
|
|
85
|
+
react::ViewEventEmitter /* default */,
|
|
86
|
+
HybridUiListViewState /* custom state */>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The Component Descriptor for the "UiListView" View.
|
|
90
|
+
*/
|
|
91
|
+
class HybridUiListViewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridUiListViewShadowNode> {
|
|
92
|
+
public:
|
|
93
|
+
explicit HybridUiListViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
94
|
+
|
|
95
|
+
public:
|
|
96
|
+
/**
|
|
97
|
+
* A faster path for cloning props - reuses the caching logic from `HybridUiListViewProps`.
|
|
98
|
+
*/
|
|
99
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
100
|
+
const std::shared_ptr<const react::Props>& props,
|
|
101
|
+
react::RawProps rawProps) const override;
|
|
102
|
+
#ifdef ANDROID
|
|
103
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
104
|
+
#endif
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/* The actual view for "UiListView" needs to be implemented in platform-specific code. */
|
|
108
|
+
|
|
109
|
+
} // namespace margelo::nitro::reactnativelist::views
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridViewHolderComponent.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridViewHolderComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
16
|
+
#include <react/renderer/core/RawValue.h>
|
|
17
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
18
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
19
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::reactnativelist::views {
|
|
22
|
+
|
|
23
|
+
extern const char HybridViewHolderComponentName[] = "ViewHolder";
|
|
24
|
+
|
|
25
|
+
HybridViewHolderProps::HybridViewHolderProps(const react::PropsParserContext& context,
|
|
26
|
+
const HybridViewHolderProps& sourceProps,
|
|
27
|
+
const react::RawProps& rawProps):
|
|
28
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
29
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridViewHolderSpec>& /* ref */)>>> {
|
|
30
|
+
try {
|
|
31
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
32
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
33
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
34
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridViewHolderSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.hybridRef);
|
|
35
|
+
} catch (const std::exception& exc) {
|
|
36
|
+
throw std::runtime_error(std::string("ViewHolder.hybridRef: ") + exc.what());
|
|
37
|
+
}
|
|
38
|
+
}()) { }
|
|
39
|
+
|
|
40
|
+
bool HybridViewHolderProps::filterObjectKeys(const std::string& propName) {
|
|
41
|
+
switch (hashString(propName)) {
|
|
42
|
+
case hashString("hybridRef"): return true;
|
|
43
|
+
default: return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
HybridViewHolderComponentDescriptor::HybridViewHolderComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
48
|
+
: ConcreteComponentDescriptor(parameters,
|
|
49
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
50
|
+
|
|
51
|
+
std::shared_ptr<const react::Props> HybridViewHolderComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
52
|
+
const std::shared_ptr<const react::Props>& props,
|
|
53
|
+
react::RawProps rawProps) const {
|
|
54
|
+
// 1. Prepare raw props parser
|
|
55
|
+
rawProps.parse(rawPropsParser_);
|
|
56
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
57
|
+
return HybridViewHolderShadowNode::Props(context, /* & */ rawProps, props);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#ifdef ANDROID
|
|
61
|
+
void HybridViewHolderComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
62
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
63
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
64
|
+
auto& concreteShadowNode = static_cast<HybridViewHolderShadowNode&>(shadowNode);
|
|
65
|
+
const std::shared_ptr<const HybridViewHolderProps>& constProps = concreteShadowNode.getConcreteSharedProps();
|
|
66
|
+
const std::shared_ptr<HybridViewHolderProps>& props = std::const_pointer_cast<HybridViewHolderProps>(constProps);
|
|
67
|
+
HybridViewHolderState state{props};
|
|
68
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
69
|
+
}
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::reactnativelist::views
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridViewHolderComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <optional>
|
|
11
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
12
|
+
#include <NitroModules/NitroHash.hpp>
|
|
13
|
+
#include <NitroModules/CachedProp.hpp>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
18
|
+
|
|
19
|
+
#include <memory>
|
|
20
|
+
#include "HybridViewHolderSpec.hpp"
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <optional>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::reactnativelist::views {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The name of the actual native View.
|
|
30
|
+
*/
|
|
31
|
+
extern const char HybridViewHolderComponentName[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for the "ViewHolder" View.
|
|
35
|
+
*/
|
|
36
|
+
class HybridViewHolderProps final: public react::ViewProps {
|
|
37
|
+
public:
|
|
38
|
+
HybridViewHolderProps() = default;
|
|
39
|
+
HybridViewHolderProps(const react::PropsParserContext& context,
|
|
40
|
+
const HybridViewHolderProps& sourceProps,
|
|
41
|
+
const react::RawProps& rawProps);
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridViewHolderSpec>& /* ref */)>>> hybridRef;
|
|
45
|
+
|
|
46
|
+
private:
|
|
47
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* State for the "ViewHolder" View.
|
|
52
|
+
*/
|
|
53
|
+
class HybridViewHolderState final {
|
|
54
|
+
public:
|
|
55
|
+
HybridViewHolderState() = default;
|
|
56
|
+
explicit HybridViewHolderState(const std::shared_ptr<HybridViewHolderProps>& props):
|
|
57
|
+
_props(props) {}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
[[nodiscard]]
|
|
61
|
+
const std::shared_ptr<HybridViewHolderProps>& getProps() const {
|
|
62
|
+
return _props;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
#ifdef ANDROID
|
|
67
|
+
HybridViewHolderState(const HybridViewHolderState& /* previousState */, folly::dynamic /* data */) {}
|
|
68
|
+
folly::dynamic getDynamic() const {
|
|
69
|
+
throw std::runtime_error("HybridViewHolderState does not support folly!");
|
|
70
|
+
}
|
|
71
|
+
react::MapBuffer getMapBuffer() const {
|
|
72
|
+
throw std::runtime_error("HybridViewHolderState does not support MapBuffer!");
|
|
73
|
+
};
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
std::shared_ptr<HybridViewHolderProps> _props;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The Shadow Node for the "ViewHolder" View.
|
|
82
|
+
*/
|
|
83
|
+
using HybridViewHolderShadowNode = react::ConcreteViewShadowNode<HybridViewHolderComponentName /* "HybridViewHolder" */,
|
|
84
|
+
HybridViewHolderProps /* custom props */,
|
|
85
|
+
react::ViewEventEmitter /* default */,
|
|
86
|
+
HybridViewHolderState /* custom state */>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The Component Descriptor for the "ViewHolder" View.
|
|
90
|
+
*/
|
|
91
|
+
class HybridViewHolderComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridViewHolderShadowNode> {
|
|
92
|
+
public:
|
|
93
|
+
explicit HybridViewHolderComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
94
|
+
|
|
95
|
+
public:
|
|
96
|
+
/**
|
|
97
|
+
* A faster path for cloning props - reuses the caching logic from `HybridViewHolderProps`.
|
|
98
|
+
*/
|
|
99
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
100
|
+
const std::shared_ptr<const react::Props>& props,
|
|
101
|
+
react::RawProps rawProps) const override;
|
|
102
|
+
#ifdef ANDROID
|
|
103
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
104
|
+
#endif
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/* The actual view for "ViewHolder" needs to be implemented in platform-specific code. */
|
|
108
|
+
|
|
109
|
+
} // namespace margelo::nitro::reactnativelist::views
|
package/package.json
CHANGED
|
@@ -1,8 +1,155 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-list",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
|
+
"description": "React Native List",
|
|
5
|
+
"main": "lib/index",
|
|
6
|
+
"module": "lib/index",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"metro",
|
|
13
|
+
"metro-config.js",
|
|
14
|
+
"metro-config.d.ts",
|
|
15
|
+
"react-native.config.js",
|
|
16
|
+
"lib",
|
|
17
|
+
"nitrogen",
|
|
18
|
+
"android/build.gradle",
|
|
19
|
+
"android/gradle.properties",
|
|
20
|
+
"android/fix-prefab.gradle",
|
|
21
|
+
"android/CMakeLists.txt",
|
|
22
|
+
"android/src",
|
|
23
|
+
"ios/**/*.h",
|
|
24
|
+
"ios/**/*.m",
|
|
25
|
+
"ios/**/*.mm",
|
|
26
|
+
"ios/**/*.cpp",
|
|
27
|
+
"ios/**/*.swift",
|
|
28
|
+
"app.plugin.js",
|
|
29
|
+
"nitro.json",
|
|
30
|
+
"*.podspec",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"clean": "rm -rf android/build node_modules/**/android/build lib",
|
|
36
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
|
37
|
+
"lint-ci": "eslint \"**/*.{js,ts,tsx}\" -f @jamesacarr/github-actions",
|
|
38
|
+
"typescript": "tsc",
|
|
39
|
+
"specs": "nitrogen --logLevel=\"debug\"",
|
|
40
|
+
"android": "expo run:android",
|
|
41
|
+
"ios": "expo run:ios",
|
|
42
|
+
"bundle:js": "bun run react-bundler/bundle.ts",
|
|
43
|
+
"bundle:js:prod": "NODE_ENV=production bun run react-bundler/bundle.ts",
|
|
44
|
+
"prepack": "cp ../README.md ./README.md",
|
|
45
|
+
"postpack": "rm ./README.md",
|
|
46
|
+
"release": "release-it"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"react-native",
|
|
50
|
+
"nitro"
|
|
51
|
+
],
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/hannojg/react-native-list.git"
|
|
55
|
+
},
|
|
56
|
+
"author": "Hanno Gödecke <hanno@margelo.com> (https://github.com/hannojg)",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/hannojg/react-native-list/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/hannojg/react-native-list#readme",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"registry": "https://registry.npmjs.org/"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@react-native/eslint-config": "0.83.6",
|
|
67
|
+
"eslint": "^8.57.0",
|
|
68
|
+
"eslint-config-prettier": "^9.1.0",
|
|
69
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
70
|
+
"flow-remove-types": "^2.299.0",
|
|
71
|
+
"nitrogen": "catalog:",
|
|
72
|
+
"prettier": "^3.3.3",
|
|
73
|
+
"react": "catalog:",
|
|
74
|
+
"react-native": "catalog:",
|
|
75
|
+
"react-native-nitro-modules": "catalog:",
|
|
76
|
+
"react-native-worklets": "catalog:",
|
|
77
|
+
"react-reconciler": "^0.33.0",
|
|
78
|
+
"release-it": "^20.0.1",
|
|
79
|
+
"typescript": "^5.8.3"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"react": "*",
|
|
83
|
+
"react-native": "*",
|
|
84
|
+
"react-native-worklets": "*",
|
|
85
|
+
"react-native-nitro-modules": "*"
|
|
86
|
+
},
|
|
87
|
+
"eslintConfig": {
|
|
88
|
+
"root": true,
|
|
89
|
+
"extends": [
|
|
90
|
+
"@react-native",
|
|
91
|
+
"prettier"
|
|
92
|
+
],
|
|
93
|
+
"plugins": [
|
|
94
|
+
"prettier"
|
|
95
|
+
],
|
|
96
|
+
"rules": {
|
|
97
|
+
"no-restricted-syntax": [
|
|
98
|
+
"error",
|
|
99
|
+
{
|
|
100
|
+
"selector": "ImportDeclaration[source.value=/ReactFabricMirror(\\.bundle)?(\\.[jt]sx?)?$/]",
|
|
101
|
+
"message": "Import React Fabric mirror through src/renderer/react/ReactFabricRenderer instead."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"selector": "ExportNamedDeclaration[source.value=/ReactFabricMirror(\\.bundle)?(\\.[jt]sx?)?$/]",
|
|
105
|
+
"message": "Export React Fabric mirror through src/renderer/react/ReactFabricRenderer instead."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"selector": "ExportAllDeclaration[source.value=/ReactFabricMirror(\\.bundle)?(\\.[jt]sx?)?$/]",
|
|
109
|
+
"message": "Export React Fabric mirror through src/renderer/react/ReactFabricRenderer instead."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"selector": "CallExpression[callee.name='require'][arguments.0.value=/ReactFabricMirror(\\.bundle)?(\\.[jt]sx?)?$/]",
|
|
113
|
+
"message": "Require React Fabric mirror through src/renderer/react/ReactFabricRenderer instead."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"selector": "TSImportType Literal[value=/ReactFabricMirror(\\.bundle)?(\\.[jt]sx?)?$/]",
|
|
117
|
+
"message": "Reference React Fabric mirror types through src/renderer/react/ReactFabricRenderer instead."
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"prettier/prettier": [
|
|
121
|
+
"warn",
|
|
122
|
+
{
|
|
123
|
+
"quoteProps": "consistent",
|
|
124
|
+
"singleQuote": true,
|
|
125
|
+
"tabWidth": 2,
|
|
126
|
+
"trailingComma": "es5",
|
|
127
|
+
"useTabs": false
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"overrides": [
|
|
132
|
+
{
|
|
133
|
+
"files": [
|
|
134
|
+
"src/renderer/react/ReactFabricRenderer.ts"
|
|
135
|
+
],
|
|
136
|
+
"rules": {
|
|
137
|
+
"no-restricted-syntax": "off"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"eslintIgnore": [
|
|
143
|
+
"node_modules/",
|
|
144
|
+
"lib/"
|
|
145
|
+
],
|
|
146
|
+
"prettier": {
|
|
147
|
+
"quoteProps": "consistent",
|
|
148
|
+
"singleQuote": true,
|
|
149
|
+
"tabWidth": 2,
|
|
150
|
+
"trailingComma": "es5",
|
|
151
|
+
"useTabs": false,
|
|
152
|
+
"semi": false
|
|
153
|
+
},
|
|
154
|
+
"patchedDependencies": {}
|
|
8
155
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// https://github.com/react-native-community/cli/blob/main/docs/dependencies.md
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
dependency: {
|
|
5
|
+
platforms: {
|
|
6
|
+
/**
|
|
7
|
+
* @type {import('@react-native-community/cli-types').IOSDependencyParams}
|
|
8
|
+
*/
|
|
9
|
+
ios: {},
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@react-native-community/cli-types').AndroidDependencyParams}
|
|
12
|
+
*/
|
|
13
|
+
android: {},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
}
|