cozy-sharing 12.0.0 → 12.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/ConfirmTrustedRecipientsDialog.js +11 -3
  3. package/dist/components/ConfirmTrustedRecipientsDialog.stories.js +39 -0
  4. package/dist/components/Recipient/GroupRecipient.js +36 -5
  5. package/dist/components/Recipient/GroupRecipient.stories.js +3 -2
  6. package/dist/components/Recipient/GroupRecipientDetail.js +43 -0
  7. package/dist/components/Recipient/GroupRecipientDetail.stories.js +55 -0
  8. package/dist/components/Recipient/GroupRecipientDetailWithAccess.js +44 -0
  9. package/dist/components/Recipient/GroupRecipientDetailWithoutAccess.js +45 -0
  10. package/dist/components/Recipient/LinkRecipient.js +5 -1
  11. package/dist/components/Recipient/MemberRecipient.js +5 -1
  12. package/dist/components/Recipient/RecipientList.stories.js +3 -0
  13. package/dist/components/ShareDialogCozyToCozy.js +9 -3
  14. package/dist/components/ShareDialogOnlyByLink.js +12 -4
  15. package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -0
  16. package/dist/components/ShareModal/SharingDetailsModal.js +7 -1
  17. package/dist/components/WhoHasAccess.js +1 -3
  18. package/locales/en.json +13 -0
  19. package/locales/fr.json +13 -0
  20. package/package.json +2 -2
  21. package/src/components/ConfirmTrustedRecipientsDialog.jsx +24 -13
  22. package/src/components/ConfirmTrustedRecipientsDialog.stories.jsx +45 -0
  23. package/src/components/Recipient/GroupRecipient.jsx +51 -24
  24. package/src/components/Recipient/GroupRecipient.stories.jsx +3 -2
  25. package/src/components/Recipient/GroupRecipientDetail.jsx +50 -0
  26. package/src/components/Recipient/GroupRecipientDetail.stories.jsx +53 -0
  27. package/src/components/Recipient/GroupRecipientDetailWithAccess.jsx +57 -0
  28. package/src/components/Recipient/GroupRecipientDetailWithoutAccess.jsx +60 -0
  29. package/src/components/Recipient/LinkRecipient.jsx +3 -1
  30. package/src/components/Recipient/MemberRecipient.jsx +3 -1
  31. package/src/components/Recipient/RecipientList.stories.jsx +3 -0
  32. package/src/components/ShareDialogCozyToCozy.jsx +40 -36
  33. package/src/components/ShareDialogOnlyByLink.jsx +22 -8
  34. package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +1 -0
  35. package/src/components/ShareModal/SharingDetailsModal.jsx +10 -1
  36. package/src/components/WhoHasAccess.jsx +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [12.1.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@12.0.0...cozy-sharing@12.1.0) (2024-03-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * Adapt modal design to allow gutters into ListItem ([39dc590](https://github.com/cozy/cozy-libs/commit/39dc5905ee19e07967227e76d376ff04c6145c1e))
12
+ * Show detail of recipient groups ([7d731db](https://github.com/cozy/cozy-libs/commit/7d731db9d313ba763652612352ce393f475bfe5f))
13
+
14
+
15
+
16
+
17
+
6
18
  # [12.0.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@11.1.0...cozy-sharing@12.0.0) (2024-03-21)
7
19
 
8
20
 
@@ -1,7 +1,10 @@
1
1
  import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import cx from 'classnames';
3
4
  import React from 'react';
5
+ import List from 'cozy-ui/transpiled/react/List';
4
6
  import Typography from 'cozy-ui/transpiled/react/Typography';
7
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
5
8
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
6
9
  import MemberRecipient from './Recipient/MemberRecipient';
7
10
  import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer';
@@ -16,17 +19,22 @@ var SharingContent = function SharingContent(_ref) {
16
19
  var _useI18n = useI18n(),
17
20
  t = _useI18n.t;
18
21
 
22
+ var _useBreakpoints = useBreakpoints(),
23
+ isMobile = _useBreakpoints.isMobile;
24
+
19
25
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
20
26
  variant: "body1",
21
- className: "u-mb-2"
22
- }, t("ConfirmRecipientModal.intruction")), recipientsToBeConfirmed.map(function (recipientConfirmationData) {
27
+ className: cx('u-mb-half', isMobile ? 'u-ph-1 u-mt-1' : 'u-ph-2 u-mt-1-half')
28
+ }, t("ConfirmRecipientModal.intruction")), /*#__PURE__*/React.createElement(List, {
29
+ className: isMobile ? 'u-mb-half' : 'u-mb-1'
30
+ }, recipientsToBeConfirmed.map(function (recipientConfirmationData) {
23
31
  return /*#__PURE__*/React.createElement(MemberRecipient, _extends({}, recipientConfirmationData, {
24
32
  key: "key_r_".concat(recipientConfirmationData.id),
25
33
  isOwner: false,
26
34
  recipientConfirmationData: recipientConfirmationData,
27
35
  verifyRecipient: verifyRecipient
28
36
  }));
29
- }));
37
+ })));
30
38
  };
