aix 0.0.15 → 0.1.0
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/Aix.podspec +32 -0
- package/LICENSE +2 -2
- package/README.md +165 -33
- 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/aix/AixPackage.kt +29 -0
- package/android/src/main/java/com/aix/HybridAix.kt +27 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridAix.swift +1072 -0
- package/ios/HybridAixCellView.swift +174 -0
- package/ios/HybridAixComposer.swift +119 -0
- package/lib/commonjs/aix.js +25 -0
- package/lib/commonjs/aix.js.map +1 -0
- package/lib/commonjs/fade-in/createUsePool.js +50 -0
- package/lib/commonjs/fade-in/createUsePool.js.map +1 -0
- package/lib/commonjs/fade-in/createUseStaggered.js +82 -0
- package/lib/commonjs/fade-in/createUseStaggered.js.map +1 -0
- package/lib/commonjs/fade-in/index.js +78 -0
- package/lib/commonjs/fade-in/index.js.map +1 -0
- package/lib/commonjs/footer.js +28 -0
- package/lib/commonjs/footer.js.map +1 -0
- package/lib/commonjs/index.js +48 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/views/aix.nitro.js +6 -0
- package/lib/commonjs/views/aix.nitro.js.map +1 -0
- package/lib/module/aix.js +20 -0
- package/lib/module/aix.js.map +1 -0
- package/lib/module/fade-in/createUsePool.js +46 -0
- package/lib/module/fade-in/createUsePool.js.map +1 -0
- package/lib/module/fade-in/createUseStaggered.js +79 -0
- package/lib/module/fade-in/createUseStaggered.js.map +1 -0
- package/lib/module/fade-in/index.js +74 -0
- package/lib/module/fade-in/index.js.map +1 -0
- package/lib/module/footer.js +23 -0
- package/lib/module/footer.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/views/aix.nitro.js +4 -0
- package/lib/module/views/aix.nitro.js.map +1 -0
- package/lib/typescript/src/aix.d.ts +14 -0
- package/lib/typescript/src/aix.d.ts.map +1 -0
- package/lib/typescript/src/fade-in/createUsePool.d.ts +5 -0
- package/lib/typescript/src/fade-in/createUsePool.d.ts.map +1 -0
- package/lib/typescript/src/fade-in/createUseStaggered.d.ts +2 -0
- package/lib/typescript/src/fade-in/createUseStaggered.d.ts.map +1 -0
- package/lib/typescript/src/fade-in/index.d.ts +5 -0
- package/lib/typescript/src/fade-in/index.d.ts.map +1 -0
- package/lib/typescript/src/footer.d.ts +5 -0
- package/lib/typescript/src/footer.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/views/aix.nitro.d.ts +101 -0
- package/lib/typescript/src/views/aix.nitro.d.ts.map +1 -0
- package/nitro.json +26 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/Aix+autolinking.cmake +91 -0
- package/nitrogen/generated/android/Aix+autolinking.gradle +27 -0
- package/nitrogen/generated/android/AixOnLoad.cpp +70 -0
- package/nitrogen/generated/android/AixOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAixAdditionalContentInsets.hpp +61 -0
- package/nitrogen/generated/android/c++/JAixAdditionalContentInsetsProp.hpp +63 -0
- package/nitrogen/generated/android/c++/JAixScrollIndicatorInsetValue.hpp +61 -0
- package/nitrogen/generated/android/c++/JAixScrollIndicatorInsets.hpp +63 -0
- package/nitrogen/generated/android/c++/JAixScrollOnFooterSizeUpdate.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridAixCellViewSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridAixCellViewSpec.hpp +68 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.cpp +48 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridAixSpec.cpp +137 -0
- package/nitrogen/generated/android/c++/JHybridAixSpec.hpp +79 -0
- package/nitrogen/generated/android/c++/views/JHybridAixCellViewStateUpdater.cpp +60 -0
- package/nitrogen/generated/android/c++/views/JHybridAixCellViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridAixComposerStateUpdater.cpp +53 -0
- package/nitrogen/generated/android/c++/views/JHybridAixComposerStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridAixStateUpdater.cpp +80 -0
- package/nitrogen/generated/android/c++/views/JHybridAixStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixAdditionalContentInsets.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixAdditionalContentInsetsProp.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixScrollIndicatorInsetValue.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixScrollIndicatorInsets.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixScrollOnFooterSizeUpdate.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixCellViewSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixComposerSpec.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixSpec.kt +101 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixCellViewManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixCellViewStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixComposerManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixComposerStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/Aix+autolinking.rb +60 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.cpp +67 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.hpp +222 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Umbrella.hpp +70 -0
- package/nitrogen/generated/ios/AixAutolinking.mm +49 -0
- package/nitrogen/generated/ios/AixAutolinking.swift +55 -0
- package/nitrogen/generated/ios/c++/HybridAixCellViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixCellViewSpecSwift.hpp +80 -0
- package/nitrogen/generated/ios/c++/HybridAixComposerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixComposerSpecSwift.hpp +69 -0
- package/nitrogen/generated/ios/c++/HybridAixSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixSpecSwift.hpp +142 -0
- package/nitrogen/generated/ios/c++/views/HybridAixCellViewComponent.mm +101 -0
- package/nitrogen/generated/ios/c++/views/HybridAixComponent.mm +126 -0
- package/nitrogen/generated/ios/c++/views/HybridAixComposerComponent.mm +92 -0
- package/nitrogen/generated/ios/swift/AixAdditionalContentInsets.swift +47 -0
- package/nitrogen/generated/ios/swift/AixAdditionalContentInsetsProp.swift +71 -0
- package/nitrogen/generated/ios/swift/AixScrollIndicatorInsetValue.swift +47 -0
- package/nitrogen/generated/ios/swift/AixScrollIndicatorInsets.swift +71 -0
- package/nitrogen/generated/ios/swift/AixScrollOnFooterSizeUpdate.swift +89 -0
- package/nitrogen/generated/ios/swift/HybridAixCellViewSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridAixCellViewSpec_cxx.swift +151 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec_cxx.swift +131 -0
- package/nitrogen/generated/ios/swift/HybridAixSpec.swift +63 -0
- package/nitrogen/generated/ios/swift/HybridAixSpec_cxx.swift +292 -0
- package/nitrogen/generated/shared/c++/AixAdditionalContentInsets.hpp +79 -0
- package/nitrogen/generated/shared/c++/AixAdditionalContentInsetsProp.hpp +81 -0
- package/nitrogen/generated/shared/c++/AixScrollIndicatorInsetValue.hpp +79 -0
- package/nitrogen/generated/shared/c++/AixScrollIndicatorInsets.hpp +81 -0
- package/nitrogen/generated/shared/c++/AixScrollOnFooterSizeUpdate.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridAixCellViewSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridAixCellViewSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridAixSpec.cpp +36 -0
- package/nitrogen/generated/shared/c++/HybridAixSpec.hpp +85 -0
- package/nitrogen/generated/shared/c++/views/HybridAixCellViewComponent.cpp +99 -0
- package/nitrogen/generated/shared/c++/views/HybridAixCellViewComponent.hpp +108 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComponent.cpp +159 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComponent.hpp +117 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.cpp +75 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.hpp +106 -0
- package/nitrogen/generated/shared/json/AixCellViewConfig.json +11 -0
- package/nitrogen/generated/shared/json/AixComposerConfig.json +9 -0
- package/nitrogen/generated/shared/json/AixConfig.json +16 -0
- package/package.json +113 -14
- package/src/aix.tsx +43 -0
- package/src/fade-in/createUsePool.ts +46 -0
- package/src/fade-in/createUseStaggered.ts +82 -0
- package/src/fade-in/index.tsx +97 -0
- package/src/footer.tsx +30 -0
- package/src/index.ts +20 -16
- package/src/views/aix.nitro.ts +148 -0
- package/docs/API.md +0 -288
- package/jest.config.js +0 -17
- package/lib/__tests__/deferredIterable.test.d.ts +0 -1
- package/lib/__tests__/deferredIterable.test.js +0 -108
- package/lib/__tests__/filter.test.d.ts +0 -1
- package/lib/__tests__/filter.test.js +0 -53
- package/lib/__tests__/flatMap.test.d.ts +0 -1
- package/lib/__tests__/flatMap.test.js +0 -77
- package/lib/__tests__/lookahead.test.d.ts +0 -1
- package/lib/__tests__/lookahead.test.js +0 -57
- package/lib/__tests__/map.test.d.ts +0 -1
- package/lib/__tests__/map.test.js +0 -53
- package/lib/__tests__/merge.test.d.ts +0 -1
- package/lib/__tests__/merge.test.js +0 -55
- package/lib/__tests__/reduce.test.d.ts +0 -1
- package/lib/__tests__/reduce.test.js +0 -52
- package/lib/__tests__/spanAll.test.d.ts +0 -1
- package/lib/__tests__/spanAll.test.js +0 -120
- package/lib/concat.d.ts +0 -4
- package/lib/concat.js +0 -126
- package/lib/deferred.d.ts +0 -9
- package/lib/deferred.js +0 -18
- package/lib/deferredIterable.d.ts +0 -22
- package/lib/deferredIterable.js +0 -111
- package/lib/filter.d.ts +0 -7
- package/lib/filter.js +0 -99
- package/lib/flatMap.d.ts +0 -1
- package/lib/flatMap.js +0 -119
- package/lib/fromEvent.d.ts +0 -5
- package/lib/fromEvent.js +0 -13
- package/lib/index.d.ts +0 -16
- package/lib/index.js +0 -34
- package/lib/insert.d.ts +0 -4
- package/lib/insert.js +0 -113
- package/lib/interval.d.ts +0 -4
- package/lib/interval.js +0 -64
- package/lib/iterableToArray.d.ts +0 -1
- package/lib/iterableToArray.js +0 -87
- package/lib/iteratorToIterable.d.ts +0 -6
- package/lib/iteratorToIterable.js +0 -70
- package/lib/lookahead.d.ts +0 -10
- package/lib/lookahead.js +0 -78
- package/lib/map.d.ts +0 -4
- package/lib/map.js +0 -98
- package/lib/merge.d.ts +0 -6
- package/lib/merge.js +0 -21
- package/lib/of.d.ts +0 -3
- package/lib/of.js +0 -5
- package/lib/reduce.d.ts +0 -4
- package/lib/reduce.js +0 -92
- package/lib/restToIterable.d.ts +0 -4
- package/lib/restToIterable.js +0 -73
- package/lib/spanAll.d.ts +0 -1
- package/lib/spanAll.js +0 -29
- package/lib/tap.d.ts +0 -4
- package/lib/tap.js +0 -96
- package/lib/toCallbacks.d.ts +0 -11
- package/lib/toCallbacks.js +0 -97
- package/lib/zip.d.ts +0 -4
- package/lib/zip.js +0 -75
- package/src/__tests__/deferredIterable.test.ts +0 -22
- package/src/__tests__/filter.test.ts +0 -10
- package/src/__tests__/flatMap.test.ts +0 -12
- package/src/__tests__/lookahead.test.ts +0 -9
- package/src/__tests__/map.test.ts +0 -10
- package/src/__tests__/merge.test.ts +0 -9
- package/src/__tests__/reduce.test.ts +0 -10
- package/src/__tests__/spanAll.test.ts +0 -17
- package/src/concat.ts +0 -13
- package/src/deferred.ts +0 -16
- package/src/deferredIterable.ts +0 -111
- package/src/filter.ts +0 -16
- package/src/flatMap.ts +0 -9
- package/src/fromEvent.ts +0 -16
- package/src/insert.ts +0 -13
- package/src/interval.ts +0 -20
- package/src/iterableToArray.ts +0 -7
- package/src/iteratorToIterable.ts +0 -12
- package/src/lookahead.ts +0 -27
- package/src/map.ts +0 -11
- package/src/merge.ts +0 -18
- package/src/of.ts +0 -4
- package/src/reduce.ts +0 -12
- package/src/restToIterable.ts +0 -8
- package/src/spanAll.ts +0 -26
- package/src/tap.ts +0 -11
- package/src/toCallbacks.ts +0 -27
- package/src/zip.ts +0 -19
- package/tsconfig.json +0 -63
- package/yarn.lock +0 -3514
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixCellViewSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAixCellViewSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::aix {
|
|
11
|
+
|
|
12
|
+
void HybridAixCellViewSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridGetter("isLast", &HybridAixCellViewSpec::getIsLast);
|
|
18
|
+
prototype.registerHybridSetter("isLast", &HybridAixCellViewSpec::setIsLast);
|
|
19
|
+
prototype.registerHybridGetter("index", &HybridAixCellViewSpec::getIndex);
|
|
20
|
+
prototype.registerHybridSetter("index", &HybridAixCellViewSpec::setIndex);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixCellViewSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::aix {
|
|
21
|
+
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An abstract base class for `AixCellView`
|
|
26
|
+
* Inherit this class to create instances of `HybridAixCellViewSpec` in C++.
|
|
27
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
28
|
+
* @example
|
|
29
|
+
* ```cpp
|
|
30
|
+
* class HybridAixCellView: public HybridAixCellViewSpec {
|
|
31
|
+
* public:
|
|
32
|
+
* HybridAixCellView(...): HybridObject(TAG) { ... }
|
|
33
|
+
* // ...
|
|
34
|
+
* };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
class HybridAixCellViewSpec: public virtual HybridObject {
|
|
38
|
+
public:
|
|
39
|
+
// Constructor
|
|
40
|
+
explicit HybridAixCellViewSpec(): HybridObject(TAG) { }
|
|
41
|
+
|
|
42
|
+
// Destructor
|
|
43
|
+
~HybridAixCellViewSpec() override = default;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
// Properties
|
|
47
|
+
virtual bool getIsLast() = 0;
|
|
48
|
+
virtual void setIsLast(bool isLast) = 0;
|
|
49
|
+
virtual double getIndex() = 0;
|
|
50
|
+
virtual void setIndex(double index) = 0;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Methods
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
protected:
|
|
57
|
+
// Hybrid Setup
|
|
58
|
+
void loadHybridMethods() override;
|
|
59
|
+
|
|
60
|
+
protected:
|
|
61
|
+
// Tag for logging
|
|
62
|
+
static constexpr auto TAG = "AixCellView";
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixComposerSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAixComposerSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::aix {
|
|
11
|
+
|
|
12
|
+
void HybridAixComposerSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixComposerSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::aix {
|
|
21
|
+
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An abstract base class for `AixComposer`
|
|
26
|
+
* Inherit this class to create instances of `HybridAixComposerSpec` in C++.
|
|
27
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
28
|
+
* @example
|
|
29
|
+
* ```cpp
|
|
30
|
+
* class HybridAixComposer: public HybridAixComposerSpec {
|
|
31
|
+
* public:
|
|
32
|
+
* HybridAixComposer(...): HybridObject(TAG) { ... }
|
|
33
|
+
* // ...
|
|
34
|
+
* };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
class HybridAixComposerSpec: public virtual HybridObject {
|
|
38
|
+
public:
|
|
39
|
+
// Constructor
|
|
40
|
+
explicit HybridAixComposerSpec(): HybridObject(TAG) { }
|
|
41
|
+
|
|
42
|
+
// Destructor
|
|
43
|
+
~HybridAixComposerSpec() override = default;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
// Properties
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
// Methods
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
protected:
|
|
54
|
+
// Hybrid Setup
|
|
55
|
+
void loadHybridMethods() override;
|
|
56
|
+
|
|
57
|
+
protected:
|
|
58
|
+
// Tag for logging
|
|
59
|
+
static constexpr auto TAG = "AixComposer";
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAixSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::aix {
|
|
11
|
+
|
|
12
|
+
void HybridAixSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridGetter("shouldStartAtEnd", &HybridAixSpec::getShouldStartAtEnd);
|
|
18
|
+
prototype.registerHybridSetter("shouldStartAtEnd", &HybridAixSpec::setShouldStartAtEnd);
|
|
19
|
+
prototype.registerHybridGetter("scrollOnFooterSizeUpdate", &HybridAixSpec::getScrollOnFooterSizeUpdate);
|
|
20
|
+
prototype.registerHybridSetter("scrollOnFooterSizeUpdate", &HybridAixSpec::setScrollOnFooterSizeUpdate);
|
|
21
|
+
prototype.registerHybridGetter("scrollEndReachedThreshold", &HybridAixSpec::getScrollEndReachedThreshold);
|
|
22
|
+
prototype.registerHybridSetter("scrollEndReachedThreshold", &HybridAixSpec::setScrollEndReachedThreshold);
|
|
23
|
+
prototype.registerHybridGetter("additionalContentInsets", &HybridAixSpec::getAdditionalContentInsets);
|
|
24
|
+
prototype.registerHybridSetter("additionalContentInsets", &HybridAixSpec::setAdditionalContentInsets);
|
|
25
|
+
prototype.registerHybridGetter("additionalScrollIndicatorInsets", &HybridAixSpec::getAdditionalScrollIndicatorInsets);
|
|
26
|
+
prototype.registerHybridSetter("additionalScrollIndicatorInsets", &HybridAixSpec::setAdditionalScrollIndicatorInsets);
|
|
27
|
+
prototype.registerHybridGetter("mainScrollViewID", &HybridAixSpec::getMainScrollViewID);
|
|
28
|
+
prototype.registerHybridSetter("mainScrollViewID", &HybridAixSpec::setMainScrollViewID);
|
|
29
|
+
prototype.registerHybridGetter("penultimateCellIndex", &HybridAixSpec::getPenultimateCellIndex);
|
|
30
|
+
prototype.registerHybridSetter("penultimateCellIndex", &HybridAixSpec::setPenultimateCellIndex);
|
|
31
|
+
prototype.registerHybridMethod("scrollToEnd", &HybridAixSpec::scrollToEnd);
|
|
32
|
+
prototype.registerHybridMethod("scrollToIndexWhenBlankSizeReady", &HybridAixSpec::scrollToIndexWhenBlankSizeReady);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `AixScrollOnFooterSizeUpdate` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::aix { struct AixScrollOnFooterSizeUpdate; }
|
|
18
|
+
// Forward declaration of `AixAdditionalContentInsetsProp` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::aix { struct AixAdditionalContentInsetsProp; }
|
|
20
|
+
// Forward declaration of `AixScrollIndicatorInsets` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::aix { struct AixScrollIndicatorInsets; }
|
|
22
|
+
|
|
23
|
+
#include "AixScrollOnFooterSizeUpdate.hpp"
|
|
24
|
+
#include <optional>
|
|
25
|
+
#include "AixAdditionalContentInsetsProp.hpp"
|
|
26
|
+
#include "AixScrollIndicatorInsets.hpp"
|
|
27
|
+
#include <string>
|
|
28
|
+
|
|
29
|
+
namespace margelo::nitro::aix {
|
|
30
|
+
|
|
31
|
+
using namespace margelo::nitro;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* An abstract base class for `Aix`
|
|
35
|
+
* Inherit this class to create instances of `HybridAixSpec` in C++.
|
|
36
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
37
|
+
* @example
|
|
38
|
+
* ```cpp
|
|
39
|
+
* class HybridAix: public HybridAixSpec {
|
|
40
|
+
* public:
|
|
41
|
+
* HybridAix(...): HybridObject(TAG) { ... }
|
|
42
|
+
* // ...
|
|
43
|
+
* };
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
class HybridAixSpec: public virtual HybridObject {
|
|
47
|
+
public:
|
|
48
|
+
// Constructor
|
|
49
|
+
explicit HybridAixSpec(): HybridObject(TAG) { }
|
|
50
|
+
|
|
51
|
+
// Destructor
|
|
52
|
+
~HybridAixSpec() override = default;
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
// Properties
|
|
56
|
+
virtual bool getShouldStartAtEnd() = 0;
|
|
57
|
+
virtual void setShouldStartAtEnd(bool shouldStartAtEnd) = 0;
|
|
58
|
+
virtual std::optional<AixScrollOnFooterSizeUpdate> getScrollOnFooterSizeUpdate() = 0;
|
|
59
|
+
virtual void setScrollOnFooterSizeUpdate(const std::optional<AixScrollOnFooterSizeUpdate>& scrollOnFooterSizeUpdate) = 0;
|
|
60
|
+
virtual std::optional<double> getScrollEndReachedThreshold() = 0;
|
|
61
|
+
virtual void setScrollEndReachedThreshold(std::optional<double> scrollEndReachedThreshold) = 0;
|
|
62
|
+
virtual std::optional<AixAdditionalContentInsetsProp> getAdditionalContentInsets() = 0;
|
|
63
|
+
virtual void setAdditionalContentInsets(const std::optional<AixAdditionalContentInsetsProp>& additionalContentInsets) = 0;
|
|
64
|
+
virtual std::optional<AixScrollIndicatorInsets> getAdditionalScrollIndicatorInsets() = 0;
|
|
65
|
+
virtual void setAdditionalScrollIndicatorInsets(const std::optional<AixScrollIndicatorInsets>& additionalScrollIndicatorInsets) = 0;
|
|
66
|
+
virtual std::optional<std::string> getMainScrollViewID() = 0;
|
|
67
|
+
virtual void setMainScrollViewID(const std::optional<std::string>& mainScrollViewID) = 0;
|
|
68
|
+
virtual std::optional<double> getPenultimateCellIndex() = 0;
|
|
69
|
+
virtual void setPenultimateCellIndex(std::optional<double> penultimateCellIndex) = 0;
|
|
70
|
+
|
|
71
|
+
public:
|
|
72
|
+
// Methods
|
|
73
|
+
virtual void scrollToEnd(std::optional<bool> animated) = 0;
|
|
74
|
+
virtual void scrollToIndexWhenBlankSizeReady(double index, std::optional<bool> animated, std::optional<bool> waitForKeyboardToEnd) = 0;
|
|
75
|
+
|
|
76
|
+
protected:
|
|
77
|
+
// Hybrid Setup
|
|
78
|
+
void loadHybridMethods() override;
|
|
79
|
+
|
|
80
|
+
protected:
|
|
81
|
+
// Tag for logging
|
|
82
|
+
static constexpr auto TAG = "Aix";
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
} // namespace margelo::nitro::aix
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixCellViewComponent.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAixCellViewComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <react/renderer/core/RawValue.h>
|
|
16
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
17
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
18
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::aix::views {
|
|
21
|
+
|
|
22
|
+
extern const char HybridAixCellViewComponentName[] = "AixCellView";
|
|
23
|
+
|
|
24
|
+
HybridAixCellViewProps::HybridAixCellViewProps(const react::PropsParserContext& context,
|
|
25
|
+
const HybridAixCellViewProps& sourceProps,
|
|
26
|
+
const react::RawProps& rawProps):
|
|
27
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
28
|
+
isLast([&]() -> CachedProp<bool> {
|
|
29
|
+
try {
|
|
30
|
+
const react::RawValue* rawValue = rawProps.at("isLast", nullptr, nullptr);
|
|
31
|
+
if (rawValue == nullptr) return sourceProps.isLast;
|
|
32
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
33
|
+
return CachedProp<bool>::fromRawValue(*runtime, value, sourceProps.isLast);
|
|
34
|
+
} catch (const std::exception& exc) {
|
|
35
|
+
throw std::runtime_error(std::string("AixCellView.isLast: ") + exc.what());
|
|
36
|
+
}
|
|
37
|
+
}()),
|
|
38
|
+
index([&]() -> CachedProp<double> {
|
|
39
|
+
try {
|
|
40
|
+
const react::RawValue* rawValue = rawProps.at("index", nullptr, nullptr);
|
|
41
|
+
if (rawValue == nullptr) return sourceProps.index;
|
|
42
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
43
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.index);
|
|
44
|
+
} catch (const std::exception& exc) {
|
|
45
|
+
throw std::runtime_error(std::string("AixCellView.index: ") + exc.what());
|
|
46
|
+
}
|
|
47
|
+
}()),
|
|
48
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAixCellViewSpec>& /* ref */)>>> {
|
|
49
|
+
try {
|
|
50
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
51
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
52
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
53
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAixCellViewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef);
|
|
54
|
+
} catch (const std::exception& exc) {
|
|
55
|
+
throw std::runtime_error(std::string("AixCellView.hybridRef: ") + exc.what());
|
|
56
|
+
}
|
|
57
|
+
}()) { }
|
|
58
|
+
|
|
59
|
+
HybridAixCellViewProps::HybridAixCellViewProps(const HybridAixCellViewProps& other):
|
|
60
|
+
react::ViewProps(),
|
|
61
|
+
isLast(other.isLast),
|
|
62
|
+
index(other.index),
|
|
63
|
+
hybridRef(other.hybridRef) { }
|
|
64
|
+
|
|
65
|
+
bool HybridAixCellViewProps::filterObjectKeys(const std::string& propName) {
|
|
66
|
+
switch (hashString(propName)) {
|
|
67
|
+
case hashString("isLast"): return true;
|
|
68
|
+
case hashString("index"): return true;
|
|
69
|
+
case hashString("hybridRef"): return true;
|
|
70
|
+
default: return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
HybridAixCellViewComponentDescriptor::HybridAixCellViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
75
|
+
: ConcreteComponentDescriptor(parameters,
|
|
76
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
77
|
+
|
|
78
|
+
std::shared_ptr<const react::Props> HybridAixCellViewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
79
|
+
const std::shared_ptr<const react::Props>& props,
|
|
80
|
+
react::RawProps rawProps) const {
|
|
81
|
+
// 1. Prepare raw props parser
|
|
82
|
+
rawProps.parse(rawPropsParser_);
|
|
83
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
84
|
+
return HybridAixCellViewShadowNode::Props(context, /* & */ rawProps, props);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#ifdef ANDROID
|
|
88
|
+
void HybridAixCellViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
89
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
90
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
91
|
+
auto& concreteShadowNode = dynamic_cast<HybridAixCellViewShadowNode&>(shadowNode);
|
|
92
|
+
const HybridAixCellViewProps& props = concreteShadowNode.getConcreteProps();
|
|
93
|
+
HybridAixCellViewState state;
|
|
94
|
+
state.setProps(props);
|
|
95
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixCellViewComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 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 "HybridAixCellViewSpec.hpp"
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <optional>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::aix::views {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The name of the actual native View.
|
|
30
|
+
*/
|
|
31
|
+
extern const char HybridAixCellViewComponentName[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for the "AixCellView" View.
|
|
35
|
+
*/
|
|
36
|
+
class HybridAixCellViewProps final: public react::ViewProps {
|
|
37
|
+
public:
|
|
38
|
+
HybridAixCellViewProps() = default;
|
|
39
|
+
HybridAixCellViewProps(const HybridAixCellViewProps&);
|
|
40
|
+
HybridAixCellViewProps(const react::PropsParserContext& context,
|
|
41
|
+
const HybridAixCellViewProps& sourceProps,
|
|
42
|
+
const react::RawProps& rawProps);
|
|
43
|
+
|
|
44
|
+
public:
|
|
45
|
+
CachedProp<bool> isLast;
|
|
46
|
+
CachedProp<double> index;
|
|
47
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAixCellViewSpec>& /* ref */)>>> hybridRef;
|
|
48
|
+
|
|
49
|
+
private:
|
|
50
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* State for the "AixCellView" View.
|
|
55
|
+
*/
|
|
56
|
+
class HybridAixCellViewState final {
|
|
57
|
+
public:
|
|
58
|
+
HybridAixCellViewState() = default;
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
void setProps(const HybridAixCellViewProps& props) { _props.emplace(props); }
|
|
62
|
+
const std::optional<HybridAixCellViewProps>& getProps() const { return _props; }
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
#ifdef ANDROID
|
|
66
|
+
HybridAixCellViewState(const HybridAixCellViewState& /* previousState */, folly::dynamic /* data */) {}
|
|
67
|
+
folly::dynamic getDynamic() const {
|
|
68
|
+
throw std::runtime_error("HybridAixCellViewState does not support folly!");
|
|
69
|
+
}
|
|
70
|
+
react::MapBuffer getMapBuffer() const {
|
|
71
|
+
throw std::runtime_error("HybridAixCellViewState does not support MapBuffer!");
|
|
72
|
+
};
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
std::optional<HybridAixCellViewProps> _props;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The Shadow Node for the "AixCellView" View.
|
|
81
|
+
*/
|
|
82
|
+
using HybridAixCellViewShadowNode = react::ConcreteViewShadowNode<HybridAixCellViewComponentName /* "HybridAixCellView" */,
|
|
83
|
+
HybridAixCellViewProps /* custom props */,
|
|
84
|
+
react::ViewEventEmitter /* default */,
|
|
85
|
+
HybridAixCellViewState /* custom state */>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The Component Descriptor for the "AixCellView" View.
|
|
89
|
+
*/
|
|
90
|
+
class HybridAixCellViewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridAixCellViewShadowNode> {
|
|
91
|
+
public:
|
|
92
|
+
HybridAixCellViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
93
|
+
|
|
94
|
+
public:
|
|
95
|
+
/**
|
|
96
|
+
* A faster path for cloning props - reuses the caching logic from `HybridAixCellViewProps`.
|
|
97
|
+
*/
|
|
98
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
99
|
+
const std::shared_ptr<const react::Props>& props,
|
|
100
|
+
react::RawProps rawProps) const override;
|
|
101
|
+
#ifdef ANDROID
|
|
102
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
103
|
+
#endif
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/* The actual view for "AixCellView" needs to be implemented in platform-specific code. */
|
|
107
|
+
|
|
108
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixComponent.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridAixComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <react/renderer/core/RawValue.h>
|
|
16
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
17
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
18
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::aix::views {
|
|
21
|
+
|
|
22
|
+
extern const char HybridAixComponentName[] = "Aix";
|
|
23
|
+
|
|
24
|
+
HybridAixProps::HybridAixProps(const react::PropsParserContext& context,
|
|
25
|
+
const HybridAixProps& sourceProps,
|
|
26
|
+
const react::RawProps& rawProps):
|
|
27
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
28
|
+
shouldStartAtEnd([&]() -> CachedProp<bool> {
|
|
29
|
+
try {
|
|
30
|
+
const react::RawValue* rawValue = rawProps.at("shouldStartAtEnd", nullptr, nullptr);
|
|
31
|
+
if (rawValue == nullptr) return sourceProps.shouldStartAtEnd;
|
|
32
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
33
|
+
return CachedProp<bool>::fromRawValue(*runtime, value, sourceProps.shouldStartAtEnd);
|
|
34
|
+
} catch (const std::exception& exc) {
|
|
35
|
+
throw std::runtime_error(std::string("Aix.shouldStartAtEnd: ") + exc.what());
|
|
36
|
+
}
|
|
37
|
+
}()),
|
|
38
|
+
scrollOnFooterSizeUpdate([&]() -> CachedProp<std::optional<AixScrollOnFooterSizeUpdate>> {
|
|
39
|
+
try {
|
|
40
|
+
const react::RawValue* rawValue = rawProps.at("scrollOnFooterSizeUpdate", nullptr, nullptr);
|
|
41
|
+
if (rawValue == nullptr) return sourceProps.scrollOnFooterSizeUpdate;
|
|
42
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
43
|
+
return CachedProp<std::optional<AixScrollOnFooterSizeUpdate>>::fromRawValue(*runtime, value, sourceProps.scrollOnFooterSizeUpdate);
|
|
44
|
+
} catch (const std::exception& exc) {
|
|
45
|
+
throw std::runtime_error(std::string("Aix.scrollOnFooterSizeUpdate: ") + exc.what());
|
|
46
|
+
}
|
|
47
|
+
}()),
|
|
48
|
+
scrollEndReachedThreshold([&]() -> CachedProp<std::optional<double>> {
|
|
49
|
+
try {
|
|
50
|
+
const react::RawValue* rawValue = rawProps.at("scrollEndReachedThreshold", nullptr, nullptr);
|
|
51
|
+
if (rawValue == nullptr) return sourceProps.scrollEndReachedThreshold;
|
|
52
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
53
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.scrollEndReachedThreshold);
|
|
54
|
+
} catch (const std::exception& exc) {
|
|
55
|
+
throw std::runtime_error(std::string("Aix.scrollEndReachedThreshold: ") + exc.what());
|
|
56
|
+
}
|
|
57
|
+
}()),
|
|
58
|
+
additionalContentInsets([&]() -> CachedProp<std::optional<AixAdditionalContentInsetsProp>> {
|
|
59
|
+
try {
|
|
60
|
+
const react::RawValue* rawValue = rawProps.at("additionalContentInsets", nullptr, nullptr);
|
|
61
|
+
if (rawValue == nullptr) return sourceProps.additionalContentInsets;
|
|
62
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
63
|
+
return CachedProp<std::optional<AixAdditionalContentInsetsProp>>::fromRawValue(*runtime, value, sourceProps.additionalContentInsets);
|
|
64
|
+
} catch (const std::exception& exc) {
|
|
65
|
+
throw std::runtime_error(std::string("Aix.additionalContentInsets: ") + exc.what());
|
|
66
|
+
}
|
|
67
|
+
}()),
|
|
68
|
+
additionalScrollIndicatorInsets([&]() -> CachedProp<std::optional<AixScrollIndicatorInsets>> {
|
|
69
|
+
try {
|
|
70
|
+
const react::RawValue* rawValue = rawProps.at("additionalScrollIndicatorInsets", nullptr, nullptr);
|
|
71
|
+
if (rawValue == nullptr) return sourceProps.additionalScrollIndicatorInsets;
|
|
72
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
73
|
+
return CachedProp<std::optional<AixScrollIndicatorInsets>>::fromRawValue(*runtime, value, sourceProps.additionalScrollIndicatorInsets);
|
|
74
|
+
} catch (const std::exception& exc) {
|
|
75
|
+
throw std::runtime_error(std::string("Aix.additionalScrollIndicatorInsets: ") + exc.what());
|
|
76
|
+
}
|
|
77
|
+
}()),
|
|
78
|
+
mainScrollViewID([&]() -> CachedProp<std::optional<std::string>> {
|
|
79
|
+
try {
|
|
80
|
+
const react::RawValue* rawValue = rawProps.at("mainScrollViewID", nullptr, nullptr);
|
|
81
|
+
if (rawValue == nullptr) return sourceProps.mainScrollViewID;
|
|
82
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
83
|
+
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.mainScrollViewID);
|
|
84
|
+
} catch (const std::exception& exc) {
|
|
85
|
+
throw std::runtime_error(std::string("Aix.mainScrollViewID: ") + exc.what());
|
|
86
|
+
}
|
|
87
|
+
}()),
|
|
88
|
+
penultimateCellIndex([&]() -> CachedProp<std::optional<double>> {
|
|
89
|
+
try {
|
|
90
|
+
const react::RawValue* rawValue = rawProps.at("penultimateCellIndex", nullptr, nullptr);
|
|
91
|
+
if (rawValue == nullptr) return sourceProps.penultimateCellIndex;
|
|
92
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
93
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.penultimateCellIndex);
|
|
94
|
+
} catch (const std::exception& exc) {
|
|
95
|
+
throw std::runtime_error(std::string("Aix.penultimateCellIndex: ") + exc.what());
|
|
96
|
+
}
|
|
97
|
+
}()),
|
|
98
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAixSpec>& /* ref */)>>> {
|
|
99
|
+
try {
|
|
100
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
101
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
102
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
103
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAixSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef);
|
|
104
|
+
} catch (const std::exception& exc) {
|
|
105
|
+
throw std::runtime_error(std::string("Aix.hybridRef: ") + exc.what());
|
|
106
|
+
}
|
|
107
|
+
}()) { }
|
|
108
|
+
|
|
109
|
+
HybridAixProps::HybridAixProps(const HybridAixProps& other):
|
|
110
|
+
react::ViewProps(),
|
|
111
|
+
shouldStartAtEnd(other.shouldStartAtEnd),
|
|
112
|
+
scrollOnFooterSizeUpdate(other.scrollOnFooterSizeUpdate),
|
|
113
|
+
scrollEndReachedThreshold(other.scrollEndReachedThreshold),
|
|
114
|
+
additionalContentInsets(other.additionalContentInsets),
|
|
115
|
+
additionalScrollIndicatorInsets(other.additionalScrollIndicatorInsets),
|
|
116
|
+
mainScrollViewID(other.mainScrollViewID),
|
|
117
|
+
penultimateCellIndex(other.penultimateCellIndex),
|
|
118
|
+
hybridRef(other.hybridRef) { }
|
|
119
|
+
|
|
120
|
+
bool HybridAixProps::filterObjectKeys(const std::string& propName) {
|
|
121
|
+
switch (hashString(propName)) {
|
|
122
|
+
case hashString("shouldStartAtEnd"): return true;
|
|
123
|
+
case hashString("scrollOnFooterSizeUpdate"): return true;
|
|
124
|
+
case hashString("scrollEndReachedThreshold"): return true;
|
|
125
|
+
case hashString("additionalContentInsets"): return true;
|
|
126
|
+
case hashString("additionalScrollIndicatorInsets"): return true;
|
|
127
|
+
case hashString("mainScrollViewID"): return true;
|
|
128
|
+
case hashString("penultimateCellIndex"): return true;
|
|
129
|
+
case hashString("hybridRef"): return true;
|
|
130
|
+
default: return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
HybridAixComponentDescriptor::HybridAixComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
135
|
+
: ConcreteComponentDescriptor(parameters,
|
|
136
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
137
|
+
|
|
138
|
+
std::shared_ptr<const react::Props> HybridAixComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
139
|
+
const std::shared_ptr<const react::Props>& props,
|
|
140
|
+
react::RawProps rawProps) const {
|
|
141
|
+
// 1. Prepare raw props parser
|
|
142
|
+
rawProps.parse(rawPropsParser_);
|
|
143
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
144
|
+
return HybridAixShadowNode::Props(context, /* & */ rawProps, props);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#ifdef ANDROID
|
|
148
|
+
void HybridAixComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
149
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
150
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
151
|
+
auto& concreteShadowNode = dynamic_cast<HybridAixShadowNode&>(shadowNode);
|
|
152
|
+
const HybridAixProps& props = concreteShadowNode.getConcreteProps();
|
|
153
|
+
HybridAixState state;
|
|
154
|
+
state.setProps(props);
|
|
155
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
156
|
+
}
|
|
157
|
+
#endif
|
|
158
|
+
|
|
159
|
+
} // namespace margelo::nitro::aix::views
|