@onekeyfe/react-native-chart-webview 3.0.60 → 3.0.63

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.
Files changed (49) hide show
  1. package/ChartWebview.podspec +0 -3
  2. package/android/src/main/java/com/margelo/nitro/chartwebview/ChartWebview.kt +18 -85
  3. package/android/src/main/java/com/margelo/nitro/chartwebview/PooledChartWebView.kt +26 -253
  4. package/ios/ChartWebview.swift +31 -190
  5. package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +0 -18
  6. package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +0 -4
  7. package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +0 -8
  8. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +0 -12
  9. package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +0 -14
  10. package/lib/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +0 -10
  11. package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +0 -2
  12. package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +0 -48
  13. package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +0 -4
  14. package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +0 -4
  15. package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +0 -24
  16. package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +0 -2
  17. package/lib/nitrogen/generated/shared/json/ChartWebviewConfig.json +0 -2
  18. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +0 -18
  19. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +0 -4
  20. package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +0 -8
  21. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +0 -12
  22. package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +0 -14
  23. package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +0 -10
  24. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +0 -2
  25. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +0 -48
  26. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +0 -4
  27. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +0 -4
  28. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +0 -24
  29. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +0 -2
  30. package/lib/nitrogen/nitrogen/generated/shared/json/ChartWebviewConfig.json +0 -2
  31. package/lib/typescript/src/ChartWebview.nitro.d.ts +0 -2
  32. package/lib/typescript/src/ChartWebview.nitro.d.ts.map +1 -1
  33. package/lib/typescript/src/index.d.ts +0 -2
  34. package/lib/typescript/src/index.d.ts.map +1 -1
  35. package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +0 -18
  36. package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +0 -4
  37. package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +0 -8
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +0 -12
  39. package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +0 -14
  40. package/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +0 -10
  41. package/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +0 -2
  42. package/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +0 -48
  43. package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +0 -4
  44. package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +0 -4
  45. package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +0 -24
  46. package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +0 -2
  47. package/nitrogen/generated/shared/json/ChartWebviewConfig.json +0 -2
  48. package/package.json +1 -1
  49. package/src/ChartWebview.nitro.ts +0 -18
@@ -91,11 +91,6 @@ using namespace margelo::nitro::chartwebview::views;
91
91
  swiftPart.setParamsJson(newViewProps.paramsJson.value);
92
92
  newViewProps.paramsJson.isDirty = false;
93
93
  }
94
- // assetHost: optional
95
- if (newViewProps.assetHost.isDirty) {
96
- swiftPart.setAssetHost(newViewProps.assetHost.value);
97
- newViewProps.assetHost.isDirty = false;
98
- }
99
94
  // bridgeScript: optional
100
95
  if (newViewProps.bridgeScript.isDirty) {
101
96
  swiftPart.setBridgeScript(newViewProps.bridgeScript.value);
@@ -116,11 +111,6 @@ using namespace margelo::nitro::chartwebview::views;
116
111
  swiftPart.setActive(newViewProps.active.value);
117
112
  newViewProps.active.isDirty = false;
118
113
  }
119
- // webviewDebuggingEnabled: optional
120
- if (newViewProps.webviewDebuggingEnabled.isDirty) {
121
- swiftPart.setWebviewDebuggingEnabled(newViewProps.webviewDebuggingEnabled.value);
122
- newViewProps.webviewDebuggingEnabled.isDirty = false;
123
- }
124
114
  // onMessage: optional