31
39
  /**
32
40
  * Displays the dialog's title that can be used when ConfirmTrustedRecipientsDialog is in sharing state
@@ -0,0 +1,39 @@
1
+ import ConfirmTrustedRecipientsDialog from './ConfirmTrustedRecipientsDialog';
2
+ var meta = {
3
+ component: ConfirmTrustedRecipientsDialog,
4
+ args: {
5
+ recipientsToBeConfirmed: [{
6
+ instance: 'https://example.com',
7
+ isOwner: false,
8
+ status: 'ready',
9
+ recipientConfirmationData: null,
10
+ verifyRecipient: function verifyRecipient() {},
11
+ fadeIn: true,
12
+ type: 'two-way',
13
+ onRevoke: function onRevoke() {},
14
+ onRevokeSelf: function onRevokeSelf() {}
15
+ }]
16
+ }
17
+ };
18
+ export default meta;
19
+ export var Default = {
20
+ name: 'Default',
21
+ args: {
22
+ twoStepsConfirmationMethods: {
23
+ getRecipientsToBeConfirmed: function getRecipientsToBeConfirmed() {
24
+ return [{
25
+ name: 'John Doe',
26
+ instance: 'https://example.com',
27
+ isOwner: false,
28
+ status: 'ready'
29
+ }, {
30
+ name: 'Alice Doe',
31
+ instance: 'https://example.com',
32
+ isOwner: false,
33
+ status: 'ready'
34
+ }];
35
+ }
36
+ },
37
+ verifyRecipient: function verifyRecipient() {}
38
+ }
39
+ };
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useState } from 'react';
2
3
  import { useClient } from 'cozy-client';
3
4
  import Fade from 'cozy-ui/transpiled/react/Fade';
4
5
  import ListItem from 'cozy-ui/transpiled/react/ListItem';
@@ -6,7 +7,9 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
6
7
  import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction';
7
8
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
8
9
  import Typography from 'cozy-ui/transpiled/react/Typography';
10
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
9
11
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
12
+ import { GroupRecipientDetail } from './GroupRecipientDetail';
10
13
  import { GroupRecipientPermissions } from './GroupRecipientPermissions';
11
14
  import { FADE_IN_DURATION } from '../../helpers/recipients';
12
15
  import { GroupAvatar } from '../Avatar/GroupAvatar';
@@ -14,12 +17,22 @@ import { GroupAvatar } from '../Avatar/GroupAvatar';
14
17
  var GroupRecipient = function GroupRecipient(props) {
15
18
  var name = props.name,
16
19
  members = props.members,
17
- fadeIn = props.fadeIn;
20
+ fadeIn = props.fadeIn,
21
+ owner = props.owner;
18
22
 
19
23
  var _useI18n = useI18n(),
20
24
  t = _useI18n.t;
21
25
 
22
26
  var client = useClient();
27
+
28
+ var _useBreakpoints = useBreakpoints(),
29
+ isMobile = _useBreakpoints.isMobile;
30
+
31
+ var _useState = useState(false),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ isDetailOpened = _useState2[0],
34
+ setDetailOpened = _useState2[1];
35
+
23
36
  var nbMember = members.length;
24
37
  var nbMemberReady = members.filter(function (member) {
25
38
  return !['revoked', 'mail-not-sent'].includes(member.status);
@@ -27,11 +40,22 @@ var GroupRecipient = function GroupRecipient(props) {
27
40
  var isCurrentInstanceInsideMembers = members.some(function (member) {
28
41
  return member.instance === client.options.uri;
29
42
  });
30
- return /*#__PURE__*/React.createElement(Fade, {
43
+
44
+ var toogleDetailOpened = function toogleDetailOpened() {
45
+ setDetailOpened(!isDetailOpened);
46
+ };
47
+
48
+ var closeDetail = function closeDetail() {
49
+ setDetailOpened(false);
50
+ };
51
+
52
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Fade, {
31
53
  in: true,
32
54
  timeout: fadeIn ? FADE_IN_DURATION : 0
33
55
  }, /*#__PURE__*/React.createElement(ListItem, {
34
- disableGutters: true
56
+ button: true,
57
+ onClick: toogleDetailOpened,
58
+ gutters: isMobile ? 'default' : 'double'
35
59
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(GroupAvatar, {
36
60
  size: "small"
37
61
  })), /*#__PURE__*/React.createElement(ListItemText, {
@@ -43,7 +67,14 @@ var GroupRecipient = function GroupRecipient(props) {
43
67
  nbMember: nbMember,
44
68
  nbMemberReady: nbMemberReady
45
69
  }) + (isCurrentInstanceInsideMembers ? " (".concat(t('GroupRecipient.secondary_you'), ")") : '')
46
- }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(GroupRecipientPermissions, props))));
70
+ }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, {
71
+ className: isMobile ? 'u-mr-1' : 'u-mr-2'
72
+ }, /*#__PURE__*/React.createElement(GroupRecipientPermissions, props)))), isDetailOpened ? /*#__PURE__*/React.createElement(GroupRecipientDetail, {
73
+ owner: owner,
74
+ name: name,
75
+ members: members,
76
+ onClose: closeDetail
77
+ }) : null);
47
78
  };
