@onekeyfe/react-native-chart-webview 3.0.81-alpha.8 → 3.0.82
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/lib/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/lib/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/lib/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/lib/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/lib/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/lib/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/lib/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/nitrogen/generated/android/c++/JFunc_void.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +3 -3
- package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +49 -48
- package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +20 -22
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +53 -53
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +4 -4
- package/nitrogen/generated/android/chartwebview+autolinking.cmake +1 -1
- package/nitrogen/generated/android/chartwebview+autolinking.gradle +1 -1
- package/nitrogen/generated/android/chartwebviewOnLoad.cpp +30 -20
- package/nitrogen/generated/android/chartwebviewOnLoad.hpp +14 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +17 -19
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +40 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +1 -1
- package/nitrogen/generated/ios/ChartWebview+autolinking.rb +2 -2
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +5 -5
- package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/ChartWebviewAutolinking.mm +1 -1
- package/nitrogen/generated/ios/ChartWebviewAutolinking.swift +9 -8
- package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +7 -1
- package/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +27 -1
- package/nitrogen/generated/ios/swift/Func_void.swift +1 -2
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -2
- package/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +3 -4
- package/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +18 -2
- package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +10 -26
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +9 -6
- package/package.json +6 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewSpecSwift.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -49,6 +49,12 @@ namespace margelo::nitro::chartwebview {
|
|
|
49
49
|
inline size_t getExternalMemorySize() noexcept override {
|
|
50
50
|
return _swiftPart.getMemorySize();
|
|
51
51
|
}
|
|
52
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
53
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridChartWebviewSpecSwift>(other)) {
|
|
54
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
52
58
|
void dispose() noexcept override {
|
|
53
59
|
_swiftPart.dispose();
|
|
54
60
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewComponent.mm
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#import "HybridChartWebviewComponent.hpp"
|
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
#import "HybridChartWebviewSpecSwift.hpp"
|
|
18
18
|
#import "ChartWebview-Swift-Cxx-Umbrella.hpp"
|
|
19
19
|
|
|
20
|
+
#if __has_include(<cxxreact/ReactNativeVersion.h>)
|
|
21
|
+
#include <cxxreact/ReactNativeVersion.h>
|
|
22
|
+
#if REACT_NATIVE_VERSION_MINOR >= 82
|
|
23
|
+
#define ENABLE_RCT_COMPONENT_VIEW_INVALIDATE
|
|
24
|
+
#endif
|
|
25
|
+
#endif
|
|
26
|
+
|
|
20
27
|
using namespace facebook;
|
|
21
28
|
using namespace margelo::nitro::chartwebview;
|
|
22
29
|
using namespace margelo::nitro::chartwebview::views;
|
|
@@ -25,6 +32,7 @@ using namespace margelo::nitro::chartwebview::views;
|
|
|
25
32
|
* Represents the React Native View holder for the Nitro "ChartWebview" HybridView.
|
|
26
33
|
*/
|
|
27
34
|
@interface HybridChartWebviewComponent: RCTViewComponentView
|
|
35
|
+
+ (BOOL)shouldBeRecycled;
|
|
28
36
|
@end
|
|
29
37
|
|
|
30
38
|
@implementation HybridChartWebviewComponent {
|
|
@@ -153,4 +161,22 @@ using namespace margelo::nitro::chartwebview::views;
|
|
|
153
161
|
[super updateProps:props oldProps:oldProps];
|
|
154
162
|
}
|
|
155
163
|
|
|
164
|
+
+ (BOOL)shouldBeRecycled {
|
|
165
|
+
return ChartWebview::ChartWebviewAutolinking::isChartWebviewRecyclable();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
- (void)prepareForRecycle {
|
|
169
|
+
[super prepareForRecycle];
|
|
170
|
+
ChartWebview::HybridChartWebviewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
171
|
+
swiftPart.maybePrepareForRecycle();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#ifdef ENABLE_RCT_COMPONENT_VIEW_INVALIDATE
|
|
175
|
+
- (void)invalidate {
|
|
176
|
+
ChartWebview::HybridChartWebviewSpec_cxx& swiftPart = _hybridView->getSwiftPart();
|
|
177
|
+
swiftPart.onDropView();
|
|
178
|
+
[super invalidate];
|
|
179
|
+
}
|
|
180
|
+
#endif
|
|
181
|
+
|
|
156
182
|
@end
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// Func_void.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// Func_void_std__string.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridChartWebviewSpec.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/// See ``HybridChartWebviewSpec``
|
|
@@ -44,14 +43,14 @@ open class HybridChartWebviewSpec_base {
|
|
|
44
43
|
public init() { }
|
|
45
44
|
public func getCxxWrapper() -> HybridChartWebviewSpec_cxx {
|
|
46
45
|
#if DEBUG
|
|
47
|
-
guard self is HybridChartWebviewSpec else {
|
|
46
|
+
guard self is any HybridChartWebviewSpec else {
|
|
48
47
|
fatalError("`self` is not a `HybridChartWebviewSpec`! Did you accidentally inherit from `HybridChartWebviewSpec_base` instead of `HybridChartWebviewSpec`?")
|
|
49
48
|
}
|
|
50
49
|
#endif
|
|
51
50
|
if let cxxWrapper = self.cxxWrapper {
|
|
52
51
|
return cxxWrapper
|
|
53
52
|
} else {
|
|
54
|
-
let cxxWrapper = HybridChartWebviewSpec_cxx(self as! HybridChartWebviewSpec)
|
|
53
|
+
let cxxWrapper = HybridChartWebviewSpec_cxx(self as! any HybridChartWebviewSpec)
|
|
55
54
|
self.cxxWrapper = cxxWrapper
|
|
56
55
|
return cxxWrapper
|
|
57
56
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
/// HybridChartWebviewSpec_cxx.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
import Foundation
|
|
9
8
|
import NitroModules
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -96,6 +95,14 @@ open class HybridChartWebviewSpec_cxx {
|
|
|
96
95
|
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
96
|
}
|
|
98
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridChartWebviewSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
/**
|
|
100
107
|
* Call dispose() on the Swift class.
|
|
101
108
|
* This _may_ be called manually from JS.
|
|
@@ -495,4 +502,13 @@ open class HybridChartWebviewSpec_cxx {
|
|
|
495
502
|
public final func afterUpdate() {
|
|
496
503
|
__implementation.afterUpdate()
|
|
497
504
|
}
|
|
505
|
+
|
|
506
|
+
public final func maybePrepareForRecycle() {
|
|
507
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
508
|
+
recyclable.prepareForRecycle()
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
public final func onDropView() {
|
|
512
|
+
__implementation.onDropView()
|
|
513
|
+
}
|
|
498
514
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridChartWebviewSpec.hpp"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewComponent.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#include "HybridChartWebviewComponent.hpp"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include <utility>
|
|
13
13
|
#include <NitroModules/NitroDefines.hpp>
|
|
14
14
|
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
15
16
|
#include <react/renderer/core/RawValue.h>
|
|
16
17
|
#include <react/renderer/core/ShadowNode.h>
|
|
17
18
|
#include <react/renderer/core/ComponentDescriptor.h>
|
|
@@ -130,7 +131,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
130
131
|
const react::RawValue* rawValue = rawProps.at("onMessage", nullptr, nullptr);
|
|
131
132
|
if (rawValue == nullptr) return sourceProps.onMessage;
|
|
132
133
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
133
|
-
return CachedProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMessage);
|
|
134
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onMessage);
|
|
134
135
|
} catch (const std::exception& exc) {
|
|
135
136
|
throw std::runtime_error(std::string("ChartWebview.onMessage: ") + exc.what());
|
|
136
137
|
}
|
|
@@ -140,7 +141,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
140
141
|
const react::RawValue* rawValue = rawProps.at("onLoadEnd", nullptr, nullptr);
|
|
141
142
|
if (rawValue == nullptr) return sourceProps.onLoadEnd;
|
|
142
143
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
143
|
-
return CachedProp<std::optional<std::function<void()>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onLoadEnd);
|
|
144
|
+
return CachedProp<std::optional<std::function<void()>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onLoadEnd);
|
|
144
145
|
} catch (const std::exception& exc) {
|
|
145
146
|
throw std::runtime_error(std::string("ChartWebview.onLoadEnd: ") + exc.what());
|
|
146
147
|
}
|
|
@@ -150,7 +151,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
150
151
|
const react::RawValue* rawValue = rawProps.at("onError", nullptr, nullptr);
|
|
151
152
|
if (rawValue == nullptr) return sourceProps.onError;
|
|
152
153
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
153
|
-
return CachedProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onError);
|
|
154
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onError);
|
|
154
155
|
} catch (const std::exception& exc) {
|
|
155
156
|
throw std::runtime_error(std::string("ChartWebview.onError: ") + exc.what());
|
|
156
157
|
}
|
|
@@ -160,29 +161,12 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
160
161
|
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
161
162
|
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
162
163
|
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
163
|
-
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridChartWebviewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef);
|
|
164
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridChartWebviewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.hybridRef);
|
|
164
165
|
} catch (const std::exception& exc) {
|
|
165
166
|
throw std::runtime_error(std::string("ChartWebview.hybridRef: ") + exc.what());
|
|
166
167
|
}
|
|
167
168
|
}()) { }
|
|
168
169
|
|
|
169
|
-
HybridChartWebviewProps::HybridChartWebviewProps(const HybridChartWebviewProps& other):
|
|
170
|
-
react::ViewProps(),
|
|
171
|
-
uri(other.uri),
|
|
172
|
-
localBundle(other.localBundle),
|
|
173
|
-
entry(other.entry),
|
|
174
|
-
paramsJson(other.paramsJson),
|
|
175
|
-
assetHost(other.assetHost),
|
|
176
|
-
bridgeScript(other.bridgeScript),
|
|
177
|
-
reuseKey(other.reuseKey),
|
|
178
|
-
pooled(other.pooled),
|
|
179
|
-
active(other.active),
|
|
180
|
-
webviewDebuggingEnabled(other.webviewDebuggingEnabled),
|
|
181
|
-
onMessage(other.onMessage),
|
|
182
|
-
onLoadEnd(other.onLoadEnd),
|
|
183
|
-
onError(other.onError),
|
|
184
|
-
hybridRef(other.hybridRef) { }
|
|
185
|
-
|
|
186
170
|
bool HybridChartWebviewProps::filterObjectKeys(const std::string& propName) {
|
|
187
171
|
switch (hashString(propName)) {
|
|
188
172
|
case hashString("uri"): return true;
|
|
@@ -220,10 +204,10 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
220
204
|
void HybridChartWebviewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
221
205
|
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
222
206
|
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
223
|
-
auto& concreteShadowNode =
|
|
224
|
-
const HybridChartWebviewProps
|
|
225
|
-
|
|
226
|
-
state
|
|
207
|
+
auto& concreteShadowNode = static_cast<HybridChartWebviewShadowNode&>(shadowNode);
|
|
208
|
+
const std::shared_ptr<const HybridChartWebviewProps>& constProps = concreteShadowNode.getConcreteSharedProps();
|
|
209
|
+
const std::shared_ptr<HybridChartWebviewProps>& props = std::const_pointer_cast<HybridChartWebviewProps>(constProps);
|
|
210
|
+
HybridChartWebviewState state{props};
|
|
227
211
|
concreteShadowNode.setStateData(std::move(state));
|
|
228
212
|
}
|
|
229
213
|
#endif
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// HybridChartWebviewComponent.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -37,7 +37,6 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
37
37
|
class HybridChartWebviewProps final: public react::ViewProps {
|
|
38
38
|
public:
|
|
39
39
|
HybridChartWebviewProps() = default;
|
|
40
|
-
HybridChartWebviewProps(const HybridChartWebviewProps&);
|
|
41
40
|
HybridChartWebviewProps(const react::PropsParserContext& context,
|
|
42
41
|
const HybridChartWebviewProps& sourceProps,
|
|
43
42
|
const react::RawProps& rawProps);
|
|
@@ -68,10 +67,14 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
68
67
|
class HybridChartWebviewState final {
|
|
69
68
|
public:
|
|
70
69
|
HybridChartWebviewState() = default;
|
|
70
|
+
explicit HybridChartWebviewState(const std::shared_ptr<HybridChartWebviewProps>& props):
|
|
71
|
+
_props(props) {}
|
|
71
72
|
|
|
72
73
|
public:
|
|
73
|
-
|
|
74
|
-
const std::
|
|
74
|
+
[[nodiscard]]
|
|
75
|
+
const std::shared_ptr<HybridChartWebviewProps>& getProps() const {
|
|
76
|
+
return _props;
|
|
77
|
+
}
|
|
75
78
|
|
|
76
79
|
public:
|
|
77
80
|
#ifdef ANDROID
|
|
@@ -85,7 +88,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
85
88
|
#endif
|
|
86
89
|
|
|
87
90
|
private:
|
|
88
|
-
std::
|
|
91
|
+
std::shared_ptr<HybridChartWebviewProps> _props;
|
|
89
92
|
};
|
|
90
93
|
|
|
91
94
|
/**
|
|
@@ -101,7 +104,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
101
104
|
*/
|
|
102
105
|
class HybridChartWebviewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridChartWebviewShadowNode> {
|
|
103
106
|
public:
|
|
104
|
-
HybridChartWebviewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
107
|
+
explicit HybridChartWebviewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
105
108
|
|
|
106
109
|
public:
|
|
107
110
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-chart-webview",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.82",
|
|
4
4
|
"description": "react-native-chart-webview",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
38
38
|
"prepare": "bob build && cp -r nitrogen lib/nitrogen",
|
|
39
|
-
"nitrogen": "nitrogen",
|
|
39
|
+
"nitrogen": "nitrogen && node ./scripts/open-generated-view-manager.mjs",
|
|
40
40
|
"typecheck": "tsc",
|
|
41
41
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
42
42
|
"test": "jest",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"eslint-plugin-prettier": "^5.5.4",
|
|
78
78
|
"jest": "^29.7.0",
|
|
79
79
|
"lefthook": "^2.0.3",
|
|
80
|
-
"nitrogen": "0.
|
|
80
|
+
"nitrogen": "0.35.2",
|
|
81
81
|
"prettier": "^2.8.8",
|
|
82
82
|
"react": "19.2.0",
|
|
83
83
|
"react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
|
|
84
84
|
"react-native-builder-bob": "^0.40.13",
|
|
85
|
-
"react-native-nitro-modules": "0.
|
|
85
|
+
"react-native-nitro-modules": "0.35.2",
|
|
86
86
|
"release-it": "^19.0.4",
|
|
87
87
|
"turbo": "^2.5.6",
|
|
88
88
|
"typescript": "^5.9.2"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-native": "*",
|
|
93
|
-
"react-native-nitro-modules": "0.
|
|
93
|
+
"react-native-nitro-modules": "0.35.2"
|
|
94
94
|
},
|
|
95
95
|
"packageManager": "yarn@4.11.0",
|
|
96
96
|
"react-native-builder-bob": {
|
|
@@ -166,6 +166,5 @@
|
|
|
166
166
|
"release-it"
|
|
167
167
|
],
|
|
168
168
|
"version": "0.56.0"
|
|
169
|
-
}
|
|
170
|
-
"stableVersion": "3.0.80"
|
|
169
|
+
}
|
|
171
170
|
}
|