cozy-sharing 10.2.0 → 10.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ConfirmTrustedRecipientsDialog.js +1 -1
  3. package/dist/ShareButton.js +1 -1
  4. package/dist/ShareButton.spec.js +1 -1
  5. package/dist/SharedBadge.js +1 -1
  6. package/dist/SharedRecipients.js +1 -1
  7. package/dist/SharedRecipientsList.js +1 -1
  8. package/dist/SharedStatus.js +1 -1
  9. package/dist/SharingOwnerAvatar.js +1 -1
  10. package/dist/components/CozyPassFingerprintDialogContent.js +1 -1
  11. package/dist/components/Recipient/Identity.js +15 -17
  12. package/dist/components/Recipient/LinkRecipient.js +16 -18
  13. package/dist/components/Recipient/OwnerIdentity.js +16 -18
  14. package/dist/components/Recipient/RecipientConfirm.js +21 -25
  15. package/dist/components/Recipient/RecipientList.js +36 -0
  16. package/dist/components/Recipient/RecipientPlusX.js +16 -18
  17. package/dist/components/Recipient/RecipientStatus.js +15 -17
  18. package/dist/components/Recipient/RecipientWithoutStatus.js +16 -18
  19. package/dist/components/Recipient/RecipientsAvatars.js +16 -18
  20. package/dist/components/ShareAutosuggest.js +10 -12
  21. package/dist/components/ShareButton.js +2 -2
  22. package/dist/components/ShareByEmail.js +22 -26
  23. package/dist/components/ShareDialogCozyToCozy.js +21 -25
  24. package/dist/components/{EditableSharingModal.js → ShareModal/EditableSharingModal.js} +5 -5
  25. package/dist/components/{EditableSharingModal.spec.js → ShareModal/EditableSharingModal.spec.js} +6 -6
  26. package/dist/components/ShareModal/ShareModal.js +43 -0
  27. package/dist/{SharingDetailsModal.js → components/ShareModal/SharingDetailsModal.js} +24 -28
  28. package/dist/components/SharedBadge.js +6 -6
  29. package/dist/components/SharedStatus.js +4 -4
  30. package/dist/components/Sharetypeselect.js +21 -25
  31. package/dist/{SharingBanner → components/SharingBanner}/components/PublicBanner.js +2 -2
  32. package/dist/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.js +2 -2
  33. package/dist/{SharingBanner → components/SharingBanner}/index.js +1 -1
  34. package/dist/{SharingBanner → components/SharingBanner}/test/AppLike.js +2 -2
  35. package/dist/components/Tooltip.js +2 -2
  36. package/dist/components/WhoHasAccess.js +10 -20
  37. package/dist/components/WhoHasAccessLight.js +17 -1
  38. package/dist/{withLocales.js → hoc/withLocales.js} +2 -2
  39. package/dist/index.js +5 -5
  40. package/dist/{components → styles}/actionmenu.styl +0 -2
  41. package/dist/{components → styles}/autosuggest.styl +1 -4
  42. package/dist/{SharingBanner/components → styles}/publicBanner.styl +5 -5
  43. package/dist/{components/Recipient → styles}/recipient.styl +0 -1
  44. package/{src → dist/styles}/share.styl +0 -1
  45. package/dist/stylesheet.css +214 -2635
  46. package/docs/share-modal-architecture.md +44 -0
  47. package/package.json +6 -6
  48. package/src/ConfirmTrustedRecipientsDialog.jsx +1 -1
  49. package/src/ShareButton.jsx +1 -1
  50. package/src/ShareButton.spec.jsx +1 -1
  51. package/src/SharedBadge.jsx +1 -1
  52. package/src/SharedRecipients.jsx +1 -1
  53. package/src/SharedRecipientsList.jsx +1 -1
  54. package/src/SharedStatus.jsx +1 -1
  55. package/src/SharingOwnerAvatar.jsx +1 -1
  56. package/src/assets/icons/icon-arrow-down.svg +3 -0
  57. package/src/assets/icons/icon-calendar-16.svg +8 -0
  58. package/src/assets/icons/icon-check-blue.svg +59 -0
  59. package/src/assets/icons/icon-cross-bold.svg +5 -0
  60. package/src/assets/icons/icon-link.svg +14 -0
  61. package/src/assets/icons/icon-pen-16.svg +3 -0
  62. package/src/components/CozyPassFingerprintDialogContent.jsx +1 -1
  63. package/src/components/Recipient/Identity.jsx +1 -1
  64. package/src/components/Recipient/LinkRecipient.jsx +1 -1
  65. package/src/components/Recipient/OwnerIdentity.jsx +1 -1
  66. package/src/components/Recipient/RecipientConfirm.jsx +1 -1
  67. package/src/components/Recipient/RecipientList.jsx +45 -0
  68. package/src/components/Recipient/RecipientPlusX.jsx +1 -1
  69. package/src/components/Recipient/RecipientStatus.jsx +1 -1
  70. package/src/components/Recipient/RecipientWithoutStatus.jsx +1 -1
  71. package/src/components/Recipient/RecipientsAvatars.jsx +1 -1
  72. package/src/components/ShareAutosuggest.jsx +1 -1
  73. package/src/components/ShareButton.jsx +1 -1
  74. package/src/components/ShareByEmail.jsx +1 -1
  75. package/src/components/ShareDialogCozyToCozy.jsx +1 -1
  76. package/src/components/{EditableSharingModal.jsx → ShareModal/EditableSharingModal.jsx} +5 -5
  77. package/src/components/{EditableSharingModal.spec.jsx → ShareModal/EditableSharingModal.spec.jsx} +6 -6
  78. package/src/components/ShareModal/ShareModal.jsx +45 -0
  79. package/src/{SharingDetailsModal.jsx → components/ShareModal/SharingDetailsModal.jsx} +4 -4
  80. package/src/components/SharedBadge.jsx +1 -1
  81. package/src/components/SharedStatus.jsx +2 -2
  82. package/src/components/Sharetypeselect.jsx +1 -1
  83. package/src/{SharingBanner → components/SharingBanner}/components/PublicBanner.jsx +2 -2
  84. package/src/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.jsx +2 -2
  85. package/src/{SharingBanner → components/SharingBanner}/index.jsx +1 -1
  86. package/src/{SharingBanner → components/SharingBanner}/test/AppLike.jsx +2 -2
  87. package/src/components/Tooltip.jsx +1 -1
  88. package/src/components/WhoHasAccess.jsx +11 -29
  89. package/src/components/WhoHasAccessLight.jsx +1 -1
  90. package/src/components/__snapshots__/ContactSuggestion.spec.jsx.snap +120 -105
  91. package/src/{withLocales.jsx → hoc/withLocales.jsx} +2 -2
  92. package/src/index.jsx +6 -5
  93. package/src/{components → styles}/actionmenu.styl +0 -2
  94. package/src/{components → styles}/autosuggest.styl +1 -4
  95. package/src/{SharingBanner/components → styles}/publicBanner.styl +5 -5
  96. package/src/{components/Recipient → styles}/recipient.styl +0 -1
  97. package/{dist → src/styles}/share.styl +0 -1
  98. package/dist/ShareModal.js +0 -50
  99. package/src/ShareModal.jsx +0 -51
  100. /package/{assets → dist/assets}/icons/icon-arrow-down.svg +0 -0
  101. /package/{assets → dist/assets}/icons/icon-calendar-16.svg +0 -0
  102. /package/{assets → dist/assets}/icons/icon-check-blue.svg +0 -0
  103. /package/{assets → dist/assets}/icons/icon-cross-bold.svg +0 -0
  104. /package/{assets → dist/assets}/icons/icon-link.svg +0 -0
  105. /package/{assets → dist/assets}/icons/icon-pen-16.svg +0 -0
  106. /package/dist/{SharingBanner → components/SharingBanner}/components/CozyHomeLinkIcon.js +0 -0
  107. /package/dist/{SharingBanner → components/SharingBanner}/components/PublicBanner.spec.js +0 -0
  108. /package/dist/{SharingBanner → components/SharingBanner}/components/SharingBanner.js +0 -0
  109. /package/dist/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.js +0 -0
  110. /package/dist/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.spec.js +0 -0
  111. /package/dist/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.spec.js +0 -0
  112. /package/dist/{SharingBanner → components/SharingBanner}/test/AcceptingSharingContext.js +0 -0
  113. /package/dist/{SharingBanner → components/SharingBanner}/test/FabProvider.js +0 -0
  114. /package/dist/{SharingBanner → components/SharingBanner}/test/ModalContext.js +0 -0
  115. /package/dist/{SharingBanner → components/SharingBanner}/test/RouterContext.js +0 -0
  116. /package/dist/{SharingBanner → components/SharingBanner}/test/ThumbnailSizeContext.js +0 -0
  117. /package/dist/{components → hooks}/useFetchDocumentPath.js +0 -0
  118. /package/dist/{components → styles}/CozyPassFingerprintDialogContent.styl +0 -0
  119. /package/dist/{components → styles}/badge.styl +0 -0
  120. /package/dist/{components → styles}/button.styl +0 -0
  121. /package/dist/{components → styles}/status.styl +0 -0
  122. /package/dist/{components → styles}/tooltip.styl +0 -0
  123. /package/src/{SharingBanner → components/SharingBanner}/components/CozyHomeLinkIcon.jsx +0 -0
  124. /package/src/{SharingBanner → components/SharingBanner}/components/PublicBanner.spec.jsx +0 -0
  125. /package/src/{SharingBanner → components/SharingBanner}/components/SharingBanner.jsx +0 -0
  126. /package/src/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.js +0 -0
  127. /package/src/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.spec.js +0 -0
  128. /package/src/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.spec.js +0 -0
  129. /package/src/{SharingBanner → components/SharingBanner}/test/AcceptingSharingContext.jsx +0 -0
  130. /package/src/{SharingBanner → components/SharingBanner}/test/FabProvider.jsx +0 -0
  131. /package/src/{SharingBanner → components/SharingBanner}/test/ModalContext.jsx +0 -0
  132. /package/src/{SharingBanner → components/SharingBanner}/test/RouterContext.jsx +0 -0
  133. /package/src/{SharingBanner → components/SharingBanner}/test/ThumbnailSizeContext.jsx +0 -0
  134. /package/src/{components → hooks}/useFetchDocumentPath.jsx +0 -0
  135. /package/src/{components → styles}/CozyPassFingerprintDialogContent.styl +0 -0
  136. /package/src/{components → styles}/badge.styl +0 -0
  137. /package/src/{components → styles}/button.styl +0 -0
  138. /package/src/{components → styles}/status.styl +0 -0
  139. /package/src/{components → styles}/tooltip.styl +0 -0
