@portal-hq/webview 3.0.4 → 3.0.5

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 CHANGED
@@ -24,11 +24,7 @@ To use the WebView component, import it from the `@portal-hq/webview` package an
24
24
  import WebView from '@portal-hq/webview'
25
25
 
26
26
  const App = () => {
27
- return (
28
- <WebView
29
- url={'https://app.uniswap.com/'}
30
- />
31
- )
27
+ return <WebView url={'https://app.uniswap.com/'} />
32
28
  }
33
29
  ```
34
30
 
@@ -43,7 +39,3 @@ This allows you to provide a callback for when the navigation state changes. Thi
43
39
  #### `onSigningRequested`
44
40
 
45
41
  This allows you to provide a callback for when signing is requested. For the most part, this prop is not needed if you have already set up the `PortalProvider` in your app.
46
-
47
-
48
-
49
-
@@ -36,12 +36,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  // Node modules.
39
+ // Relative modules.
40
+ const core_1 = require("@portal-hq/core");
41
+ const injected_provider_1 = require("@portal-hq/injected-provider");
39
42
  const react_1 = __importStar(require("react"));
40
- const react_native_webview_1 = __importDefault(require("react-native-webview"));
41
43
  const react_native_1 = require("react-native");
42
- const injected_provider_1 = require("@portal-hq/injected-provider");
43
- const core_1 = require("@portal-hq/core");
44
- // Relative modules.
44
+ const react_native_webview_1 = __importDefault(require("react-native-webview"));
45
45
  const loading_1 = __importDefault(require("./loading"));
46
46
  const Webview = (0, react_1.memo)((0, react_1.forwardRef)(({ onNavigationStateChange, onSigningRequested, url }, webViewRef) => {
47
47
  const Webview = () => {
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // Node modules.
7
+ // Relative modules.
7
8
  const react_1 = __importDefault(require("react"));
8
9
  const react_native_1 = require("react-native");
9
- // Relative modules.
10
10
  const loader_1 = __importDefault(require("./loader"));
11
11
  const Loading = () => (<react_native_1.View style={styles.container}>
12
12
  <loader_1.default />
package/lib/esm/index.js CHANGED
@@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  // Node modules.
11
+ // Relative modules.
12
+ import { usePortal } from '@portal-hq/core';
13
+ import { injectionScript, } from '@portal-hq/injected-provider';
11
14
  import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState, } from 'react';
12
- import WebView from 'react-native-webview';
13
15
  import { BackHandler, Platform, StyleSheet, View } from 'react-native';
14
- import { injectionScript, } from '@portal-hq/injected-provider';
15
- import { usePortal } from '@portal-hq/core';
16
- // Relative modules.
16
+ import WebView from 'react-native-webview';
17
17
  import Loading from './loading';
18
18
  const Webview = memo(forwardRef(({ onNavigationStateChange, onSigningRequested, url }, webViewRef) => {
19
19
  const Webview = () => {
@@ -1,7 +1,7 @@
1
1
  // Node modules.
2
+ // Relative modules.
2
3
  import React from 'react';
3
4
  import { StyleSheet, View } from 'react-native';
4
- // Relative modules.
5
5
  import Loader from './loader';
6
6
  const Loading = () => (<View style={styles.container}>
7
7
  <Loader />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/webview",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/esm/index",
@@ -18,9 +18,9 @@
18
18
  "test": "jest --passWithNoTests"
19
19
  },
20
20
  "dependencies": {
21
- "@portal-hq/core": "^3.0.4",
22
- "@portal-hq/injected-provider": "^3.0.4",
23
- "@portal-hq/utils": "^3.0.4"
21
+ "@portal-hq/core": "^3.0.5",
22
+ "@portal-hq/injected-provider": "^3.0.5",
23
+ "@portal-hq/utils": "^3.0.5"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/jest": "^29.2.0",
@@ -36,5 +36,5 @@
36
36
  "react-native": "*",
37
37
  "react-native-webview": "*"
38
38
  },
39
- "gitHead": "06ea78f34f46124827901f7a55b9a3dc761a5172"
39
+ "gitHead": "58faddeac81625fcb230357540e7f4663f8c810c"
40
40
  }
package/src/index.tsx CHANGED
@@ -1,4 +1,10 @@
1
1
  // Node modules.
2
+ // Relative modules.
3
+ import { usePortal } from '@portal-hq/core'
4
+ import {
5
+ type RequestArguments,
6
+ injectionScript,
7
+ } from '@portal-hq/injected-provider'
2
8
  import React, {
3
9
  FC,
4
10
  MutableRefObject,
@@ -10,18 +16,13 @@ import React, {
10
16
  useRef,
11
17
  useState,
12
18
  } from 'react'
19
+ import { BackHandler, Platform, StyleSheet, View } from 'react-native'
13
20
  import WebView, {
14
21
  WebViewMessageEvent,
15
22
  WebViewNavigation,
16
23
  } from 'react-native-webview'
17
- import { BackHandler, Platform, StyleSheet, View } from 'react-native'
18
- import {
19
- injectionScript,
20
- type RequestArguments,
21
- } from '@portal-hq/injected-provider'
22
24
  import { type WebViewSourceUri } from 'react-native-webview/lib/WebViewTypes'
23
- import { usePortal } from '@portal-hq/core'
24
- // Relative modules.
25
+
25
26
  import Loading from './loading'
26
27
 
27
28
  interface WebviewProps {
@@ -1,7 +1,8 @@
1
1
  // Node modules.
2
+ // Relative modules.
2
3
  import React, { FC } from 'react'
3
4
  import { StyleSheet, View } from 'react-native'
4
- // Relative modules.
5
+
5
6
  import Loader from './loader'
6
7
 
7
8
  const Loading: FC = () => (