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
@@ -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 '../../../locales/en.json'
15
- import SharingContext from '../../context'
14
+ import langEn from '../../../../locales/en.json'
15
+ import SharingContext from '../../../context'
16
16
 
17
17
  const mockStore = createStore(() => ({
18
18
  mobile: {
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types'
2
2
  import React from 'react'
3
3
  import ReactTooltip from 'react-tooltip'
4
4
 
5
- import styles from './tooltip.styl'
5
+ import styles from '../styles/tooltip.styl'
6
6
 
7
7
  export const SharingTooltip = props => (
8
8
  <ReactTooltip
@@ -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 Recipient from './Recipient/Recipient'
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
- {recipientsToDisplay.map(recipient => {
78
- const recipientConfirmationData = recipientsToBeConfirmed.find(
79
- user => user.email === recipient.email
80
- )
81
-
82
- return (
83
- <Recipient
84
- {...recipient}
85
- key={`key_r_${recipient.index}`}
86
- isOwner={isOwner}
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 './recipient.styl'
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
- classes={
137
- Object {
138
- "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
139
- "root": "MuiListItemIcon-root",
140
- }
141
- }
135
+ <WithStyles(ForwardRef(ListItemIcon))
136
+ className="cozyListItemIcon"
142
137
  >
143
- <div
144
- className="MuiListItemIcon-root"
138
+ <ForwardRef(ListItemIcon)
139
+ className="cozyListItemIcon"
140
+ classes={
141
+ Object {
142
+ "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
143
+ "root": "MuiListItemIcon-root",
144
+ }
145
+ }
145
146
  >
146
- <Avatar
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
- <div
157
- className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
158
- data-testid="Avatar"
159
- style={
160
- Object {
161
- "--circleSize": "32px",
162
- "backgroundColor": "#C2ADF4",
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
- <span
167
- className="styles__c-avatar-initials___310qC"
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
- JS
170
- </span>
171
- </div>
172
- </Avatar>
173
- </div>
174
- </ForwardRef(ListItemIcon)>
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
- classes={
506
- Object {
507
- "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
508
- "root": "MuiListItemIcon-root",
509
- }
510
- }
509
+ <WithStyles(ForwardRef(ListItemIcon))
510
+ className="cozyListItemIcon"
511
511
  >
512
- <div
513
- className="MuiListItemIcon-root"
512
+ <ForwardRef(ListItemIcon)
513
+ className="cozyListItemIcon"
514
+ classes={
515
+ Object {
516
+ "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
517
+ "root": "MuiListItemIcon-root",
518
+ }
519
+ }
514
520
  >
515
- <Avatar
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
- <div
526
- className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
527
- data-testid="Avatar"
528
- style={
529
- Object {
530
- "--circleSize": "32px",
531
- "backgroundColor": "#0DCBCF",
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
- <span
536
- className="styles__c-avatar-initials___310qC"
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
- J
539
- </span>
540
- </div>
541
- </Avatar>
542
- </div>
543
- </ForwardRef(ListItemIcon)>
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
- classes={
926
- Object {
927
- "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
928
- "root": "MuiListItemIcon-root",
929
- }
930
- }
934
+ <WithStyles(ForwardRef(ListItemIcon))
935
+ className="cozyListItemIcon"
931
936
  >
932
- <div
933
- className="MuiListItemIcon-root"
937
+ <ForwardRef(ListItemIcon)
938
+ className="cozyListItemIcon"
939
+ classes={
940
+ Object {
941
+ "alignItemsFlexStart": "MuiListItemIcon-alignItemsFlexStart",
942
+ "root": "MuiListItemIcon-root",
943
+ }
944
+ }
934
945
  >
935
- <Avatar
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
- <div
946
- className="styles__c-avatar___PpDI- styles__c-avatar--text___2dvna"
947
- data-testid="Avatar"
948
- style={
949
- Object {
950
- "--circleSize": "32px",
951
- "backgroundColor": "#7F6BEE",
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
- <span
956
- className="styles__c-avatar-initials___310qC"
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
- G
959
- </span>
960
- </div>
961
- </Avatar>
962
- </div>
963
- </ForwardRef(ListItemIcon)>
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(`../locales/en.json`),
7
- fr: require(`../locales/fr.json`)
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,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)
@@ -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
- });
@@ -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