@@ -17,34 +17,30 @@ import { hasReachRecipientsLimit } from '../helpers/recipients';
17
17
  import { getSuccessMessage } from '../helpers/successMessage';
18
18
  import { Group } from '../models';
19
19
  import { contactsResponseType, groupsResponseType } from '../propTypes';
20
+ import { isReadOnlySharing } from '../state';
20
21
  var styles = {
21
- "share-modal-content": "share__share-modal-content___XTtaK",
22
- "coz-form": "share__coz-form___33NYF",
23
- "coz-form-group": "share__coz-form-group___1PLAZ",
24
- "coz-form-desc": "share__coz-form-desc___-pmK5",
25
- "coz-form-label": "share__coz-form-label___31jb0",
26
- "coz-form-label--error": "share__coz-form-label--error___2EXCl",
27
- "coz-form-errors": "share__coz-form-errors___1rk2R",
28
- "coz-form-controls": "share__coz-form-controls___39Uwg",
29
- "coz-form-controls--full": "share__coz-form-controls--full___1YpNp",
30
- "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___3JXzz",
31
- "error": "share__error___6Ycal",
32
- "CozyTheme--inverted": "share__CozyTheme--inverted___2pLD2",
33
- "CozyTheme--normal": "share__CozyTheme--normal___qSFyr",
34
- "share-byemail-onlybylink": "share__share-byemail-onlybylink___C_7b_",
35
- "aligned-dropdown-button": "share__aligned-dropdown-button___CeTDs",
36
- "share-type-control": "share__share-type-control___KcpDf",
37
- "select-wrapper": "share__select-wrapper___3FfiH",
38
- "select-option": "share__select-option___13o6b",
39
- "select-option-label": "share__select-option-label___Zj_RU",
40
- "select-option-desc": "share__select-option-desc___6uaQq",
41
- "share-details-created": "share__share-details-created___13BO0",
42
- "share-details-perm": "share__share-details-perm___23_VF",
43
- "share-details-perm-desc": "share__share-details-perm-desc___tqfXx",
44
- "spin": "share__spin___1P7nU",
45
- "shake": "share__shake___1EeCI"
22
+ "share-modal-content": "share__share-modal-content___1iqEq",
23
+ "coz-form": "share__coz-form___1ICST",
24
+ "coz-form-group": "share__coz-form-group___VsQp7",
25
+ "coz-form-desc": "share__coz-form-desc___2mYN4",
26
+ "coz-form-label": "share__coz-form-label___bogBw",
27
+ "coz-form-label--error": "share__coz-form-label--error___3YPkf",
28
+ "coz-form-errors": "share__coz-form-errors___2xYRz",
29
+ "coz-form-controls": "share__coz-form-controls___H8kGc",
30
+ "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
31
+ "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
32
+ "error": "share__error___pwqPO",
33
+ "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
34
+ "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
35
+ "share-type-control": "share__share-type-control___1YoRr",
36
+ "select-wrapper": "share__select-wrapper___3XBKC",
37
+ "select-option": "share__select-option___3Jp8_",
38
+ "select-option-label": "share__select-option-label___1BWz_",
39
+ "select-option-desc": "share__select-option-desc___3jOnr",
40
+ "share-details-created": "share__share-details-created___z3nvO",
41
+ "share-details-perm": "share__share-details-perm___3HjxK",
42
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
46
43
  };
