@onekeyfe/react-native-chart-webview 3.0.157-alpha.275 → 3.0.157-alpha.276
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 +29 -4
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
ChartWebview view for React Native
|
|
4
4
|
|
|
5
|
+
The native iOS and Android host can load a remote chart URL or a local asset
|
|
6
|
+
bundle. Its JavaScript wrapper supplies the default chart bridge script and
|
|
7
|
+
forwards load, error and message events to the application.
|
|
8
|
+
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
7
11
|
```sh
|
|
8
|
-
yarn add @onekeyfe/react-native-chart-webview
|
|
12
|
+
yarn add @onekeyfe/react-native-chart-webview react-native-nitro-modules
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
## Usage
|
|
@@ -21,19 +25,40 @@ import { ChartWebviewView } from '@onekeyfe/react-native-chart-webview';
|
|
|
21
25
|
reuseKey="market"
|
|
22
26
|
pooled={true}
|
|
23
27
|
active={true}
|
|
24
|
-
|
|
28
|
+
/>;
|
|
25
29
|
|
|
26
30
|
<ChartWebviewView
|
|
27
31
|
style={{ flex: 1 }}
|
|
28
32
|
localBundle="tradingview-assets"
|
|
29
33
|
entry="index.html"
|
|
30
34
|
paramsJson={JSON.stringify({ theme: 'dark', symbol: 'BTC' })}
|
|
31
|
-
|
|
35
|
+
/>;
|
|
32
36
|
```
|
|
33
37
|
|
|
38
|
+
## Source, pooling and messaging
|
|
39
|
+
|
|
40
|
+
Install the application's iOS pods and rebuild the native application after
|
|
41
|
+
adding this Nitro view. Give the component a visible layout size through style.
|
|
42
|
+
|
|
43
|
+
Use `uri` for remote content, or `localBundle`, `entry` and `paramsJson` for
|
|
44
|
+
application-provided offline assets. `paramsJson` is a serialized JSON object;
|
|
45
|
+
the application owns its business meaning. Android can set `assetHost` for
|
|
46
|
+
the offline origin; iOS serves offline content through its custom scheme.
|
|
47
|
+
|
|
48
|
+
`pooled` opts into reuse, `reuseKey` identifies the shared WebView group and
|
|
49
|
+
`active` coordinates ownership when hosts share that group. An unchanged source
|
|
50
|
+
can preserve the WebView; pooling does not interpret symbols or migrate page
|
|
51
|
+
state for the caller.
|
|
52
|
+
|
|
53
|
+
`onMessage` receives a string from the page. Native methods expose `postMessage`,
|
|
54
|
+
`reload` and `clearSnapshot` through the Nitro reference. See
|
|
55
|
+
[src/ChartWebview.nitro.ts](src/ChartWebview.nitro.ts) for the full prop/method
|
|
56
|
+
surface and [src/index.tsx](src/index.tsx) for callback wrapping.
|
|
57
|
+
|
|
34
58
|
## Contributing
|
|
35
59
|
|
|
36
|
-
|
|
60
|
+
Follow the repository's
|
|
61
|
+
[native development workflow](https://github.com/OneKeyHQ/app-modules/blob/main/docs/NATIVE_MODULE_DEVELOPMENT.md).
|
|
37
62
|
|
|
38
63
|
## License
|
|
39
64
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-chart-webview",
|
|
3
|
-
"version": "3.0.157-alpha.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.157-alpha.276",
|
|
4
|
+
"description": "Native chart WebView with local assets, pooling and message bridging for OneKey",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -49,14 +49,15 @@
|
|
|
49
49
|
],
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/OneKeyHQ/
|
|
52
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
53
|
+
"directory": "native-views/react-native-chart-webview"
|
|
53
54
|
},
|
|
54
55
|
"author": "@onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
55
56
|
"license": "MIT",
|
|
56
57
|
"bugs": {
|
|
57
|
-
"url": "https://github.com/OneKeyHQ/
|
|
58
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
58
59
|
},
|
|
59
|
-
"homepage": "https://github.com/OneKeyHQ/native-views/react-native-chart-webview#readme",
|
|
60
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-views/react-native-chart-webview#readme",
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"registry": "https://registry.npmjs.org/"
|
|
62
63
|
},
|