@connectid-tools/idp-selector-react 6.10.0-alpha.9 → 6.11.0-alpha.1
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/Benefits.d.ts +2 -2
- package/Benefits.js +14 -14
- package/CidButton.css +5 -0
- package/CidButton.d.ts +3 -3
- package/CidButton.js +68 -59
- package/CidButtonHowItWorks.js +9 -9
- package/CidButtonInfo.js +4 -4
- package/FullProcess.js +4 -4
- package/IdpLogoList.css +7 -37
- package/IdpLogoList.d.ts +2 -2
- package/IdpLogoList.js +8 -12
- package/IntroText.d.ts +2 -2
- package/IntroText.js +11 -11
- package/LearnMore.js +9 -9
- package/NoIdpError.js +3 -3
- package/Popup.d.ts +3 -3
- package/Popup.js +54 -44
- package/Process.css +5 -2
- package/Process.js +8 -8
- package/README.md +36 -1
- package/ThemeContext.d.ts +1 -1
- package/analytics.d.ts +1 -1
- package/certification.d.ts +1 -1
- package/certification.js +15 -15
- package/certification.test.js +225 -225
- package/compatibility.d.ts +1 -1
- package/compatibility.test.js +25 -25
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +5 -4
- package/userAgent.d.ts +1 -1
- package/validator.d.ts +1 -1
- package/validator.test.js +20 -20
package/compatibility.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CompatibilityEnvironment, CompatibilityWarnings } from
|
|
1
|
+
import { CompatibilityEnvironment, CompatibilityWarnings } from "./types.js";
|
|
2
2
|
export declare const getCompatibility: (env: CompatibilityEnvironment) => CompatibilityWarnings;
|
|
3
3
|
export declare const getMightFail: (env: Pick<CompatibilityEnvironment, "supportIncognito" | "idpHasAppCertification" | "isMobile" | "isIncognito" | "isAndroid" | "isIos" | "browser">) => boolean;
|
package/compatibility.test.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describe, it } from
|
|
2
|
-
import assert from
|
|
3
|
-
import { getCompatibility, getMightFail } from
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import assert from "node:assert";
|
|
3
|
+
import { getCompatibility, getMightFail } from "./compatibility.js";
|
|
4
|
+
describe("getCompatibility", () => {
|
|
5
|
+
it("should return compatibility warnings", () => {
|
|
6
6
|
const compatibility = getCompatibility({
|
|
7
7
|
supportIncognito: false,
|
|
8
8
|
idpHasAppCertification: true,
|
|
@@ -10,19 +10,19 @@ describe('getCompatibility', () => {
|
|
|
10
10
|
isIncognito: false,
|
|
11
11
|
isAndroid: false,
|
|
12
12
|
isIos: false,
|
|
13
|
-
browser:
|
|
13
|
+
browser: "other",
|
|
14
14
|
});
|
|
15
15
|
assert.deepStrictEqual(compatibility, {
|
|
16
16
|
isMobile: true,
|
|
17
17
|
isIncognito: false,
|
|
18
|
-
mobileOs:
|
|
19
|
-
browser:
|
|
18
|
+
mobileOs: "other",
|
|
19
|
+
browser: "other",
|
|
20
20
|
mightFail: false,
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
describe(
|
|
25
|
-
it(
|
|
24
|
+
describe("getMightFail", () => {
|
|
25
|
+
it("should return false when idpHasAppCertification is false", () => {
|
|
26
26
|
const mightFail = getMightFail({
|
|
27
27
|
supportIncognito: false,
|
|
28
28
|
idpHasAppCertification: false,
|
|
@@ -30,11 +30,11 @@ describe('getMightFail', () => {
|
|
|
30
30
|
isIncognito: false,
|
|
31
31
|
isAndroid: false,
|
|
32
32
|
isIos: false,
|
|
33
|
-
browser:
|
|
33
|
+
browser: "other",
|
|
34
34
|
});
|
|
35
35
|
assert.ok(mightFail === false);
|
|
36
36
|
});
|
|
37
|
-
it(
|
|
37
|
+
it("should return false when isMobile is false", () => {
|
|
38
38
|
const mightFail = getMightFail({
|
|
39
39
|
supportIncognito: false,
|
|
40
40
|
idpHasAppCertification: true,
|
|
@@ -42,11 +42,11 @@ describe('getMightFail', () => {
|
|
|
42
42
|
isIncognito: false,
|
|
43
43
|
isAndroid: false,
|
|
44
44
|
isIos: false,
|
|
45
|
-
browser:
|
|
45
|
+
browser: "other",
|
|
46
46
|
});
|
|
47
47
|
assert.ok(mightFail === false);
|
|
48
48
|
});
|
|
49
|
-
it(
|
|
49
|
+
it("should return true when does not support incognito and settings are incognito/android/chrome", () => {
|
|
50
50
|
const mightFail = getMightFail({
|
|
51
51
|
supportIncognito: false,
|
|
52
52
|
idpHasAppCertification: true,
|
|
@@ -54,11 +54,11 @@ describe('getMightFail', () => {
|
|
|
54
54
|
isIncognito: true,
|
|
55
55
|
isAndroid: true,
|
|
56
56
|
isIos: false,
|
|
57
|
-
browser:
|
|
57
|
+
browser: "chrome",
|
|
58
58
|
});
|
|
59
59
|
assert.ok(mightFail === true);
|
|
60
60
|
});
|
|
61
|
-
it(
|
|
61
|
+
it("should return false when supports incognito and settings are incognito/android/chrome", () => {
|
|
62
62
|
const mightFail = getMightFail({
|
|
63
63
|
supportIncognito: true,
|
|
64
64
|
idpHasAppCertification: true,
|
|
@@ -66,11 +66,11 @@ describe('getMightFail', () => {
|
|
|
66
66
|
isIncognito: true,
|
|
67
67
|
isAndroid: true,
|
|
68
68
|
isIos: false,
|
|
69
|
-
browser:
|
|
69
|
+
browser: "chrome",
|
|
70
70
|
});
|
|
71
71
|
assert.ok(mightFail === false);
|
|
72
72
|
});
|
|
73
|
-
it(
|
|
73
|
+
it("should return true when android/samsung", () => {
|
|
74
74
|
const mightFail = getMightFail({
|
|
75
75
|
supportIncognito: false,
|
|
76
76
|
idpHasAppCertification: true,
|
|
@@ -78,11 +78,11 @@ describe('getMightFail', () => {
|
|
|
78
78
|
isIncognito: false,
|
|
79
79
|
isAndroid: true,
|
|
80
80
|
isIos: false,
|
|
81
|
-
browser:
|
|
81
|
+
browser: "samsung",
|
|
82
82
|
});
|
|
83
83
|
assert.ok(mightFail === true);
|
|
84
84
|
});
|
|
85
|
-
it(
|
|
85
|
+
it("should return true when does not support incognito and settings are incognito/ios", () => {
|
|
86
86
|
const mightFail = getMightFail({
|
|
87
87
|
supportIncognito: false,
|
|
88
88
|
idpHasAppCertification: true,
|
|
@@ -90,11 +90,11 @@ describe('getMightFail', () => {
|
|
|
90
90
|
isIncognito: true,
|
|
91
91
|
isAndroid: false,
|
|
92
92
|
isIos: true,
|
|
93
|
-
browser:
|
|
93
|
+
browser: "safari",
|
|
94
94
|
});
|
|
95
95
|
assert.ok(mightFail === true);
|
|
96
96
|
});
|
|
97
|
-
it(
|
|
97
|
+
it("should return false when supports incognito and settings are incognito/ios", () => {
|
|
98
98
|
const mightFail = getMightFail({
|
|
99
99
|
supportIncognito: true,
|
|
100
100
|
idpHasAppCertification: true,
|
|
@@ -102,11 +102,11 @@ describe('getMightFail', () => {
|
|
|
102
102
|
isIncognito: true,
|
|
103
103
|
isAndroid: false,
|
|
104
104
|
isIos: true,
|
|
105
|
-
browser:
|
|
105
|
+
browser: "safari",
|
|
106
106
|
});
|
|
107
107
|
assert.ok(mightFail === false);
|
|
108
108
|
});
|
|
109
|
-
it(
|
|
109
|
+
it("should return false when none of the conditions are met", () => {
|
|
110
110
|
const mightFail = getMightFail({
|
|
111
111
|
supportIncognito: false,
|
|
112
112
|
idpHasAppCertification: true,
|
|
@@ -114,7 +114,7 @@ describe('getMightFail', () => {
|
|
|
114
114
|
isIncognito: false,
|
|
115
115
|
isAndroid: false,
|
|
116
116
|
isIos: false,
|
|
117
|
-
browser:
|
|
117
|
+
browser: "other",
|
|
118
118
|
});
|
|
119
119
|
assert.ok(mightFail === false);
|
|
120
120
|
});
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CidButton } from
|
|
1
|
+
export { CidButton } from "./CidButton.js";
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CidButton } from
|
|
1
|
+
export { CidButton } from "./CidButton.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@connectid-tools/idp-selector-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.0-alpha.1",
|
|
4
4
|
"description": "React component for IDP Selector.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"cy:open": "cypress open",
|
|
12
12
|
"clean": "rm -rf dist",
|
|
13
13
|
"build": "npm run clean && tsc && cp package.json README.md license ./src/*.css ./dist",
|
|
14
|
-
"build:prod": "npm run build && replace-in-file process.env.NODE_ENV \\'production\\' ./dist/analytics.js"
|
|
14
|
+
"build:prod": "npm run build && replace-in-file process.env.NODE_ENV \\'production\\' ./dist/analytics.js && npx ts-add-js-extension --dir dist"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -26,15 +26,16 @@
|
|
|
26
26
|
"homepage": "https://github.com/connectid-tools/idp-selector-react",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/preset-typescript": "^7.27.1",
|
|
29
|
-
"@types/node": "^22.16.
|
|
29
|
+
"@types/node": "^22.16.5",
|
|
30
30
|
"@types/react": "^18.3.23",
|
|
31
31
|
"@types/react-dom": "^18.3.7",
|
|
32
|
-
"cypress": "^14.5.
|
|
32
|
+
"cypress": "^14.5.2",
|
|
33
33
|
"jest-environment-jsdom": "^29.7.0",
|
|
34
34
|
"prettier": "^3.6.2",
|
|
35
35
|
"react": "^18.3.1",
|
|
36
36
|
"react-dom": "^18.3.1",
|
|
37
37
|
"replace-in-file": "^8.3.0",
|
|
38
|
+
"ts-add-js-extension": "^1.6.6",
|
|
38
39
|
"tsx": "^4.20.3",
|
|
39
40
|
"typescript": "^5.8.3"
|
|
40
41
|
},
|
package/userAgent.d.ts
CHANGED
package/validator.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CidButtonType, Claim, IntroTextType } from
|
|
1
|
+
import { CidButtonType, Claim, IntroTextType } from "./types.js";
|
|
2
2
|
export declare const isRequiredClaimsValid: (claims: Claim[], requiredClaims?: Claim[]) => boolean;
|
|
3
3
|
export declare const isIntroTextTypeValid: (type?: CidButtonType, introTextType?: IntroTextType) => boolean;
|
package/validator.test.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { describe, it } from
|
|
2
|
-
import { isIntroTextTypeValid, isRequiredClaimsValid } from
|
|
3
|
-
import assert from
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
6
|
-
const claims = [
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import { isIntroTextTypeValid, isRequiredClaimsValid } from "./validator.js";
|
|
3
|
+
import assert from "node:assert";
|
|
4
|
+
describe("isRequiredClaimsValid", () => {
|
|
5
|
+
it("should return true if requiredClaims is undefined", () => {
|
|
6
|
+
const claims = ["given_name", "over18"];
|
|
7
7
|
const requiredClaims = undefined;
|
|
8
8
|
assert.strictEqual(isRequiredClaimsValid(claims, requiredClaims), true);
|
|
9
9
|
});
|
|
10
|
-
it(
|
|
11
|
-
const claims = [
|
|
10
|
+
it("should return false if requiredClaims is empty", () => {
|
|
11
|
+
const claims = ["given_name", "over18"];
|
|
12
12
|
const requiredClaims = [];
|
|
13
13
|
assert.strictEqual(isRequiredClaimsValid(claims, requiredClaims), false);
|
|
14
14
|
});
|
|
15
|
-
it(
|
|
16
|
-
const claims = [
|
|
17
|
-
const requiredClaims = [
|
|
15
|
+
it("should return true if requiredClaims is a subset of claims", () => {
|
|
16
|
+
const claims = ["given_name", "over18"];
|
|
17
|
+
const requiredClaims = ["given_name"];
|
|
18
18
|
assert.strictEqual(isRequiredClaimsValid(claims, requiredClaims), true);
|
|
19
19
|
});
|
|
20
|
-
it(
|
|
21
|
-
const claims = [
|
|
22
|
-
const requiredClaims = [
|
|
20
|
+
it("should return false if requiredClaims is not a subset of claims", () => {
|
|
21
|
+
const claims = ["given_name", "over18"];
|
|
22
|
+
const requiredClaims = ["given_name", "birthdate"];
|
|
23
23
|
assert.strictEqual(isRequiredClaimsValid(claims, requiredClaims), false);
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
|
-
describe(
|
|
27
|
-
it(
|
|
26
|
+
describe("isIntroTextTypeValid", () => {
|
|
27
|
+
it("should return true if type is undefined", () => {
|
|
28
28
|
assert.ok(isIntroTextTypeValid(undefined, undefined));
|
|
29
29
|
});
|
|
30
|
-
it(
|
|
31
|
-
assert.ok(isIntroTextTypeValid(
|
|
30
|
+
it("should return true if introTextType is defined", () => {
|
|
31
|
+
assert.ok(isIntroTextTypeValid("tiny", "verify-account"));
|
|
32
32
|
});
|
|
33
|
-
it(
|
|
34
|
-
assert.ok(!isIntroTextTypeValid(
|
|
33
|
+
it("should return false if introTextType is undefined", () => {
|
|
34
|
+
assert.ok(!isIntroTextTypeValid("tiny", undefined));
|
|
35
35
|
});
|
|
36
36
|
});
|