react-native-nitro-list 0.0.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/LICENSE +21 -0
- package/NitroList.podspec +31 -0
- package/README.md +29 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +148 -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/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/nitrolist/HybridNitroList.kt +27 -0
- package/android/src/main/java/com/nitrolist/NitroListPackage.kt +29 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridNitroList.swift +21 -0
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/nitro-list.nitro.js +6 -0
- package/lib/commonjs/specs/nitro-list.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/nitro-list.nitro.js +4 -0
- package/lib/module/specs/nitro-list.nitro.js.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/nitro-list.nitro.d.ts +11 -0
- package/lib/typescript/src/specs/nitro-list.nitro.d.ts.map +1 -0
- package/nitro.json +24 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroList+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroList+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroListOnLoad.cpp +46 -0
- package/nitrogen/generated/android/NitroListOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JHybridNitroListSpec.cpp +56 -0
- package/nitrogen/generated/android/c++/JHybridNitroListSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.cpp +56 -0
- package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/HybridNitroListSpec.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/NitroListOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/NitroList+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +40 -0
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +41 -0
- package/nitrogen/generated/ios/NitroListAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroListAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridNitroListSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroListSpecSwift.hpp +74 -0
- package/nitrogen/generated/ios/c++/views/HybridNitroListComponent.mm +96 -0
- package/nitrogen/generated/ios/swift/HybridNitroListSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridNitroListSpec_cxx.swift +140 -0
- package/nitrogen/generated/shared/c++/HybridNitroListSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNitroListSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.cpp +88 -0
- package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.hpp +107 -0
- package/nitrogen/generated/shared/json/NitroListConfig.json +10 -0
- package/package.json +122 -0
- package/src/index.ts +14 -0
- package/src/specs/nitro-list.nitro.ts +13 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroListComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 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 "HybridNitroListSpec.hpp"
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <optional>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::nitrolist::views {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The name of the actual native View.
|
|
30
|
+
*/
|
|
31
|
+
extern const char HybridNitroListComponentName[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for the "NitroList" View.
|
|
35
|
+
*/
|
|
36
|
+
class HybridNitroListProps final: public react::ViewProps {
|
|
37
|
+
public:
|
|
38
|
+
HybridNitroListProps() = default;
|
|
39
|
+
HybridNitroListProps(const HybridNitroListProps&);
|
|
40
|
+
HybridNitroListProps(const react::PropsParserContext& context,
|
|
41
|
+
const HybridNitroListProps& sourceProps,
|
|
42
|
+
const react::RawProps& rawProps);
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
CachedProp<bool> isRed;
|
|
46
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridNitroListSpec>& /* ref */)>>> hybridRef;
|
|
47
|
+
|
|
48
|
+
private:
|
|
49
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* State for the "NitroList" View.
|
|
54
|
+
*/
|
|
55
|
+
class HybridNitroListState final {
|
|
56
|
+
public:
|
|
57
|
+
HybridNitroListState() = default;
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
void setProps(const HybridNitroListProps& props) { _props.emplace(props); }
|
|
61
|
+
const std::optional<HybridNitroListProps>& getProps() const { return _props; }
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
#ifdef ANDROID
|
|
65
|
+
HybridNitroListState(const HybridNitroListState& /* previousState */, folly::dynamic /* data */) {}
|
|
66
|
+
folly::dynamic getDynamic() const {
|
|
67
|
+
throw std::runtime_error("HybridNitroListState does not support folly!");
|
|
68
|
+
}
|
|
69
|
+
react::MapBuffer getMapBuffer() const {
|
|
70
|
+
throw std::runtime_error("HybridNitroListState does not support MapBuffer!");
|
|
71
|
+
};
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
std::optional<HybridNitroListProps> _props;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The Shadow Node for the "NitroList" View.
|
|
80
|
+
*/
|
|
81
|
+
using HybridNitroListShadowNode = react::ConcreteViewShadowNode<HybridNitroListComponentName /* "HybridNitroList" */,
|
|
82
|
+
HybridNitroListProps /* custom props */,
|
|
83
|
+
react::ViewEventEmitter /* default */,
|
|
84
|
+
HybridNitroListState /* custom state */>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The Component Descriptor for the "NitroList" View.
|
|
88
|
+
*/
|
|
89
|
+
class HybridNitroListComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridNitroListShadowNode> {
|
|
90
|
+
public:
|
|
91
|
+
HybridNitroListComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
92
|
+
|
|
93
|
+
public:
|
|
94
|
+
/**
|
|
95
|
+
* A faster path for cloning props - reuses the caching logic from `HybridNitroListProps`.
|
|
96
|
+
*/
|
|
97
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
98
|
+
const std::shared_ptr<const react::Props>& props,
|
|
99
|
+
react::RawProps rawProps) const override;
|
|
100
|
+
#ifdef ANDROID
|
|
101
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
102
|
+
#endif
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/* The actual view for "NitroList" needs to be implemented in platform-specific code. */
|
|
106
|
+
|
|
107
|
+
} // namespace margelo::nitro::nitrolist::views
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-nitro-list",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "react-native-nitro-list is a react native package built with Nitro",
|
|
5
|
+
"main": "./lib/commonjs/index.js",
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"clean": "git clean -dfX",
|
|
13
|
+
"release": "semantic-release",
|
|
14
|
+
"build": "npm run typecheck && bob build",
|
|
15
|
+
"codegen": "nitrogen --logLevel=\"debug\" && npm run build && node post-script.js"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"react-native",
|
|
19
|
+
"react-native-nitro-list"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"react-native.config.js",
|
|
24
|
+
"lib",
|
|
25
|
+
"nitrogen",
|
|
26
|
+
"cpp",
|
|
27
|
+
"nitro.json",
|
|
28
|
+
"android/build.gradle",
|
|
29
|
+
"android/fix-prefab.gradle",
|
|
30
|
+
"android/gradle.properties",
|
|
31
|
+
"android/CMakeLists.txt",
|
|
32
|
+
"android/src",
|
|
33
|
+
"ios/**/*.h",
|
|
34
|
+
"ios/**/*.m",
|
|
35
|
+
"ios/**/*.mm",
|
|
36
|
+
"ios/**/*.cpp",
|
|
37
|
+
"ios/**/*.swift",
|
|
38
|
+
"app.plugin.js",
|
|
39
|
+
"*.podspec",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"workspaces": [
|
|
43
|
+
"example"
|
|
44
|
+
],
|
|
45
|
+
"repository": "https://github.com/shivshankartiwari/react-native-nitro-list.git",
|
|
46
|
+
"author": "Shiv Shankar Tiwari",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"bugs": "https://github.com/shivshankartiwari/react-native-nitro-list/issues",
|
|
49
|
+
"homepage": "https://github.com/shivshankartiwari/react-native-nitro-list#readme",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
|
|
56
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
57
|
+
"@semantic-release/git": "^10.0.1",
|
|
58
|
+
"@types/jest": "^29.5.12",
|
|
59
|
+
"@types/react": "19.2.0",
|
|
60
|
+
"nitrogen": "0.32.0",
|
|
61
|
+
"react": "19.2.0",
|
|
62
|
+
"react-native": "0.83",
|
|
63
|
+
"react-native-builder-bob": "^0.40.17",
|
|
64
|
+
"react-native-nitro-modules": "0.32.0",
|
|
65
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
66
|
+
"semantic-release": "^25.0.2",
|
|
67
|
+
"typescript": "^5.8.3"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"react": "*",
|
|
71
|
+
"react-native": "*",
|
|
72
|
+
"react-native-nitro-modules": "*"
|
|
73
|
+
},
|
|
74
|
+
"eslintConfig": {
|
|
75
|
+
"root": true,
|
|
76
|
+
"extends": [
|
|
77
|
+
"@react-native",
|
|
78
|
+
"prettier"
|
|
79
|
+
],
|
|
80
|
+
"plugins": [
|
|
81
|
+
"prettier"
|
|
82
|
+
],
|
|
83
|
+
"rules": {
|
|
84
|
+
"prettier/prettier": [
|
|
85
|
+
"warn",
|
|
86
|
+
{
|
|
87
|
+
"quoteProps": "consistent",
|
|
88
|
+
"singleQuote": true,
|
|
89
|
+
"tabWidth": 2,
|
|
90
|
+
"trailingComma": "es5",
|
|
91
|
+
"useTabs": false
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"eslintIgnore": [
|
|
97
|
+
"node_modules/",
|
|
98
|
+
"lib/"
|
|
99
|
+
],
|
|
100
|
+
"prettier": {
|
|
101
|
+
"quoteProps": "consistent",
|
|
102
|
+
"singleQuote": true,
|
|
103
|
+
"tabWidth": 2,
|
|
104
|
+
"trailingComma": "es5",
|
|
105
|
+
"useTabs": false,
|
|
106
|
+
"semi": false
|
|
107
|
+
},
|
|
108
|
+
"react-native-builder-bob": {
|
|
109
|
+
"source": "src",
|
|
110
|
+
"output": "lib",
|
|
111
|
+
"targets": [
|
|
112
|
+
"commonjs",
|
|
113
|
+
"module",
|
|
114
|
+
[
|
|
115
|
+
"typescript",
|
|
116
|
+
{
|
|
117
|
+
"project": "tsconfig.json"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getHostComponent, type HybridRef } from 'react-native-nitro-modules'
|
|
2
|
+
import NitroListConfig from '../nitrogen/generated/shared/json/NitroListConfig.json'
|
|
3
|
+
import type {
|
|
4
|
+
NitroListProps,
|
|
5
|
+
NitroListMethods,
|
|
6
|
+
} from './specs/nitro-list.nitro'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const NitroList = getHostComponent<NitroListProps, NitroListMethods>(
|
|
10
|
+
'NitroList',
|
|
11
|
+
() => NitroListConfig
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
export type NitroListRef = HybridRef<NitroListProps, NitroListMethods>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HybridView,
|
|
3
|
+
HybridViewProps,
|
|
4
|
+
HybridViewMethods,
|
|
5
|
+
} from 'react-native-nitro-modules'
|
|
6
|
+
|
|
7
|
+
export interface NitroListProps extends HybridViewProps {
|
|
8
|
+
isRed: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface NitroListMethods extends HybridViewMethods {}
|
|
12
|
+
|
|
13
|
+
export type NitroList = HybridView<NitroListProps, NitroListMethods, { ios: 'swift', android: 'kotlin' }>
|