cozy-keys-lib 5.0.0 → 6.1.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/package.json +5 -5
- package/src/components/IconCozySecurity.jsx +73 -6
- package/src/components/PasswordField.jsx +1 -1
- package/src/components/UnlockForm.jsx +4 -4
- package/src/components/UnlockForm.spec.jsx +2 -2
- package/src/components/VaultUnlocker.jsx +1 -1
- package/transpiled/components/IconCozySecurity.js +74 -6
- package/transpiled/components/PasswordField.js +1 -1
- package/transpiled/components/UnlockForm.js +5 -4
- package/transpiled/components/UnlockForm.spec.js +2 -2
- package/transpiled/components/VaultUnlocker.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-keys-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Interactions between cozy-keys and a bitwarden server",
|
|
5
5
|
"browser": "transpiled/index.js",
|
|
6
6
|
"main": "transpiled/index.node.js",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"babel-plugin-mock-imports": "^1.0.2",
|
|
50
50
|
"babel-plugin-rewire": "1.2.0",
|
|
51
51
|
"babel-preset-cozy-app": "^1.6.0",
|
|
52
|
-
"cozy-client": "^
|
|
52
|
+
"cozy-client": "^40.5.0",
|
|
53
53
|
"cozy-flags": "2.8.6",
|
|
54
54
|
"cozy-intent": "^2.0.2",
|
|
55
|
-
"cozy-ui": "^
|
|
55
|
+
"cozy-ui": "^93.1.1",
|
|
56
56
|
"enzyme": "^3.10.0",
|
|
57
57
|
"enzyme-adapter-react-16": "^1.14.0",
|
|
58
58
|
"enzyme-to-json": "3.4.0",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"zxcvbn": "^4.4.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"cozy-client": "^
|
|
89
|
+
"cozy-client": "^40.5.0",
|
|
90
90
|
"cozy-flags": "^2.8.6",
|
|
91
91
|
"cozy-intent": "^2.0.2",
|
|
92
|
-
"cozy-ui": "^
|
|
92
|
+
"cozy-ui": "^93.1.1",
|
|
93
93
|
"react": "^16.9.0",
|
|
94
94
|
"react-dom": "^16.9.0"
|
|
95
95
|
}
|
|
@@ -4,12 +4,79 @@ import React from 'react'
|
|
|
4
4
|
|
|
5
5
|
function SvgIconCozySecurity(props) {
|
|
6
6
|
return (
|
|
7
|
-
<svg
|
|
8
|
-
<
|
|
9
|
-
fill="#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
<svg viewBox="0 0 104 104" fill="none" {...props}>
|
|
8
|
+
<g filter="url(#icon-connect_svg__filter0_ddd_8318_41471)">
|
|
9
|
+
<rect x={16} y={12} width={72} height={72} rx={36} fill="#fff" />
|
|
10
|
+
<path
|
|
11
|
+
d="M28 50.5c0 7.364 5.97 13.333 13.333 13.333h21.334C70.03 63.833 76 57.863 76 50.5c0-6.53-4.693-11.962-10.89-13.11C63.962 31.193 58.53 26.5 52 26.5c-6.53 0-11.962 4.693-13.11 10.89C32.693 38.538 28 43.97 28 50.5z"
|
|
12
|
+
fill="#B3D3FF"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M54 50.584A5.001 5.001 0 0052 41a5 5 0 00-2 9.584V55a2 2 0 104 0v-4.416z"
|
|
18
|
+
fill="#297EF2"
|
|
19
|
+
/>
|
|
20
|
+
</g>
|
|
21
|
+
<defs>
|
|
22
|
+
<filter
|
|
23
|
+
id="icon-connect_svg__filter0_ddd_8318_41471"
|
|
24
|
+
x={0}
|
|
25
|
+
y={0}
|
|
26
|
+
width={104}
|
|
27
|
+
height={104}
|
|
28
|
+
filterUnits="userSpaceOnUse"
|
|
29
|
+
colorInterpolationFilters="sRGB"
|
|
30
|
+
>
|
|
31
|
+
<feFlood floodOpacity={0} result="BackgroundImageFix" />
|
|
32
|
+
<feColorMatrix
|
|
33
|
+
in="SourceAlpha"
|
|
34
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
35
|
+
result="hardAlpha"
|
|
36
|
+
/>
|
|
37
|
+
<feOffset dy={4} />
|
|
38
|
+
<feGaussianBlur stdDeviation={8} />
|
|
39
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0" />
|
|
40
|
+
<feBlend
|
|
41
|
+
in2="BackgroundImageFix"
|
|
42
|
+
result="effect1_dropShadow_8318_41471"
|
|
43
|
+
/>
|
|
44
|
+
<feColorMatrix
|
|
45
|
+
in="SourceAlpha"
|
|
46
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
47
|
+
result="hardAlpha"
|
|
48
|
+
/>
|
|
49
|
+
<feOffset dy={2} />
|
|
50
|
+
<feGaussianBlur stdDeviation={2} />
|
|
51
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0" />
|
|
52
|
+
<feBlend
|
|
53
|
+
in2="effect1_dropShadow_8318_41471"
|
|
54
|
+
result="effect2_dropShadow_8318_41471"
|
|
55
|
+
/>
|
|
56
|
+
<feColorMatrix
|
|
57
|
+
in="SourceAlpha"
|
|
58
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
59
|
+
result="hardAlpha"
|
|
60
|
+
/>
|
|
61
|
+
<feMorphology
|
|
62
|
+
radius={0.5}
|
|
63
|
+
operator="dilate"
|
|
64
|
+
in="SourceAlpha"
|
|
65
|
+
result="effect3_dropShadow_8318_41471"
|
|
66
|
+
/>
|
|
67
|
+
<feOffset />
|
|
68
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0" />
|
|
69
|
+
<feBlend
|
|
70
|
+
in2="effect2_dropShadow_8318_41471"
|
|
71
|
+
result="effect3_dropShadow_8318_41471"
|
|
72
|
+
/>
|
|
73
|
+
<feBlend
|
|
74
|
+
in="SourceGraphic"
|
|
75
|
+
in2="effect3_dropShadow_8318_41471"
|
|
76
|
+
result="shape"
|
|
77
|
+
/>
|
|
78
|
+
</filter>
|
|
79
|
+
</defs>
|
|
13
80
|
</svg>
|
|
14
81
|
)
|
|
15
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import TextField from 'cozy-ui/transpiled/react/TextField'
|
|
3
3
|
import InputAdornment from '@material-ui/core/InputAdornment'
|
|
4
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
|
|
4
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
5
5
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
6
|
import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye'
|
|
7
7
|
import EyeClosedIcon from 'cozy-ui/transpiled/react/Icons/EyeClosed'
|
|
@@ -6,11 +6,11 @@ import PropTypes from 'prop-types'
|
|
|
6
6
|
import { useClient } from 'cozy-client'
|
|
7
7
|
import flag from 'cozy-flags'
|
|
8
8
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
9
|
-
import useBreakpoints from 'cozy-ui/transpiled/react/
|
|
10
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
|
|
9
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
10
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
11
11
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button'
|
|
12
12
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
13
|
-
import CozyTheme from 'cozy-ui/transpiled/react/CozyTheme'
|
|
13
|
+
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme'
|
|
14
14
|
import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs'
|
|
15
15
|
import KeychainIcon from 'cozy-ui/transpiled/react/Icons/Keychain'
|
|
16
16
|
import { useWebviewIntent } from 'cozy-intent'
|
|
@@ -117,7 +117,7 @@ const UnlockForm = props => {
|
|
|
117
117
|
{canAuthWithOIDC ? (
|
|
118
118
|
<Icon icon={KeychainIcon} size={64} className="u-mb-half" />
|
|
119
119
|
) : (
|
|
120
|
-
<CloudIcon className="u-mb-half" />
|
|
120
|
+
<CloudIcon className="u-mb-half" size={104} />
|
|
121
121
|
)}
|
|
122
122
|
<Typography variant="h3" gutterBottom>
|
|
123
123
|
{canAuthWithOIDC ? t('unlock.title-oidc') : t('unlock.title')}
|
|
@@ -2,8 +2,8 @@ import React from 'react'
|
|
|
2
2
|
import UnlockForm from './UnlockForm'
|
|
3
3
|
import { render, fireEvent, act, waitFor } from '@testing-library/react'
|
|
4
4
|
import CozyClient, { CozyProvider } from 'cozy-client'
|
|
5
|
-
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/
|
|
6
|
-
import I18n from 'cozy-ui/transpiled/react/I18n'
|
|
5
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
6
|
+
import I18n from 'cozy-ui/transpiled/react/providers/I18n'
|
|
7
7
|
import { VaultProvider, useVaultClient } from './VaultContext'
|
|
8
8
|
import en from '../locales/en.json'
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
|
|
4
4
|
import Spinner from 'cozy-ui/transpiled/react/Spinner'
|
|
5
5
|
import Overlay from 'cozy-ui/transpiled/react/deprecated/Overlay'
|
|
6
|
-
import withLocales from 'cozy-ui/transpiled/react/I18n/withLocales'
|
|
6
|
+
import withLocales from 'cozy-ui/transpiled/react/providers/I18n/withLocales'
|
|
7
7
|
|
|
8
8
|
import localesEn from '../locales/en.json'
|
|
9
9
|
import localesFr from '../locales/fr.json'
|
|
@@ -4,12 +4,80 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
function SvgIconCozySecurity(props) {
|
|
6
6
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, props), /*#__PURE__*/React.createElement("
|
|
10
|
-
|
|
7
|
+
viewBox: "0 0 104 104",
|
|
8
|
+
fill: "none"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
filter: "url(#icon-connect_svg__filter0_ddd_8318_41471)"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
12
|
+
x: 16,
|
|
13
|
+
y: 12,
|
|
14
|
+
width: 72,
|
|
15
|
+
height: 72,
|
|
16
|
+
rx: 36,
|
|
17
|
+
fill: "#fff"
|
|
18
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
d: "M28 50.5c0 7.364 5.97 13.333 13.333 13.333h21.334C70.03 63.833 76 57.863 76 50.5c0-6.53-4.693-11.962-10.89-13.11C63.962 31.193 58.53 26.5 52 26.5c-6.53 0-11.962 4.693-13.11 10.89C32.693 38.538 28 43.97 28 50.5z",
|
|
20
|
+
fill: "#B3D3FF"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
11
22
|
fillRule: "evenodd",
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d: "M54 50.584A5.001 5.001 0 0052 41a5 5 0 00-2 9.584V55a2 2 0 104 0v-4.416z",
|
|
25
|
+
fill: "#297EF2"
|
|
26
|
+
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("filter", {
|
|
27
|
+
id: "icon-connect_svg__filter0_ddd_8318_41471",
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0,
|
|
30
|
+
width: 104,
|
|
31
|
+
height: 104,
|
|
32
|
+
filterUnits: "userSpaceOnUse",
|
|
33
|
+
colorInterpolationFilters: "sRGB"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("feFlood", {
|
|
35
|
+
floodOpacity: 0,
|
|
36
|
+
result: "BackgroundImageFix"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
38
|
+
in: "SourceAlpha",
|
|
39
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
40
|
+
result: "hardAlpha"
|
|
41
|
+
}), /*#__PURE__*/React.createElement("feOffset", {
|
|
42
|
+
dy: 4
|
|
43
|
+
}), /*#__PURE__*/React.createElement("feGaussianBlur", {
|
|
44
|
+
stdDeviation: 8
|
|
45
|
+
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
46
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"
|
|
47
|
+
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
48
|
+
in2: "BackgroundImageFix",
|
|
49
|
+
result: "effect1_dropShadow_8318_41471"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
51
|
+
in: "SourceAlpha",
|
|
52
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
53
|
+
result: "hardAlpha"
|
|
54
|
+
}), /*#__PURE__*/React.createElement("feOffset", {
|
|
55
|
+
dy: 2
|
|
56
|
+
}), /*#__PURE__*/React.createElement("feGaussianBlur", {
|
|
57
|
+
stdDeviation: 2
|
|
58
|
+
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
59
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"
|
|
60
|
+
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
61
|
+
in2: "effect1_dropShadow_8318_41471",
|
|
62
|
+
result: "effect2_dropShadow_8318_41471"
|
|
63
|
+
}), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
64
|
+
in: "SourceAlpha",
|
|
65
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
66
|
+
result: "hardAlpha"
|
|
67
|
+
}), /*#__PURE__*/React.createElement("feMorphology", {
|
|
68
|
+
radius: 0.5,
|
|
69
|
+
operator: "dilate",
|
|
70
|
+
in: "SourceAlpha",
|
|
71
|
+
result: "effect3_dropShadow_8318_41471"
|
|
72
|
+
}), /*#__PURE__*/React.createElement("feOffset", null), /*#__PURE__*/React.createElement("feColorMatrix", {
|
|
73
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"
|
|
74
|
+
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
75
|
+
in2: "effect2_dropShadow_8318_41471",
|
|
76
|
+
result: "effect3_dropShadow_8318_41471"
|
|
77
|
+
}), /*#__PURE__*/React.createElement("feBlend", {
|
|
78
|
+
in: "SourceGraphic",
|
|
79
|
+
in2: "effect3_dropShadow_8318_41471",
|
|
80
|
+
result: "shape"
|
|
81
|
+
}))));
|
|
14
82
|
}
|
|
15
83
|
export default SvgIconCozySecurity;
|
|
@@ -5,7 +5,7 @@ var _excluded = ["hidden"];
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
import TextField from 'cozy-ui/transpiled/react/TextField';
|
|
7
7
|
import InputAdornment from '@material-ui/core/InputAdornment';
|
|
8
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
8
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
|
|
9
9
|
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
10
10
|
import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye';
|
|
11
11
|
import EyeClosedIcon from 'cozy-ui/transpiled/react/Icons/EyeClosed';
|
|
@@ -8,11 +8,11 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { useClient } from 'cozy-client';
|
|
9
9
|
import flag from 'cozy-flags';
|
|
10
10
|
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
11
|
-
import useBreakpoints from 'cozy-ui/transpiled/react/
|
|
12
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
11
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
|
|
12
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
|
|
13
13
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button';
|
|
14
14
|
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
15
|
-
import CozyTheme from 'cozy-ui/transpiled/react/CozyTheme';
|
|
15
|
+
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme';
|
|
16
16
|
import { IllustrationDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
17
17
|
import KeychainIcon from 'cozy-ui/transpiled/react/Icons/Keychain';
|
|
18
18
|
import { useWebviewIntent } from 'cozy-intent';
|
|
@@ -115,7 +115,8 @@ var UnlockForm = function UnlockForm(props) {
|
|
|
115
115
|
size: 64,
|
|
116
116
|
className: "u-mb-half"
|
|
117
117
|
}) : /*#__PURE__*/React.createElement(CloudIcon, {
|
|
118
|
-
className: "u-mb-half"
|
|
118
|
+
className: "u-mb-half",
|
|
119
|
+
size: 104
|
|
119
120
|
}), /*#__PURE__*/React.createElement(Typography, {
|
|
120
121
|
variant: "h3",
|
|
121
122
|
gutterBottom: true
|
|
@@ -4,8 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import UnlockForm from './UnlockForm';
|
|
5
5
|
import { render, fireEvent, act, waitFor } from '@testing-library/react';
|
|
6
6
|
import CozyClient, { CozyProvider } from 'cozy-client';
|
|
7
|
-
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/
|
|
8
|
-
import I18n from 'cozy-ui/transpiled/react/I18n';
|
|
7
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints';
|
|
8
|
+
import I18n from 'cozy-ui/transpiled/react/providers/I18n';
|
|
9
9
|
import { VaultProvider, useVaultClient } from './VaultContext';
|
|
10
10
|
import en from '../locales/en.json';
|
|
11
11
|
jest.mock('./VaultContext', function () {
|
|
@@ -5,7 +5,7 @@ import React, { useContext, useState, useEffect } from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Spinner from 'cozy-ui/transpiled/react/Spinner';
|
|
7
7
|
import Overlay from 'cozy-ui/transpiled/react/deprecated/Overlay';
|
|
8
|
-
import withLocales from 'cozy-ui/transpiled/react/I18n/withLocales';
|
|
8
|
+
import withLocales from 'cozy-ui/transpiled/react/providers/I18n/withLocales';
|
|
9
9
|
import localesEn from '../locales/en.json';
|
|
10
10
|
import localesFr from '../locales/fr.json';
|
|
11
11
|
import { VaultContext } from './VaultContext';
|