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.
- package/CHANGELOG.md +22 -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 +15 -17
- package/dist/components/Recipient/LinkRecipient.js +16 -18
- package/dist/components/Recipient/OwnerIdentity.js +16 -18
- package/dist/components/Recipient/RecipientConfirm.js +21 -25
- package/dist/components/Recipient/RecipientList.js +36 -0
- package/dist/components/Recipient/RecipientPlusX.js +16 -18
- package/dist/components/Recipient/RecipientStatus.js +15 -17
- package/dist/components/Recipient/RecipientWithoutStatus.js +16 -18
- package/dist/components/Recipient/RecipientsAvatars.js +16 -18
- package/dist/components/ShareAutosuggest.js +10 -12
- package/dist/components/ShareButton.js +2 -2
- package/dist/components/ShareByEmail.js +22 -26
- package/dist/components/ShareDialogCozyToCozy.js +21 -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} +24 -28
- package/dist/components/SharedBadge.js +6 -6
- package/dist/components/SharedStatus.js +4 -4
- package/dist/components/Sharetypeselect.js +21 -25
- package/dist/{SharingBanner → components/SharingBanner}/components/PublicBanner.js +2 -2
- 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 +17 -1
- package/dist/{withLocales.js → hoc/withLocales.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/{components → styles}/actionmenu.styl +0 -2
- package/dist/{components → styles}/autosuggest.styl +1 -4
- package/dist/{SharingBanner/components → styles}/publicBanner.styl +5 -5
- package/dist/{components/Recipient → styles}/recipient.styl +0 -1
- package/{src → dist/styles}/share.styl +0 -1
- package/dist/stylesheet.css +214 -2635
- package/docs/share-modal-architecture.md +44 -0
- package/package.json +6 -6
- 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 +2 -2
- 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/components/__snapshots__/ContactSuggestion.spec.jsx.snap +120 -105
- package/src/{withLocales.jsx → hoc/withLocales.jsx} +2 -2
- package/src/index.jsx +6 -5
- package/src/{components → styles}/actionmenu.styl +0 -2
- package/src/{components → styles}/autosuggest.styl +1 -4
- package/src/{SharingBanner/components → styles}/publicBanner.styl +5 -5
- package/src/{components/Recipient → styles}/recipient.styl +0 -1
- package/{dist → src/styles}/share.styl +0 -1
- 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}/badge.styl +0 -0
- /package/dist/{components → styles}/button.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}/badge.styl +0 -0
- /package/src/{components → styles}/button.styl +0 -0
- /package/src/{components → styles}/status.styl +0 -0
- /package/src/{components → styles}/tooltip.styl +0 -0
|
@@ -11,8 +11,8 @@ import FabProvider from './FabProvider'
|
|
|
11
11
|
import { ModalContext } from './ModalContext'
|
|
12
12
|
import { RouterContext } from './RouterContext'
|
|
13
13
|
import { ThumbnailSizeContextProvider } from './ThumbnailSizeContext'
|
|
14
|
-
import langEn from '
|
|
15
|
-
import SharingContext from '
|
|
14
|
+
import langEn from '../../../../locales/en.json'
|
|
15
|
+
import SharingContext from '../../../context'
|
|
16
16
|
|
|
17
17
|
const mockStore = createStore(() => ({
|
|
18
18
|
mobile: {
|
|
@@ -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
|
|
|
@@ -132,46 +132,51 @@ exports[`ContactSuggestion component should display contact suggestion for a con
|
|
|
132
132
|
<ListItemIcon
|
|
133
133
|
key=".$.$.0"
|
|
134
134
|
>
|
|
135
|
-
<ForwardRef(ListItemIcon)
|
|
136
|
-
|
|
137
|
-
Object {
|
|
138
|
-
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
139
|
-
"root": "MuiListItemIcon-root",
|
|
140
|
-
}
|
|
141
|
-
}
|
|
135
|
+
<WithStyles(ForwardRef(ListItemIcon))
|
|
136
|
+
className="cozyListItemIcon"
|
|
142
137
|
>
|
|
143
|
-
<
|
|
144
|
-
className="
|
|
138
|
+
<ForwardRef(ListItemIcon)
|
|
139
|
+
className="cozyListItemIcon"
|
|
140
|
+
classes={
|
|
141
|
+
Object {
|
|
142
|
+
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
143
|
+
"root": "MuiListItemIcon-root",
|
|
144
|
+
}
|
|
145
|
+
}
|
|
145
146
|
>
|
|
146
|
-
<
|
|
147
|
-
className=""
|
|
148
|
-
disabled={false}
|
|
149
|
-
ghost={false}
|
|
150
|
-
icon={[Function]}
|
|
151
|
-
image=""
|
|
152
|
-
size="small"
|
|
153
|
-
style={Object {}}
|
|
154
|
-
text="JS"
|
|
147
|
+
<div
|
|
148
|
+
className="MuiListItemIcon-root cozyListItemIcon"
|
|
155
149
|
>
|
|
156
|
-
<
|
|
157
|
-
className="
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
150
|
+
<Avatar
|
|
151
|
+
className=""
|
|
152
|
+
disabled={false}
|
|
153
|
+
ghost={false}
|
|
154
|
+
icon={[Function]}
|
|
155
|
+
image=""
|
|
156
|
+
size="small"
|
|
157
|
+
style={Object {}}
|
|
158
|
+
text="JS"
|
|
165
159
|
>
|
|
166
|
-
<
|
|
167
|
-
className="styles__c-avatar
|
|
160
|
+
<div
|
|
161
|
+
className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
|
|
162
|
+
data-testid="Avatar"
|
|
163
|
+
style={
|
|
164
|
+
Object {
|
|
165
|
+
"--circleSize": "32px",
|
|
166
|
+
"backgroundColor": "#C2ADF4",
|
|
167
|
+
}
|
|
168
|
+
}
|
|
168
169
|
>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
<span
|
|
171
|
+
className="styles__c-avatar-initials___310qC"
|
|
172
|
+
>
|
|
173
|
+
JS
|
|
174
|
+
</span>
|
|
175
|
+
</div>
|
|
176
|
+
</Avatar>
|
|
177
|
+
</div>
|
|
178
|
+
</ForwardRef(ListItemIcon)>
|
|
179
|
+
</WithStyles(ForwardRef(ListItemIcon))>
|
|
175
180
|
</ListItemIcon>
|
|
176
181
|
<ListItemText
|
|
177
182
|
ellipsis={true}
|
|
@@ -501,46 +506,51 @@ exports[`ContactSuggestion component should display contact suggestion for a con
|
|
|
501
506
|
<ListItemIcon
|
|
502
507
|
key=".$.$.0"
|
|
503
508
|
>
|
|
504
|
-
<ForwardRef(ListItemIcon)
|
|
505
|
-
|
|
506
|
-
Object {
|
|
507
|
-
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
508
|
-
"root": "MuiListItemIcon-root",
|
|
509
|
-
}
|
|
510
|
-
}
|
|
509
|
+
<WithStyles(ForwardRef(ListItemIcon))
|
|
510
|
+
className="cozyListItemIcon"
|
|
511
511
|
>
|
|
512
|
-
<
|
|
513
|
-
className="
|
|
512
|
+
<ForwardRef(ListItemIcon)
|
|
513
|
+
className="cozyListItemIcon"
|
|
514
|
+
classes={
|
|
515
|
+
Object {
|
|
516
|
+
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
517
|
+
"root": "MuiListItemIcon-root",
|
|
518
|
+
}
|
|
519
|
+
}
|
|
514
520
|
>
|
|
515
|
-
<
|
|
516
|
-
className=""
|
|
517
|
-
disabled={false}
|
|
518
|
-
ghost={false}
|
|
519
|
-
icon={[Function]}
|
|
520
|
-
image=""
|
|
521
|
-
size="small"
|
|
522
|
-
style={Object {}}
|
|
523
|
-
text="J"
|
|
521
|
+
<div
|
|
522
|
+
className="MuiListItemIcon-root cozyListItemIcon"
|
|
524
523
|
>
|
|
525
|
-
<
|
|
526
|
-
className="
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
524
|
+
<Avatar
|
|
525
|
+
className=""
|
|
526
|
+
disabled={false}
|
|
527
|
+
ghost={false}
|
|
528
|
+
icon={[Function]}
|
|
529
|
+
image=""
|
|
530
|
+
size="small"
|
|
531
|
+
style={Object {}}
|
|
532
|
+
text="J"
|
|
534
533
|
>
|
|
535
|
-
<
|
|
536
|
-
className="styles__c-avatar
|
|
534
|
+
<div
|
|
535
|
+
className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
|
|
536
|
+
data-testid="Avatar"
|
|
537
|
+
style={
|
|
538
|
+
Object {
|
|
539
|
+
"--circleSize": "32px",
|
|
540
|
+
"backgroundColor": "#0DCBCF",
|
|
541
|
+
}
|
|
542
|
+
}
|
|
537
543
|
>
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
+
<span
|
|
545
|
+
className="styles__c-avatar-initials___310qC"
|
|
546
|
+
>
|
|
547
|
+
J
|
|
548
|
+
</span>
|
|
549
|
+
</div>
|
|
550
|
+
</Avatar>
|
|
551
|
+
</div>
|
|
552
|
+
</ForwardRef(ListItemIcon)>
|
|
553
|
+
</WithStyles(ForwardRef(ListItemIcon))>
|
|
544
554
|
</ListItemIcon>
|
|
545
555
|
<ListItemText
|
|
546
556
|
ellipsis={true}
|
|
@@ -921,46 +931,51 @@ exports[`ContactSuggestion component should display contact suggestion for a gro
|
|
|
921
931
|
<ListItemIcon
|
|
922
932
|
key=".$.$.0"
|
|
923
933
|
>
|
|
924
|
-
<ForwardRef(ListItemIcon)
|
|
925
|
-
|
|
926
|
-
Object {
|
|
927
|
-
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
928
|
-
"root": "MuiListItemIcon-root",
|
|
929
|
-
}
|
|
930
|
-
}
|
|
934
|
+
<WithStyles(ForwardRef(ListItemIcon))
|
|
935
|
+
className="cozyListItemIcon"
|
|
931
936
|
>
|
|
932
|
-
<
|
|
933
|
-
className="
|
|
937
|
+
<ForwardRef(ListItemIcon)
|
|
938
|
+
className="cozyListItemIcon"
|
|
939
|
+
classes={
|
|
940
|
+
Object {
|
|
941
|
+
"alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
|
|
942
|
+
"root": "MuiListItemIcon-root",
|
|
943
|
+
}
|
|
944
|
+
}
|
|
934
945
|
>
|
|
935
|
-
<
|
|
936
|
-
className=""
|
|
937
|
-
disabled={false}
|
|
938
|
-
ghost={false}
|
|
939
|
-
icon={[Function]}
|
|
940
|
-
image=""
|
|
941
|
-
size="small"
|
|
942
|
-
style={Object {}}
|
|
943
|
-
text="G"
|
|
946
|
+
<div
|
|
947
|
+
className="MuiListItemIcon-root cozyListItemIcon"
|
|
944
948
|
>
|
|
945
|
-
<
|
|
946
|
-
className="
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
949
|
+
<Avatar
|
|
950
|
+
className=""
|
|
951
|
+
disabled={false}
|
|
952
|
+
ghost={false}
|
|
953
|
+
icon={[Function]}
|
|
954
|
+
image=""
|
|
955
|
+
size="small"
|
|
956
|
+
style={Object {}}
|
|
957
|
+
text="G"
|
|
954
958
|
>
|
|
955
|
-
<
|
|
956
|
-
className="styles__c-avatar
|
|
959
|
+
<div
|
|
960
|
+
className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
|
|
961
|
+
data-testid="Avatar"
|
|
962
|
+
style={
|
|
963
|
+
Object {
|
|
964
|
+
"--circleSize": "32px",
|
|
965
|
+
"backgroundColor": "#7F6BEE",
|
|
966
|
+
}
|
|
967
|
+
}
|
|
957
968
|
>
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
969
|
+
<span
|
|
970
|
+
className="styles__c-avatar-initials___310qC"
|
|
971
|
+
>
|
|
972
|
+
G
|
|
973
|
+
</span>
|
|
974
|
+
</div>
|
|
975
|
+
</Avatar>
|
|
976
|
+
</div>
|
|
977
|
+
</ForwardRef(ListItemIcon)>
|
|
978
|
+
</WithStyles(ForwardRef(ListItemIcon))>
|
|
964
979
|
</ListItemIcon>
|
|
965
980
|
<ListItemText
|
|
966
981
|
ellipsis={true}
|
|
@@ -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'
|
|
@@ -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
|
|
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
|
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
|