48
79
 
49
80
  export { GroupRecipient };
@@ -3,8 +3,9 @@ var meta = {
3
3
  component: GroupRecipient,
4
4
  args: {
5
5
  name: 'Family',
6
- isOwner: true,
7
- read_only: false,
6
+ owner: {
7
+ public_name: 'Alice'
8
+ },
8
9
  members: [{
9
10
  status: 'ready'
10
11
  }, {
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
3
+ import Typography from 'cozy-ui/transpiled/react/Typography';
4
+ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
5
+ import { GroupRecipientDetailWithAccess } from './GroupRecipientDetailWithAccess';
6
+ import { GroupRecipientDetailWithoutAccess } from './GroupRecipientDetailWithoutAccess';
7
+
8
+ var GroupRecipientDetail = function GroupRecipientDetail(_ref) {
9
+ var name = _ref.name,
10
+ owner = _ref.owner,
11
+ members = _ref.members,
12
+ onClose = _ref.onClose;
13
+
14
+ var _useI18n = useI18n(),
15
+ t = _useI18n.t;
16
+
17
+ var withAccess = members.filter(function (member) {
18
+ return !['revoked', 'mail-not-sent'].includes(member.status);
19
+ });
20
+ var withoutAccess = members.filter(function (member) {
21
+ return ['revoked', 'mail-not-sent'].includes(member.status);
22
+ });
23
+ var ownerName = owner.public_name;
24
+ return /*#__PURE__*/React.createElement(Dialog, {
25
+ open: true,
26
+ size: "small",
27
+ onClose: onClose,
28
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, name, ownerName ? /*#__PURE__*/React.createElement(Typography, {
29
+ variant: "caption"
30
+ }, t('GroupRecipientDetail.subtitle', {
31
+ ownerName: ownerName
32
+ })) : null),
33
+ content: /*#__PURE__*/React.createElement("div", {
34
+ className: "u-flex u-stack-xs u-flex-column"
35
+ }, withAccess.length > 0 ? /*#__PURE__*/React.createElement(GroupRecipientDetailWithAccess, {
36
+ withAccess: withAccess
37
+ }) : null, withoutAccess.length > 0 ? /*#__PURE__*/React.createElement(GroupRecipientDetailWithoutAccess, {
38
+ withoutAccess: withoutAccess
39
+ }) : null)
40
+ });
41
+ };
42
+
43
+ export { GroupRecipientDetail };
@@ -0,0 +1,55 @@
1
+ import { GroupRecipientDetail } from './GroupRecipientDetail';
2
+ var meta = {
3
+ component: GroupRecipientDetail,
4
+ args: {
5
+ name: 'Family',
6
+ owner: {
7
+ public_name: 'Alice'
8
+ }
9
+ }
10
+ };
11
+ export default meta;
12
+ export var Default = {
13
+ name: 'Default',
14
+ args: {
15
+ members: [{
16
+ name: 'Alice',
17
+ instance: 'http://alice.cozy.localhost:8080',
18
+ status: 'ready'
19
+ }, {
20
+ name: 'marine@google.com',
21
+ status: 'mail-not-sent'
22
+ }, {
23
+ email: 'Martin',
24
+ status: 'pending'
25
+ }, {
26
+ name: 'Paul',
27
+ status: 'revoked'
28
+ }]
29
+ }
30
+ };
31
+ export var OnlyWithAccess = {
32
+ name: 'OnlyWithAccess',
33
+ args: {
34
+ members: [{
35
+ name: 'Alice',
36
+ instance: 'http://alice.cozy.localhost:8080',
37
+ status: 'ready'
38
+ }, {
39
+ name: 'Martin',
40
+ status: 'pending'
41
+ }]
42
+ }
43
+ };
44
+ export var OnlyWithoutAccess = {
45
+ name: 'OnlyWithoutAccess',
46
+ args: {
47
+ members: [{
48
+ name: 'marine@google.com',
49
+ status: 'mail-not-sent'
50
+ }, {
51
+ name: 'Paul',
52
+ status: 'revoked'
53
+ }]
54
+ }
55
+ };
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import Avatar from 'cozy-ui/transpiled/react/Avatar';
3
+ import Icon from 'cozy-ui/transpiled/react/Icon';
4
+ import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud';
5
+ import List from 'cozy-ui/transpiled/react/List';
6
+ import ListItem from 'cozy-ui/transpiled/react/ListItem';
7
+ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
8
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
9
+ import Typography from 'cozy-ui/transpiled/react/Typography';
10
+ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
11
+ import { getInitials, getDisplayName } from '../../models';
12
+
13
+ var GroupRecipientDetailWithAccess = function GroupRecipientDetailWithAccess(_ref) {
14
+ var withAccess = _ref.withAccess;
15
+
16
+ var _useI18n = useI18n(),
17
+ t = _useI18n.t;
18
+
19
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
20
+ variant: "subtitle2"
21
+ }, t('GroupRecipientDetail.withAccess.title')), /*#__PURE__*/React.createElement(List, null, withAccess.map(function (recipient) {
22
+ var name = getDisplayName(recipient);
23
+ return /*#__PURE__*/React.createElement(ListItem, {
24
+ disableGutters: true,
25
+ key: recipient.index
26
+ }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Avatar, {
27
+ text: getInitials(recipient),
28
+ textId: name
29
+ })), /*#__PURE__*/React.createElement(ListItemText, {
30
+ primary: name,
31
+ secondary: recipient.instance ? /*#__PURE__*/React.createElement("div", {
32
+ className: "u-flex u-flex-items-center"
33
+ }, /*#__PURE__*/React.createElement(Icon, {
34
+ icon: ToTheCloudIcon,
35
+ size: 10,
36
+ style: {
37
+ marginRight: '0.25rem'
38
+ }
39
+ }), recipient.instance) : null
40
+ }));
41
+ })));
42
+ };
43
+
44
+ export { GroupRecipientDetailWithAccess };
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import Avatar from 'cozy-ui/transpiled/react/Avatar';
3
+ import Icon from 'cozy-ui/transpiled/react/Icon';
4
+ import ForbiddenIcon from 'cozy-ui/transpiled/react/Icons/Forbidden';
5
+ import List from 'cozy-ui/transpiled/react/List';
6
+ import ListItem from 'cozy-ui/transpiled/react/ListItem';
7
+ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
8
+ import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
9
+ import Typography from 'cozy-ui/transpiled/react/Typography';
10
+ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
11
+ import { getInitials, getDisplayName } from '../../models';
12
+
13
+ var GroupRecipientDetailWithoutAccess = function GroupRecipientDetailWithoutAccess(_ref) {
14
+ var withoutAccess = _ref.withoutAccess;
15
+
16
+ var _useI18n = useI18n(),
17
+ t = _useI18n.t;
18
+
19
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
20
+ variant: "subtitle2"
21
+ }, t('GroupRecipientDetail.withoutAccess.title')), /*#__PURE__*/React.createElement(List, null, withoutAccess.map(function (recipient) {
22
+ var icon = recipient.status === 'revoked' ? ForbiddenIcon : null;
23
+ var name = getDisplayName(recipient);
24
+ return /*#__PURE__*/React.createElement(ListItem, {
25
+ disableGutters: true,
26
+ key: recipient.index
27
+ }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Avatar, {
28
+ text: getInitials(recipient),
29
+ textId: name
30
+ })), /*#__PURE__*/React.createElement(ListItemText, {
31
+ primary: name,
32
+ secondary: /*#__PURE__*/React.createElement("div", {
33
+ className: "u-flex u-flex-items-center"
34
+ }, icon ? /*#__PURE__*/React.createElement(Icon, {
35
+ icon: icon,
36
+ size: 10,
37
+ style: {
38
+ marginRight: '0.25rem'
39
+ }
40
+ }) : null, t("GroupRecipientDetail.withoutAccess.status.".concat(recipient.status)))
41
+ }));
42
+ })));
43
+ };
44
+
45
+ export { GroupRecipientDetailWithoutAccess };
@@ -9,6 +9,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem';
9
9
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
10
10
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
11
11
  import Typography from 'cozy-ui/transpiled/react/Typography';