47
- import { isReadOnlySharing } from '../state';
48
44
  export var ShareByEmail = function ShareByEmail(_ref) {
49
45
  var contacts = _ref.contacts,
50
46
  groups = _ref.groups,
@@ -10,31 +10,27 @@ import { default as DumbShareByLink } from './ShareByLink';
10
10
  import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer';
11
11
  import WhoHasAccess from './WhoHasAccess';
12
12
  var styles = {
13
- "share-modal-content": "share__share-modal-content___XTtaK",
14
- "coz-form": "share__coz-form___33NYF",
15
- "coz-form-group": "share__coz-form-group___1PLAZ",
16
- "coz-form-desc": "share__coz-form-desc___-pmK5",
17
- "coz-form-label": "share__coz-form-label___31jb0",
18
- "coz-form-label--error": "share__coz-form-label--error___2EXCl",
19
- "coz-form-errors": "share__coz-form-errors___1rk2R",
20
- "coz-form-controls": "share__coz-form-controls___39Uwg",
21
- "coz-form-controls--full": "share__coz-form-controls--full___1YpNp",
22
- "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___3JXzz",
23
- "error": "share__error___6Ycal",
24
- "CozyTheme--inverted": "share__CozyTheme--inverted___2pLD2",
25
- "CozyTheme--normal": "share__CozyTheme--normal___qSFyr",
26
- "share-byemail-onlybylink": "share__share-byemail-onlybylink___C_7b_",
27
- "aligned-dropdown-button": "share__aligned-dropdown-button___CeTDs",
28
- "share-type-control": "share__share-type-control___KcpDf",
29
- "select-wrapper": "share__select-wrapper___3FfiH",
30
- "select-option": "share__select-option___13o6b",
31
- "select-option-label": "share__select-option-label___Zj_RU",
32
- "select-option-desc": "share__select-option-desc___6uaQq",
33
- "share-details-created": "share__share-details-created___13BO0",
34
- "share-details-perm": "share__share-details-perm___23_VF",
35
- "share-details-perm-desc": "share__share-details-perm-desc___tqfXx",
36
- "spin": "share__spin___1P7nU",
37
- "shake": "share__shake___1EeCI"
13
+ "share-modal-content": "share__share-modal-content___1iqEq",
14
+ "coz-form": "share__coz-form___1ICST",
15
+ "coz-form-group": "share__coz-form-group___VsQp7",
16
+ "coz-form-desc": "share__coz-form-desc___2mYN4",
17
+ "coz-form-label": "share__coz-form-label___bogBw",
18
+ "coz-form-label--error": "share__coz-form-label--error___3YPkf",
19
+ "coz-form-errors": "share__coz-form-errors___2xYRz",
20
+ "coz-form-controls": "share__coz-form-controls___H8kGc",
21
+ "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
22
+ "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
23
+ "error": "share__error___pwqPO",
24
+ "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
25
+ "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
26
+ "share-type-control": "share__share-type-control___1YoRr",
27
+ "select-wrapper": "share__select-wrapper___3XBKC",
28
+ "select-option": "share__select-option___3Jp8_",
29
+ "select-option-label": "share__select-option-label___1BWz_",
30
+ "select-option-desc": "share__select-option-desc___3jOnr",
31
+ "share-details-created": "share__share-details-created___z3nvO",
32
+ "share-details-perm": "share__share-details-perm___3HjxK",
33
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
38
34
  };
39
35
  /**
40
36
  * Displays the sharing interface that can be used when ShareDialogCozyToCozy is in sharing state
@@ -4,11 +4,11 @@ var _excluded = ["document"];
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import { useClient, useQueryAll } from 'cozy-client';
7
- import { default as DumbShareModal } from './ShareModal';
8
- import { useFetchDocumentPath } from './useFetchDocumentPath';
9
- import SharingContext from '../context';
10
- import { Contact } from '../models';
11
- import { buildContactsQuery, buildGroupsQuery } from '../queries/queries';
7
+ import SharingContext from '../../context';
8
+ import { useFetchDocumentPath } from '../../hooks/useFetchDocumentPath';
9
+ import { Contact } from '../../models';
10
+ import { buildContactsQuery, buildGroupsQuery } from '../../queries/queries';
11
+ import { default as DumbShareModal } from '../ShareModal';
12
12
  export var EditableSharingModal = function EditableSharingModal(_ref) {
13
13
  var document = _ref.document,
14
14
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -3,12 +3,12 @@ import React from 'react';
3
3
  import { createMockClient } from 'cozy-client';
4
4
  import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints';
5
5
  import { EditableSharingModal } from './EditableSharingModal';
6
- import { default as DumbShareModal } from './ShareModal';
7
- import { useFetchDocumentPath } from './useFetchDocumentPath';
8
- import AppLike from '../../test/AppLike';
9
- import { SharingProvider } from '../SharingProvider';
10
- import { receivePaths } from '../state';
11
- jest.mock('./useFetchDocumentPath', function () {
6
+ import AppLike from '../../../test/AppLike';
7
+ import { SharingProvider } from '../../SharingProvider';
8
+ import { useFetchDocumentPath } from '../../hooks/useFetchDocumentPath';
9
+ import { receivePaths } from '../../state';
10
+ import { default as DumbShareModal } from '../ShareModal';
11
+ jest.mock('../../hooks/useFetchDocumentPath', function () {
12
12
  return {
13
13
  useFetchDocumentPath: jest.fn()
14
14
  };
@@ -0,0 +1,43 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import omit from 'lodash/omit';
3
+ import React from 'react';
4
+ import { useLocation } from 'react-router';
5
+ import EditableSharingModal from './EditableSharingModal';
6
+ import { SharingDetailsModal } from './SharingDetailsModal';
7
+ import withLocales from '../../hoc/withLocales';
8
+ import { useSharingContext } from '../../hooks/useSharingContext';
9
+ export var ShareModal = withLocales(function (props) {
10
+ var _location$state;
11
+
12
+ var location = useLocation === null || useLocation === void 0 ? void 0 : useLocation();
13
+ var locationProps = location === null || location === void 0 || (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.modalProps;
14
+ var document = (locationProps === null || locationProps === void 0 ? void 0 : locationProps.document) || props.document;
15
+ var rest = omit(locationProps || props, 'document');
16
+
17
+ var _useSharingContext = useSharingContext(),
18
+ byDocId = _useSharingContext.byDocId,
19
+ isOwner = _useSharingContext.isOwner,
20
+ canReshare = _useSharingContext.canReshare,
21
+ documentType = _useSharingContext.documentType,
22
+ getOwner = _useSharingContext.getOwner,
23
+ getSharingType = _useSharingContext.getSharingType,
24
+ getRecipients = _useSharingContext.getRecipients,
25
+ revokeSelf = _useSharingContext.revokeSelf;
26
+
27
+ var isEditable = !byDocId[document.id] || isOwner(document.id) || canReshare(document.id);
28
+
29
+ if (isEditable) {
30
+ return /*#__PURE__*/React.createElement(EditableSharingModal, _extends({
31
+ document: document
32
+ }, rest));
33
+ }
34
+
35
+ return /*#__PURE__*/React.createElement(SharingDetailsModal, _extends({
36
+ document: document,
37
+ documentType: documentType,
38
+ owner: getOwner(document.id),
39
+ sharingType: getSharingType(document.id),
40
+ recipients: getRecipients(document.id),
41
+ onRevoke: revokeSelf
42
+ }, rest));
43
+ });
@@ -3,36 +3,32 @@ import React from 'react';
3
3
  import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
