@tap-payments/connect 2.10.6-beta → 2.10.7-beta
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 +171 -171
- package/build/@types/config.d.ts +63 -63
- package/build/@types/config.js +1 -1
- package/build/@types/index.d.ts +74 -74
- package/build/@types/index.js +1 -1
- package/build/api/index.d.ts +12 -12
- package/build/api/index.js +95 -95
- package/build/constants/index.d.ts +17 -17
- package/build/constants/index.js +17 -17
- package/build/features/Connect/Connect.d.ts +5 -5
- package/build/features/Connect/Connect.js +150 -150
- package/build/features/Connect/ConnectAuth.d.ts +7 -7
- package/build/features/Connect/ConnectAuth.js +115 -115
- package/build/features/Connect/ConnectBank.d.ts +12 -12
- package/build/features/Connect/ConnectBank.js +118 -118
- package/build/features/Connect/ConnectBoard.d.ts +10 -10
- package/build/features/Connect/ConnectBoard.js +117 -117
- package/build/features/Connect/ConnectBrand.d.ts +12 -12
- package/build/features/Connect/ConnectBrand.js +118 -118
- package/build/features/Connect/ConnectEntity.d.ts +12 -12
- package/build/features/Connect/ConnectEntity.js +118 -118
- package/build/features/Connect/ConnectExpress.d.ts +4 -4
- package/build/features/Connect/ConnectExpress.js +78 -78
- package/build/features/Connect/ConnectFull.d.ts +4 -4
- package/build/features/Connect/ConnectFull.js +13 -13
- package/build/features/Connect/ConnectIndividual.d.ts +12 -12
- package/build/features/Connect/ConnectIndividual.js +118 -118
- package/build/features/Connect/ConnectPassword.d.ts +12 -12
- package/build/features/Connect/ConnectPassword.js +118 -118
- package/build/features/Connect/ConnectTax.d.ts +12 -12
- package/build/features/Connect/ConnectTax.js +118 -118
- package/build/features/Connect/index.d.ts +11 -11
- package/build/features/Connect/index.js +10 -10
- package/build/hooks/index.d.ts +2 -2
- package/build/hooks/index.js +2 -2
- package/build/hooks/useScript.d.ts +1 -1
- package/build/hooks/useScript.js +39 -39
- package/build/hooks/useStyle.d.ts +1 -1
- package/build/hooks/useStyle.js +13 -13
- package/build/index.d.ts +4 -4
- package/build/index.js +14 -14
- package/build/utils/common.d.ts +2 -2
- package/build/utils/common.js +16 -16
- package/build/utils/config.d.ts +7 -7
- package/build/utils/config.js +47 -47
- package/build/utils/html.d.ts +1 -1
- package/build/utils/html.js +9 -9
- package/build/utils/index.d.ts +4 -4
- package/build/utils/index.js +4 -4
- package/build/utils/validation.d.ts +8 -8
- package/build/utils/validation.js +190 -190
- package/package.json +106 -108
package/build/hooks/useScript.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
export function useScript(src, async) {
|
|
3
|
-
if (async === void 0) { async = true; }
|
|
4
|
-
var _a = useState(src ? 'loading' : 'idle'), status = _a[0], setStatus = _a[1];
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
if (!src) {
|
|
7
|
-
setStatus('idle');
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
var script = document.querySelector("script[src=\"".concat(src, "\"]"));
|
|
11
|
-
if (!script) {
|
|
12
|
-
script = document.createElement('script');
|
|
13
|
-
script.src = src;
|
|
14
|
-
script.async = async;
|
|
15
|
-
script.setAttribute('data-status', 'loading');
|
|
16
|
-
document.body.appendChild(script);
|
|
17
|
-
var setAttributeFromEvent = function (event) {
|
|
18
|
-
script.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error');
|
|
19
|
-
};
|
|
20
|
-
script.addEventListener('load', setAttributeFromEvent);
|
|
21
|
-
script.addEventListener('error', setAttributeFromEvent);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
setStatus(script.getAttribute('data-status'));
|
|
25
|
-
}
|
|
26
|
-
var setStateFromEvent = function (event) {
|
|
27
|
-
setStatus(event.type === 'load' ? 'ready' : 'error');
|
|
28
|
-
};
|
|
29
|
-
script.addEventListener('load', setStateFromEvent);
|
|
30
|
-
script.addEventListener('error', setStateFromEvent);
|
|
31
|
-
return function () {
|
|
32
|
-
if (script) {
|
|
33
|
-
script.removeEventListener('load', setStateFromEvent);
|
|
34
|
-
script.removeEventListener('error', setStateFromEvent);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}, [src]);
|
|
38
|
-
return status;
|
|
39
|
-
}
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export function useScript(src, async) {
|
|
3
|
+
if (async === void 0) { async = true; }
|
|
4
|
+
var _a = useState(src ? 'loading' : 'idle'), status = _a[0], setStatus = _a[1];
|
|
5
|
+
useEffect(function () {
|
|
6
|
+
if (!src) {
|
|
7
|
+
setStatus('idle');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
var script = document.querySelector("script[src=\"".concat(src, "\"]"));
|
|
11
|
+
if (!script) {
|
|
12
|
+
script = document.createElement('script');
|
|
13
|
+
script.src = src;
|
|
14
|
+
script.async = async;
|
|
15
|
+
script.setAttribute('data-status', 'loading');
|
|
16
|
+
document.body.appendChild(script);
|
|
17
|
+
var setAttributeFromEvent = function (event) {
|
|
18
|
+
script.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error');
|
|
19
|
+
};
|
|
20
|
+
script.addEventListener('load', setAttributeFromEvent);
|
|
21
|
+
script.addEventListener('error', setAttributeFromEvent);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setStatus(script.getAttribute('data-status'));
|
|
25
|
+
}
|
|
26
|
+
var setStateFromEvent = function (event) {
|
|
27
|
+
setStatus(event.type === 'load' ? 'ready' : 'error');
|
|
28
|
+
};
|
|
29
|
+
script.addEventListener('load', setStateFromEvent);
|
|
30
|
+
script.addEventListener('error', setStateFromEvent);
|
|
31
|
+
return function () {
|
|
32
|
+
if (script) {
|
|
33
|
+
script.removeEventListener('load', setStateFromEvent);
|
|
34
|
+
script.removeEventListener('error', setStateFromEvent);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, [src]);
|
|
38
|
+
return status;
|
|
39
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyle: (url: string) => void;
|
|
1
|
+
export declare const useStyle: (url: string) => void;
|
package/build/hooks/useStyle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
export var useStyle = function (url) {
|
|
3
|
-
useEffect(function () {
|
|
4
|
-
var link = document.createElement('link');
|
|
5
|
-
link.href = url;
|
|
6
|
-
link.rel = 'stylesheet';
|
|
7
|
-
link.type = 'text/css';
|
|
8
|
-
document.head.appendChild(link);
|
|
9
|
-
return function () {
|
|
10
|
-
document.head.removeChild(link);
|
|
11
|
-
};
|
|
12
|
-
}, [url]);
|
|
13
|
-
};
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export var useStyle = function (url) {
|
|
3
|
+
useEffect(function () {
|
|
4
|
+
var link = document.createElement('link');
|
|
5
|
+
link.href = url;
|
|
6
|
+
link.rel = 'stylesheet';
|
|
7
|
+
link.type = 'text/css';
|
|
8
|
+
document.head.appendChild(link);
|
|
9
|
+
return function () {
|
|
10
|
+
document.head.removeChild(link);
|
|
11
|
+
};
|
|
12
|
+
}, [url]);
|
|
13
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TapConnect, TapConnectProps, renderTapConnect, ConnectAuthProps, TapConnectAuth, renderTapConnectAuth, renderTapBoard, TapBoardProps, TapBoard, TapBrand, TapBrandProps, renderTapBrand, TapBank, TapBankProps, renderTapBank, TapEntity, TapEntityProps, renderTapEntity, TapIndividual, TapIndividualProps, renderTapIndividual, TapPassword, TapPasswordProps, renderTapPassword, TapTax, TapTaxProps, renderTapTax } from './features/Connect';
|
|
2
|
-
import { Language } from './constants';
|
|
3
|
-
export type { TapConnectProps, ConnectAuthProps, TapBoardProps, TapBrandProps, TapBankProps, TapEntityProps, TapIndividualProps, TapPasswordProps, TapTaxProps };
|
|
4
|
-
export { Language, TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, TapBoard, renderTapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax };
|
|
1
|
+
import { TapConnect, TapConnectProps, renderTapConnect, ConnectAuthProps, TapConnectAuth, renderTapConnectAuth, renderTapBoard, TapBoardProps, TapBoard, TapBrand, TapBrandProps, renderTapBrand, TapBank, TapBankProps, renderTapBank, TapEntity, TapEntityProps, renderTapEntity, TapIndividual, TapIndividualProps, renderTapIndividual, TapPassword, TapPasswordProps, renderTapPassword, TapTax, TapTaxProps, renderTapTax } from './features/Connect';
|
|
2
|
+
import { Language } from './constants';
|
|
3
|
+
export type { TapConnectProps, ConnectAuthProps, TapBoardProps, TapBrandProps, TapBankProps, TapEntityProps, TapIndividualProps, TapPasswordProps, TapTaxProps };
|
|
4
|
+
export { Language, TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, TapBoard, renderTapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax };
|
package/build/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, renderTapBoard, TapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax } from './features/Connect';
|
|
2
|
-
import { Language } from './constants';
|
|
3
|
-
export { Language, TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, TapBoard, renderTapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax };
|
|
4
|
-
window['TapPayments'] = {
|
|
5
|
-
renderTapConnect: renderTapConnect,
|
|
6
|
-
Language: Language,
|
|
7
|
-
renderTapConnectAuth: renderTapConnectAuth,
|
|
8
|
-
renderTapBoard: renderTapBoard,
|
|
9
|
-
renderTapBrand: renderTapBrand,
|
|
10
|
-
renderTapBank: renderTapBank,
|
|
11
|
-
renderTapEntity: renderTapEntity,
|
|
12
|
-
renderTapPassword: renderTapPassword,
|
|
13
|
-
renderTapTax: renderTapTax
|
|
14
|
-
};
|
|
1
|
+
import { TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, renderTapBoard, TapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax } from './features/Connect';
|
|
2
|
+
import { Language } from './constants';
|
|
3
|
+
export { Language, TapConnect, renderTapConnect, TapConnectAuth, renderTapConnectAuth, TapBoard, renderTapBoard, TapBrand, renderTapBrand, TapBank, renderTapBank, TapEntity, renderTapEntity, TapIndividual, renderTapIndividual, TapPassword, renderTapPassword, TapTax, renderTapTax };
|
|
4
|
+
window['TapPayments'] = {
|
|
5
|
+
renderTapConnect: renderTapConnect,
|
|
6
|
+
Language: Language,
|
|
7
|
+
renderTapConnectAuth: renderTapConnectAuth,
|
|
8
|
+
renderTapBoard: renderTapBoard,
|
|
9
|
+
renderTapBrand: renderTapBrand,
|
|
10
|
+
renderTapBank: renderTapBank,
|
|
11
|
+
renderTapEntity: renderTapEntity,
|
|
12
|
+
renderTapPassword: renderTapPassword,
|
|
13
|
+
renderTapTax: renderTapTax
|
|
14
|
+
};
|
package/build/utils/common.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getBaseUrl: (publicKey: string) => "https://connect-mw.beta.tap.company/middleware/" | "https://connect-mw.sandbox.tap.company/middleware/";
|
|
2
|
-
export declare const getRedirectBaseUrl: (publicKey: string) => "https://connect.beta.tap.company/" | "https://connect.sandbox.tap.company/";
|
|
1
|
+
export declare const getBaseUrl: (publicKey: string) => "https://connect-mw.beta.tap.company/middleware/" | "https://connect-mw.sandbox.tap.company/middleware/";
|
|
2
|
+
export declare const getRedirectBaseUrl: (publicKey: string) => "https://connect.beta.tap.company/" | "https://connect.sandbox.tap.company/";
|
package/build/utils/common.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CONNECT_SANDBOX_MW_URL, CONNECT_SANDBOX_URL, CONNECT_BETA_URL, CONNECT_MW_BETA_URL } from '../constants';
|
|
2
|
-
var isProd = function (publicKey) {
|
|
3
|
-
return publicKey.includes('pk_live');
|
|
4
|
-
};
|
|
5
|
-
export var getBaseUrl = function (publicKey) {
|
|
6
|
-
if (isProd(publicKey)) {
|
|
7
|
-
return CONNECT_MW_BETA_URL;
|
|
8
|
-
}
|
|
9
|
-
return CONNECT_SANDBOX_MW_URL;
|
|
10
|
-
};
|
|
11
|
-
export var getRedirectBaseUrl = function (publicKey) {
|
|
12
|
-
if (isProd(publicKey)) {
|
|
13
|
-
return CONNECT_BETA_URL;
|
|
14
|
-
}
|
|
15
|
-
return CONNECT_SANDBOX_URL;
|
|
16
|
-
};
|
|
1
|
+
import { CONNECT_SANDBOX_MW_URL, CONNECT_SANDBOX_URL, CONNECT_BETA_URL, CONNECT_MW_BETA_URL } from '../constants';
|
|
2
|
+
var isProd = function (publicKey) {
|
|
3
|
+
return publicKey.includes('pk_live');
|
|
4
|
+
};
|
|
5
|
+
export var getBaseUrl = function (publicKey) {
|
|
6
|
+
if (isProd(publicKey)) {
|
|
7
|
+
return CONNECT_MW_BETA_URL;
|
|
8
|
+
}
|
|
9
|
+
return CONNECT_SANDBOX_MW_URL;
|
|
10
|
+
};
|
|
11
|
+
export var getRedirectBaseUrl = function (publicKey) {
|
|
12
|
+
if (isProd(publicKey)) {
|
|
13
|
+
return CONNECT_BETA_URL;
|
|
14
|
+
}
|
|
15
|
+
return CONNECT_SANDBOX_URL;
|
|
16
|
+
};
|
package/build/utils/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ConnectProps, OriginalConnectProps } from '../@types';
|
|
2
|
-
type ExtraProps = {
|
|
3
|
-
verifyToken?: string;
|
|
4
|
-
onBoardButtonClick?: (data: Record<string, string>) => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const wrapLibConfig: ({ publicKey, open, mode, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity, data, redirectUrl, features, notification }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
7
|
-
export {};
|
|
1
|
+
import { ConnectProps, OriginalConnectProps } from '../@types';
|
|
2
|
+
type ExtraProps = {
|
|
3
|
+
verifyToken?: string;
|
|
4
|
+
onBoardButtonClick?: (data: Record<string, string>) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const wrapLibConfig: ({ publicKey, open, mode, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity, data, redirectUrl, features, notification }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
7
|
+
export {};
|
package/build/utils/config.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export var wrapLibConfig = function (_a) {
|
|
2
|
-
var publicKey = _a.publicKey, open = _a.open, mode = _a.mode, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity, data = _a.data, redirectUrl = _a.redirectUrl, features = _a.features, notification = _a.notification;
|
|
3
|
-
return {
|
|
4
|
-
appInfo: {
|
|
5
|
-
name: window.location.hostname || window.location.origin
|
|
6
|
-
},
|
|
7
|
-
businessCountryCode: country,
|
|
8
|
-
language: language,
|
|
9
|
-
merchantDomain: domain,
|
|
10
|
-
open: open,
|
|
11
|
-
mode: mode,
|
|
12
|
-
postURL: postURL,
|
|
13
|
-
publicKey: publicKey,
|
|
14
|
-
scope: scope,
|
|
15
|
-
data: data,
|
|
16
|
-
redirectUrl: redirectUrl,
|
|
17
|
-
leadId: lead,
|
|
18
|
-
showBoard: board,
|
|
19
|
-
boardMaturity: boardMaturity,
|
|
20
|
-
verifyToken: verifyToken,
|
|
21
|
-
features: features,
|
|
22
|
-
notification: notification,
|
|
23
|
-
onFlowCompleted: function (res) {
|
|
24
|
-
onSuccess && onSuccess(res);
|
|
25
|
-
},
|
|
26
|
-
onError: function (err) {
|
|
27
|
-
onError && onError(err);
|
|
28
|
-
},
|
|
29
|
-
onReady: function () {
|
|
30
|
-
onReady && onReady();
|
|
31
|
-
},
|
|
32
|
-
onBoardButtonClick: function (data) {
|
|
33
|
-
onBoardButtonClick && onBoardButtonClick(data);
|
|
34
|
-
},
|
|
35
|
-
onCreated: function (res) {
|
|
36
|
-
onCreated && onCreated(res);
|
|
37
|
-
},
|
|
38
|
-
onClose: function () {
|
|
39
|
-
onClose && onClose();
|
|
40
|
-
},
|
|
41
|
-
onBoardCompleted: function () {
|
|
42
|
-
onBoardCompleted && onBoardCompleted();
|
|
43
|
-
},
|
|
44
|
-
onStepCompleted: function (name, info) { },
|
|
45
|
-
onStepStarted: function (name) { }
|
|
46
|
-
};
|
|
47
|
-
};
|
|
1
|
+
export var wrapLibConfig = function (_a) {
|
|
2
|
+
var publicKey = _a.publicKey, open = _a.open, mode = _a.mode, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity, data = _a.data, redirectUrl = _a.redirectUrl, features = _a.features, notification = _a.notification;
|
|
3
|
+
return {
|
|
4
|
+
appInfo: {
|
|
5
|
+
name: window.location.hostname || window.location.origin
|
|
6
|
+
},
|
|
7
|
+
businessCountryCode: country,
|
|
8
|
+
language: language,
|
|
9
|
+
merchantDomain: domain,
|
|
10
|
+
open: open,
|
|
11
|
+
mode: mode,
|
|
12
|
+
postURL: postURL,
|
|
13
|
+
publicKey: publicKey,
|
|
14
|
+
scope: scope,
|
|
15
|
+
data: data,
|
|
16
|
+
redirectUrl: redirectUrl,
|
|
17
|
+
leadId: lead,
|
|
18
|
+
showBoard: board,
|
|
19
|
+
boardMaturity: boardMaturity,
|
|
20
|
+
verifyToken: verifyToken,
|
|
21
|
+
features: features,
|
|
22
|
+
notification: notification,
|
|
23
|
+
onFlowCompleted: function (res) {
|
|
24
|
+
onSuccess && onSuccess(res);
|
|
25
|
+
},
|
|
26
|
+
onError: function (err) {
|
|
27
|
+
onError && onError(err);
|
|
28
|
+
},
|
|
29
|
+
onReady: function () {
|
|
30
|
+
onReady && onReady();
|
|
31
|
+
},
|
|
32
|
+
onBoardButtonClick: function (data) {
|
|
33
|
+
onBoardButtonClick && onBoardButtonClick(data);
|
|
34
|
+
},
|
|
35
|
+
onCreated: function (res) {
|
|
36
|
+
onCreated && onCreated(res);
|
|
37
|
+
},
|
|
38
|
+
onClose: function () {
|
|
39
|
+
onClose && onClose();
|
|
40
|
+
},
|
|
41
|
+
onBoardCompleted: function () {
|
|
42
|
+
onBoardCompleted && onBoardCompleted();
|
|
43
|
+
},
|
|
44
|
+
onStepCompleted: function (name, info) { },
|
|
45
|
+
onStepStarted: function (name) { }
|
|
46
|
+
};
|
|
47
|
+
};
|
package/build/utils/html.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const findOrCreateElementAndInject: (id: string) => HTMLElement;
|
|
1
|
+
export declare const findOrCreateElementAndInject: (id: string) => HTMLElement;
|
package/build/utils/html.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export var findOrCreateElementAndInject = function (id) {
|
|
2
|
-
var elementExist = document.getElementById(id);
|
|
3
|
-
if (elementExist)
|
|
4
|
-
return elementExist;
|
|
5
|
-
var element = document.createElement('div');
|
|
6
|
-
element.setAttribute('id', id || 'tap-connect-sdk-lib');
|
|
7
|
-
document.body.prepend(element);
|
|
8
|
-
return element;
|
|
9
|
-
};
|
|
1
|
+
export var findOrCreateElementAndInject = function (id) {
|
|
2
|
+
var elementExist = document.getElementById(id);
|
|
3
|
+
if (elementExist)
|
|
4
|
+
return elementExist;
|
|
5
|
+
var element = document.createElement('div');
|
|
6
|
+
element.setAttribute('id', id || 'tap-connect-sdk-lib');
|
|
7
|
+
document.body.prepend(element);
|
|
8
|
+
return element;
|
|
9
|
+
};
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './html';
|
|
2
|
-
export * from './validation';
|
|
3
|
-
export * from './config';
|
|
4
|
-
export * from './common';
|
|
1
|
+
export * from './html';
|
|
2
|
+
export * from './validation';
|
|
3
|
+
export * from './config';
|
|
4
|
+
export * from './common';
|
package/build/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './html';
|
|
2
|
-
export * from './validation';
|
|
3
|
-
export * from './config';
|
|
4
|
-
export * from './common';
|
|
1
|
+
export * from './html';
|
|
2
|
+
export * from './validation';
|
|
3
|
+
export * from './config';
|
|
4
|
+
export * from './common';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ConnectProps } from '../@types';
|
|
2
|
-
export declare const validateConnectProps: (props: ConnectProps) => void;
|
|
3
|
-
export declare const validateConnectAuthProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose'>) => void;
|
|
4
|
-
export declare const validateBoardProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'scope' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'boardId'>) => void;
|
|
5
|
-
export declare const validateBoardOtherKitsProps: (props: Pick<ConnectProps, "open" | "domain" | "publicKey" | "postURL" | "country" | "language" | "onSuccess" | "onError" | "onReady" | "onClose" | "scope"> & {
|
|
6
|
-
verifyToken: string;
|
|
7
|
-
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
8
|
-
}) => void;
|
|
1
|
+
import { ConnectProps } from '../@types';
|
|
2
|
+
export declare const validateConnectProps: (props: ConnectProps) => void;
|
|
3
|
+
export declare const validateConnectAuthProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose'>) => void;
|
|
4
|
+
export declare const validateBoardProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'scope' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'boardId'>) => void;
|
|
5
|
+
export declare const validateBoardOtherKitsProps: (props: Pick<ConnectProps, "open" | "domain" | "publicKey" | "postURL" | "country" | "language" | "onSuccess" | "onError" | "onReady" | "onClose" | "scope"> & {
|
|
6
|
+
verifyToken: string;
|
|
7
|
+
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
8
|
+
}) => void;
|