cozy-ui 82.3.0 → 82.4.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,12 @@
1
+ # [82.4.0](https://github.com/cozy/cozy-ui/compare/v82.3.0...v82.4.0) (2023-03-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * Change OnlyOffice paywall action for mobile app ([c3b3406](https://github.com/cozy/cozy-ui/commit/c3b3406))
7
+ * **ExpandedAttributes:** Change flexsearchProps translated keys ([4b8c4ee](https://github.com/cozy/cozy-ui/commit/4b8c4ee))
8
+ * Update OnlyOffice paywall wording ([58af6d8](https://github.com/cozy/cozy-ui/commit/58af6d8))
9
+
1
10
  # [82.3.0](https://github.com/cozy/cozy-ui/compare/v82.2.0...v82.3.0) (2023-03-29)
2
11
 
3
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "82.3.0",
3
+ "version": "82.4.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@ export const normalizeExpandedAttribute = attr =>
11
11
  // attributes not considered as expanded attributes
12
12
  export const notExpandedAttributes = {
13
13
  'io.cozy.contacts': ['fullname', 'civility', 'note'],
14
- 'io.cozy.files': ['name', 'flexsearchProps:translatedQualificationLabel']
14
+ 'io.cozy.files': ['name', 'flexsearchProps:translated:qualificationLabel']
15
15
  }
16
16
 
17
17
  // attributes that we want to display if no attribute of the document is related to the search
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import ReactMarkdown from 'react-markdown'
3
3
 
4
+ import { isMobileApp } from 'cozy-device-helper'
4
5
  import { useClient } from 'cozy-client'
5
6
  import { buildPremiumLink } from 'cozy-client/dist/models/instance'
6
7
 
@@ -42,8 +43,11 @@ const OnlyOfficePaywall = ({ onClose, isPublic, t } = { isPublic: false }) => {
42
43
  const link = buildPremiumLink(instance)
43
44
  const type = makeType(instance, isPublic, link)
44
45
 
45
- const onAction = () =>
46
- type === 'premium' ? window.open(link, 'self') : onClose()
46
+ const onAction = () => {
47
+ return type === 'premium' && !isMobileApp()
48
+ ? window.open(link, 'self')
49
+ : onClose()
50
+ }
47
51
 
48
52
  return (
49
53
  <IllustrationDialog
@@ -61,7 +65,11 @@ const OnlyOfficePaywall = ({ onClose, isPublic, t } = { isPublic: false }) => {
61
65
  actions={
62
66
  <Button
63
67
  onClick={onAction}
64
- label={t(`onlyOfficePaywall.${type}.action`)}
68
+ label={
69
+ isMobileApp()
70
+ ? t(`mobileApp.action`)
71
+ : t(`onlyOfficePaywall.${type}.action`)
72
+ }
65
73
  />
66
74
  }
67
75
  content={
@@ -1,9 +1,12 @@
1
1
  {
2
+ "mobileApp": {
3
+ "action": "I understood"
4
+ },
2
5
  "onlyOfficePaywall": {
3
6
  "premium": {
4
- "title": "Reserved for the higher plan",
5
- "content": "Your current offer does not allow you to take advantage of this feature. Please update your subscription.",
6
- "action": "See packages"
7
+ "title": "Free up your Cozy!",
8
+ "content": "To unlock this feature, or simply support us, you can change your Cozy offer.",
9
+ "action": "Check our plans"
7
10
  },
8
11
  "public": {
9
12
  "title": "Information",
@@ -1,9 +1,12 @@
1
1
  {
2
+ "mobileApp": {
3
+ "action": "J'ai compris"
4
+ },
2
5
  "onlyOfficePaywall": {
3
6
  "premium": {
4
- "title": "Réservé au forfait supérieur",
5
- "content": "Votre offre actuelle ne vous permet pas de profiter de cette fonctionnalité. Merci de mettre à jour votre abonnement.",
6
- "action": "Voir les forfaits"
7
+ "title": "Libérer votre Cozy !",
8
+ "content": "Pour débloquer cette fonctionnalité, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
9
+ "action": "Voir les offres"
7
10
  },
8
11
  "public": {
9
12
  "title": "Information",
@@ -6,7 +6,7 @@ export var normalizeExpandedAttribute = function normalizeExpandedAttribute(attr
6
6
 
7
7
  export var notExpandedAttributes = {
8
8
  'io.cozy.contacts': ['fullname', 'civility', 'note'],
9
- 'io.cozy.files': ['name', 'flexsearchProps:translatedQualificationLabel']
9
+ 'io.cozy.files': ['name', 'flexsearchProps:translated:qualificationLabel']
10
10
  }; // attributes that we want to display if no attribute of the document is related to the search
11
11
 
12
12
  export var defaultExpandedAttributes = {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import ReactMarkdown from 'react-markdown';
3
+ import { isMobileApp } from 'cozy-device-helper';
3
4
  import { useClient } from 'cozy-client';
4
5
  import { buildPremiumLink } from 'cozy-client/dist/models/instance';
5
6
  import useInstance from "cozy-ui/transpiled/react/helpers/useInstance";
@@ -12,11 +13,14 @@ import Typography from "cozy-ui/transpiled/react/Typography";
12
13
  import withLocales from "cozy-ui/transpiled/react/I18n/withLocales";
13
14
  import { makeType } from "cozy-ui/transpiled/react/Paywall/helpers";
14
15
  var fr = {
16
+ mobileApp: {
17
+ action: "J'ai compris"
18
+ },
15
19
  onlyOfficePaywall: {
16
20
  premium: {
17
- title: "R\xE9serv\xE9 au forfait sup\xE9rieur",
18
- content: "Votre offre actuelle ne vous permet pas de profiter de cette fonctionnalit\xE9. Merci de mettre \xE0 jour votre abonnement.",
19
- action: "Voir les forfaits"
21
+ title: "Lib\xE9rer votre Cozy !",
22
+ content: "Pour d\xE9bloquer cette fonctionnalit\xE9, ou simplement nous soutenir, vous pouvez modifier l'offre de votre Cozy.",
23
+ action: "Voir les offres"
20
24
  },
21
25
  "public": {
22
26
  title: "Information",
@@ -31,11 +35,14 @@ var fr = {
31
35
  }
32
36
  };
33
37
  var en = {
38
+ mobileApp: {
39
+ action: "I understood"
40
+ },
34
41
  onlyOfficePaywall: {
35
42
  premium: {
36
- title: "Reserved for the higher plan",
37
- content: "Your current offer does not allow you to take advantage of this feature. Please update your subscription.",
38
- action: "See packages"
43
+ title: "Free up your Cozy!",
44
+ content: "To unlock this feature, or simply support us, you can change your Cozy offer.",
45
+ action: "Check our plans"
39
46
  },
40
47
  "public": {
41
48
  title: "Information",
@@ -82,7 +89,7 @@ var OnlyOfficePaywall = function OnlyOfficePaywall() {
82
89
  var type = makeType(instance, isPublic, link);
83
90
 
84
91
  var onAction = function onAction() {
85
- return type === 'premium' ? window.open(link, 'self') : onClose();
92
+ return type === 'premium' && !isMobileApp() ? window.open(link, 'self') : onClose();
86
93
  };
87
94
 
88
95
  return /*#__PURE__*/React.createElement(IllustrationDialog, {
@@ -101,7 +108,7 @@ var OnlyOfficePaywall = function OnlyOfficePaywall() {
101
108
  }, t("onlyOfficePaywall.".concat(type, ".title")))),
102
109
  actions: /*#__PURE__*/React.createElement(Button, {
103
110
  onClick: onAction,
104
- label: t("onlyOfficePaywall.".concat(type, ".action"))
111
+ label: isMobileApp() ? t("mobileApp.action") : t("onlyOfficePaywall.".concat(type, ".action"))
105
112
  }),
106
113
  content: type === 'default' ? /*#__PURE__*/React.createElement(ReactMarkdown, {
107
114
  source: t('onlyOfficePaywall.default.content', {