4
4
  import Divider from 'cozy-ui/transpiled/react/Divider';
5
5
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
6
- import OwnerIdentity from './components/Recipient/OwnerIdentity';
7
- import WhoHasAccess from './components/WhoHasAccess';
8
- import { getDisplayName } from './models';
6
+ import { getDisplayName } from '../../models';
9
7
  var styles = {
10
- "share-modal-content": "share__share-modal-content___XTtaK",
11
- "coz-form": "share__coz-form___33NYF",
12
- "coz-form-group": "share__coz-form-group___1PLAZ",
13
- "coz-form-desc": "share__coz-form-desc___-pmK5",
14
- "coz-form-label": "share__coz-form-label___31jb0",
15
- "coz-form-label--error": "share__coz-form-label--error___2EXCl",
16
- "coz-form-errors": "share__coz-form-errors___1rk2R",
17
- "coz-form-controls": "share__coz-form-controls___39Uwg",
18
- "coz-form-controls--full": "share__coz-form-controls--full___1YpNp",
19
- "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___3JXzz",
20
- "error": "share__error___6Ycal",
21
- "CozyTheme--inverted": "share__CozyTheme--inverted___2pLD2",
22
- "CozyTheme--normal": "share__CozyTheme--normal___qSFyr",
23
- "share-byemail-onlybylink": "share__share-byemail-onlybylink___C_7b_",
24
- "aligned-dropdown-button": "share__aligned-dropdown-button___CeTDs",
25
- "share-type-control": "share__share-type-control___KcpDf",
26
- "select-wrapper": "share__select-wrapper___3FfiH",
27
- "select-option": "share__select-option___13o6b",
28
- "select-option-label": "share__select-option-label___Zj_RU",
29
- "select-option-desc": "share__select-option-desc___6uaQq",
30
- "share-details-created": "share__share-details-created___13BO0",
31
- "share-details-perm": "share__share-details-perm___23_VF",
32
- "share-details-perm-desc": "share__share-details-perm-desc___tqfXx",
33
- "spin": "share__spin___1P7nU",
34
- "shake": "share__shake___1EeCI"
8
+ "share-modal-content": "share__share-modal-content___1iqEq",
9
+ "coz-form": "share__coz-form___1ICST",
10
+ "coz-form-group": "share__coz-form-group___VsQp7",
11
+ "coz-form-desc": "share__coz-form-desc___2mYN4",
12
+ "coz-form-label": "share__coz-form-label___bogBw",
13
+ "coz-form-label--error": "share__coz-form-label--error___3YPkf",
14
+ "coz-form-errors": "share__coz-form-errors___2xYRz",
15
+ "coz-form-controls": "share__coz-form-controls___H8kGc",
16
+ "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
17
+ "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
18
+ "error": "share__error___pwqPO",
19
+ "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
20
+ "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
21
+ "share-type-control": "share__share-type-control___1YoRr",
22
+ "select-wrapper": "share__select-wrapper___3XBKC",
23
+ "select-option": "share__select-option___3Jp8_",
24
+ "select-option-label": "share__select-option-label___1BWz_",
25
+ "select-option-desc": "share__select-option-desc___3jOnr",
26
+ "share-details-created": "share__share-details-created___z3nvO",
27
+ "share-details-perm": "share__share-details-perm___3HjxK",
28
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
35
29
  };