12
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
12
13
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
13
14
  import LinkRecipientPermissions from './LinkRecipientPermissions';
14
15
  import RecipientConfirm from './RecipientConfirm';
@@ -35,6 +36,9 @@ var LinkRecipient = function LinkRecipient(props) {
35
36
  var _useI18n = useI18n(),
36
37
  t = _useI18n.t;
37
38
 
39
+ var _useBreakpoints = useBreakpoints(),
40
+ isMobile = _useBreakpoints.isMobile;
41
+
38
42
  var recipientConfirmationData = props.recipientConfirmationData,
39
43
  verifyRecipient = props.verifyRecipient,
40
44
  link = props.link,
@@ -49,7 +53,7 @@ var LinkRecipient = function LinkRecipient(props) {
49
53
  in: true,
50
54
  timeout: fadeIn ? FADE_IN_DURATION : 0
51
55
  }, /*#__PURE__*/React.createElement(ListItem, {
52
- disableGutters: true
56
+ gutters: isMobile ? 'default' : 'double'
53
57
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Circle, {
54
58
  size: "small",
55
59
  className: styles['link-recipient-icon-circle']
@@ -9,6 +9,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem';
9
9
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon';
10
10
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText';
11
11
  import Typography from 'cozy-ui/transpiled/react/Typography';
12
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
12
13
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
13
14
  import MemberRecipientPermissions from './MemberRecipientPermissions';
14
15
  import MemberRecipientStatus from './MemberRecipientStatus';
@@ -24,6 +25,9 @@ var MemberRecipient = function MemberRecipient(props) {
24
25
 
25
26
  var client = useClient();
26
27
 
28
+ var _useBreakpoints = useBreakpoints(),
29
+ isMobile = _useBreakpoints.isMobile;
30
+
27
31
  var instance = props.instance,
28
32
  isOwner = props.isOwner,
29
33
  status = props.status,
@@ -45,7 +49,7 @@ var MemberRecipient = function MemberRecipient(props) {
45
49
  in: true,
46
50
  timeout: fadeIn ? FADE_IN_DURATION : 0
47
51
  }, /*#__PURE__*/React.createElement(ListItem, {
48
- disableGutters: true
52
+ gutters: isMobile ? 'default' : 'double'
49
53
  }, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(MemberAvatar, {
50
54
  size: "small",
51
55
  recipient: props
@@ -34,6 +34,9 @@ export var WithGroup = {
34
34
  addedBy: 0,
35
35
  read_only: false,
36
36
  index: 0,
37
+ owner: {
38
+ public_name: 'Alice'
39
+ },
37
40
  members: [{
38
41
  status: 'pending',
39
42
  email: 'ben@gmail.com',
@@ -4,6 +4,7 @@ var _excluded = ["showShareByLink", "documentType", "document"];
4
4
  import cx from 'classnames';
5
5
  import React from 'react';
6
6
  import Typography from 'cozy-ui/transpiled/react/Typography';
7
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
7
8
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
8
9
  import { default as DumbShareByEmail } from './ShareByEmail';
9
10
  import { default as DumbShareByLink } from './ShareByLink';
@@ -64,8 +65,13 @@ var SharingContent = function SharingContent(_ref) {
64
65
  var _useI18n = useI18n(),
65
66
  t = _useI18n.t;
66
67
 
68
+ var _useBreakpoints = useBreakpoints(),
69
+ isMobile = _useBreakpoints.isMobile;
70
+
67
71
  return /*#__PURE__*/React.createElement("div", {
68
72
  className: cx(styles['share-modal-content'])
73
+ }, /*#__PURE__*/React.createElement("div", {
74
+ className: cx('u-pt-1-half', isMobile ? 'u-ph-1' : 'u-ph-2')
69
75
  }, showShareOnlyByLink && /*#__PURE__*/React.createElement("div", {
70
76
  className: styles['share-byemail-onlybylink']
71
77
  }, t("".concat(documentType, ".share.shareByEmail.onlyByLink"), {
@@ -84,8 +90,7 @@ var SharingContent = function SharingContent(_ref) {
84
90
  onShare: onShare,
85
91
  sharing: sharing,
86
92
  sharingDesc: sharingDesc
87
- }), showWhoHasAccess && /*#__PURE__*/React.createElement(WhoHasAccess, {
88
- className: "u-mt-half",
93
+ })), showWhoHasAccess && /*#__PURE__*/React.createElement(WhoHasAccess, {
89
94
  document: document,
90
95
  documentType: documentType,
91
96
  isOwner: isOwner,
@@ -139,7 +144,8 @@ var ShareDialogCozyToCozy = function ShareDialogCozyToCozy(_ref3) {
139
144
  dialogTitleOnShare: SharingTitleFunction({
140
145
  documentType: documentType,
141
146
  document: document
142
- })
147
+ }),
148
+ disableGutters: true
143
149
  }));
144
150
  };
145
151
 
@@ -1,6 +1,8 @@
1
+ import cx from 'classnames';
1
2
  import React from 'react';
2
3
  import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
3
4
  import Typography from 'cozy-ui/transpiled/react/Typography';
5
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
4
6
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
5
7
  import { default as DumbShareByLink } from './ShareByLink';
6
8
  import WhoHasAccess from './WhoHasAccess';
@@ -22,7 +24,11 @@ var ShareDialogOnlyByLink = function ShareDialogOnlyByLink(_ref) {
22
24
  var _useI18n = useI18n(),
23
25
  t = _useI18n.t;
24
26
 
27
+ var _useBreakpoints = useBreakpoints(),
28
+ isMobile = _useBreakpoints.isMobile;
29
+
25
30
  return /*#__PURE__*/React.createElement(Dialog, {
31
+ disableGutters: true,
26
32
  disableEnforceFocus: true,
27
33
  open: true,
28
34
  onClose: onClose,
@@ -30,9 +36,9 @@ var ShareDialogOnlyByLink = function ShareDialogOnlyByLink(_ref) {
30
36
  name: document.name || document.attributes.name
31
37
  }),
32
38
  content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
33
- variant: "h6"
39
+ variant: "h6",
40
+ className: cx(isMobile ? 'u-ph-1 u-mt-1' : 'u-ph-2 u-mt-1-half')
34
41
  }, t('Share.contacts.whoHasAccess')), /*#__PURE__*/React.createElement(WhoHasAccess, {
35
- className: "u-mt-half",
36
42
  document: document,
37
43
  documentType: documentType,
38
44
  isOwner: isOwner,
@@ -43,12 +49,14 @@ var ShareDialogOnlyByLink = function ShareDialogOnlyByLink(_ref) {
43
49
  permissions: permissions,
44
50
  onUpdateShareLinkPermissions: onUpdateShareLinkPermissions,
45
51
  onRevokeLink: onRevokeLink
46
- }), /*#__PURE__*/React.createElement(DumbShareByLink, {
52
+ }), /*#__PURE__*/React.createElement("div", {
53
+ className: cx('u-mt-half', isMobile ? 'u-ph-1 u-mb-1' : 'u-ph-2 u-mb-1-half')
54
+ }, /*#__PURE__*/React.createElement(DumbShareByLink, {
47
55
  link: link,
48
56
  document: document,
49
57
  documentType: documentType,
50
58
  onEnable: onShareByLink
51
- }))
59
+ })))
52
60
  });
53
61
  };
54
62
 
@@ -293,6 +293,7 @@ var ShareDialogTwoStepsConfirmationContainer = function ShareDialogTwoStepsConfi
293
293
  }
294
294
 
295
295
  return /*#__PURE__*/React.createElement(FixedDialog, {
296
+ disableGutters: true,
296
297
  disableEnforceFocus: true,
297
298
  open: true,
298
299
  onClose: onClose,
@@ -1,7 +1,9 @@
1
+ import cx from 'classnames';
1
2
  import PropTypes from 'prop-types';
2
3
  import React from 'react';
3
4
  import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
4
5
  import Divider from 'cozy-ui/transpiled/react/Divider';
6
+ import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints';
5
7
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
6
8
  import { getDisplayName } from '../../models';
7
9
  var styles = {
@@ -44,7 +46,11 @@ export var SharingDetailsModal = function SharingDetailsModal(_ref) {
44
46
  t = _useI18n.t,
45
47
  f = _useI18n.f;
46
48
 
49
+ var _useBreakpoints = useBreakpoints(),
50
+ isMobile = _useBreakpoints.isMobile;
51
+
47
52
  return /*#__PURE__*/React.createElement(Dialog, {
53
+ disableGutters: true,
48
54
  open: true,
49
55
  onClose: onClose,
50
56
  className: styles['share-modal'],
@@ -52,7 +58,7 @@ export var SharingDetailsModal = function SharingDetailsModal(_ref) {
52
58
  content: /*#__PURE__*/React.createElement("div", {
53
59
  className: styles['share-modal-content']
54
60
  }, /*#__PURE__*/React.createElement("div", {
55
- className: styles['share-details']
61
+ className: cx(styles['share-details'], isMobile ? 'u-ph-1 u-pt-1-half' : 'u-ph-2 u-pt-1')
56
62
  }, /*#__PURE__*/React.createElement(OwnerIdentity, {
57
63
  name: t("".concat(documentType, ".share.sharedBy"), {
58
64
  name: getDisplayName(owner)
@@ -49,9 +49,7 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
49
49
  className: className
50
50
  }, /*#__PURE__*/React.createElement(RecipientWaitingForConfirmationAlert, {
51
51
  recipientsToBeConfirmed: recipientsToBeConfirmed
52
- }), /*#__PURE__*/React.createElement(List, {
53
- disablePadding: true
54
- }, link && /*#__PURE__*/React.createElement(LinkRecipient, {
52
+ }), /*#__PURE__*/React.createElement(List, null, link && /*#__PURE__*/React.createElement(LinkRecipient, {
55
53
  document: document,
56
54
  documentType: documentType,
57
55
  onRevoke: onRevoke,
package/locales/en.json CHANGED
@@ -376,5 +376,18 @@
376
376
  "title": "Remove me from sharing",
377
377
  "desc": "You keep the content but it won't be updated between your Cozy anymore."
378
378
  }
379
+ },
380
+ "GroupRecipientDetail": {
381
+ "subtitle": "Managed by %{ownerName}",
382
+ "withAccess": {
383
+ "title": "Access to item"
384
+ },
385
+ "withoutAccess": {
386
+ "title": "No access",
387
+ "status": {
388
+ "mail-not-sent": "Invitation failed",
389
+ "revoked": "Sharing revoked"
390
+ }
391
+ }
379
392
  }
380
393
  }
package/locales/fr.json CHANGED
@@ -374,5 +374,18 @@
374
374
  "title": "Quitter le partage",
375
375
  "desc": "Vous conserverez une copie mais vos changements ne seront plus synchronisés."
376
376
  }
377
+ },
378
+ "GroupRecipientDetail": {
379
+ "subtitle": "Géré par %{ownerName}",
380
+ "withAccess": {
381
+ "title": "Accès à l’élément"
382
+ },
383
+ "withoutAccess": {
384
+ "title": "Aucun accès",
385
+ "status": {
386
+ "mail-not-sent": "Echec de l’invitation",
387
+ "revoked": "Partage révoqué"
388
+ }
389
+ }
377
390
  }
378
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -71,5 +71,5 @@
71
71
  "sideEffects": [
72
72
  "*.css"
73
73
  ],
74
- "gitHead": "ebef29fe4f3f3704c967ebfd2d330d9b95d6e25b"
74
+ "gitHead": "5de831d050135822b1b9295ae8888d11f6372ee5"
75
75
  }