cozy-ui 88.3.0 → 88.5.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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ # [88.5.0](https://github.com/cozy/cozy-ui/compare/v88.4.0...v88.5.0) (2023-07-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add images to transpiled folder ([17c2440](https://github.com/cozy/cozy-ui/commit/17c2440)), closes [/github.com/babel/babel/issues/11394#issuecomment-649014113](https://github.com//github.com/babel/babel/issues/11394/issues/issuecomment-649014113)
7
+ * Move InstallFlagshipAppDialog images from ./assets to ./icons folder ([e8100e9](https://github.com/cozy/cozy-ui/commit/e8100e9))
8
+
9
+
10
+ ### Reverts
11
+
12
+ * Assets were not in the good directory ([aaf3fc3](https://github.com/cozy/cozy-ui/commit/aaf3fc3))
13
+
14
+ # [88.4.0](https://github.com/cozy/cozy-ui/compare/v88.3.0...v88.4.0) (2023-07-06)
15
+
16
+
17
+ ### Features
18
+
19
+ * **AuthentificationDialog:** Allow redirection after password reset ([0ba12cc](https://github.com/cozy/cozy-ui/commit/0ba12cc)), closes [cozy/cozy-stack#4040](https://github.com/cozy/cozy-stack/issues/4040)
20
+
1
21
  # [88.3.0](https://github.com/cozy/cozy-ui/compare/v88.2.1...v88.3.0) (2023-07-05)
2
22
 
3
23
 
package/babel.config.js CHANGED
@@ -44,5 +44,5 @@ module.exports = {
44
44
  plugins: plugins
45
45
  }
46
46
  },
47
- ignore: ['examples/**/*']
47
+ ignore: ['examples/**/*', '**/*.md', '**/*.styl', '**/*.json', '**/*.snap']
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "88.3.0",
3
+ "version": "88.5.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -29,7 +29,7 @@
29
29
  "build:doc:react": "styleguidist build --config docs/styleguide.config.js",
30
30
  "build:types": "tsc -p tsconfig-build.json",
31
31
  "build:all": "yarn makeSpriteAndPalette && yarn build && yarn build:css:all && yarn build:doc",
32
- "build:js": "env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx react/ --out-dir transpiled/react --verbose",
32
+ "build:js": "env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx,.md,.styl,.json,.snap react/ --out-dir transpiled/react --copy-files --no-copy-ignored --verbose",
33
33
  "build": "yarn build:types && yarn build:js",
34
34
  "clean:doc:kss": "rm -rf build/styleguide",
35
35
  "deploy:doc": "git-directory-deploy --directory build/ --branch gh-pages",
@@ -20,7 +20,8 @@ const AuthentificationDialog = ({
20
20
  onSubmit,
21
21
  isLoading,
22
22
  isOIDC,
23
- error
23
+ error,
24
+ resetRedirection
24
25
  }) => {
25
26
  const { t } = useI18n()
26
27
  const client = useClient()
@@ -37,8 +38,11 @@ const AuthentificationDialog = ({
37
38
 
38
39
  const passphraseResetUrl = useMemo(() => {
39
40
  const url = new URL('/auth/passphrase_reset', client.getStackClient().uri)
41
+ if (resetRedirection) {
42
+ url.searchParams.set('from', resetRedirection)
43
+ }
40
44
  return url.href
41
- }, [client])
45
+ }, [client, resetRedirection])
42
46
 
43
47
  return (
44
48
  <PermissionDialog
@@ -103,7 +107,9 @@ AuthentificationDialog.propTypes = {
103
107
  /** Show specific wording for OIDC */
104
108
  isOIDC: PropTypes.bool,
105
109
  /** Error key to display a message */
106
- error: PropTypes.string
110
+ error: PropTypes.string,
111
+ /** Application slug where to redirect the user after a password reset */
112
+ resetRedirection: PropTypes.string
107
113
  }
108
114
 
109
115
  export default withSpecificDialogsLocales(AuthentificationDialog)
@@ -6,9 +6,9 @@ import { useI18n } from '../../I18n'
6
6
  import Link from '../../Link'
7
7
  import Typography from '../../Typography'
8
8
 
9
- import DefaultQRCode from 'cozy-ui/assets/images/QRCodeInstallFlagshipAppDialog.png'
10
- import appStoreIcon from 'cozy-ui/assets/images/appstore.png'
11
- import playStoreIcon from 'cozy-ui/assets/images/playstore.png'
9
+ import DefaultQRCode from './icons/QRCodeInstallFlagshipAppDialog.png'
10
+ import appStoreIcon from './icons/appstore.png'
11
+ import playStoreIcon from './icons/playstore.png'
12
12
  import withSpecificDialogsLocales from './withSpecificDialogsLocales'
13
13
 
14
14
  const InstallFlagshipAppDialog = forwardRef(
@@ -19,7 +19,8 @@ var AuthentificationDialog = function AuthentificationDialog(_ref) {
19
19
  onSubmit = _ref.onSubmit,
20
20
  isLoading = _ref.isLoading,
21
21
  isOIDC = _ref.isOIDC,
22
- error = _ref.error;
22
+ error = _ref.error,
23
+ resetRedirection = _ref.resetRedirection;
23
24
 
24
25
  var _useI18n = useI18n(),
25
26
  t = _useI18n.t;
@@ -42,8 +43,13 @@ var AuthentificationDialog = function AuthentificationDialog(_ref) {
42
43
 
43
44
  var passphraseResetUrl = useMemo(function () {
44
45
  var url = new URL('/auth/passphrase_reset', client.getStackClient().uri);
46
+
47
+ if (resetRedirection) {
48
+ url.searchParams.set('from', resetRedirection);
49
+ }
50
+
45
51
  return url.href;
46
- }, [client]);
52
+ }, [client, resetRedirection]);
47
53
  return /*#__PURE__*/React.createElement(PermissionDialog, {
48
54
  open: true,
49
55
  onClose: onClose,
@@ -99,6 +105,9 @@ AuthentificationDialog.propTypes = {
99
105
  isOIDC: PropTypes.bool,
100
106
 
101
107
  /** Error key to display a message */
102
- error: PropTypes.string
108
+ error: PropTypes.string,
109
+
110
+ /** Application slug where to redirect the user after a password reset */
111
+ resetRedirection: PropTypes.string
103
112
  };
104
113
  export default withSpecificDialogsLocales(AuthentificationDialog);
@@ -4,9 +4,9 @@ import { IllustrationDialog } from "cozy-ui/transpiled/react/CozyDialogs";
4
4
  import { useI18n } from "cozy-ui/transpiled/react/I18n";
5
5
  import Link from "cozy-ui/transpiled/react/Link";
6
6
  import Typography from "cozy-ui/transpiled/react/Typography";
7
- import DefaultQRCode from 'cozy-ui/assets/images/QRCodeInstallFlagshipAppDialog.png';
8
- import appStoreIcon from 'cozy-ui/assets/images/appstore.png';
9
- import playStoreIcon from 'cozy-ui/assets/images/playstore.png';
7
+ import DefaultQRCode from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/QRCodeInstallFlagshipAppDialog.png";
8
+ import appStoreIcon from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/appstore.png";
9
+ import playStoreIcon from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/icons/playstore.png";
10
10
  import withSpecificDialogsLocales from "cozy-ui/transpiled/react/CozyDialogs/SpecificDialogs/withSpecificDialogsLocales";
11
11
  var InstallFlagshipAppDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
12
  var onClose = _ref.onClose,