@tap-payments/connect-v2 0.0.2-test → 0.0.4-test
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/build/App.js +1 -1
- package/build/connect/Connect.d.ts +1 -1
- package/build/connect/Connect.js +2 -2
- package/build/connect/ConnectIFrame.js +3 -3
- package/build/connect/renderConnectElement.d.ts +1 -1
- package/build/connect/renderConnectElement.js +1 -1
- package/build/context/index.d.ts +1 -1
- package/build/hooks/useConfig.js +3 -3
- package/build/hooks/useEventListener.js +3 -3
- package/build/hooks/usePostEvents.d.ts +1 -1
- package/build/hooks/usePostEvents.js +1 -1
- package/build/index.d.ts +1 -1
- package/package.json +2 -2
- package/build/vite.config.d.ts +0 -2
- package/build/vite.config.js +0 -38
package/build/App.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { ConnectMode, ConnectScope, DialogTransition, ThemeMode } from '
|
|
3
|
+
import { ConnectMode, ConnectScope, DialogTransition, ThemeMode } from '@types';
|
|
4
4
|
import { ConnectElement } from './connect';
|
|
5
5
|
function App() {
|
|
6
6
|
const [open, setOpen] = React.useState(true);
|
package/build/connect/Connect.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import ConnectIFrame from './ConnectIFrame';
|
|
4
|
-
import ConnectContextProvider from '
|
|
5
|
-
import { useEventListener, useConfig } from '
|
|
4
|
+
import ConnectContextProvider from '@context';
|
|
5
|
+
import { useEventListener, useConfig } from '@hooks';
|
|
6
6
|
const Connect = () => {
|
|
7
7
|
const { connectLink } = useConfig();
|
|
8
8
|
useEventListener();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Loader from '
|
|
3
|
-
import { useConnectContext } from '
|
|
4
|
-
import { CONNECT_IFRAME_ID } from '
|
|
2
|
+
import Loader from '@src/components/loader';
|
|
3
|
+
import { useConnectContext } from '@context';
|
|
4
|
+
import { CONNECT_IFRAME_ID } from '@constants';
|
|
5
5
|
const ConnectIFrame = ({ src }) => {
|
|
6
6
|
const { loading } = useConnectContext();
|
|
7
7
|
return (_jsxs(_Fragment, { children: [loading && _jsx(Loader, { toggleAnimation: true }), src && (_jsx("iframe", { id: CONNECT_IFRAME_ID, title: "connect", src: src, style: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import ConnectElement from './Connect';
|
|
4
|
-
import { findOrCreateElementAndInject } from '
|
|
4
|
+
import { findOrCreateElementAndInject } from '@utils';
|
|
5
5
|
const renderConnectElement = (elementId, config) => {
|
|
6
6
|
const element = findOrCreateElementAndInject(elementId);
|
|
7
7
|
const root = createRoot(element);
|
package/build/context/index.d.ts
CHANGED
package/build/hooks/useConfig.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { WebErrorHandler } from '@tap-payments/web-error-handing';
|
|
3
|
-
import { ConnectMode, SearchParams } from '
|
|
4
|
-
import { useConnectContext } from '
|
|
5
|
-
import { CONNECT_CONFIG_URL, CONNECT_ORIGIN } from '
|
|
3
|
+
import { ConnectMode, SearchParams } from '@types';
|
|
4
|
+
import { useConnectContext } from '@context';
|
|
5
|
+
import { CONNECT_CONFIG_URL, CONNECT_ORIGIN } from '@constants';
|
|
6
6
|
const useConfig = () => {
|
|
7
7
|
const [connectLink, setConnectLink] = React.useState('');
|
|
8
8
|
const { onError, onLoadingHandler, ...config } = useConnectContext();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ConnectEvents } from '
|
|
3
|
-
import { CONNECT_ORIGIN } from '
|
|
4
|
-
import { useConnectContext } from '
|
|
2
|
+
import { ConnectEvents } from '@types';
|
|
3
|
+
import { CONNECT_ORIGIN } from '@constants';
|
|
4
|
+
import { useConnectContext } from '@context';
|
|
5
5
|
const useEventListener = () => {
|
|
6
6
|
const { onSuccess, onClose, onError, onReady, onLoaded } = useConnectContext();
|
|
7
7
|
const handleEvent = React.useCallback(async (message) => {
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectProps, ConnectMode, ThemeMode, LanguageMode, AppInfo, ConnectScope, PaymentProvider, DialogTransition, DialogEdgeFormat, SDKNotification, PASSWORD_OPERATION_TYPE } from '
|
|
1
|
+
import { ConnectProps, ConnectMode, ThemeMode, LanguageMode, AppInfo, ConnectScope, PaymentProvider, DialogTransition, DialogEdgeFormat, SDKNotification, PASSWORD_OPERATION_TYPE } from '@types';
|
|
2
2
|
import { ConnectElement, renderConnectElement } from './connect';
|
|
3
3
|
export type { ConnectProps, ConnectMode, ThemeMode, LanguageMode, AppInfo, ConnectScope, PaymentProvider, DialogTransition, DialogEdgeFormat, SDKNotification, PASSWORD_OPERATION_TYPE, };
|
|
4
4
|
export { ConnectElement, renderConnectElement };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/connect-v2",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4-test",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"module": "build/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rm -rf build*",
|
|
14
14
|
"dev": "vite",
|
|
15
15
|
"tsc:alias": "tsc-alias -p tsconfig.app.json",
|
|
16
|
-
"build": "yarn clean && tsc -b &&
|
|
16
|
+
"build": "yarn clean && tsc -b && vite build",
|
|
17
17
|
"lint": "eslint .",
|
|
18
18
|
"lint:fix": "eslint . --fix",
|
|
19
19
|
"preview": "vite preview",
|
package/build/vite.config.d.ts
DELETED
package/build/vite.config.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
import react from '@vitejs/plugin-react';
|
|
4
|
-
import dts from 'vite-plugin-dts';
|
|
5
|
-
import replace from 'rollup-plugin-replace';
|
|
6
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
7
|
-
// https://vite.dev/config/
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
plugins: [
|
|
10
|
-
react(),
|
|
11
|
-
tsconfigPaths(),
|
|
12
|
-
dts({
|
|
13
|
-
insertTypesEntry: true,
|
|
14
|
-
}),
|
|
15
|
-
],
|
|
16
|
-
server: {
|
|
17
|
-
port: 3001,
|
|
18
|
-
},
|
|
19
|
-
build: {
|
|
20
|
-
outDir: `build-${process.env.npm_package_version}`,
|
|
21
|
-
lib: {
|
|
22
|
-
entry: resolve(__dirname, 'src/index.ts'),
|
|
23
|
-
name: 'TapConnectSdkV2',
|
|
24
|
-
fileName: 'index',
|
|
25
|
-
formats: ['umd', 'cjs', 'es'],
|
|
26
|
-
},
|
|
27
|
-
rollupOptions: {
|
|
28
|
-
output: {
|
|
29
|
-
entryFileNames: 'main.js',
|
|
30
|
-
},
|
|
31
|
-
plugins: [
|
|
32
|
-
replace({
|
|
33
|
-
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
34
|
-
}),
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
});
|