@incodetech/web 2.0.0-alpha.6 → 2.0.0-alpha.8
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/dist/email/email.es.js +10 -10
- package/dist/flow/flow.es.js +381 -381
- package/dist/{preact-custom-element.esm-BGQkPkOv.js → incodeModule-Dv8Qllrv.js} +72 -63
- package/dist/{otpInput-cq1THeRd.js → otpInput-BtoZe0Wz.js} +1 -1
- package/dist/{incodeModule-BuCBWati.js → page-D9ijzlSn.js} +56 -66
- package/dist/phone/phone.es.js +11 -11
- package/dist/selfie/selfie.es.js +13 -13
- package/dist/themes/dark.css +3 -3
- package/dist/themes/light.css +3 -3
- package/dist/{title-XSxhaBDx.js → title-BfO5Dlzk.js} +1 -1
- package/dist/types/email.d.ts +10 -3
- package/dist/types/flow.d.ts +30 -7
- package/dist/types/index.d.ts +1 -91
- package/dist/types/phone.d.ts +10 -3
- package/dist/types/selfie.d.ts +10 -3
- package/package.json +6 -6
- package/dist/types/email/email.d.ts +0 -2
- package/dist/types/email/styles.d.ts +0 -1
- package/dist/types/flow/flow.d.ts +0 -2
- package/dist/types/flow/styles.d.ts +0 -1
- package/dist/types/phone/phone.d.ts +0 -2
- package/dist/types/phone/styles.d.ts +0 -1
- package/dist/types/selfie/selfie.d.ts +0 -2
- package/dist/types/selfie/styles.d.ts +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,100 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FlowCompletedProps } from '../flow/flowCompleted';
|
|
3
|
-
import { IncodeFlowProps } from '../flow/flow';
|
|
4
|
-
import { PhoneConfig } from '../../../core/src/phone';
|
|
5
|
-
import { SelfieConfig } from '../../../core/src/selfie';
|
|
6
|
-
import { WasmConfig } from '../../core/src';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Element type for the `<incode-flow-completed>` web component.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const completed = document.createElement('incode-flow-completed');
|
|
14
|
-
* completed.action = 'approved';
|
|
15
|
-
* completed.scoreStatus = 'OK';
|
|
16
|
-
* document.body.appendChild(completed);
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare type FlowCompletedElement = HTMLElement & FlowCompletedProps;
|
|
1
|
+
import { WasmConfig } from '@incodetech/core';
|
|
20
2
|
|
|
21
3
|
declare type I18nOptions = {
|
|
22
4
|
lang?: string;
|
|
23
5
|
translations?: Translations;
|
|
24
6
|
};
|
|
25
7
|
|
|
26
|
-
/**
|
|
27
|
-
* Element type for the `<incode-email>` web component.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const email = document.createElement('incode-email');
|
|
32
|
-
* email.config = { otpVerification: true, otpExpirationInMinutes: 5 };
|
|
33
|
-
* email.onFinish = () => console.log('Email verified!');
|
|
34
|
-
* email.onError = (error) => console.error(error);
|
|
35
|
-
* document.body.appendChild(email);
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare type IncodeEmailElement = HTMLElement & IncodeModuleProps<EmailConfig>;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Element type for the `<incode-flow>` web component.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const flow = document.createElement('incode-flow');
|
|
46
|
-
* flow.apiURL = 'https://api.example.com';
|
|
47
|
-
* flow.token = 'session-token';
|
|
48
|
-
* flow.onComplete = (result) => console.log(result);
|
|
49
|
-
* document.body.appendChild(flow);
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare type IncodeFlowElement = HTMLElement & IncodeFlowProps;
|
|
53
|
-
|
|
54
|
-
export declare type IncodeModuleProps<TConfig> = {
|
|
55
|
-
/**
|
|
56
|
-
* Module configuration required to render the flow.
|
|
57
|
-
* For Web Components, this is typically assigned via `element.config = ...`.
|
|
58
|
-
*/
|
|
59
|
-
config?: TConfig;
|
|
60
|
-
/**
|
|
61
|
-
* Callback invoked when the module completes successfully.
|
|
62
|
-
*/
|
|
63
|
-
onFinish?: () => void;
|
|
64
|
-
/**
|
|
65
|
-
* Callback invoked when a fatal module error occurs.
|
|
66
|
-
*/
|
|
67
|
-
onError?: (error: string | undefined) => void;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Element type for the `<incode-phone>` web component.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const phone = document.createElement('incode-phone');
|
|
76
|
-
* phone.config = { otpVerification: true, otpExpirationInMinutes: 5 };
|
|
77
|
-
* phone.onFinish = () => console.log('Phone verified!');
|
|
78
|
-
* phone.onError = (error) => console.error(error);
|
|
79
|
-
* document.body.appendChild(phone);
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare type IncodePhoneElement = HTMLElement & IncodeModuleProps<PhoneConfig>;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Element type for the `<incode-selfie>` web component.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const selfie = document.createElement('incode-selfie');
|
|
90
|
-
* selfie.config = { showTutorial: true };
|
|
91
|
-
* selfie.onFinish = () => console.log('Selfie captured!');
|
|
92
|
-
* selfie.onError = (error) => console.error(error);
|
|
93
|
-
* document.body.appendChild(selfie);
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
export declare type IncodeSelfieElement = HTMLElement & IncodeModuleProps<SelfieConfig>;
|
|
97
|
-
|
|
98
8
|
declare type LanguageTranslations = Record<string, TranslationValue>;
|
|
99
9
|
|
|
100
10
|
/**
|
package/dist/types/phone.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'preact/compat';
|
|
2
|
-
import { PhoneConfig } from '
|
|
2
|
+
import { PhoneConfig } from '@incodetech/core/phone';
|
|
3
3
|
|
|
4
|
-
declare type IncodeModuleProps<TConfig> = {
|
|
4
|
+
declare type IncodeModuleProps<TConfig, TResult = void> = {
|
|
5
5
|
/**
|
|
6
6
|
* Module configuration required to render the flow.
|
|
7
7
|
* For Web Components, this is typically assigned via `element.config = ...`.
|
|
@@ -9,8 +9,9 @@ declare type IncodeModuleProps<TConfig> = {
|
|
|
9
9
|
config?: TConfig;
|
|
10
10
|
/**
|
|
11
11
|
* Callback invoked when the module completes successfully.
|
|
12
|
+
* @param result - Optional result data from the module completion
|
|
12
13
|
*/
|
|
13
|
-
onFinish?: () => void;
|
|
14
|
+
onFinish?: (result?: TResult) => void;
|
|
14
15
|
/**
|
|
15
16
|
* Callback invoked when a fatal module error occurs.
|
|
16
17
|
*/
|
|
@@ -49,3 +50,9 @@ export declare const Phone: FC<PhoneProps>;
|
|
|
49
50
|
declare type PhoneProps = IncodeModuleProps<PhoneConfig>;
|
|
50
51
|
|
|
51
52
|
export { }
|
|
53
|
+
|
|
54
|
+
declare global {
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
'incode-phone': HTMLElement & IncodeModuleProps<PhoneConfig>;
|
|
57
|
+
}
|
|
58
|
+
}
|
package/dist/types/selfie.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'preact/compat';
|
|
2
|
-
import { SelfieConfig } from '
|
|
2
|
+
import { SelfieConfig } from '@incodetech/core/selfie';
|
|
3
3
|
|
|
4
|
-
declare type IncodeModuleProps<TConfig> = {
|
|
4
|
+
declare type IncodeModuleProps<TConfig, TResult = void> = {
|
|
5
5
|
/**
|
|
6
6
|
* Module configuration required to render the flow.
|
|
7
7
|
* For Web Components, this is typically assigned via `element.config = ...`.
|
|
@@ -9,8 +9,9 @@ declare type IncodeModuleProps<TConfig> = {
|
|
|
9
9
|
config?: TConfig;
|
|
10
10
|
/**
|
|
11
11
|
* Callback invoked when the module completes successfully.
|
|
12
|
+
* @param result - Optional result data from the module completion
|
|
12
13
|
*/
|
|
13
|
-
onFinish?: () => void;
|
|
14
|
+
onFinish?: (result?: TResult) => void;
|
|
14
15
|
/**
|
|
15
16
|
* Callback invoked when a fatal module error occurs.
|
|
16
17
|
*/
|
|
@@ -22,3 +23,9 @@ export declare const Selfie: FC<SelfieProps>;
|
|
|
22
23
|
declare type SelfieProps = IncodeModuleProps<SelfieConfig>;
|
|
23
24
|
|
|
24
25
|
export { }
|
|
26
|
+
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
'incode-selfie': HTMLElement & IncodeModuleProps<SelfieConfig>;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -19,28 +19,28 @@
|
|
|
19
19
|
"default": "./dist/base.css"
|
|
20
20
|
},
|
|
21
21
|
"./selfie": {
|
|
22
|
-
"types": "./dist/types/selfie
|
|
22
|
+
"types": "./dist/types/selfie.d.ts",
|
|
23
23
|
"import": "./dist/selfie/selfie.es.js"
|
|
24
24
|
},
|
|
25
25
|
"./selfie/styles.css": {
|
|
26
26
|
"default": "./dist/selfie/styles.css"
|
|
27
27
|
},
|
|
28
28
|
"./phone": {
|
|
29
|
-
"types": "./dist/types/phone
|
|
29
|
+
"types": "./dist/types/phone.d.ts",
|
|
30
30
|
"import": "./dist/phone/phone.es.js"
|
|
31
31
|
},
|
|
32
32
|
"./phone/styles.css": {
|
|
33
33
|
"default": "./dist/phone/styles.css"
|
|
34
34
|
},
|
|
35
35
|
"./email": {
|
|
36
|
-
"types": "./dist/types/email
|
|
36
|
+
"types": "./dist/types/email.d.ts",
|
|
37
37
|
"import": "./dist/email/email.es.js"
|
|
38
38
|
},
|
|
39
39
|
"./email/styles.css": {
|
|
40
40
|
"default": "./dist/email/styles.css"
|
|
41
41
|
},
|
|
42
42
|
"./flow": {
|
|
43
|
-
"types": "./dist/types/flow
|
|
43
|
+
"types": "./dist/types/flow.d.ts",
|
|
44
44
|
"import": "./dist/flow/flow.es.js"
|
|
45
45
|
},
|
|
46
46
|
"./flow/styles.css": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"libphonenumber-js": "^1.11.0",
|
|
59
59
|
"preact-custom-element": "^4.6.0",
|
|
60
60
|
"tailwindcss": "^4.1.17",
|
|
61
|
-
"@incodetech/core": "2.0.0-alpha.
|
|
61
|
+
"@incodetech/core": "2.0.0-alpha.8"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@preact/preset-vite": "^2.10.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|