cozy-sharing 10.2.0 → 10.3.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 +11 -0
- package/dist/ConfirmTrustedRecipientsDialog.js +1 -1
- package/dist/ShareButton.js +1 -1
- package/dist/ShareButton.spec.js +1 -1
- package/dist/SharedBadge.js +1 -1
- package/dist/SharedRecipients.js +1 -1
- package/dist/SharedRecipientsList.js +1 -1
- package/dist/SharedStatus.js +1 -1
- package/dist/SharingOwnerAvatar.js +1 -1
- package/dist/components/CozyPassFingerprintDialogContent.js +1 -1
- package/dist/components/Recipient/Identity.js +17 -17
- package/dist/components/Recipient/LinkRecipient.js +18 -18
- package/dist/components/Recipient/OwnerIdentity.js +18 -18
- package/dist/components/Recipient/RecipientConfirm.js +25 -25
- package/dist/components/Recipient/RecipientList.js +36 -0
- package/dist/components/Recipient/RecipientPlusX.js +18 -18
- package/dist/components/Recipient/RecipientStatus.js +17 -17
- package/dist/components/Recipient/RecipientWithoutStatus.js +18 -18
- package/dist/components/Recipient/RecipientsAvatars.js +18 -18
- package/dist/components/ShareAutosuggest.js +12 -12
- package/dist/components/ShareButton.js +2 -2
- package/dist/components/ShareByEmail.js +26 -26
- package/dist/components/ShareDialogCozyToCozy.js +25 -25
- package/dist/components/{EditableSharingModal.js → ShareModal/EditableSharingModal.js} +5 -5
- package/dist/components/{EditableSharingModal.spec.js → ShareModal/EditableSharingModal.spec.js} +6 -6
- package/dist/components/ShareModal/ShareModal.js +43 -0
- package/dist/{SharingDetailsModal.js → components/ShareModal/SharingDetailsModal.js} +28 -28
- package/dist/components/SharedBadge.js +6 -6
- package/dist/components/SharedStatus.js +4 -4
- package/dist/components/Sharetypeselect.js +25 -25
- package/dist/{SharingBanner → components/SharingBanner}/components/PublicBanner.js +1 -1
- package/dist/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.js +2 -2
- package/dist/{SharingBanner → components/SharingBanner}/index.js +1 -1
- package/dist/{SharingBanner → components/SharingBanner}/test/AppLike.js +2 -2
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/WhoHasAccess.js +10 -20
- package/dist/components/WhoHasAccessLight.js +19 -1
- package/dist/{withLocales.js → hoc/withLocales.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/{SharingBanner/components → styles}/publicBanner.styl +5 -5
- package/dist/stylesheet.css +340 -340
- package/docs/share-modal-architecture.md +44 -0
- package/package.json +2 -2
- package/src/ConfirmTrustedRecipientsDialog.jsx +1 -1
- package/src/ShareButton.jsx +1 -1
- package/src/ShareButton.spec.jsx +1 -1
- package/src/SharedBadge.jsx +1 -1
- package/src/SharedRecipients.jsx +1 -1
- package/src/SharedRecipientsList.jsx +1 -1
- package/src/SharedStatus.jsx +1 -1
- package/src/SharingOwnerAvatar.jsx +1 -1
- package/src/assets/icons/icon-arrow-down.svg +3 -0
- package/src/assets/icons/icon-calendar-16.svg +8 -0
- package/src/assets/icons/icon-check-blue.svg +59 -0
- package/src/assets/icons/icon-cross-bold.svg +5 -0
- package/src/assets/icons/icon-link.svg +14 -0
- package/src/assets/icons/icon-pen-16.svg +3 -0
- package/src/components/CozyPassFingerprintDialogContent.jsx +1 -1
- package/src/components/Recipient/Identity.jsx +1 -1
- package/src/components/Recipient/LinkRecipient.jsx +1 -1
- package/src/components/Recipient/OwnerIdentity.jsx +1 -1
- package/src/components/Recipient/RecipientConfirm.jsx +1 -1
- package/src/components/Recipient/RecipientList.jsx +45 -0
- package/src/components/Recipient/RecipientPlusX.jsx +1 -1
- package/src/components/Recipient/RecipientStatus.jsx +1 -1
- package/src/components/Recipient/RecipientWithoutStatus.jsx +1 -1
- package/src/components/Recipient/RecipientsAvatars.jsx +1 -1
- package/src/components/ShareAutosuggest.jsx +1 -1
- package/src/components/ShareButton.jsx +1 -1
- package/src/components/ShareByEmail.jsx +1 -1
- package/src/components/ShareDialogCozyToCozy.jsx +1 -1
- package/src/components/{EditableSharingModal.jsx → ShareModal/EditableSharingModal.jsx} +5 -5
- package/src/components/{EditableSharingModal.spec.jsx → ShareModal/EditableSharingModal.spec.jsx} +6 -6
- package/src/components/ShareModal/ShareModal.jsx +45 -0
- package/src/{SharingDetailsModal.jsx → components/ShareModal/SharingDetailsModal.jsx} +4 -4
- package/src/components/SharedBadge.jsx +1 -1
- package/src/components/SharedStatus.jsx +2 -2
- package/src/components/Sharetypeselect.jsx +1 -1
- package/src/{SharingBanner → components/SharingBanner}/components/PublicBanner.jsx +1 -1
- package/src/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.jsx +2 -2
- package/src/{SharingBanner → components/SharingBanner}/index.jsx +1 -1
- package/src/{SharingBanner → components/SharingBanner}/test/AppLike.jsx +2 -2
- package/src/components/Tooltip.jsx +1 -1
- package/src/components/WhoHasAccess.jsx +11 -29
- package/src/components/WhoHasAccessLight.jsx +1 -1
- package/src/{withLocales.jsx → hoc/withLocales.jsx} +2 -2
- package/src/index.jsx +6 -5
- package/src/{SharingBanner/components → styles}/publicBanner.styl +5 -5
- package/dist/ShareModal.js +0 -50
- package/src/ShareModal.jsx +0 -51
- /package/{assets → dist/assets}/icons/icon-arrow-down.svg +0 -0
- /package/{assets → dist/assets}/icons/icon-calendar-16.svg +0 -0
- /package/{assets → dist/assets}/icons/icon-check-blue.svg +0 -0
- /package/{assets → dist/assets}/icons/icon-cross-bold.svg +0 -0
- /package/{assets → dist/assets}/icons/icon-link.svg +0 -0
- /package/{assets → dist/assets}/icons/icon-pen-16.svg +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/components/CozyHomeLinkIcon.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/components/PublicBanner.spec.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/components/SharingBanner.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.spec.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.spec.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/test/AcceptingSharingContext.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/test/FabProvider.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/test/ModalContext.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/test/RouterContext.js +0 -0
- /package/dist/{SharingBanner → components/SharingBanner}/test/ThumbnailSizeContext.js +0 -0
- /package/dist/{components → hooks}/useFetchDocumentPath.js +0 -0
- /package/dist/{components → styles}/CozyPassFingerprintDialogContent.styl +0 -0
- /package/dist/{components → styles}/actionmenu.styl +0 -0
- /package/dist/{components → styles}/autosuggest.styl +0 -0
- /package/dist/{components → styles}/badge.styl +0 -0
- /package/dist/{components → styles}/button.styl +0 -0
- /package/dist/{components/Recipient → styles}/recipient.styl +0 -0
- /package/dist/{share.styl → styles/share.styl} +0 -0
- /package/dist/{components → styles}/status.styl +0 -0
- /package/dist/{components → styles}/tooltip.styl +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/components/CozyHomeLinkIcon.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/components/PublicBanner.spec.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/components/SharingBanner.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.js +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/helpers/QueryParameter.spec.js +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/hooks/useSharingInfos.spec.js +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/test/AcceptingSharingContext.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/test/FabProvider.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/test/ModalContext.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/test/RouterContext.jsx +0 -0
- /package/src/{SharingBanner → components/SharingBanner}/test/ThumbnailSizeContext.jsx +0 -0
- /package/src/{components → hooks}/useFetchDocumentPath.jsx +0 -0
- /package/src/{components → styles}/CozyPassFingerprintDialogContent.styl +0 -0
- /package/src/{components → styles}/actionmenu.styl +0 -0
- /package/src/{components → styles}/autosuggest.styl +0 -0
- /package/src/{components → styles}/badge.styl +0 -0
- /package/src/{components → styles}/button.styl +0 -0
- /package/src/{components/Recipient → styles}/recipient.styl +0 -0
- /package/src/{share.styl → styles/share.styl} +0 -0
- /package/src/{components → styles}/status.styl +0 -0
- /package/src/{components → styles}/tooltip.styl +0 -0
|
@@ -6,9 +6,8 @@ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
|
6
6
|
|
|
7
7
|
import LinkRecipient from './Recipient/LinkRecipient'
|
|
8
8
|
import OwnerRecipient from './Recipient/OwnerRecipient'
|
|
9
|
-
import
|
|
9
|
+
import { RecipientList } from './Recipient/RecipientList'
|
|
10
10
|
import { usePrevious } from '../helpers/hooks'
|
|
11
|
-
import { filterAndReworkRecipients } from '../helpers/recipients'
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Displays a warning if some contacts are waiting for confirmation of their sharing
|
|
@@ -43,15 +42,8 @@ const WhoHasAccess = ({
|
|
|
43
42
|
onRevokeLink
|
|
44
43
|
}) => {
|
|
45
44
|
const previousLink = usePrevious(link)
|
|
46
|
-
const previousRecipients = usePrevious(recipients)
|
|
47
|
-
|
|
48
45
|
const linkHasBeenJustCreated = link && previousLink === null
|
|
49
46
|
|
|
50
|
-
const recipientsToDisplay = filterAndReworkRecipients(
|
|
51
|
-
recipients,
|
|
52
|
-
previousRecipients
|
|
53
|
-
)
|
|
54
|
-
|
|
55
47
|
return (
|
|
56
48
|
<div className={className}>
|
|
57
49
|
<RecipientWaitingForConfirmationAlert
|
|
@@ -74,26 +66,16 @@ const WhoHasAccess = ({
|
|
|
74
66
|
|
|
75
67
|
<OwnerRecipient recipients={recipients} />
|
|
76
68
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
document={document}
|
|
88
|
-
documentType={documentType}
|
|
89
|
-
onRevoke={onRevoke}
|
|
90
|
-
onRevokeSelf={onRevokeSelf}
|
|
91
|
-
recipientConfirmationData={recipientConfirmationData}
|
|
92
|
-
verifyRecipient={verifyRecipient}
|
|
93
|
-
fadeIn={recipient.hasBeenJustAdded}
|
|
94
|
-
/>
|
|
95
|
-
)
|
|
96
|
-
})}
|
|
69
|
+
<RecipientList
|
|
70
|
+
recipients={recipients}
|
|
71
|
+
recipientsToBeConfirmed={recipientsToBeConfirmed}
|
|
72
|
+
isOwner={isOwner}
|
|
73
|
+
document={document}
|
|
74
|
+
documentType={documentType}
|
|
75
|
+
onRevoke={onRevoke}
|
|
76
|
+
onRevokeSelf={onRevokeSelf}
|
|
77
|
+
verifyRecipient={verifyRecipient}
|
|
78
|
+
/>
|
|
97
79
|
</List>
|
|
98
80
|
</div>
|
|
99
81
|
)
|
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import RecipientPlusX from './Recipient/RecipientPlusX'
|
|
5
5
|
import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus'
|
|
6
|
-
import styles from '
|
|
6
|
+
import styles from '../styles/recipient.styl'
|
|
7
7
|
|
|
8
8
|
const MAX_DISPLAYED_RECIPIENTS = 2
|
|
9
9
|
|
|
@@ -3,8 +3,8 @@ import React from 'react'
|
|
|
3
3
|
import { I18n, translate } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
4
4
|
|
|
5
5
|
const locales = {
|
|
6
|
-
en: require(
|
|
7
|
-
fr: require(
|
|
6
|
+
en: require(`../../locales/en.json`),
|
|
7
|
+
fr: require(`../../locales/fr.json`)
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/**
|
package/src/index.jsx
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
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
|
|
|
5
5
|
export default SharingProvider
|
|
6
6
|
|
|
7
7
|
export { SharingContext, withLocales }
|
|
8
8
|
|
|
9
9
|
export { useSharingContext } from './hooks/useSharingContext'
|
|
10
|
+
export { useFetchDocumentPath } from './hooks/useFetchDocumentPath'
|
|
11
|
+
|
|
10
12
|
export { SharedDocument } from './SharedDocument'
|
|
11
13
|
export { SharedStatus } from './SharedStatus'
|
|
12
14
|
export { SharedBadge } from './SharedBadge'
|
|
@@ -14,12 +16,11 @@ export { SharingOwnerAvatar } from './SharingOwnerAvatar'
|
|
|
14
16
|
export { SharedRecipients } from './SharedRecipients'
|
|
15
17
|
export { SharedRecipientsList } from './SharedRecipientsList'
|
|
16
18
|
export { ShareButton } from './ShareButton'
|
|
17
|
-
export { ShareModal } from './ShareModal'
|
|
19
|
+
export { ShareModal } from './components/ShareModal/ShareModal'
|
|
18
20
|
export { RefreshableSharings } from './RefreshableSharings'
|
|
19
|
-
export { useFetchDocumentPath } from './components/useFetchDocumentPath'
|
|
20
21
|
export { CozyPassFingerprintDialogContent } from './components/CozyPassFingerprintDialogContent'
|
|
21
|
-
export { SharingBannerPlugin } from './SharingBanner'
|
|
22
|
-
export { useSharingInfos } from './SharingBanner/hooks/useSharingInfos'
|
|
22
|
+
export { SharingBannerPlugin } from './components/SharingBanner'
|
|
23
|
+
export { useSharingInfos } from './components/SharingBanner/hooks/useSharingInfos'
|
|
23
24
|
export { ConfirmTrustedRecipientsDialog } from './ConfirmTrustedRecipientsDialog'
|
|
24
25
|
export { ShareButtonWithRecipients } from './ShareButtonWithRecipients'
|
|
25
26
|
export { DOCUMENT_TYPE } from './helpers/documentType'
|
|
@@ -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
|
package/dist/ShareModal.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["document"];
|
|
4
|
-
import omit from 'lodash/omit';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { useLocation } from 'react-router';
|
|
7
|
-
import { SharingDetailsModal } from './SharingDetailsModal';
|
|
8
|
-
import EditableSharingModal from './components/EditableSharingModal';
|
|
9
|
-
import SharingContext from './context';
|
|
10
|
-
import withLocales from './withLocales';
|
|
11
|
-
|
|
12
|
-
var SharingModal = function SharingModal(_ref) {
|
|
13
|
-
var document = _ref.document,
|
|
14
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
|
|
16
|
-
return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function (_ref2) {
|
|
17
|
-
var documentType = _ref2.documentType,
|
|
18
|
-
getOwner = _ref2.getOwner,
|
|
19
|
-
getSharingType = _ref2.getSharingType,
|
|
20
|
-
getRecipients = _ref2.getRecipients,
|
|
21
|
-
revokeSelf = _ref2.revokeSelf;
|
|
22
|
-
return /*#__PURE__*/React.createElement(SharingDetailsModal, _extends({
|
|
23
|
-
document: document,
|
|
24
|
-
documentType: documentType,
|
|
25
|
-
owner: getOwner(document.id),
|
|
26
|
-
sharingType: getSharingType(document.id),
|
|
27
|
-
recipients: getRecipients(document.id),
|
|
28
|
-
onRevoke: revokeSelf
|
|
29
|
-
}, rest));
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export var ShareModal = withLocales(function (props) {
|
|
34
|
-
var _location$state;
|
|
35
|
-
|
|
36
|
-
var location = useLocation === null || useLocation === void 0 ? void 0 : useLocation();
|
|
37
|
-
var locationProps = location === null || location === void 0 || (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.modalProps;
|
|
38
|
-
var document = (locationProps === null || locationProps === void 0 ? void 0 : locationProps.document) || props.document;
|
|
39
|
-
var rest = omit(locationProps || props, 'document');
|
|
40
|
-
return /*#__PURE__*/React.createElement(SharingContext.Consumer, null, function (_ref3) {
|
|
41
|
-
var byDocId = _ref3.byDocId,
|
|
42
|
-
isOwner = _ref3.isOwner,
|
|
43
|
-
canReshare = _ref3.canReshare;
|
|
44
|
-
return !byDocId[document.id] || isOwner(document.id) || canReshare(document.id) ? /*#__PURE__*/React.createElement(EditableSharingModal, _extends({
|
|
45
|
-
document: document
|
|
46
|
-
}, rest)) : /*#__PURE__*/React.createElement(SharingModal, _extends({
|
|
47
|
-
document: document
|
|
48
|
-
}, rest));
|
|
49
|
-
});
|
|
50
|
-
});
|
package/src/ShareModal.jsx
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import omit from 'lodash/omit'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { useLocation } from 'react-router'
|
|
4
|
-
|
|
5
|
-
import { SharingDetailsModal } from './SharingDetailsModal'
|
|
6
|
-
import EditableSharingModal from './components/EditableSharingModal'
|
|
7
|
-
import SharingContext from './context'
|
|
8
|
-
import withLocales from './withLocales'
|
|
9
|
-
|
|
10
|
-
const SharingModal = ({ document, ...rest }) => (
|
|
11
|
-
<SharingContext.Consumer>
|
|
12
|
-
{({
|
|
13
|
-
documentType,
|
|
14
|
-
getOwner,
|
|
15
|
-
getSharingType,
|
|
16
|
-
getRecipients,
|
|
17
|
-
revokeSelf
|
|
18
|
-
}) => (
|
|
19
|
-
<SharingDetailsModal
|
|
20
|
-
document={document}
|
|
21
|
-
documentType={documentType}
|
|
22
|
-
owner={getOwner(document.id)}
|
|
23
|
-
sharingType={getSharingType(document.id)}
|
|
24
|
-
recipients={getRecipients(document.id)}
|
|
25
|
-
onRevoke={revokeSelf}
|
|
26
|
-
{...rest}
|
|
27
|
-
/>
|
|
28
|
-
)}
|
|
29
|
-
</SharingContext.Consumer>
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
export const ShareModal = withLocales(props => {
|
|
33
|
-
const location = useLocation?.()
|
|
34
|
-
const locationProps = location?.state?.modalProps
|
|
35
|
-
const document = locationProps?.document || props.document
|
|
36
|
-
const rest = omit(locationProps || props, 'document')
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<SharingContext.Consumer>
|
|
40
|
-
{({ byDocId, isOwner, canReshare }) =>
|
|
41
|
-
!byDocId[document.id] ||
|
|
42
|
-
isOwner(document.id) ||
|
|
43
|
-
canReshare(document.id) ? (
|
|
44
|
-
<EditableSharingModal document={document} {...rest} />
|
|
45
|
-
) : (
|
|
46
|
-
<SharingModal document={document} {...rest} />
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
</SharingContext.Consumer>
|
|
50
|
-
)
|
|
51
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|