aix 0.6.0 → 0.6.2
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 +269 -70
- package/ios/EditMenuDefaultActions.swift +70 -0
- package/ios/HybridAix.swift +28 -3
- package/ios/HybridAixCellView.swift +1 -1
- package/ios/HybridAixComposer.swift +82 -0
- package/ios/HybridAixDropzone.swift +104 -0
- package/ios/HybridAixInputWrapper.swift +447 -0
- package/ios/InputType.swift +40 -0
- package/ios/PasteFileManager.swift +92 -0
- package/nitro.json +8 -0
- package/nitrogen/generated/android/Aix+autolinking.cmake +8 -0
- package/nitrogen/generated/android/AixOnLoad.cpp +26 -0
- package/nitrogen/generated/android/c++/JAixInputWrapperOnPasteEvent.hpp +70 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_AixInputWrapperOnPasteEvent_.hpp +98 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridAixComposerSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridAixDropzoneSpec.cpp +72 -0
- package/nitrogen/generated/android/c++/JHybridAixDropzoneSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridAixInputWrapperSpec.cpp +144 -0
- package/nitrogen/generated/android/c++/JHybridAixInputWrapperSpec.hpp +74 -0
- package/nitrogen/generated/android/c++/views/JHybridAixComposerStateUpdater.cpp +4 -0
- package/nitrogen/generated/android/c++/views/JHybridAixDropzoneStateUpdater.cpp +56 -0
- package/nitrogen/generated/android/c++/views/JHybridAixDropzoneStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridAixInputWrapperStateUpdater.cpp +72 -0
- package/nitrogen/generated/android/c++/views/JHybridAixInputWrapperStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixInputWrapperOnPasteEvent.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/Func_void_std__vector_AixInputWrapperOnPasteEvent_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixComposerSpec.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixDropzoneSpec.kt +67 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/HybridAixInputWrapperSpec.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixDropzoneManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixDropzoneStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixInputWrapperManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixInputWrapperStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.cpp +42 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Bridge.hpp +112 -0
- package/nitrogen/generated/ios/Aix-Swift-Cxx-Umbrella.hpp +14 -0
- package/nitrogen/generated/ios/AixAutolinking.mm +16 -0
- package/nitrogen/generated/ios/AixAutolinking.swift +30 -0
- package/nitrogen/generated/ios/c++/HybridAixComposerSpecSwift.hpp +7 -0
- package/nitrogen/generated/ios/c++/HybridAixDropzoneSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixDropzoneSpecSwift.hpp +80 -0
- package/nitrogen/generated/ios/c++/HybridAixInputWrapperSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAixInputWrapperSpecSwift.hpp +108 -0
- package/nitrogen/generated/ios/c++/views/HybridAixComposerComponent.mm +5 -0
- package/nitrogen/generated/ios/c++/views/HybridAixDropzoneComponent.mm +96 -0
- package/nitrogen/generated/ios/c++/views/HybridAixInputWrapperComponent.mm +116 -0
- package/nitrogen/generated/ios/swift/AixInputWrapperOnPasteEvent.swift +107 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AixInputWrapperOnPasteEvent_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridAixComposerSpec_cxx.swift +24 -0
- package/nitrogen/generated/ios/swift/HybridAixDropzoneSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridAixDropzoneSpec_cxx.swift +167 -0
- package/nitrogen/generated/ios/swift/HybridAixInputWrapperSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridAixInputWrapperSpec_cxx.swift +261 -0
- package/nitrogen/generated/shared/c++/AixInputWrapperOnPasteEvent.hpp +88 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridAixComposerSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/HybridAixDropzoneSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridAixDropzoneSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridAixInputWrapperSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridAixInputWrapperSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridAixComposerComponent.hpp +1 -0
- package/nitrogen/generated/shared/c++/views/HybridAixDropzoneComponent.cpp +87 -0
- package/nitrogen/generated/shared/c++/views/HybridAixDropzoneComponent.hpp +109 -0
- package/nitrogen/generated/shared/c++/views/HybridAixInputWrapperComponent.cpp +135 -0
- package/nitrogen/generated/shared/c++/views/HybridAixInputWrapperComponent.hpp +114 -0
- package/nitrogen/generated/shared/json/AixComposerConfig.json +1 -0
- package/nitrogen/generated/shared/json/AixDropzoneConfig.json +10 -0
- package/nitrogen/generated/shared/json/AixInputWrapperConfig.json +14 -0
- package/package.json +1 -1
- package/src/dropzone.ios.tsx +27 -0
- package/src/dropzone.tsx +10 -0
- package/src/index.ts +3 -0
- package/src/input-wrapper.ios.tsx +30 -0
- package/src/input-wrapper.tsx +17 -0
- package/src/views/aix.nitro.ts +33 -19
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixInputWrapperSpec.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 <NitroModules/JHybridObject.hpp>
|
|
11
|
+
#include <fbjni/fbjni.h>
|
|
12
|
+
#include "HybridAixInputWrapperSpec.hpp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::aix {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
class JHybridAixInputWrapperSpec: public jni::HybridClass<JHybridAixInputWrapperSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridAixInputWrapperSpec {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/aix/HybridAixInputWrapperSpec;";
|
|
25
|
+
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
+
static void registerNatives();
|
|
27
|
+
|
|
28
|
+
protected:
|
|
29
|
+
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
+
explicit JHybridAixInputWrapperSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridAixInputWrapperSpec::TAG),
|
|
32
|
+
HybridBase(jThis),
|
|
33
|
+
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
~JHybridAixInputWrapperSpec() override {
|
|
37
|
+
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
+
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
size_t getExternalMemorySize() noexcept override;
|
|
43
|
+
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
inline const jni::global_ref<JHybridAixInputWrapperSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
+
return _javaPart;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
std::optional<std::vector<std::string>> getPasteConfiguration() override;
|
|
54
|
+
void setPasteConfiguration(const std::optional<std::vector<std::string>>& pasteConfiguration) override;
|
|
55
|
+
std::optional<std::vector<std::string>> getEditMenuDefaultActions() override;
|
|
56
|
+
void setEditMenuDefaultActions(const std::optional<std::vector<std::string>>& editMenuDefaultActions) override;
|
|
57
|
+
std::optional<double> getMaxLines() override;
|
|
58
|
+
void setMaxLines(std::optional<double> maxLines) override;
|
|
59
|
+
std::optional<double> getMaxChars() override;
|
|
60
|
+
void setMaxChars(std::optional<double> maxChars) override;
|
|
61
|
+
std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>> getOnPaste() override;
|
|
62
|
+
void setOnPaste(const std::optional<std::function<void(const std::vector<AixInputWrapperOnPasteEvent>& /* events */)>>& onPaste) override;
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
// Methods
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
friend HybridBase;
|
|
70
|
+
using HybridBase::HybridBase;
|
|
71
|
+
jni::global_ref<JHybridAixInputWrapperSpec::javaobject> _javaPart;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::aix
|
|
@@ -40,6 +40,10 @@ void JHybridAixComposerStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
|
|
|
40
40
|
view->setStickToKeyboard(props.stickToKeyboard.value);
|
|
41
41
|
// TODO: Set isDirty = false
|
|
42
42
|
}
|
|
43
|
+
if (props.fixInput.isDirty) {
|
|
44
|
+
view->setFixInput(props.fixInput.value);
|
|
45
|
+
// TODO: Set isDirty = false
|
|
46
|
+
}
|
|
43
47
|
|
|
44
48
|
// Update hybridRef if it changed
|
|
45
49
|
if (props.hybridRef.isDirty) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixDropzoneStateUpdater.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 "JHybridAixDropzoneStateUpdater.hpp"
|
|
9
|
+
#include "views/HybridAixDropzoneComponent.hpp"
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::aix::views {
|
|
13
|
+
|
|
14
|
+
using namespace facebook;
|
|
15
|
+
using ConcreteStateData = react::ConcreteState<HybridAixDropzoneState>;
|
|
16
|
+
|
|
17
|
+
void JHybridAixDropzoneStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
18
|
+
jni::alias_ref<JHybridAixDropzoneSpec::javaobject> javaView,
|
|
19
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
|
|
20
|
+
JHybridAixDropzoneSpec* view = javaView->cthis();
|
|
21
|
+
|
|
22
|
+
// Get concrete StateWrapperImpl from passed StateWrapper interface object
|
|
23
|
+
jobject rawStateWrapper = stateWrapperInterface.get();
|
|
24
|
+
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
|
|
25
|
+
throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
|
|
26
|
+
}
|
|
27
|
+
auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
|
|
28
|
+
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
29
|
+
|
|
30
|
+
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
31
|
+
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
|
|
32
|
+
const HybridAixDropzoneState& data = concreteState->getData();
|
|
33
|
+
const std::optional<HybridAixDropzoneProps>& maybeProps = data.getProps();
|
|
34
|
+
if (!maybeProps.has_value()) {
|
|
35
|
+
// Props aren't set yet!
|
|
36
|
+
throw std::runtime_error("HybridAixDropzoneState's data doesn't contain any props!");
|
|
37
|
+
}
|
|
38
|
+
const HybridAixDropzoneProps& props = maybeProps.value();
|
|
39
|
+
if (props.onDrop.isDirty) {
|
|
40
|
+
view->setOnDrop(props.onDrop.value);
|
|
41
|
+
// TODO: Set isDirty = false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Update hybridRef if it changed
|
|
45
|
+
if (props.hybridRef.isDirty) {
|
|
46
|
+
// hybridRef changed - call it with new this
|
|
47
|
+
const auto& maybeFunc = props.hybridRef.value;
|
|
48
|
+
if (maybeFunc.has_value()) {
|
|
49
|
+
std::shared_ptr<JHybridAixDropzoneSpec> shared = javaView->cthis()->shared_cast<JHybridAixDropzoneSpec>();
|
|
50
|
+
maybeFunc.value()(shared);
|
|
51
|
+
}
|
|
52
|
+
// TODO: Set isDirty = false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixDropzoneStateUpdater.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
|
+
#ifndef RN_SERIALIZABLE_STATE
|
|
11
|
+
#error Aix was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <fbjni/fbjni.h>
|
|
15
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
16
|
+
#include <react/fabric/CoreComponentsRegistry.h>
|
|
17
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
18
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
19
|
+
#include <NitroModules/JStateWrapper.hpp>
|
|
20
|
+
#include "JHybridAixDropzoneSpec.hpp"
|
|
21
|
+
#include "views/HybridAixDropzoneComponent.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::aix::views {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
class JHybridAixDropzoneStateUpdater: public jni::JavaClass<JHybridAixDropzoneStateUpdater> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/aix/views/HybridAixDropzoneStateUpdater;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
33
|
+
jni::alias_ref<JHybridAixDropzoneSpec::javaobject> view,
|
|
34
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
static void registerNatives() {
|
|
38
|
+
// Register JNI calls
|
|
39
|
+
javaClassStatic()->registerNatives({
|
|
40
|
+
makeNativeMethod("updateViewProps", JHybridAixDropzoneStateUpdater::updateViewProps),
|
|
41
|
+
});
|
|
42
|
+
// Register React Native view component descriptor
|
|
43
|
+
auto provider = react::concreteComponentDescriptorProvider<HybridAixDropzoneComponentDescriptor>();
|
|
44
|
+
auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
|
|
45
|
+
providerRegistry->add(provider);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixInputWrapperStateUpdater.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 "JHybridAixInputWrapperStateUpdater.hpp"
|
|
9
|
+
#include "views/HybridAixInputWrapperComponent.hpp"
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::aix::views {
|
|
13
|
+
|
|
14
|
+
using namespace facebook;
|
|
15
|
+
using ConcreteStateData = react::ConcreteState<HybridAixInputWrapperState>;
|
|
16
|
+
|
|
17
|
+
void JHybridAixInputWrapperStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
18
|
+
jni::alias_ref<JHybridAixInputWrapperSpec::javaobject> javaView,
|
|
19
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface) {
|
|
20
|
+
JHybridAixInputWrapperSpec* view = javaView->cthis();
|
|
21
|
+
|
|
22
|
+
// Get concrete StateWrapperImpl from passed StateWrapper interface object
|
|
23
|
+
jobject rawStateWrapper = stateWrapperInterface.get();
|
|
24
|
+
if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) {
|
|
25
|
+
throw std::runtime_error("StateWrapper is not a StateWrapperImpl");
|
|
26
|
+
}
|
|
27
|
+
auto stateWrapper = jni::alias_ref<react::StateWrapperImpl::javaobject>{
|
|
28
|
+
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
|
|
29
|
+
|
|
30
|
+
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
|
|
31
|
+
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
|
|
32
|
+
const HybridAixInputWrapperState& data = concreteState->getData();
|
|
33
|
+
const std::optional<HybridAixInputWrapperProps>& maybeProps = data.getProps();
|
|
34
|
+
if (!maybeProps.has_value()) {
|
|
35
|
+
// Props aren't set yet!
|
|
36
|
+
throw std::runtime_error("HybridAixInputWrapperState's data doesn't contain any props!");
|
|
37
|
+
}
|
|
38
|
+
const HybridAixInputWrapperProps& props = maybeProps.value();
|
|
39
|
+
if (props.pasteConfiguration.isDirty) {
|
|
40
|
+
view->setPasteConfiguration(props.pasteConfiguration.value);
|
|
41
|
+
// TODO: Set isDirty = false
|
|
42
|
+
}
|
|
43
|
+
if (props.editMenuDefaultActions.isDirty) {
|
|
44
|
+
view->setEditMenuDefaultActions(props.editMenuDefaultActions.value);
|
|
45
|
+
// TODO: Set isDirty = false
|
|
46
|
+
}
|
|
47
|
+
if (props.maxLines.isDirty) {
|
|
48
|
+
view->setMaxLines(props.maxLines.value);
|
|
49
|
+
// TODO: Set isDirty = false
|
|
50
|
+
}
|
|
51
|
+
if (props.maxChars.isDirty) {
|
|
52
|
+
view->setMaxChars(props.maxChars.value);
|
|
53
|
+
// TODO: Set isDirty = false
|
|
54
|
+
}
|
|
55
|
+
if (props.onPaste.isDirty) {
|
|
56
|
+
view->setOnPaste(props.onPaste.value);
|
|
57
|
+
// TODO: Set isDirty = false
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Update hybridRef if it changed
|
|
61
|
+
if (props.hybridRef.isDirty) {
|
|
62
|
+
// hybridRef changed - call it with new this
|
|
63
|
+
const auto& maybeFunc = props.hybridRef.value;
|
|
64
|
+
if (maybeFunc.has_value()) {
|
|
65
|
+
std::shared_ptr<JHybridAixInputWrapperSpec> shared = javaView->cthis()->shared_cast<JHybridAixInputWrapperSpec>();
|
|
66
|
+
maybeFunc.value()(shared);
|
|
67
|
+
}
|
|
68
|
+
// TODO: Set isDirty = false
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::aix::views
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JHybridAixInputWrapperStateUpdater.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
|
+
#ifndef RN_SERIALIZABLE_STATE
|
|
11
|
+
#error Aix was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists!
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <fbjni/fbjni.h>
|
|
15
|
+
#include <react/fabric/StateWrapperImpl.h>
|
|
16
|
+
#include <react/fabric/CoreComponentsRegistry.h>
|
|
17
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
18
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
19
|
+
#include <NitroModules/JStateWrapper.hpp>
|
|
20
|
+
#include "JHybridAixInputWrapperSpec.hpp"
|
|
21
|
+
#include "views/HybridAixInputWrapperComponent.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::aix::views {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
class JHybridAixInputWrapperStateUpdater: public jni::JavaClass<JHybridAixInputWrapperStateUpdater> {
|
|
28
|
+
public:
|
|
29
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/aix/views/HybridAixInputWrapperStateUpdater;";
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
static void updateViewProps(jni::alias_ref<jni::JClass> /* class */,
|
|
33
|
+
jni::alias_ref<JHybridAixInputWrapperSpec::javaobject> view,
|
|
34
|
+
jni::alias_ref<JStateWrapper::javaobject> stateWrapperInterface);
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
static void registerNatives() {
|
|
38
|
+
// Register JNI calls
|
|
39
|
+
javaClassStatic()->registerNatives({
|
|
40
|
+
makeNativeMethod("updateViewProps", JHybridAixInputWrapperStateUpdater::updateViewProps),
|
|
41
|
+
});
|
|
42
|
+
// Register React Native view component descriptor
|
|
43
|
+
auto provider = react::concreteComponentDescriptorProvider<HybridAixInputWrapperComponentDescriptor>();
|
|
44
|
+
auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry();
|
|
45
|
+
providerRegistry->add(provider);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::aix::views
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/AixInputWrapperOnPasteEvent.kt
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AixInputWrapperOnPasteEvent.kt
|
|
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
|
+
package com.margelo.nitro.aix
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "AixInputWrapperOnPasteEvent".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class AixInputWrapperOnPasteEvent(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val type: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val filePath: String,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val fileExtension: String?,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val fileName: String?
|
|
32
|
+
) {
|
|
33
|
+
/* primary constructor */
|
|
34
|
+
|
|
35
|
+
private companion object {
|
|
36
|
+
/**
|
|
37
|
+
* Constructor called from C++
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress("unused")
|
|
42
|
+
@JvmStatic
|
|
43
|
+
private fun fromCpp(type: String, filePath: String, fileExtension: String?, fileName: String?): AixInputWrapperOnPasteEvent {
|
|
44
|
+
return AixInputWrapperOnPasteEvent(type, filePath, fileExtension, fileName)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__vector_AixInputWrapperOnPasteEvent_.kt
|
|
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
|
+
package com.margelo.nitro.aix
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents the JavaScript callback `(events: array) => void`.
|
|
18
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
+
fun interface Func_void_std__vector_AixInputWrapperOnPasteEvent_: (Array<AixInputWrapperOnPasteEvent>) -> Unit {
|
|
25
|
+
/**
|
|
26
|
+
* Call the given JS callback.
|
|
27
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
+
*/
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
override fun invoke(events: Array<AixInputWrapperOnPasteEvent>): Unit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the JavaScript callback `(events: array) => void`.
|
|
36
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
+
* The callback might be coming from JS.
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress(
|
|
42
|
+
"KotlinJniMissingFunction", "unused",
|
|
43
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
+
)
|
|
46
|
+
class Func_void_std__vector_AixInputWrapperOnPasteEvent__cxx: Func_void_std__vector_AixInputWrapperOnPasteEvent_ {
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
private val mHybridData: HybridData
|
|
50
|
+
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
private constructor(hybridData: HybridData) {
|
|
54
|
+
mHybridData = hybridData
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
override fun invoke(events: Array<AixInputWrapperOnPasteEvent>): Unit
|
|
60
|
+
= invoke_cxx(events)
|
|
61
|
+
|
|
62
|
+
@FastNative
|
|
63
|
+
private external fun invoke_cxx(events: Array<AixInputWrapperOnPasteEvent>): Unit
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the JavaScript callback `(events: array) => void`.
|
|
68
|
+
* This is implemented in Java/Kotlin, via a `(Array<AixInputWrapperOnPasteEvent>) -> Unit`.
|
|
69
|
+
* The callback is always coming from native.
|
|
70
|
+
*/
|
|
71
|
+
@DoNotStrip
|
|
72
|
+
@Keep
|
|
73
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
+
class Func_void_std__vector_AixInputWrapperOnPasteEvent__java(private val function: (Array<AixInputWrapperOnPasteEvent>) -> Unit): Func_void_std__vector_AixInputWrapperOnPasteEvent_ {
|
|
75
|
+
@DoNotStrip
|
|
76
|
+
@Keep
|
|
77
|
+
override fun invoke(events: Array<AixInputWrapperOnPasteEvent>): Unit {
|
|
78
|
+
return this.function(events)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -47,6 +47,12 @@ abstract class HybridAixComposerSpec: HybridView() {
|
|
|
47
47
|
@set:DoNotStrip
|
|
48
48
|
@set:Keep
|
|
49
49
|
abstract var stickToKeyboard: AixStickToKeyboard?
|
|
50
|
+
|
|
51
|
+
@get:DoNotStrip
|
|
52
|
+
@get:Keep
|
|
53
|
+
@set:DoNotStrip
|
|
54
|
+
@set:Keep
|
|
55
|
+
abstract var fixInput: Boolean?
|
|
50
56
|
|
|
51
57
|
// Methods
|
|
52
58
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixDropzoneSpec.kt
|
|
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
|
+
package com.margelo.nitro.aix
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.views.HybridView
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the AixDropzone HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of AixDropzone.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridAixDropzoneSpec: HybridView() {
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private var mHybridData: HybridData = initHybrid()
|
|
29
|
+
|
|
30
|
+
init {
|
|
31
|
+
super.updateNative(mHybridData)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun updateNative(hybridData: HybridData) {
|
|
35
|
+
mHybridData = hybridData
|
|
36
|
+
super.updateNative(hybridData)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Default implementation of `HybridObject.toString()`
|
|
40
|
+
override fun toString(): String {
|
|
41
|
+
return "[HybridObject AixDropzone]"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Properties
|
|
45
|
+
abstract var onDrop: ((events: Array<AixInputWrapperOnPasteEvent>) -> Unit)?
|
|
46
|
+
|
|
47
|
+
private var onDrop_cxx: Func_void_std__vector_AixInputWrapperOnPasteEvent_?
|
|
48
|
+
@Keep
|
|
49
|
+
@DoNotStrip
|
|
50
|
+
get() {
|
|
51
|
+
return onDrop?.let { Func_void_std__vector_AixInputWrapperOnPasteEvent__java(it) }
|
|
52
|
+
}
|
|
53
|
+
@Keep
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
set(value) {
|
|
56
|
+
onDrop = value?.let { it }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Methods
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
private external fun initHybrid(): HybridData
|
|
63
|
+
|
|
64
|
+
companion object {
|
|
65
|
+
protected const val TAG = "HybridAixDropzoneSpec"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixInputWrapperSpec.kt
|
|
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
|
+
package com.margelo.nitro.aix
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.views.HybridView
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Kotlin class representing the AixInputWrapper HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of AixInputWrapper.
|
|
18
|
+
*/
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
@Keep
|
|
21
|
+
@Suppress(
|
|
22
|
+
"KotlinJniMissingFunction", "unused",
|
|
23
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
|
+
)
|
|
26
|
+
abstract class HybridAixInputWrapperSpec: HybridView() {
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
private var mHybridData: HybridData = initHybrid()
|
|
29
|
+
|
|
30
|
+
init {
|
|
31
|
+
super.updateNative(mHybridData)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun updateNative(hybridData: HybridData) {
|
|
35
|
+
mHybridData = hybridData
|
|
36
|
+
super.updateNative(hybridData)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Default implementation of `HybridObject.toString()`
|
|
40
|
+
override fun toString(): String {
|
|
41
|
+
return "[HybridObject AixInputWrapper]"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Properties
|
|
45
|
+
@get:DoNotStrip
|
|
46
|
+
@get:Keep
|
|
47
|
+
@set:DoNotStrip
|
|
48
|
+
@set:Keep
|
|
49
|
+
abstract var pasteConfiguration: Array<String>?
|
|
50
|
+
|
|
51
|
+
@get:DoNotStrip
|
|
52
|
+
@get:Keep
|
|
53
|
+
@set:DoNotStrip
|
|
54
|
+
@set:Keep
|
|
55
|
+
abstract var editMenuDefaultActions: Array<String>?
|
|
56
|
+
|
|
57
|
+
@get:DoNotStrip
|
|
58
|
+
@get:Keep
|
|
59
|
+
@set:DoNotStrip
|
|
60
|
+
@set:Keep
|
|
61
|
+
abstract var maxLines: Double?
|
|
62
|
+
|
|
63
|
+
@get:DoNotStrip
|
|
64
|
+
@get:Keep
|
|
65
|
+
@set:DoNotStrip
|
|
66
|
+
@set:Keep
|
|
67
|
+
abstract var maxChars: Double?
|
|
68
|
+
|
|
69
|
+
abstract var onPaste: ((events: Array<AixInputWrapperOnPasteEvent>) -> Unit)?
|
|
70
|
+
|
|
71
|
+
private var onPaste_cxx: Func_void_std__vector_AixInputWrapperOnPasteEvent_?
|
|
72
|
+
@Keep
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
get() {
|
|
75
|
+
return onPaste?.let { Func_void_std__vector_AixInputWrapperOnPasteEvent__java(it) }
|
|
76
|
+
}
|
|
77
|
+
@Keep
|
|
78
|
+
@DoNotStrip
|
|
79
|
+
set(value) {
|
|
80
|
+
onPaste = value?.let { it }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Methods
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
private external fun initHybrid(): HybridData
|
|
87
|
+
|
|
88
|
+
companion object {
|
|
89
|
+
protected const val TAG = "HybridAixInputWrapperSpec"
|
|
90
|
+
}
|
|
91
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/aix/views/HybridAixDropzoneManager.kt
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAixDropzoneManager.kt
|
|
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
|
+
package com.margelo.nitro.aix.views
|
|
9
|
+
|
|
10
|
+
import android.view.View
|
|
11
|
+
import com.facebook.react.uimanager.ReactStylesDiffMap
|
|
12
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
13
|
+
import com.facebook.react.uimanager.StateWrapper
|
|
14
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
15
|
+
import com.aix.*
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the React Native `ViewManager` for the "AixDropzone" Nitro HybridView.
|
|
19
|
+
*/
|
|
20
|
+
open class HybridAixDropzoneManager: SimpleViewManager<View>() {
|
|
21
|
+
private val views = hashMapOf<View, HybridAixDropzone>()
|
|
22
|
+
|
|
23
|
+
override fun getName(): String {
|
|
24
|
+
return "AixDropzone"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
28
|
+
val hybridView = HybridAixDropzone(reactContext)
|
|
29
|
+
val view = hybridView.view
|
|
30
|
+
views[view] = hybridView
|
|
31
|
+
return view
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun onDropViewInstance(view: View) {
|
|
35
|
+
super.onDropViewInstance(view)
|
|
36
|
+
views.remove(view)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? {
|
|
40
|
+
val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!")
|
|
41
|
+
|
|
42
|
+
// 1. Update each prop individually
|
|
43
|
+
hybridView.beforeUpdate()
|
|
44
|
+
HybridAixDropzoneStateUpdater.updateViewProps(hybridView, stateWrapper)
|
|
45
|
+
hybridView.afterUpdate()
|
|
46
|
+
|
|
47
|
+
// 2. Continue in base View props
|
|
48
|
+
return super.updateState(view, props, stateWrapper)
|
|
49
|
+
}
|
|
50
|
+
}
|