30
+ import OwnerIdentity from '../Recipient/OwnerIdentity';
31
+ import WhoHasAccess from '../WhoHasAccess';
36
32
  export var SharingDetailsModal = function SharingDetailsModal(_ref) {
37
33
  var onClose = _ref.onClose,
38
34
  sharingType = _ref.sharingType,
@@ -5,12 +5,12 @@ import Icon from 'cozy-ui/transpiled/react/Icon';
5
5
  import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share';
6
6
  import palette from 'cozy-ui/transpiled/react/palette';
7
7
  var styles = {
8
- "shared-badge": "badge__shared-badge___2QYc_",
9
- "--small": "badge__--small___3i2p8",
10
- "shared-badge-icon": "badge__shared-badge-icon___kngsy",
11
- "--xsmall": "badge__--xsmall___1SOfR",
12
- "--by-me": "badge__--by-me___3zfDg",
13
- "--with-me": "badge__--with-me___30u7z"
8
+ "shared-badge": "badge__shared-badge___2jGsy",
9
+ "--small": "badge__--small___2VMyY",
10
+ "shared-badge-icon": "badge__shared-badge-icon___3s9t1",
11
+ "--xsmall": "badge__--xsmall___2cEGG",
12
+ "--by-me": "badge__--by-me___3aTHb",
13
+ "--with-me": "badge__--with-me___3jW7R"
14
14
  };
15
15
 
16
16
  var SharedBadge = function SharedBadge(_ref) {
@@ -3,10 +3,6 @@ import React from 'react';
3
3
  import palette from 'cozy-ui/transpiled/react/palette';
4
4
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
5
5
  import { SharingTooltip, TooltipRecipientList } from './Tooltip';
6
- var styles = {
7
- "shared-status": "status__shared-status___J15Fy",
8
- "shared-status-label": "status__shared-status-label___2AWic"
9
- };
10
6
 
11
7
  var LinkIcon = function LinkIcon(props) {
12
8
  return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
@@ -26,6 +22,10 @@ LinkIcon.defaultProps = {
26
22
  xmlnsXlink: "http://www.w3.org/1999/xlink"
27
23
  };
28
24
  import { getDisplayName } from '../models';
25
+ var styles = {
26
+ "shared-status": "status__shared-status___2HpyL",
27
+ "shared-status-label": "status__shared-status-label___1-jvS"
28
+ };
29
29
  export var SharedStatus = function SharedStatus(_ref) {
30
30
  var className = _ref.className,
31
31
  docId = _ref.docId,
@@ -14,31 +14,27 @@ import SelectBox, { components } from 'cozy-ui/transpiled/react/SelectBox';
14
14
  import palette from 'cozy-ui/transpiled/react/palette';
15
15
  import logger from '../logger';
16
16
  var styles = {
17
- "share-modal-content": "share__share-modal-content___XTtaK",
18
- "coz-form": "share__coz-form___33NYF",
19
- "coz-form-group": "share__coz-form-group___1PLAZ",
20
- "coz-form-desc": "share__coz-form-desc___-pmK5",
21
- "coz-form-label": "share__coz-form-label___31jb0",
22
- "coz-form-label--error": "share__coz-form-label--error___2EXCl",
23
- "coz-form-errors": "share__coz-form-errors___1rk2R",
24
- "coz-form-controls": "share__coz-form-controls___39Uwg",
25
- "coz-form-controls--full": "share__coz-form-controls--full___1YpNp",
26
- "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___3JXzz",
27
- "error": "share__error___6Ycal",
28
- "CozyTheme--inverted": "share__CozyTheme--inverted___2pLD2",
29
- "CozyTheme--normal": "share__CozyTheme--normal___qSFyr",
30
- "share-byemail-onlybylink": "share__share-byemail-onlybylink___C_7b_",
31
- "aligned-dropdown-button": "share__aligned-dropdown-button___CeTDs",
32
- "share-type-control": "share__share-type-control___KcpDf",
33
- "select-wrapper": "share__select-wrapper___3FfiH",
34
- "select-option": "share__select-option___13o6b",
35
- "select-option-label": "share__select-option-label___Zj_RU",
36
- "select-option-desc": "share__select-option-desc___6uaQq",
37
- "share-details-created": "share__share-details-created___13BO0",
38
- "share-details-perm": "share__share-details-perm___23_VF",
39
- "share-details-perm-desc": "share__share-details-perm-desc___tqfXx",
40
- "spin": "share__spin___1P7nU",
41
- "shake": "share__shake___1EeCI"
17
+ "share-modal-content": "share__share-modal-content___1iqEq",
18
+ "coz-form": "share__coz-form___1ICST",
19
+ "coz-form-group": "share__coz-form-group___VsQp7",
20
+ "coz-form-desc": "share__coz-form-desc___2mYN4",
21
+ "coz-form-label": "share__coz-form-label___bogBw",
22
+ "coz-form-label--error": "share__coz-form-label--error___3YPkf",
23
+ "coz-form-errors": "share__coz-form-errors___2xYRz",
24
+ "coz-form-controls": "share__coz-form-controls___H8kGc",
25
+ "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
26
+ "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
27
+ "error": "share__error___pwqPO",
28
+ "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
29
+ "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
30
+ "share-type-control": "share__share-type-control___1YoRr",
31
+ "select-wrapper": "share__select-wrapper___3XBKC",
32
+ "select-option": "share__select-option___3Jp8_",
33
+ "select-option-label": "share__select-option-label___1BWz_",
34
+ "select-option-desc": "share__select-option-desc___3jOnr",
35
+ "share-details-created": "share__share-details-created___z3nvO",
36
+ "share-details-perm": "share__share-details-perm___3HjxK",
37
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
42
38
  };
43
39
 
44
40
  var DropdownIndicator = function DropdownIndicator(props) {
@@ -7,7 +7,7 @@ import Button, { ButtonLink } from 'cozy-ui/transpiled/react/deprecated/Button';
7
7
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
8
8
  import CozyHomeLinkIcon from './CozyHomeLinkIcon';
9
9
  var styles = {
10
- "bannermarkdown": "publicBanner__bannermarkdown___1EMSa"
10
+ "bannermarkdown": "publicBanner__bannermarkdown___1dR1E"
11
11
  };
12
12
  var HOME_LINK_HREF = 'https://manager.cozycloud.cc/cozy/create';
13
13
 
@@ -111,7 +111,7 @@ var SharingBannerByLinkText = function SharingBannerByLinkText() {
111
111
  }, t('Share.banner.know_more'));
112
112
  return /*#__PURE__*/React.createElement("span", {
113
113
  style: {
114
- color: 'var(--textIconColor)'
114
+ color: 'var(--iconTextColor)'
115
115
  }
116
116
  }, text, " ", knowMore);
117
117
  };
@@ -3,8 +3,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { useState, useEffect } from 'react';
5
5
  import { useClient, models } from 'cozy-client';
6
- import logger from '../../logger';
7
- import { buildSharingsByIdQuery } from '../../queries/queries';
6
+ import logger from '../../../logger';
7
+ import { buildSharingsByIdQuery } from '../../../queries/queries';
8
8
  import getQueryParameter from '../helpers/QueryParameter';
9
9
 
10
10
  var getSharingId = function getSharingId(permission) {
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { SharingBanner } from './components/SharingBanner';
4
4
  import { useSharingInfos } from './hooks/useSharingInfos';
5
- import withLocales from '../withLocales';
5
+ import withLocales from '../../hoc/withLocales';
6
6
 
7
7
  var Plugin = function Plugin(_ref) {
8
8
  var previewPath = _ref.previewPath;
@@ -9,8 +9,8 @@ import FabProvider from './FabProvider';
9
9
  import { ModalContext } from './ModalContext';
10
10
  import { RouterContext } from './RouterContext';
11
11
  import { ThumbnailSizeContextProvider } from './ThumbnailSizeContext';
12
- import langEn from '../../../locales/en.json';
13
- import SharingContext from '../../context';
12
+ import langEn from '../../../../locales/en.json';
13
+ import SharingContext from '../../../context';
14
14
  var mockStore = createStore(function () {
15
15
  return {
16
16
  mobile: {
@@ -27,8 +27,8 @@ import PropTypes from 'prop-types';
27
27
  import React from 'react';
28
28
  import ReactTooltip from 'react-tooltip';
29
29
  var styles = {
30
- "shared-tooltip": "tooltip__shared-tooltip___33CoC",
31
- "shared-tooltip-list": "tooltip__shared-tooltip-list___3gFkD"
30
+ "shared-tooltip": "tooltip__shared-tooltip___7Dys3",
31
+ "shared-tooltip-list": "tooltip__shared-tooltip-list___jD5hi"
32
32
  };
33
33
  export var SharingTooltip = function SharingTooltip(props) {
34
34
  return /*#__PURE__*/React.createElement(ReactTooltip, _extends({
@@ -1,13 +1,11 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import PropTypes from 'prop-types';
3
2
  import React from 'react';
4
3
  import List from 'cozy-ui/transpiled/react/List';
5
4
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
6
5
  import LinkRecipient from './Recipient/LinkRecipient';
7
6
  import OwnerRecipient from './Recipient/OwnerRecipient';
8
- import Recipient from './Recipient/Recipient';
7
+ import { RecipientList } from './Recipient/RecipientList';
9
8
  import { usePrevious } from '../helpers/hooks';
10
- import { filterAndReworkRecipients } from '../helpers/recipients';
11
9
  /**
12
10
  * Displays a warning if some contacts are waiting for confirmation of their sharing
13
11
  *
@@ -46,9 +44,7 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
46
44
  onUpdateShareLinkPermissions = _ref2.onUpdateShareLinkPermissions,
47
45
  onRevokeLink = _ref2.onRevokeLink;
48
46
  var previousLink = usePrevious(link);
49
- var previousRecipients = usePrevious(recipients);
50
47
  var linkHasBeenJustCreated = link && previousLink === null;
51
- var recipientsToDisplay = filterAndReworkRecipients(recipients, previousRecipients);
52
48
  return /*#__PURE__*/React.createElement("div", {
53
49
  className: className
54
50
  }, /*#__PURE__*/React.createElement(RecipientWaitingForConfirmationAlert, {
@@ -67,21 +63,15 @@ var WhoHasAccess = function WhoHasAccess(_ref2) {
67
63
  fadeIn: linkHasBeenJustCreated
68
64
  }), /*#__PURE__*/React.createElement(OwnerRecipient, {
69
65
  recipients: recipients
70
- }), recipientsToDisplay.map(function (recipient) {
71
- var recipientConfirmationData = recipientsToBeConfirmed.find(function (user) {
72
- return user.email === recipient.email;
73
- });
74
- return /*#__PURE__*/React.createElement(Recipient, _extends({}, recipient, {
75
- key: "key_r_".concat(recipient.index),
76
- isOwner: isOwner,
77
- document: document,
78
- documentType: documentType,
79
- onRevoke: onRevoke,
80
- onRevokeSelf: onRevokeSelf,
81
- recipientConfirmationData: recipientConfirmationData,
82
- verifyRecipient: verifyRecipient,
83
- fadeIn: recipient.hasBeenJustAdded
84
- }));
66
+ }), /*#__PURE__*/React.createElement(RecipientList, {
67
+ recipients: recipients,
68
+ recipientsToBeConfirmed: recipientsToBeConfirmed,
69
+ isOwner: isOwner,
70
+ document: document,
71
+ documentType: documentType,
72
+ onRevoke: onRevoke,
73
+ onRevokeSelf: onRevokeSelf,
74
+ verifyRecipient: verifyRecipient
85
75
  })));
86
76
  };
87
77
 
@@ -3,7 +3,23 @@ import cx from 'classnames';
3
3
  import React from 'react';
4
4
  import RecipientPlusX from './Recipient/RecipientPlusX';
5
5
  import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus';
6
- var styles = {};
6
+ var styles = {
7
+ "recipient": "recipient__recipient___2DmZI",
8
+ "recipients-list-light": "recipient__recipients-list-light___Vq4op",
9
+ "recipient-idents": "recipient__recipient-idents___3s7rw",
10
+ "recipient-status-icon": "recipient__recipient-status-icon___-liGw",
11
+ "recipient-user": "recipient__recipient-user___1THIU",
12
+ "recipient-details": "recipient__recipient-details___2fZfc",
13
+ "avatar": "recipient__avatar___2LnIV",
14
+ "link-recipient-icon-circle": "recipient__link-recipient-icon-circle___3ZTU-",
15
+ "recipients-avatars": "recipient__recipients-avatars___1npjD",
16
+ "--interactive": "recipient__--interactive___160Bp",
17
+ "recipients-avatars--link": "recipient__recipients-avatars--link___1qeON",
18
+ "recipients-avatars--plusX": "recipient__recipients-avatars--plusX___3-6_l",
19
+ "recipients-avatars--avatar": "recipient__recipients-avatars--avatar___-owjC",
20
+ "spin": "recipient__spin___2tYv3",
21
+ "shake": "recipient__shake___TGyPp"
22
+ };
7
23
  var MAX_DISPLAYED_RECIPIENTS = 2;
8
24
 
9
25
  var WhoHasAccessLight = function WhoHasAccessLight(_ref) {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { I18n, translate } from 'cozy-ui/transpiled/react/providers/I18n';
3
3
  var locales = {
4
- en: require("../locales/en.json"),
5
- fr: require("../locales/fr.json")
4
+ en: require("../../locales/en.json"),
5
+ fr: require("../../locales/fr.json")
6
6
  };
7
7
  /**
8
8
  * Adds cozy-sharing translations in the React context
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import SharingProvider from './SharingProvider';
2
2
  import SharingContext from './context';
3
- import withLocales from './withLocales';
3
+ import withLocales from './hoc/withLocales';
4
4
  export default SharingProvider;
5
5
  export { SharingContext, withLocales };
6
6
  export { useSharingContext } from './hooks/useSharingContext';
7
+ export { useFetchDocumentPath } from './hooks/useFetchDocumentPath';
7
8
  export { SharedDocument } from './SharedDocument';
8
9
  export { SharedStatus } from './SharedStatus';
9
10
  export { SharedBadge } from './SharedBadge';
@@ -11,12 +12,11 @@ export { SharingOwnerAvatar } from './SharingOwnerAvatar';
11
12
  export { SharedRecipients } from './SharedRecipients';
12
13
  export { SharedRecipientsList } from './SharedRecipientsList';
13
14
  export { ShareButton } from './ShareButton';
14
- export { ShareModal } from './ShareModal';
15
+ export { ShareModal } from './components/ShareModal/ShareModal';
15
16
  export { RefreshableSharings } from './RefreshableSharings';
16
- export { useFetchDocumentPath } from './components/useFetchDocumentPath';
17
17
  export { CozyPassFingerprintDialogContent } from './components/CozyPassFingerprintDialogContent';
18
- export { SharingBannerPlugin } from './SharingBanner';
19
- export { useSharingInfos } from './SharingBanner/hooks/useSharingInfos';
18
+ export { SharingBannerPlugin } from './components/SharingBanner';
19
+ export { useSharingInfos } from './components/SharingBanner/hooks/useSharingInfos';
20
20
  export { ConfirmTrustedRecipientsDialog } from './ConfirmTrustedRecipientsDialog';
21
21
  export { ShareButtonWithRecipients } from './ShareButtonWithRecipients';
22
22
  export { DOCUMENT_TYPE } from './helpers/documentType';
@@ -1,5 +1,3 @@
1
- @require 'settings/palette.styl'
2
-
3
1
  .fil-mobileactionmenu
4
2
  color var(--charcoalGrey)
5
3
  hr
@@ -1,6 +1,3 @@
1
- @require 'settings/palette.styl'
2
- @require 'settings/z-index.styl'
3
-
4
1
  .container
5
2
  position relative
6
3
 
@@ -9,7 +6,7 @@
9
6
  position absolute
10
7
  top 100%
11
8
  margin-top .25rem
12
- z-index $alert-index-mobile
9
+ z-index var(--zIndex-alertMobile)
13
10
  width 100%
14
11
  overflow hidden
15
12
  box-shadow 0px 0px 0px 0.5px rgba(29, 33, 42, 0.12), 0px 2px 4px rgba(29, 33, 42, 0.0793047), 0px 4px 16px rgba(29, 33, 42, 0.06)
@@ -6,9 +6,9 @@
6
6
  img
7
7
  @extend $avatar
8
8
  @extend $circle
9
- width rem(16)
10
- height rem(16)
11
- min-width rem(16)
12
- min-height rem(16)
9
+ width rem(16)
10
+ height rem(16)
11
+ min-width rem(16)
12
+ min-height rem(16)
13
13
  font-size rem(7)
14
- vertical-align text-bottom
14
+ vertical-align text-bottom
@@ -1,6 +1,5 @@
1
1
  @require 'components/button.styl'
2
2
  @require 'settings/breakpoints.styl'
3
- @require 'settings/palette.styl'
4
3
 
5
4
  :root
6
5
  --genericRecipientBackground: var(--slateGrey)
@@ -1,7 +1,6 @@
1
1
  @require 'components/forms.styl'
2
2
  @require 'components/popover.styl'
3
3
  @require 'settings/breakpoints.styl'
4
- @require 'settings/palette.styl'
5
4
 
6
5
  .share-byemail-onlybylink
7
6
  background var(--paleGrey)