@parafin/react 0.0.1 → 1.0.0
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/index.tsx +5 -5
- package/out/index.d.ts +3 -3
- package/out/index.js +3 -3
- package/package.json +2 -2
package/index.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { openParafinDashboard } from '@parafin/core'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type OptInFields = {
|
|
4
|
+
type OptInFields = {
|
|
7
5
|
businessExternalId: string
|
|
8
6
|
legalBusinessName: string
|
|
9
7
|
dbaName?: string
|
|
@@ -27,7 +25,7 @@ export type OptInFields = {
|
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
const ParafinWidget = (props: {
|
|
31
29
|
token: string
|
|
32
30
|
product: 'capital' | 'banking'
|
|
33
31
|
externalBusinessId?: string
|
|
@@ -104,7 +102,7 @@ export const ParafinWidget = (props: {
|
|
|
104
102
|
<iframe
|
|
105
103
|
key={iframeKey}
|
|
106
104
|
ref={iframeRef}
|
|
107
|
-
id={`parafin-${product}-widget`}
|
|
105
|
+
id={`parafin-${props.product}-widget`}
|
|
108
106
|
src={`${baseUrl}${token}${product}${hasOptIn}${host}${externalBusinessId}`}
|
|
109
107
|
style={{
|
|
110
108
|
width: '100%',
|
|
@@ -120,3 +118,5 @@ export const ParafinWidget = (props: {
|
|
|
120
118
|
console.error('Error loading Parafin widget')
|
|
121
119
|
}
|
|
122
120
|
}
|
|
121
|
+
|
|
122
|
+
export { OptInFields, ParafinWidget }
|
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type OptInFields = {
|
|
1
|
+
type OptInFields = {
|
|
3
2
|
businessExternalId: string;
|
|
4
3
|
legalBusinessName: string;
|
|
5
4
|
dbaName?: string;
|
|
@@ -22,7 +21,7 @@ export type OptInFields = {
|
|
|
22
21
|
country: string;
|
|
23
22
|
};
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
declare const ParafinWidget: (props: {
|
|
26
25
|
token: string;
|
|
27
26
|
product: 'capital' | 'banking';
|
|
28
27
|
externalBusinessId?: string;
|
|
@@ -30,3 +29,4 @@ export declare const ParafinWidget: (props: {
|
|
|
30
29
|
onOptIn?: () => Promise<OptInFields>;
|
|
31
30
|
environment?: string;
|
|
32
31
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export { OptInFields, ParafinWidget };
|
package/out/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { openParafinDashboard } from '@parafin/core';
|
|
4
|
-
|
|
5
|
-
export const ParafinWidget = (props) => {
|
|
4
|
+
const ParafinWidget = (props) => {
|
|
6
5
|
try {
|
|
7
6
|
const iframeRef = useRef(null);
|
|
8
7
|
const [iframeKey, setIframeKey] = useState(0);
|
|
@@ -63,7 +62,7 @@ export const ParafinWidget = (props) => {
|
|
|
63
62
|
window.addEventListener('message', messageListener);
|
|
64
63
|
return () => window.removeEventListener('message', messageListener);
|
|
65
64
|
}, []);
|
|
66
|
-
return (_jsx("iframe", { ref: iframeRef, id: `parafin-${product}-widget`, src: `${baseUrl}${token}${product}${hasOptIn}${host}${externalBusinessId}`, style: {
|
|
65
|
+
return (_jsx("iframe", { ref: iframeRef, id: `parafin-${props.product}-widget`, src: `${baseUrl}${token}${product}${hasOptIn}${host}${externalBusinessId}`, style: {
|
|
67
66
|
width: '100%',
|
|
68
67
|
height: iframeHeight,
|
|
69
68
|
backgroundColor: '#fff',
|
|
@@ -76,3 +75,4 @@ export const ParafinWidget = (props) => {
|
|
|
76
75
|
console.error('Error loading Parafin widget');
|
|
77
76
|
}
|
|
78
77
|
};
|
|
78
|
+
export { ParafinWidget };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parafin/react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Parafin React widget",
|
|
5
5
|
"author": "Parafin (https://www.parafin.com)",
|
|
6
6
|
"module": "out/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"typescript": "^4.9.5"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@parafin/core": "^1.0.
|
|
17
|
+
"@parafin/core": "^1.0.2",
|
|
18
18
|
"react": "^18.2.0"
|
|
19
19
|
}
|
|
20
20
|
}
|