cozy-ui 88.4.0 → 88.6.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/babel.config.js +1 -1
  3. package/package.json +2 -2
  4. package/react/CozyDialogs/SpecificDialogs/InstallFlagshipAppDialog.jsx +3 -3
  5. package/react/Paywall/Paywall.jsx +1 -1
  6. package/react/Paywall/QuotaPaywall.jsx +18 -0
  7. package/react/Paywall/Readme.md +6 -1
  8. package/react/Paywall/index.jsx +1 -0
  9. package/react/Paywall/locales/en.json +27 -15
  10. package/react/Paywall/locales/fr.json +22 -10
  11. package/react/deprecated/QuotaAlert/Readme.md +27 -36
  12. package/react/deprecated/QuotaAlert/index.jsx +10 -66
  13. package/transpiled/react/CozyDialogs/SpecificDialogs/InstallFlagshipAppDialog.js +3 -3
  14. package/transpiled/react/CozyDialogs/SpecificDialogs/icons/QRCodeInstallFlagshipAppDialog.png +0 -0
  15. package/transpiled/react/CozyDialogs/SpecificDialogs/icons/appstore.png +0 -0
  16. package/transpiled/react/CozyDialogs/SpecificDialogs/icons/playstore.png +0 -0
  17. package/transpiled/react/CozyDialogs/background.png +0 -0
  18. package/transpiled/react/Paywall/Paywall.js +1 -1
  19. package/transpiled/react/Paywall/QuotaPaywall.js +20 -0
  20. package/transpiled/react/Paywall/index.js +2 -1
  21. package/transpiled/react/Paywall/locales/withPaywallLocales.js +49 -25
  22. package/transpiled/react/deprecated/QuotaAlert/index.js +10 -79
  23. package/react/deprecated/QuotaAlert/locales/en.json +0 -8
  24. package/react/deprecated/QuotaAlert/locales/fr.json +0 -8
  25. /package/{assets/images → react/CozyDialogs/SpecificDialogs/icons}/QRCodeInstallFlagshipAppDialog.png +0 -0
  26. /package/{assets/images → react/CozyDialogs/SpecificDialogs/icons}/appstore.png +0 -0
  27. /package/{assets/images → react/CozyDialogs/SpecificDialogs/icons}/playstore.png +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # [88.6.0](https://github.com/cozy/cozy-ui/compare/v88.5.0...v88.6.0) (2023-07-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Paywall:** Improve wording to be more explicite ([d21b311](https://github.com/cozy/cozy-ui/commit/d21b311))