125
115
  if (newViewProps.onMessage.isDirty) {
126
116
  swiftPart.setOnMessage(newViewProps.onMessage.value);
@@ -15,12 +15,10 @@ public protocol HybridChartWebviewSpec_protocol: HybridObject, HybridView {
15
15
  var localBundle: String? { get set }
16
16
  var entry: String? { get set }
17
17
  var paramsJson: String? { get set }
18
- var assetHost: String? { get set }
19
18
  var bridgeScript: String? { get set }
20
19
  var reuseKey: String? { get set }
21
20
  var pooled: Bool? { get set }
22
21
  var active: Bool? { get set }
23
- var webviewDebuggingEnabled: Bool? { get set }
24
22
  var onMessage: ((_ message: String) -> Void)? { get set }
25
23
  var onLoadEnd: (() -> Void)? { get set }
26
24
  var onError: ((_ message: String) -> Void)? { get set }
@@ -210,30 +210,6 @@ open class HybridChartWebviewSpec_cxx {
210
210
  }
211
211
  }
212
212
 
213
- public final var assetHost: bridge.std__optional_std__string_ {
214
- @inline(__always)
215
- get {
216
- return { () -> bridge.std__optional_std__string_ in
217
- if let __unwrappedValue = self.__implementation.assetHost {
218
- return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
219
- } else {
220
- return .init()
221
- }
222
- }()
223
- }
224
- @inline(__always)
225
- set {
226
- self.__implementation.assetHost = { () -> String? in
227
- if bridge.has_value_std__optional_std__string_(newValue) {
228
- let __unwrapped = bridge.get_std__optional_std__string_(newValue)
229
- return String(__unwrapped)
230
- } else {
231
- return nil
232
- }
233
- }()
234
- }
235
- }
236
-
237
213
  public final var bridgeScript: bridge.std__optional_std__string_ {
238
214
  @inline(__always)
239
215
  get {
@@ -330,30 +306,6 @@ open class HybridChartWebviewSpec_cxx {
330
306
  }
331
307
  }
332
308
 
333
- public final var webviewDebuggingEnabled: bridge.std__optional_bool_ {
334
- @inline(__always)
335
- get {
336
- return { () -> bridge.std__optional_bool_ in
337
- if let __unwrappedValue = self.__implementation.webviewDebuggingEnabled {
338
- return bridge.create_std__optional_bool_(__unwrappedValue)
339
- } else {
340
- return .init()
341
- }
342
- }()
343
- }
344
- @inline(__always)
345
- set {
346
- self.__implementation.webviewDebuggingEnabled = { () -> Bool? in
347
- if bridge.has_value_std__optional_bool_(newValue) {
348
- let __unwrapped = bridge.get_std__optional_bool_(newValue)
349
- return __unwrapped
350
- } else {
351
- return nil
352
- }
353
- }()
354
- }
355
- }
356
-
357
309
  public final var onMessage: bridge.std__optional_std__function_void_const_std__string_____message______ {
358
310
  @inline(__always)
359
311
  get {
@@ -22,8 +22,6 @@ namespace margelo::nitro::chartwebview {
22
22
  prototype.registerHybridSetter("entry", &HybridChartWebviewSpec::setEntry);
23
23
  prototype.registerHybridGetter("paramsJson", &HybridChartWebviewSpec::getParamsJson);
24
24
  prototype.registerHybridSetter("paramsJson", &HybridChartWebviewSpec::setParamsJson);
25
- prototype.registerHybridGetter("assetHost", &HybridChartWebviewSpec::getAssetHost);
26
- prototype.registerHybridSetter("assetHost", &HybridChartWebviewSpec::setAssetHost);
27
25
  prototype.registerHybridGetter("bridgeScript", &HybridChartWebviewSpec::getBridgeScript);
28
26
  prototype.registerHybridSetter("bridgeScript", &HybridChartWebviewSpec::setBridgeScript);
29
27
  prototype.registerHybridGetter("reuseKey", &HybridChartWebviewSpec::getReuseKey);
@@ -32,8 +30,6 @@ namespace margelo::nitro::chartwebview {
32
30
  prototype.registerHybridSetter("pooled", &HybridChartWebviewSpec::setPooled);
33
31
  prototype.registerHybridGetter("active", &HybridChartWebviewSpec::getActive);
34
32
  prototype.registerHybridSetter("active", &HybridChartWebviewSpec::setActive);
35
- prototype.registerHybridGetter("webviewDebuggingEnabled", &HybridChartWebviewSpec::getWebviewDebuggingEnabled);
36
- prototype.registerHybridSetter("webviewDebuggingEnabled", &HybridChartWebviewSpec::setWebviewDebuggingEnabled);
37
33
  prototype.registerHybridGetter("onMessage", &HybridChartWebviewSpec::getOnMessage);
38
34
  prototype.registerHybridSetter("onMessage", &HybridChartWebviewSpec::setOnMessage);
39
35
  prototype.registerHybridGetter("onLoadEnd", &HybridChartWebviewSpec::getOnLoadEnd);
@@ -54,8 +54,6 @@ namespace margelo::nitro::chartwebview {
54
54
  virtual void setEntry(const std::optional<std::string>& entry) = 0;
55
55
  virtual std::optional<std::string> getParamsJson() = 0;
56
56
  virtual void setParamsJson(const std::optional<std::string>& paramsJson) = 0;
57
- virtual std::optional<std::string> getAssetHost() = 0;
58
- virtual void setAssetHost(const std::optional<std::string>& assetHost) = 0;
59
57
  virtual std::optional<std::string> getBridgeScript() = 0;
60
58
  virtual void setBridgeScript(const std::optional<std::string>& bridgeScript) = 0;
61
59
  virtual std::optional<std::string> getReuseKey() = 0;
@@ -64,8 +62,6 @@ namespace margelo::nitro::chartwebview {
64
62
  virtual void setPooled(std::optional<bool> pooled) = 0;
65
63
  virtual std::optional<bool> getActive() = 0;
66
64
  virtual void setActive(std::optional<bool> active) = 0;
67
- virtual std::optional<bool> getWebviewDebuggingEnabled() = 0;
68
- virtual void setWebviewDebuggingEnabled(std::optional<bool> webviewDebuggingEnabled) = 0;
69
65
  virtual std::optional<std::function<void(const std::string& /* message */)>> getOnMessage() = 0;
70
66
  virtual void setOnMessage(const std::optional<std::function<void(const std::string& /* message */)>>& onMessage) = 0;
71
67
  virtual std::optional<std::function<void()>> getOnLoadEnd() = 0;
@@ -65,16 +65,6 @@ namespace margelo::nitro::chartwebview::views {
65
65
  throw std::runtime_error(std::string("ChartWebview.paramsJson: ") + exc.what());
66
66
  }
67
67
  }()),
68
- assetHost([&]() -> CachedProp<std::optional<std::string>> {
69
- try {
70
- const react::RawValue* rawValue = rawProps.at("assetHost", nullptr, nullptr);
71
- if (rawValue == nullptr) return sourceProps.assetHost;
72
- const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
73
- return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.assetHost);
74
- } catch (const std::exception& exc) {
75
- throw std::runtime_error(std::string("ChartWebview.assetHost: ") + exc.what());
76
- }
77
- }()),
78
68
  bridgeScript([&]() -> CachedProp<std::optional<std::string>> {
79
69
  try {
80
70
  const react::RawValue* rawValue = rawProps.at("bridgeScript", nullptr, nullptr);
@@ -115,16 +105,6 @@ namespace margelo::nitro::chartwebview::views {
115
105
  throw std::runtime_error(std::string("ChartWebview.active: ") + exc.what());
116
106
  }
117
107
  }()),
118
- webviewDebuggingEnabled([&]() -> CachedProp<std::optional<bool>> {
119
- try {
120
- const react::RawValue* rawValue = rawProps.at("webviewDebuggingEnabled", nullptr, nullptr);
121
- if (rawValue == nullptr) return sourceProps.webviewDebuggingEnabled;
122
- const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
123
- return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.webviewDebuggingEnabled);
124
- } catch (const std::exception& exc) {
125
- throw std::runtime_error(std::string("ChartWebview.webviewDebuggingEnabled: ") + exc.what());
126
- }
127
- }()),
128
108
  onMessage([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* message */)>>> {
129
109
  try {
130
110
  const react::RawValue* rawValue = rawProps.at("onMessage", nullptr, nullptr);
@@ -172,12 +152,10 @@ namespace margelo::nitro::chartwebview::views {
172
152
  localBundle(other.localBundle),
173
153
  entry(other.entry),
174
154
  paramsJson(other.paramsJson),
175
- assetHost(other.assetHost),
176
155
  bridgeScript(other.bridgeScript),
177
156
  reuseKey(other.reuseKey),
178
157
  pooled(other.pooled),
179
158
  active(other.active),
180
- webviewDebuggingEnabled(other.webviewDebuggingEnabled),
181
159
  onMessage(other.onMessage),
182
160
  onLoadEnd(other.onLoadEnd),
183
161
  onError(other.onError),
@@ -189,12 +167,10 @@ namespace margelo::nitro::chartwebview::views {
189
167
  case hashString("localBundle"): return true;
190
168
  case hashString("entry"): return true;
191
169
  case hashString("paramsJson"): return true;
192
- case hashString("assetHost"): return true;
193
170
  case hashString("bridgeScript"): return true;
194
171
  case hashString("reuseKey"): return true;
195
172
  case hashString("pooled"): return true;
196
173
  case hashString("active"): return true;
197
- case hashString("webviewDebuggingEnabled"): return true;
198
174
  case hashString("onMessage"): return true;
199
175
  case hashString("onLoadEnd"): return true;
200
176
  case hashString("onError"): return true;
@@ -47,12 +47,10 @@ namespace margelo::nitro::chartwebview::views {
47
47
  CachedProp<std::optional<std::string>> localBundle;
48
48
  CachedProp<std::optional<std::string>> entry;
49
49
  CachedProp<std::optional<std::string>> paramsJson;
50
- CachedProp<std::optional<std::string>> assetHost;
51
50
  CachedProp<std::optional<std::string>> bridgeScript;
52
51
  CachedProp<std::optional<std::string>> reuseKey;
53
52
  CachedProp<std::optional<bool>> pooled;
54
53
  CachedProp<std::optional<bool>> active;
55
- CachedProp<std::optional<bool>> webviewDebuggingEnabled;
56
54
  CachedProp<std::optional<std::function<void(const std::string& /* message */)>>> onMessage;
57
55
  CachedProp<std::optional<std::function<void()>>> onLoadEnd;
58
56
  CachedProp<std::optional<std::function<void(const std::string& /* message */)>>> onError;
@@ -8,12 +8,10 @@
8
8
  "localBundle": true,
9
9
  "entry": true,
10
10
  "paramsJson": true,
11
- "assetHost": true,
12
11
  "bridgeScript": true,
13
12
  "reuseKey": true,
14
13
  "pooled": true,
15
14
  "active": true,
16
- "webviewDebuggingEnabled": true,
17
15
  "onMessage": true,
18
16
  "onLoadEnd": true,
19
17
  "onError": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-chart-webview",
3
- "version": "3.0.60",
3
+ "version": "3.0.63",
4
4
  "description": "react-native-chart-webview",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -20,14 +20,6 @@ export interface ChartWebviewProps extends HybridViewProps {
20
20
  // '{"symbol":"BTC","type":"market","theme":"dark"}'). Kept as a string so the
21
21
  // native side stays free of a structured-prop dependency.
22
22
  paramsJson?: string;
23
- // ANDROID ONLY: the host the offline `localBundle` is served under, so Android
24
- // can reuse the real TradingView origin (e.g. "tradingview.onekey.so") and read
25
- // the existing same-origin WebView storage with zero migration. When omitted,
26
- // Android falls back to the built-in "appassets.androidplatform.net" host
27
- // (identical to the old behavior). IGNORED on iOS, which always serves offline
28
- // content from the onekey-chart:// custom scheme (https can't be intercepted
29
- // there).
30
- assetHost?: string;
31
23
 
32
24
  // JS injected into the page at document-start (before any page JS), wiring the
33
25
  // page's outbound channels to the native transport. Single source of truth in
@@ -47,16 +39,6 @@ export interface ChartWebviewProps extends HybridViewProps {
47
39
  // hardcodes `setIsActive`/`getIsActive`, causing a NoSuchMethodError at runtime.
48
40
  active?: boolean;
49
41
 
50
- // --- Debugging ---
51
- // Make the backing WebView inspectable (Safari Web Inspector on iOS,
52
- // chrome://inspect on Android). Driven by the app's "Enable Native Webview
53
- // Debugging" dev-mode toggle, mirroring how the main react-native-webview
54
- // honors it. When omitted, the native side defaults to its dev-build default
55
- // (iOS DEBUG / Android leaves it off). NOTE (Android): the underlying call
56
- // WebView.setWebContentsDebuggingEnabled is PROCESS-GLOBAL — once any WebView
57
- // enables it, it stays enabled process-wide until the app is killed.
58
- webviewDebuggingEnabled?: boolean;
59
-
60
42
  // --- Events ---
61
43
  // page -> JS, raw JSON string (the JS layer parses the $private payload).
62
44
  onMessage?: (message: string) => void;