@onekeyfe/react-native-chart-webview 3.0.95 → 3.0.98
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++/views/JHybridChartWebviewStateUpdater.cpp +97 -67
- package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +6 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +26 -10
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +2 -2
- package/lib/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +116 -82
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +18 -175
- package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +59 -61
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +97 -67
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +6 -1
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +26 -10
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +2 -2
- package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +116 -82
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +18 -175
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +59 -61
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +97 -67
- package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +6 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +26 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +2 -2
- package/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +116 -82
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +18 -175
- package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +59 -61
- package/package.json +4 -4
|
@@ -7,165 +7,33 @@
|
|
|
7
7
|
|
|
8
8
|
#include "HybridChartWebviewComponent.hpp"
|
|
9
9
|
|
|
10
|
-
#include <
|
|
11
|
-
#include <
|
|
12
|
-
#include <utility>
|
|
13
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
16
|
-
#include <react/renderer/core/RawValue.h>
|
|
17
|
-
#include <react/renderer/core/ShadowNode.h>
|
|
18
|
-
#include <react/renderer/core/ComponentDescriptor.h>
|
|
19
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
10
|
+
#include <NitroModules/NitroHash.hpp>
|
|
11
|
+
#include <NitroModules/ReactProp.hpp>
|
|
20
12
|
|
|
21
13
|
namespace margelo::nitro::chartwebview::views {
|
|
22
14
|
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
23
17
|
extern const char HybridChartWebviewComponentName[] = "ChartWebview";
|
|
24
18
|
|
|
25
19
|
HybridChartWebviewProps::HybridChartWebviewProps(const react::PropsParserContext& context,
|
|
26
20
|
const HybridChartWebviewProps& sourceProps,
|
|
27
21
|
const react::RawProps& rawProps):
|
|
28
22
|
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
29
|
-
uri(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
44
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.localBundle);
|
|
45
|
-
} catch (const std::exception& exc) {
|
|
46
|
-
throw std::runtime_error(std::string("ChartWebview.localBundle: ") + exc.what());
|
|
47
|
-
}
|
|
48
|
-
}()),
|
|
49
|
-
entry([&]() -> CachedProp<std::optional<std::string>> {
|
|
50
|
-
try {
|
|
51
|
-
const react::RawValue* rawValue = rawProps.at("entry", nullptr, nullptr);
|
|
52
|
-
if (rawValue == nullptr) return sourceProps.entry;
|
|
53
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
54
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.entry);
|
|
55
|
-
} catch (const std::exception& exc) {
|
|
56
|
-
throw std::runtime_error(std::string("ChartWebview.entry: ") + exc.what());
|
|
57
|
-
}
|
|
58
|
-
}()),
|
|
59
|
-
paramsJson([&]() -> CachedProp<std::optional<std::string>> {
|
|
60
|
-
try {
|
|
61
|
-
const react::RawValue* rawValue = rawProps.at("paramsJson", nullptr, nullptr);
|
|
62
|
-
if (rawValue == nullptr) return sourceProps.paramsJson;
|
|
63
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
64
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.paramsJson);
|
|
65
|
-
} catch (const std::exception& exc) {
|
|
66
|
-
throw std::runtime_error(std::string("ChartWebview.paramsJson: ") + exc.what());
|
|
67
|
-
}
|
|
68
|
-
}()),
|
|
69
|
-
assetHost([&]() -> CachedProp<std::optional<std::string>> {
|
|
70
|
-
try {
|
|
71
|
-
const react::RawValue* rawValue = rawProps.at("assetHost", nullptr, nullptr);
|
|
72
|
-
if (rawValue == nullptr) return sourceProps.assetHost;
|
|
73
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
74
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.assetHost);
|
|
75
|
-
} catch (const std::exception& exc) {
|
|
76
|
-
throw std::runtime_error(std::string("ChartWebview.assetHost: ") + exc.what());
|
|
77
|
-
}
|
|
78
|
-
}()),
|
|
79
|
-
bridgeScript([&]() -> CachedProp<std::optional<std::string>> {
|
|
80
|
-
try {
|
|
81
|
-
const react::RawValue* rawValue = rawProps.at("bridgeScript", nullptr, nullptr);
|
|
82
|
-
if (rawValue == nullptr) return sourceProps.bridgeScript;
|
|
83
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
84
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.bridgeScript);
|
|
85
|
-
} catch (const std::exception& exc) {
|
|
86
|
-
throw std::runtime_error(std::string("ChartWebview.bridgeScript: ") + exc.what());
|
|
87
|
-
}
|
|
88
|
-
}()),
|
|
89
|
-
reuseKey([&]() -> CachedProp<std::optional<std::string>> {
|
|
90
|
-
try {
|
|
91
|
-
const react::RawValue* rawValue = rawProps.at("reuseKey", nullptr, nullptr);
|
|
92
|
-
if (rawValue == nullptr) return sourceProps.reuseKey;
|
|
93
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
94
|
-
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.reuseKey);
|
|
95
|
-
} catch (const std::exception& exc) {
|
|
96
|
-
throw std::runtime_error(std::string("ChartWebview.reuseKey: ") + exc.what());
|
|
97
|
-
}
|
|
98
|
-
}()),
|
|
99
|
-
pooled([&]() -> CachedProp<std::optional<bool>> {
|
|
100
|
-
try {
|
|
101
|
-
const react::RawValue* rawValue = rawProps.at("pooled", nullptr, nullptr);
|
|
102
|
-
if (rawValue == nullptr) return sourceProps.pooled;
|
|
103
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
104
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.pooled);
|
|
105
|
-
} catch (const std::exception& exc) {
|
|
106
|
-
throw std::runtime_error(std::string("ChartWebview.pooled: ") + exc.what());
|
|
107
|
-
}
|
|
108
|
-
}()),
|
|
109
|
-
active([&]() -> CachedProp<std::optional<bool>> {
|
|
110
|
-
try {
|
|
111
|
-
const react::RawValue* rawValue = rawProps.at("active", nullptr, nullptr);
|
|
112
|
-
if (rawValue == nullptr) return sourceProps.active;
|
|
113
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
114
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.active);
|
|
115
|
-
} catch (const std::exception& exc) {
|
|
116
|
-
throw std::runtime_error(std::string("ChartWebview.active: ") + exc.what());
|
|
117
|
-
}
|
|
118
|
-
}()),
|
|
119
|
-
webviewDebuggingEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
120
|
-
try {
|
|
121
|
-
const react::RawValue* rawValue = rawProps.at("webviewDebuggingEnabled", nullptr, nullptr);
|
|
122
|
-
if (rawValue == nullptr) return sourceProps.webviewDebuggingEnabled;
|
|
123
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
124
|
-
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.webviewDebuggingEnabled);
|
|
125
|
-
} catch (const std::exception& exc) {
|
|
126
|
-
throw std::runtime_error(std::string("ChartWebview.webviewDebuggingEnabled: ") + exc.what());
|
|
127
|
-
}
|
|
128
|
-
}()),
|
|
129
|
-
onMessage([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* message */)>>> {
|
|
130
|
-
try {
|
|
131
|
-
const react::RawValue* rawValue = rawProps.at("onMessage", nullptr, nullptr);
|
|
132
|
-
if (rawValue == nullptr) return sourceProps.onMessage;
|
|
133
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
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);
|
|
135
|
-
} catch (const std::exception& exc) {
|
|
136
|
-
throw std::runtime_error(std::string("ChartWebview.onMessage: ") + exc.what());
|
|
137
|
-
}
|
|
138
|
-
}()),
|
|
139
|
-
onLoadEnd([&]() -> CachedProp<std::optional<std::function<void()>>> {
|
|
140
|
-
try {
|
|
141
|
-
const react::RawValue* rawValue = rawProps.at("onLoadEnd", nullptr, nullptr);
|
|
142
|
-
if (rawValue == nullptr) return sourceProps.onLoadEnd;
|
|
143
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
144
|
-
return CachedProp<std::optional<std::function<void()>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, PropNameIDCache::get(*runtime, "f")), sourceProps.onLoadEnd);
|
|
145
|
-
} catch (const std::exception& exc) {
|
|
146
|
-
throw std::runtime_error(std::string("ChartWebview.onLoadEnd: ") + exc.what());
|
|
147
|
-
}
|
|
148
|
-
}()),
|
|
149
|
-
onError([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* message */)>>> {
|
|
150
|
-
try {
|
|
151
|
-
const react::RawValue* rawValue = rawProps.at("onError", nullptr, nullptr);
|
|
152
|
-
if (rawValue == nullptr) return sourceProps.onError;
|
|
153
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
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);
|
|
155
|
-
} catch (const std::exception& exc) {
|
|
156
|
-
throw std::runtime_error(std::string("ChartWebview.onError: ") + exc.what());
|
|
157
|
-
}
|
|
158
|
-
}()),
|
|
159
|
-
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridChartWebviewSpec>& /* ref */)>>> {
|
|
160
|
-
try {
|
|
161
|
-
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
162
|
-
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
163
|
-
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
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);
|
|
165
|
-
} catch (const std::exception& exc) {
|
|
166
|
-
throw std::runtime_error(std::string("ChartWebview.hybridRef: ") + exc.what());
|
|
167
|
-
}
|
|
168
|
-
}()) { }
|
|
23
|
+
uri(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "uri", rawProps, sourceProps.uri)),
|
|
24
|
+
localBundle(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "localBundle", rawProps, sourceProps.localBundle)),
|
|
25
|
+
entry(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "entry", rawProps, sourceProps.entry)),
|
|
26
|
+
paramsJson(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "paramsJson", rawProps, sourceProps.paramsJson)),
|
|
27
|
+
assetHost(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "assetHost", rawProps, sourceProps.assetHost)),
|
|
28
|
+
bridgeScript(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "bridgeScript", rawProps, sourceProps.bridgeScript)),
|
|
29
|
+
reuseKey(nitro::ReactProp<std::optional<std::string>>::fromRawValue("ChartWebview", "reuseKey", rawProps, sourceProps.reuseKey)),
|
|
30
|
+
pooled(nitro::ReactProp<std::optional<bool>>::fromRawValue("ChartWebview", "pooled", rawProps, sourceProps.pooled)),
|
|
31
|
+
active(nitro::ReactProp<std::optional<bool>>::fromRawValue("ChartWebview", "active", rawProps, sourceProps.active)),
|
|
32
|
+
webviewDebuggingEnabled(nitro::ReactProp<std::optional<bool>>::fromRawValue("ChartWebview", "webviewDebuggingEnabled", rawProps, sourceProps.webviewDebuggingEnabled)),
|
|
33
|
+
onMessage(nitro::ReactProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue("ChartWebview", "onMessage", rawProps, sourceProps.onMessage)),
|
|
34
|
+
onLoadEnd(nitro::ReactProp<std::optional<std::function<void()>>>::fromRawValue("ChartWebview", "onLoadEnd", rawProps, sourceProps.onLoadEnd)),
|
|
35
|
+
onError(nitro::ReactProp<std::optional<std::function<void(const std::string& /* message */)>>>::fromRawValue("ChartWebview", "onError", rawProps, sourceProps.onError)),
|
|
36
|
+
hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridChartWebviewSpec>& /* ref */)>>>::fromRawValue("ChartWebview", "hybridRef", rawProps, sourceProps.hybridRef)) { }
|
|
169
37
|
|
|
170
38
|
bool HybridChartWebviewProps::filterObjectKeys(const std::string& propName) {
|
|
171
39
|
switch (hashString(propName)) {
|
|
@@ -187,29 +55,4 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
187
55
|
}
|
|
188
56
|
}
|
|
189
57
|
|
|
190
|
-
HybridChartWebviewComponentDescriptor::HybridChartWebviewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
191
|
-
: ConcreteComponentDescriptor(parameters,
|
|
192
|
-
react::RawPropsParser()) {}
|
|
193
|
-
|
|
194
|
-
std::shared_ptr<const react::Props> HybridChartWebviewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
195
|
-
const std::shared_ptr<const react::Props>& props,
|
|
196
|
-
react::RawProps rawProps) const {
|
|
197
|
-
// 1. Prepare raw props parser
|
|
198
|
-
rawProps.parse(rawPropsParser_);
|
|
199
|
-
// 2. Copy props with Nitro's cached copy constructor
|
|
200
|
-
return HybridChartWebviewShadowNode::Props(context, /* & */ rawProps, props);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
#ifdef ANDROID
|
|
204
|
-
void HybridChartWebviewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
205
|
-
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
206
|
-
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
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};
|
|
211
|
-
concreteShadowNode.setStateData(std::move(state));
|
|
212
|
-
}
|
|
213
|
-
#endif
|
|
214
|
-
|
|
215
58
|
} // namespace margelo::nitro::chartwebview::views
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <
|
|
11
|
-
#include <NitroModules/
|
|
12
|
-
#include <NitroModules/
|
|
13
|
-
#include <NitroModules/CachedProp.hpp>
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
10
|
+
#include <NitroModules/ReactProp.hpp>
|
|
11
|
+
#include <NitroModules/ViewComponentDescriptor.hpp>
|
|
12
|
+
#include <NitroModules/ViewPropsHolderState.hpp>
|
|
16
13
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
14
|
#include <react/renderer/components/view/ViewProps.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/core/RawProps.h>
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
18
19
|
|
|
19
20
|
#include <string>
|
|
20
21
|
#include <optional>
|
|
@@ -42,20 +43,56 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
42
43
|
const react::RawProps& rawProps);
|
|
43
44
|
|
|
44
45
|
public:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
nitro::ReactProp<std::optional<std::string>> uri;
|
|
47
|
+
nitro::ReactProp<std::optional<std::string>> localBundle;
|
|
48
|
+
nitro::ReactProp<std::optional<std::string>> entry;
|
|
49
|
+
nitro::ReactProp<std::optional<std::string>> paramsJson;
|
|
50
|
+
nitro::ReactProp<std::optional<std::string>> assetHost;
|
|
51
|
+
nitro::ReactProp<std::optional<std::string>> bridgeScript;
|
|
52
|
+
nitro::ReactProp<std::optional<std::string>> reuseKey;
|
|
53
|
+
nitro::ReactProp<std::optional<bool>> pooled;
|
|
54
|
+
nitro::ReactProp<std::optional<bool>> active;
|
|
55
|
+
nitro::ReactProp<std::optional<bool>> webviewDebuggingEnabled;
|
|
56
|
+
nitro::ReactProp<std::optional<std::function<void(const std::string& /* message */)>>> onMessage;
|
|
57
|
+
nitro::ReactProp<std::optional<std::function<void()>>> onLoadEnd;
|
|
58
|
+
nitro::ReactProp<std::optional<std::function<void(const std::string& /* message */)>>> onError;
|
|
59
|
+
nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridChartWebviewSpec>& /* ref */)>>> hybridRef;
|
|
60
|
+
|
|
61
|
+
[[nodiscard]]
|
|
62
|
+
bool hasSameProps(const HybridChartWebviewProps& other) const noexcept {
|
|
63
|
+
return uri.hasSameValue(other.uri) &&
|
|
64
|
+
localBundle.hasSameValue(other.localBundle) &&
|
|
65
|
+
entry.hasSameValue(other.entry) &&
|
|
66
|
+
paramsJson.hasSameValue(other.paramsJson) &&
|
|
67
|
+
assetHost.hasSameValue(other.assetHost) &&
|
|
68
|
+
bridgeScript.hasSameValue(other.bridgeScript) &&
|
|
69
|
+
reuseKey.hasSameValue(other.reuseKey) &&
|
|
70
|
+
pooled.hasSameValue(other.pooled) &&
|
|
71
|
+
active.hasSameValue(other.active) &&
|
|
72
|
+
webviewDebuggingEnabled.hasSameValue(other.webviewDebuggingEnabled) &&
|
|
73
|
+
onMessage.hasSameValue(other.onMessage) &&
|
|
74
|
+
onLoadEnd.hasSameValue(other.onLoadEnd) &&
|
|
75
|
+
onError.hasSameValue(other.onError) &&
|
|
76
|
+
hybridRef.hasSameValue(other.hybridRef);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[[nodiscard]]
|
|
80
|
+
bool hasAnyProvidedProps() const noexcept {
|
|
81
|
+
return uri.isProvided() ||
|
|
82
|
+
localBundle.isProvided() ||
|
|
83
|
+
entry.isProvided() ||
|
|
84
|
+
paramsJson.isProvided() ||
|
|
85
|
+
assetHost.isProvided() ||
|
|
86
|
+
bridgeScript.isProvided() ||
|
|
87
|
+
reuseKey.isProvided() ||
|
|
88
|
+
pooled.isProvided() ||
|
|
89
|
+
active.isProvided() ||
|
|
90
|
+
webviewDebuggingEnabled.isProvided() ||
|
|
91
|
+
onMessage.isProvided() ||
|
|
92
|
+
onLoadEnd.isProvided() ||
|
|
93
|
+
onError.isProvided() ||
|
|
94
|
+
hybridRef.isProvided();
|
|
95
|
+
}
|
|
59
96
|
|
|
60
97
|
private:
|
|
61
98
|
static bool filterObjectKeys(const std::string& propName);
|
|
@@ -64,32 +101,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
64
101
|
/**
|
|
65
102
|
* State for the "ChartWebview" View.
|
|
66
103
|
*/
|
|
67
|
-
|
|
68
|
-
public:
|
|
69
|
-
HybridChartWebviewState() = default;
|
|
70
|
-
explicit HybridChartWebviewState(const std::shared_ptr<HybridChartWebviewProps>& props):
|
|
71
|
-
_props(props) {}
|
|
72
|
-
|
|
73
|
-
public:
|
|
74
|
-
[[nodiscard]]
|
|
75
|
-
const std::shared_ptr<HybridChartWebviewProps>& getProps() const {
|
|
76
|
-
return _props;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public:
|
|
80
|
-
#ifdef ANDROID
|
|
81
|
-
HybridChartWebviewState(const HybridChartWebviewState& /* previousState */, folly::dynamic /* data */) {}
|
|
82
|
-
folly::dynamic getDynamic() const {
|
|
83
|
-
throw std::runtime_error("HybridChartWebviewState does not support folly!");
|
|
84
|
-
}
|
|
85
|
-
react::MapBuffer getMapBuffer() const {
|
|
86
|
-
throw std::runtime_error("HybridChartWebviewState does not support MapBuffer!");
|
|
87
|
-
};
|
|
88
|
-
#endif
|
|
89
|
-
|
|
90
|
-
private:
|
|
91
|
-
std::shared_ptr<HybridChartWebviewProps> _props;
|
|
92
|
-
};
|
|
104
|
+
using HybridChartWebviewState = nitro::ViewPropsHolderState<HybridChartWebviewProps>;
|
|
93
105
|
|
|
94
106
|
/**
|
|
95
107
|
* The Shadow Node for the "ChartWebview" View.
|
|
@@ -102,21 +114,7 @@ namespace margelo::nitro::chartwebview::views {
|
|
|
102
114
|
/**
|
|
103
115
|
* The Component Descriptor for the "ChartWebview" View.
|
|
104
116
|
*/
|
|
105
|
-
|
|
106
|
-
public:
|
|
107
|
-
explicit HybridChartWebviewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
108
|
-
|
|
109
|
-
public:
|
|
110
|
-
/**
|
|
111
|
-
* A faster path for cloning props - reuses the caching logic from `HybridChartWebviewProps`.
|
|
112
|
-
*/
|
|
113
|
-
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
114
|
-
const std::shared_ptr<const react::Props>& props,
|
|
115
|
-
react::RawProps rawProps) const override;
|
|
116
|
-
#ifdef ANDROID
|
|
117
|
-
void adopt(react::ShadowNode& shadowNode) const override;
|
|
118
|
-
#endif
|
|
119
|
-
};
|
|
117
|
+
using HybridChartWebviewComponentDescriptor = nitro::ViewComponentDescriptor<HybridChartWebviewShadowNode>;
|
|
120
118
|
|
|
121
119
|
/* The actual view for "ChartWebview" needs to be implemented in platform-specific code. */
|
|
122
120
|
|
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.98",
|
|
4
4
|
"description": "react-native-chart-webview",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -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.37.0",
|
|
81
81
|
"prettier": "^2.8.8",
|
|
82
82
|
"react": "19.2.3",
|
|
83
83
|
"react-native": "patch:react-native@npm%3A0.86.2#~/.yarn/patches/react-native-npm-0.86.2-c9d546616f.patch",
|
|
84
84
|
"react-native-builder-bob": "^0.40.13",
|
|
85
|
-
"react-native-nitro-modules": "0.
|
|
85
|
+
"react-native-nitro-modules": "0.37.0",
|
|
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.37.0"
|
|
94
94
|
},
|
|
95
95
|
"packageManager": "yarn@4.11.0",
|
|
96
96
|
"react-native-builder-bob": {
|