7
+ * **Paywall:** Open the premium link in the current window ([95ac4b7](https://github.com/cozy/cozy-ui/commit/95ac4b7))
8
+
9
+
10
+ ### Features
11
+
12
+ * Add QuotaPaywall ([1263285](https://github.com/cozy/cozy-ui/commit/1263285))
13
+ * Update QuotaAlert design by exposing QuotaPaywall ([8a11f9b](https://github.com/cozy/cozy-ui/commit/8a11f9b))
14
+
15
+ # [88.5.0](https://github.com/cozy/cozy-ui/compare/v88.4.0...v88.5.0) (2023-07-06)
16
+
17
+
18
+ ### Features
19
+
20
+ * 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)
21
+ * Move InstallFlagshipAppDialog images from ./assets to ./icons folder ([e8100e9](https://github.com/cozy/cozy-ui/commit/e8100e9))
22
+
23
+
24
+ ### Reverts
25
+
26
+ * Assets were not in the good directory ([aaf3fc3](https://github.com/cozy/cozy-ui/commit/aaf3fc3))
27
+
1
28
  # [88.4.0](https://github.com/cozy/cozy-ui/compare/v88.3.0...v88.4.0) (2023-07-06)
2
29
 
3
30
 
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.4.0",
3
+ "version": "88.6.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",
@@ -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(
@@ -45,7 +45,7 @@ const Paywall = ({ variant, onClose, isPublic, contentInterpolation }) => {
45
45
 
46
46
  const onAction = () => {
47
47
  return type === 'premium' && !isMobileAppVersion
48
- ? window.open(link, 'self')
48
+ ? window.open(link, '_self')
49
49
  : onClose()
50
50
  }
51
51
 
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import Paywall from './Paywall'
5
+
6
+ /**
7
+ * Paywall displayed when user disk space is full
8
+ */
9
+ const QuotaPaywall = ({ onClose }) => {
10
+ return <Paywall variant="quota" onClose={onClose} />
11
+ }
12
+
13
+ QuotaPaywall.propTypes = {
14
+ /** Callback used when the user close the paywall */
15
+ onClose: PropTypes.func.isRequired
16
+ }
17
+
18
+ export default QuotaPaywall
@@ -11,7 +11,8 @@ import {
11
11
  PasswordSharingPaywall,
12
12
  MaxAccountsByKonnectorPaywall,
13
13
  MaxAccountsPaywall,
14
- MaxPapersPaywall
14
+ MaxPapersPaywall,
15
+ QuotaPaywall
15
16
  } from "cozy-ui/transpiled/react/Paywall"
16
17
  import { CozyProvider } from "cozy-client"
17
18
  import { BreakpointsProvider } from "cozy-ui/transpiled/react/hooks/useBreakpoints"
@@ -69,6 +70,10 @@ const paywalls = [
69
70
  {
70
71
  name: 'MaxPapersPaywall',
71
72
  component: MaxPapersPaywall
73
+ },
74
+ {
75
+ name: 'QuotaPaywall',
76
+ component: QuotaPaywall
72
77
  }
73
78
  ]
74
79
 
@@ -5,3 +5,4 @@ export {
5
5
  } from './MaxAccountsByKonnectorPaywall'
6
6
  export { default as MaxAccountsPaywall } from './MaxAccountsPaywall'
7
7
  export { default as MaxPapersPaywall } from './MaxPapersPaywall'
8
+ export { default as QuotaPaywall } from './QuotaPaywall'
@@ -4,8 +4,8 @@
4
4
  },
5
5
  "onlyOfficePaywall": {
6
6
  "premium": {
7
- "title": "Upgrade your Cozy!",
8
- "content": "To unlock this feature, or simply support us, you can change your Cozy offer.",
7
+ "title": "Upgrade your plan",
8
+ "content": "Your plan doesn't allow you to **modify your documents online**.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
9
9
  "action": "Check our plans"
10
10
  },
11
11
  "public": {
@@ -15,55 +15,67 @@
15
15
  },
16
16
  "default": {
17
17
  "title": "Information",
18
- "content": "Your current offer does not allow you to take advantage of this feature.",
18
+ "content": "Your current plan does not allow you to take advantage of this feature.",
19
19
  "action": "I understand"
20
20
  }
21
21
  },
22
22
  "passwordSharingPaywall": {
23
23
  "premium": {
24
- "title": "Upgrade your Cozy!",
25
- "content": "To unlock this feature, or simply support us, you can change your Cozy offer.",
24
+ "title": "Upgrade your plan",
25
+ "content": "Your plan doesn't allow you to **share your passwords**.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
26
26
  "action": "Check our plans"
27
27
  },
28
28
  "default": {
29
29
  "title": "Information",
30
- "content": "Your current offer does not allow you to take advantage of this feature.",
30
+ "content": "Your current plan does not allow you to take advantage of this feature.",
31
31
  "action": "I understand"
32
32
  }
33
33
  },
34
34
  "maxAccountsByKonnectorPaywall": {
35
35
  "premium": {
36
- "title": "Upgrade your Cozy!",
37
- "content": "Your offer allows you to connect %{smart_count} account %{konnectorName} in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer. |||| Your offer allows you to connect %{smart_count} accounts %{konnectorName} in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer.",
36
+ "title": "Upgrade your plan",
37
+ "content": "Your plan allows you to connect up to **%{smart_count} account %{konnectorName}** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan. |||| Your plan allows you to connect up to **%{smart_count} accounts %{konnectorName}** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
38
38
  "action": "Check our plans"
39
39
  },
40
40
  "default": {
41
41
  "title": "Information",
42
- "content": "Your current offer does not allow you to take advantage of this feature.",
42
+ "content": "Your current plan does not allow you to take advantage of this feature.",
43
43
  "action": "I understand"
44
44
  }
45
45
  },
46
46
  "maxAccountsPaywall": {
47
47
  "premium": {
48
- "title": "Upgrade your Cozy!",
49
- "content": "Your offer allows you to connect %{smart_count} account in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer. |||| Your offer allows you to connect %{smart_count} accounts in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer.",
48
+ "title": "Upgrade your plan",
49
+ "content": "Your plan allows you to connect up to **%{smart_count} account** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan. |||| Your plan allows you to connect up to **%{smart_count} accounts** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
50
50
  "action": "Check our plans"
51
51
  },
52
52
  "default": {
53
53
  "title": "Information",
54
- "content": "Your current offer does not allow you to take advantage of this feature.",
54
+ "content": "Your current plan does not allow you to take advantage of this feature.",
55
55
  "action": "I understand"
56
56
  }
57
57
  },
58
58
  "maxPapersPaywall": {
59
59
  "premium": {
60
- "title": "Upgrade your Cozy!",
61
- "content": "Your offer allows you to manually add up to %{smart_count} paper.\n\nTo unlock this feature, or simply support us, you can modify the offer of your Cozy. |||| Your offer allows you to manually add up to %{smart_count} papers.\n\nTo unlock this feature, or simply support us, you can modify the offer of your Cozy.",
60
+ "title": "Upgrade your plan",
61
+ "content": "Your plan allows you to manually add up to **%{smart_count} paper**.\n\nTo unlock this feature, or simply support us, you can modify the plan of your Cozy. |||| Your plan allows you to manually add up to **%{smart_count} papers**.\n\nTo unlock this feature, or simply support us, you can modify the plan of your Cozy.",
62
62
  "action": "Check our plans"
63
63
  },
64
64
  "default": {
65
65
  "title": "Information",
66
- "content": "Your current offer does not allow you to take advantage of this feature.",
66
+ "content": "Your current plan does not allow you to take advantage of this feature.",
67
+ "action": "I understand"
68
+ }
69
+ },
70
+ "quotaPaywall": {
71
+ "premium": {
72
+ "title": "Upgrade your plan",
73
+ "content": "Your disk storage is full.\n\nPlease remove files, empty your trash or upgrade your plan before uploading files.",
74
+ "action": "Check our plans"
75
+ },
76
+ "default": {
77
+ "title": "Information",
78
+ "content": "Your disk storage is full.\n\nPlease remove files, empty your trash before uploading files.",
67
79
  "action": "I understand"
68
80
  }
69
81
  }
@@ -4,8 +4,8 @@
4
4
  },
5
5
  "onlyOfficePaywall": {
6
6
  "premium": {
7
- "title": "Augmenter votre Cozy !",
8
- "content": "Pour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
7
+ "title": "Augmentez votre offre",
8
+ "content": "Votre offre ne vous permet pas de **modifier vos documents en ligne**.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
9
9
  "action": "Voir les offres"
10
10
  },
11
11
  "public": {
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "passwordSharingPaywall": {
23
23
  "premium": {
24
- "title": "Augmenter votre Cozy !",
25
- "content": "Pour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
24
+ "title": "Augmentez votre offre",
25
+ "content": "Votre offre ne vous permet pas de **partager vos mots de passe**.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
26
26
  "action": "Voir les offres"
27
27
  },
28
28
  "default": {
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "maxAccountsByKonnectorPaywall": {
35
35
  "premium": {
36
- "title": "Augmenter votre Cozy !",
37
- "content": "Votre offre vous permet de connecter %{smart_count} compte %{konnectorName} dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter %{smart_count} comptes %{konnectorName} dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
36
+ "title": "Augmentez votre offre",
37
+ "content": "Votre offre vous permet de connecter jusqu'à **%{smart_count} compte %{konnectorName}** dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter jusqu'à **%{smart_count} comptes %{konnectorName}** dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
38
38
  "action": "Voir les offres"
39
39
  },
40
40
  "default": {
@@ -45,8 +45,8 @@
45
45
  },
46
46
  "maxAccountsPaywall": {
47
47
  "premium": {
48
- "title": "Augmenter votre Cozy !",
49
- "content": "Votre offre vous permet de connecter %{smart_count} compte dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter %{smart_count} comptes dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
48
+ "title": "Augmentez votre offre",
49
+ "content": "Votre offre vous permet de connecter jusqu'à **%{smart_count} compte** dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter jusqu'à **%{smart_count} comptes** dans votre Cozy.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
50
50
  "action": "Voir les offres"
51
51
  },
52
52
  "default": {
@@ -57,8 +57,8 @@
57
57
  },
58
58
  "maxPapersPaywall": {
59
59
  "premium": {
60
- "title": "Augmenter votre Cozy !",
61
- "content": "Votre offre vous permet d'ajouter manuellement jusqu'à %{smart_count} papier.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet d'ajouter manuellement jusqu'à %{smart_count} papiers.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
60
+ "title": "Augmentez votre offre",
61
+ "content": "Votre offre vous permet d'ajouter manuellement jusqu'à **%{smart_count} papier**.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet d'ajouter manuellement jusqu'à **%{smart_count} papiers**.\n\nPour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
62
62
  "action": "Voir les offres"
63
63
  },
64
64
  "default": {
@@ -66,5 +66,17 @@
66
66
  "content": "Votre offre actuelle ne vous permet pas de profiter de cette fonctionnalité.",
67
67
  "action": "J'ai compris"
68
68
  }
69
+ },
70
+ "quotaPaywall": {
71
+ "premium": {
72
+ "title": "Augmentez votre offre",
73
+ "content": "Votre espace de stockage est plein.\n\nVeuillez supprimer des fichiers, vider votre corbeille ou changer d'offre avant d'importer de nouveaux fichiers.",
74
+ "action": "Voir les offres"
75
+ },
76
+ "default": {
77
+ "title": "Information",
78
+ "content": "Votre espace de stockage est plein.\n\nVeuillez supprimer des fichiers, et vider votre corbeille avant d'importer de nouveaux fichiers.",
79
+ "action": "J'ai compris"
80
+ }
69
81
  }
70
82
  }
@@ -3,47 +3,38 @@
3
3
  The link to the manager is only displayed if there is a managerUrl
4
4
  in the stack response
5
5
 
6
- ```jsx noeditor
6
+ ```jsx
7
7
  import QuotaAlert from "cozy-ui/transpiled/react/deprecated/QuotaAlert";
8
- import { CozyProvider } from "cozy-client";
9
- import { BreakpointsProvider } from "cozy-ui/transpiled/react/hooks/useBreakpoints";
8
+ import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
10
9
 
11
- <BreakpointsProvider>
12
- <div>
10
+ const mockClient = {
11
+ getStackClient: () => ({
12
+ fetchJSON: (_, url) => {
13
+ let attributes = {}
14
+ if(url === '/settings/context') {
15
+ attributes = {
16
+ attributes: {
17
+ enable_premium_links: true,
18
+ manager_url: "http://mycozy.cloud",
19
+ }
20
+ }
21
+ } else if(url === '/settings/instance') {
22
+ attributes = {
23
+ attributes: { uuid: "1223" }
24
+ }
25
+ }
26
+
27
+ return Promise.resolve({ data: attributes })
28
+ }
29
+ })
30
+ };
31
+
32
+ <DemoProvider client={mockClient}>
13
33
  <button onClick={() => setState({ modalOpened: !state.modalOpened })}>
14
34
  Toggle modal
15
35
  </button>
16
-
17
36
  {state.modalOpened && (
18
- <CozyProvider
19
- client={{
20
- getStackClient: () => ({
21
- fetchJSON: () =>
22
- Promise.resolve({
23
- data: {
24
- attributes: { uuid: "1223", manager_url: "http://mycozy.cloud" }
25
- }
26
- })
27
- })
28
- }}
29
- >
30
- <QuotaAlert onClose={() => setState({ modalOpened: false })} />
31
- </CozyProvider>
37
+ <QuotaAlert onClose={() => setState({ modalOpened: false })} />
32
38
  )}
33
- </div>
34
- </BreakpointsProvider>;
35
- ```
36
-
37
- ```jsx static
38
- import QuotaAlert from "cozy-ui/transpiled/react/deprecated/QuotaAlert";
39
-
40
- <div>
41
- <button onClick={() => setState({ modalOpened: !state.modalOpened })}>
42
- Toggle modal
43
- </button>
44
-
45
- {state.modalOpened && (
46
- <QuotaAlert onClose={() => setState({ modalOpened: false })} />
47
- )}
48
- </div>;
39
+ </DemoProvider>
49
40
  ```
@@ -1,74 +1,18 @@
1
1
  import React from 'react'
2
- import get from 'lodash/get'
3
2
 
4
- import { useClient } from 'cozy-client'
5
- import { isMobileApp } from 'cozy-device-helper'
3
+ import createDepreciationLogger from '../../helpers/createDepreciationLogger'
4
+ import { QuotaPaywall } from '../../Paywall'
6
5
 
7
- import { Dialog } from '../../CozyDialogs'
8
- import Button from '../Button'
9
-
10
- import useInstance from '../../helpers/useInstance'
11
-
12
- import withLocales from '../../I18n/withLocales'
13
- import en from './locales/en.json'
14
- import fr from './locales/fr.json'
15
-
16
- const locales = {
17
- en,
18
- fr
19
- }
20
-
21
- const buildPremiumLink = (uuid, managerUrl) =>
22
- `${managerUrl}/cozy/instances/${uuid}/premium`
23
-
24
- const QuotaModalAlert = withLocales(locales)(({ t, onClose, instance }) => {
25
- const uuid = get(instance, 'instance.data.attributes.uuid')
26
- const managerUrl = get(instance, 'context.data.attributes.manager_url')
27
- return (
28
- <Dialog
29
- open={true}
30
- title={t('quotaalert.title')}
31
- content={t('quotaalert.desc')}
32
- actions={
33
- <>
34
- <Button
35
- theme="secondary"
36
- onClick={onClose}
37
- label={t('quotaalert.confirm')}
38
- />
39
- {uuid && managerUrl && (
40
- <Button
41
- theme="primary"
42
- label={t('quotaalert.increase')}
43
- onClick={() =>
44
- window.open(buildPremiumLink(uuid, managerUrl), 'self')
45
- }
46
- />
47
- )}
48
- </>
49
- }
50
- onClose={onClose}
51
- />
52
- )
53
- })
6
+ const logDeprecatedComponent = createDepreciationLogger()
54
7
 
8
+ /**
9
+ * @deprecated This component is depreacated, please use [QuotaPaywall](#/Paywall) instead.
10
+ */
55
11
  const QuotaAlert = ({ onClose }) => {
56
- const client = useClient()
57
- /**
58
- * We don't want to call useInstance if we are on
59
- * mobile since we don't want to create a link to the cozy manager
60
- * because Apple and Google have restricted policy about
61
- * making a link to an outside purchase.
62
- *
63
- * So no call, no instance info, no button
64
- */
65
- if (isMobileApp()) {
66
- return <QuotaModalAlert onClose={onClose} />
67
- }
68
- // TODO: why is there a conditional hook here?
69
- // eslint-disable-next-line react-hooks/rules-of-hooks
70
- const instanceInfo = useInstance(client)
71
- return <QuotaModalAlert instance={instanceInfo} onClose={onClose} />
12
+ logDeprecatedComponent(
13
+ 'QuotaAlert is now exported from the cozy-ui as QuotaPaywall. Please import the component from "cozy-ui/transpiled/react/Paywall"'
14
+ )
15
+ return <QuotaPaywall onClose={onClose} />
72
16
  }
73
17
 
74
18
  export default QuotaAlert
@@ -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,
@@ -52,7 +52,7 @@ var Paywall = function Paywall(_ref) {
52
52
  var type = makeType(instance, isPublic, link);
53
53
 
54
54
  var onAction = function onAction() {
55
- return type === 'premium' && !isMobileAppVersion ? window.open(link, 'self') : onClose();
55
+ return type === 'premium' && !isMobileAppVersion ? window.open(link, '_self') : onClose();
56
56
  };
57
57
 
58
58
  return /*#__PURE__*/React.createElement(IllustrationDialog, {
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Paywall from "cozy-ui/transpiled/react/Paywall/Paywall";
4
+ /**
5
+ * Paywall displayed when user disk space is full
6
+ */
7
+
8
+ var QuotaPaywall = function QuotaPaywall(_ref) {
9
+ var onClose = _ref.onClose;
10
+ return /*#__PURE__*/React.createElement(Paywall, {
11
+ variant: "quota",
12
+ onClose: onClose
13
+ });
14
+ };
15
+
16
+ QuotaPaywall.propTypes = {
17
+ /** Callback used when the user close the paywall */
18
+ onClose: PropTypes.func.isRequired
19
+ };
20
+ export default QuotaPaywall;
@@ -2,4 +2,5 @@ export { default as OnlyOfficePaywall } from './OnlyOfficePaywall';
2
2
  export { default as PasswordSharingPaywall } from './PasswordSharingPaywall';
3
3
  export { default as MaxAccountsByKonnectorPaywall } from './MaxAccountsByKonnectorPaywall';
4
4
  export { default as MaxAccountsPaywall } from './MaxAccountsPaywall';
5
- export { default as MaxPapersPaywall } from './MaxPapersPaywall';
5
+ export { default as MaxPapersPaywall } from './MaxPapersPaywall';
6
+ export { default as QuotaPaywall } from './QuotaPaywall';
@@ -5,8 +5,8 @@ var en = {
5
5
  },
6
6
  onlyOfficePaywall: {
7
7
  premium: {
8
- title: "Upgrade your Cozy!",
9
- content: "To unlock this feature, or simply support us, you can change your Cozy offer.",
8
+ title: "Upgrade your plan",
9
+ content: "Your plan doesn't allow you to **modify your documents online**.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
10
10
  action: "Check our plans"
11
11
  },
12
12
  "public": {
@@ -16,55 +16,67 @@ var en = {
16
16
  },
17
17
  "default": {
18
18
  title: "Information",
19
- content: "Your current offer does not allow you to take advantage of this feature.",
19
+ content: "Your current plan does not allow you to take advantage of this feature.",
20
20
  action: "I understand"
21
21
  }
22
22
  },
23
23
  passwordSharingPaywall: {
24
24
  premium: {
25
- title: "Upgrade your Cozy!",
26
- content: "To unlock this feature, or simply support us, you can change your Cozy offer.",
25
+ title: "Upgrade your plan",
26
+ content: "Your plan doesn't allow you to **share your passwords**.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
27
27
  action: "Check our plans"
28
28
  },
29
29
  "default": {
30
30
  title: "Information",
31
- content: "Your current offer does not allow you to take advantage of this feature.",
31
+ content: "Your current plan does not allow you to take advantage of this feature.",
32
32
  action: "I understand"
33
33
  }
34
34
  },
35
35
  maxAccountsByKonnectorPaywall: {
36
36
  premium: {
37
- title: "Upgrade your Cozy!",
38
- content: "Your offer allows you to connect %{smart_count} account %{konnectorName} in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer. |||| Your offer allows you to connect %{smart_count} accounts %{konnectorName} in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer.",
37
+ title: "Upgrade your plan",
38
+ content: "Your plan allows you to connect up to **%{smart_count} account %{konnectorName}** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan. |||| Your plan allows you to connect up to **%{smart_count} accounts %{konnectorName}** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
39
39
  action: "Check our plans"
40
40
  },
41
41
  "default": {
42
42
  title: "Information",
43
- content: "Your current offer does not allow you to take advantage of this feature.",
43
+ content: "Your current plan does not allow you to take advantage of this feature.",
44
44
  action: "I understand"
45
45
  }
46
46
  },
47
47
  maxAccountsPaywall: {
48
48
  premium: {
49
- title: "Upgrade your Cozy!",
50
- content: "Your offer allows you to connect %{smart_count} account in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer. |||| Your offer allows you to connect %{smart_count} accounts in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy offer.",
49
+ title: "Upgrade your plan",
50
+ content: "Your plan allows you to connect up to **%{smart_count} account** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan. |||| Your plan allows you to connect up to **%{smart_count} accounts** in your Cozy.\n\nTo unlock this feature, or simply support us, you can change your Cozy plan.",
51
51
  action: "Check our plans"
52
52
  },
53
53
  "default": {
54
54
  title: "Information",
55
- content: "Your current offer does not allow you to take advantage of this feature.",
55
+ content: "Your current plan does not allow you to take advantage of this feature.",
56
56
  action: "I understand"
57
57
  }
58
58
  },
59
59
  maxPapersPaywall: {
60
60
  premium: {
61
- title: "Upgrade your Cozy!",
62
- content: "Your offer allows you to manually add up to %{smart_count} paper.\n\nTo unlock this feature, or simply support us, you can modify the offer of your Cozy. |||| Your offer allows you to manually add up to %{smart_count} papers.\n\nTo unlock this feature, or simply support us, you can modify the offer of your Cozy.",
61
+ title: "Upgrade your plan",
62
+ content: "Your plan allows you to manually add up to **%{smart_count} paper**.\n\nTo unlock this feature, or simply support us, you can modify the plan of your Cozy. |||| Your plan allows you to manually add up to **%{smart_count} papers**.\n\nTo unlock this feature, or simply support us, you can modify the plan of your Cozy.",
63
63
  action: "Check our plans"
64
64
  },
65
65
  "default": {
66
66
  title: "Information",
67
- content: "Your current offer does not allow you to take advantage of this feature.",
67
+ content: "Your current plan does not allow you to take advantage of this feature.",
68
+ action: "I understand"
69
+ }
70
+ },
71
+ quotaPaywall: {
72
+ premium: {
73
+ title: "Upgrade your plan",
74
+ content: "Your disk storage is full.\n\nPlease remove files, empty your trash or upgrade your plan before uploading files.",
75
+ action: "Check our plans"
76
+ },
77
+ "default": {
78
+ title: "Information",
79
+ content: "Your disk storage is full.\n\nPlease remove files, empty your trash before uploading files.",
68
80
  action: "I understand"
69
81
  }
70
82
  }
@@ -75,8 +87,8 @@ var fr = {
75
87
  },
76
88
  onlyOfficePaywall: {
77
89
  premium: {
78
- title: "Augmenter votre Cozy !",
79
- content: "Pour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
90
+ title: "Augmentez votre offre",
91
+ content: "Votre offre ne vous permet pas de **modifier vos documents en ligne**.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
80
92
  action: "Voir les offres"
81
93
  },
82
94
  "public": {
@@ -92,8 +104,8 @@ var fr = {
92
104
  },
93
105
  passwordSharingPaywall: {
94
106
  premium: {
95
- title: "Augmenter votre Cozy !",
96
- content: "Pour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
107
+ title: "Augmentez votre offre",
108
+ content: "Votre offre ne vous permet pas de **partager vos mots de passe**.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
97
109
  action: "Voir les offres"
98
110
  },
99
111
  "default": {
@@ -104,8 +116,8 @@ var fr = {
104
116
  },
105
117
  maxAccountsByKonnectorPaywall: {
106
118
  premium: {
107
- title: "Augmenter votre Cozy !",
108
- content: "Votre offre vous permet de connecter %{smart_count} compte %{konnectorName} dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter %{smart_count} comptes %{konnectorName} dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
119
+ title: "Augmentez votre offre",
120
+ content: "Votre offre vous permet de connecter jusqu'\xE0 **%{smart_count} compte %{konnectorName}** dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter jusqu'\xE0 **%{smart_count} comptes %{konnectorName}** dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
109
121
  action: "Voir les offres"
110
122
  },
111
123
  "default": {
@@ -116,8 +128,8 @@ var fr = {
116
128
  },
117
129
  maxAccountsPaywall: {
118
130
  premium: {
119
- title: "Augmenter votre Cozy !",
120
- content: "Votre offre vous permet de connecter %{smart_count} compte dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter %{smart_count} comptes dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
131
+ title: "Augmentez votre offre",
132
+ content: "Votre offre vous permet de connecter jusqu'\xE0 **%{smart_count} compte** dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet de connecter jusqu'\xE0 **%{smart_count} comptes** dans votre Cozy.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
121
133
  action: "Voir les offres"
122
134
  },
123
135
  "default": {
@@ -128,8 +140,8 @@ var fr = {
128
140
  },
129
141
  maxPapersPaywall: {
130
142
  premium: {
131
- title: "Augmenter votre Cozy !",
132
- content: "Votre offre vous permet d'ajouter manuellement jusqu'\xE0 %{smart_count} papier.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet d'ajouter manuellement jusqu'\xE0 %{smart_count} papiers.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
143
+ title: "Augmentez votre offre",
144
+ content: "Votre offre vous permet d'ajouter manuellement jusqu'\xE0 **%{smart_count} papier**.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy. |||| Votre offre vous permet d'ajouter manuellement jusqu'\xE0 **%{smart_count} papiers**.\n\nPour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
133
145
  action: "Voir les offres"
134
146
  },
135
147
  "default": {
@@ -137,6 +149,18 @@ var fr = {
137
149
  content: "Votre offre actuelle ne vous permet pas de profiter de cette fonctionnalit\xE9.",
138
150
  action: "J'ai compris"
139
151
  }
152
+ },
153
+ quotaPaywall: {
154
+ premium: {
155
+ title: "Augmentez votre offre",
156
+ content: "Votre espace de stockage est plein.\n\nVeuillez supprimer des fichiers, vider votre corbeille ou changer d'offre avant d'importer de nouveaux fichiers.",
157
+ action: "Voir les offres"
158
+ },
159
+ "default": {
160
+ title: "Information",
161
+ content: "Votre espace de stockage est plein.\n\nVeuillez supprimer des fichiers, et vider votre corbeille avant d'importer de nouveaux fichiers.",
162
+ action: "J'ai compris"
163
+ }
140
164
  }
141
165
  };
142
166
  export var locales = {
@@ -1,84 +1,15 @@
1
1
  import React from 'react';
2
- import get from 'lodash/get';
3
- import { useClient } from 'cozy-client';
4
- import { isMobileApp } from 'cozy-device-helper';
5
- import { Dialog } from "cozy-ui/transpiled/react/CozyDialogs";
6
- import Button from "cozy-ui/transpiled/react/deprecated/Button";
7
- import useInstance from "cozy-ui/transpiled/react/helpers/useInstance";
8
- import withLocales from "cozy-ui/transpiled/react/I18n/withLocales";
9
- var en = {
10
- quotaalert: {
11
- title: "Your disk space is full :(",
12
- desc: "Please remove files, empty your trash or increase your disk space before uploading files again.",
13
- confirm: "OK",
14
- increase: "Increase your disk space"
15
- }
16
- };
17
- var fr = {
18
- quotaalert: {
19
- title: "Votre espace disque est plein :(",
20
- desc: "Veuillez supprimer des fichiers, vider votre corbeille ou augmenter votre espace disque avant d'importer de nouveau fichier.",
21
- confirm: "OK",
22
- increase: "Augmenter votre espace disque"
23
- }
24
- };
25
- var locales = {
26
- en: en,
27
- fr: fr
28
- };
29
-
30
- var buildPremiumLink = function buildPremiumLink(uuid, managerUrl) {
31
- return "".concat(managerUrl, "/cozy/instances/").concat(uuid, "/premium");
32
- };
33
-
34
- var QuotaModalAlert = withLocales(locales)(function (_ref) {
35
- var t = _ref.t,
36
- onClose = _ref.onClose,
37
- instance = _ref.instance;
38
- var uuid = get(instance, 'instance.data.attributes.uuid');
39
- var managerUrl = get(instance, 'context.data.attributes.manager_url');
40
- return /*#__PURE__*/React.createElement(Dialog, {
41
- open: true,
42
- title: t('quotaalert.title'),
43
- content: t('quotaalert.desc'),
44
- actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
45
- theme: "secondary",
46
- onClick: onClose,
47
- label: t('quotaalert.confirm')
48
- }), uuid && managerUrl && /*#__PURE__*/React.createElement(Button, {
49
- theme: "primary",
50
- label: t('quotaalert.increase'),
51
- onClick: function onClick() {
52
- return window.open(buildPremiumLink(uuid, managerUrl), 'self');
53
- }
54
- })),
55
- onClose: onClose
56
- });
57
- });
58
-
59
- var QuotaAlert = function QuotaAlert(_ref2) {
60
- var onClose = _ref2.onClose;
61
- var client = useClient();
62
- /**
63
- * We don't want to call useInstance if we are on
64
- * mobile since we don't want to create a link to the cozy manager
65
- * because Apple and Google have restricted policy about
66
- * making a link to an outside purchase.
67
- *
68
- * So no call, no instance info, no button
69
- */
70
-
71
- if (isMobileApp()) {
72
- return /*#__PURE__*/React.createElement(QuotaModalAlert, {
73
- onClose: onClose
74
- });
75
- } // TODO: why is there a conditional hook here?
76
- // eslint-disable-next-line react-hooks/rules-of-hooks
77
-
2
+ import createDepreciationLogger from "cozy-ui/transpiled/react/helpers/createDepreciationLogger";
3
+ import { QuotaPaywall } from "cozy-ui/transpiled/react/Paywall";
4
+ var logDeprecatedComponent = createDepreciationLogger();
5
+ /**
6
+ * @deprecated This component is depreacated, please use [QuotaPaywall](#/Paywall) instead.
7
+ */
78
8
 
79
- var instanceInfo = useInstance(client);
80
- return /*#__PURE__*/React.createElement(QuotaModalAlert, {
81
- instance: instanceInfo,
9
+ var QuotaAlert = function QuotaAlert(_ref) {
10
+ var onClose = _ref.onClose;
11
+ logDeprecatedComponent('QuotaAlert is now exported from the cozy-ui as QuotaPaywall. Please import the component from "cozy-ui/transpiled/react/Paywall"');
12
+ return /*#__PURE__*/React.createElement(QuotaPaywall, {
82
13
  onClose: onClose
83
14
  });
84
15
  };
@@ -1,8 +0,0 @@
1
- {
2
- "quotaalert": {
3
- "title": "Your disk space is full :(",
4
- "desc": "Please remove files, empty your trash or increase your disk space before uploading files again.",
5
- "confirm": "OK",
6
- "increase": "Increase your disk space"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "quotaalert": {
3
- "title": "Votre espace disque est plein :(",
4
- "desc": "Veuillez supprimer des fichiers, vider votre corbeille ou augmenter votre espace disque avant d'importer de nouveau fichier.",
5
- "confirm": "OK",
6
- "increase": "Augmenter votre espace disque"
7
- }
8
- }