cozy-sharing 10.3.0 → 10.4.1

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 (32) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/Recipient/Identity.js +0 -2
  3. package/dist/components/Recipient/LinkRecipient.js +0 -2
  4. package/dist/components/Recipient/OwnerIdentity.js +0 -2
  5. package/dist/components/Recipient/RecipientConfirm.js +1 -5
  6. package/dist/components/Recipient/RecipientPlusX.js +0 -2
  7. package/dist/components/Recipient/RecipientStatus.js +0 -2
  8. package/dist/components/Recipient/RecipientWithoutStatus.js +0 -2
  9. package/dist/components/Recipient/RecipientsAvatars.js +0 -2
  10. package/dist/components/ShareAutosuggest.js +0 -2
  11. package/dist/components/ShareByEmail.js +1 -5
  12. package/dist/components/ShareDialogCozyToCozy.js +1 -5
  13. package/dist/components/ShareModal/SharingDetailsModal.js +1 -5
  14. package/dist/components/Sharetypeselect.js +1 -5
  15. package/dist/components/SharingBanner/components/PublicBanner.js +1 -1
  16. package/dist/components/WhoHasAccessLight.js +0 -2
  17. package/dist/helpers/files.js +10 -0
  18. package/dist/hooks/useFetchDocumentPath.js +18 -8
  19. package/dist/styles/actionmenu.styl +0 -2
  20. package/dist/styles/autosuggest.styl +1 -4
  21. package/dist/styles/recipient.styl +0 -1
  22. package/dist/styles/share.styl +0 -1
  23. package/dist/stylesheet.css +64 -2485
  24. package/package.json +8 -7
  25. package/src/components/SharingBanner/components/PublicBanner.jsx +1 -1
  26. package/src/components/__snapshots__/ContactSuggestion.spec.jsx.snap +120 -105
  27. package/src/helpers/files.js +9 -0
  28. package/src/hooks/useFetchDocumentPath.jsx +4 -0
  29. package/src/styles/actionmenu.styl +0 -2
  30. package/src/styles/autosuggest.styl +1 -4
  31. package/src/styles/recipient.styl +0 -1
  32. package/src/styles/share.styl +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.4.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@10.4.0...cozy-sharing@10.4.1) (2024-03-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Remove scenario where sharingModal lose state ([43e583a](https://github.com/cozy/cozy-libs/commit/43e583a64855898c009972c52d66efc408c3d1d4))
12
+
13
+
14
+
15
+
16
+
17
+ # [10.4.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@10.3.0...cozy-sharing@10.4.0) (2024-02-29)
18
+
19
+
20
+ ### Features
21
+
22
+ * **sharing:** Upgrade cozy-ui and cozy-client ([f09507c](https://github.com/cozy/cozy-libs/commit/f09507c6cdd89ec9907f60cd50310a498bcd984f))
23
+
24
+
25
+
26
+
27
+
6
28
  # 10.3.0 (2024-02-29)
7
29
 
8
30
 
@@ -2,8 +2,6 @@ import classNames from 'classnames';
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
4
  var styles = {
5
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
6
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
7
5
  "recipient": "recipient__recipient___2DmZI",
8
6
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
9
7
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -14,8 +14,6 @@ import LinkRecipientPermissions from './LinkRecipientPermissions';
14
14
  import RecipientConfirm from './RecipientConfirm';
15
15
  import { FADE_IN_DURATION } from '../../helpers/recipients';
16
16
  var styles = {
17
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
18
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
19
17
  "recipient": "recipient__recipient___2DmZI",
20
18
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
21
19
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -5,8 +5,6 @@ import Avatar from 'cozy-ui/transpiled/react/Avatar';
5
5
  import Identity from './Identity';
6
6
  import { getDisplayName, getInitials } from '../../models';
7
7
  var styles = {
8
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
9
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
10
8
  "recipient": "recipient__recipient___2DmZI",
11
9
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
12
10
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -14,8 +14,6 @@ var modalStyles = {
14
14
  "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
15
15
  "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
16
16
  "error": "share__error___pwqPO",
17
- "CozyTheme--inverted": "share__CozyTheme--inverted___oxix3",
18
- "CozyTheme--normal": "share__CozyTheme--normal___2PCy8",
19
17
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
20
18
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
21
19
  "share-type-control": "share__share-type-control___1YoRr",
@@ -25,9 +23,7 @@ var modalStyles = {
25
23
  "select-option-desc": "share__select-option-desc___3jOnr",
26
24
  "share-details-created": "share__share-details-created___z3nvO",
27
25
  "share-details-perm": "share__share-details-perm___3HjxK",
28
- "share-details-perm-desc": "share__share-details-perm-desc___3HyHu",
29
- "spin": "share__spin___hhtoM",
30
- "shake": "share__shake___2au1o"
26
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
31
27
  };
32
28
  /**
33
29
  * Displays the confirmation interface that allows to confirm or reject a recipient
@@ -4,8 +4,6 @@ import AvatarPlusX from './AvatarPlusX';
4
4
  import Identity from './Identity';
5
5
  import { getDisplayName } from '../../models';
6
6
  var styles = {
7
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
8
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
9
7
  "recipient": "recipient__recipient___2DmZI",
10
8
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
11
9
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -7,8 +7,6 @@ import Typography from 'cozy-ui/transpiled/react/Typography';
7
7
  import { Media, Img, Bd } from 'cozy-ui/transpiled/react/deprecated/Media';
8
8
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n';
9
9
  var styles = {
10
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
11
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
12
10
  "recipient": "recipient__recipient___2DmZI",
13
11
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
14
12
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -5,8 +5,6 @@ import Avatar from 'cozy-ui/transpiled/react/Avatar';
5
5
  import Identity from './Identity';
6
6
  import { getDisplayName, getInitials } from '../../models';
7
7
  var styles = {
8
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
9
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
10
8
  "recipient": "recipient__recipient___2DmZI",
11
9
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
12
10
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -8,8 +8,6 @@ import AvatarPlusX from './AvatarPlusX';
8
8
  import RecipientAvatar from './RecipientAvatar';
9
9
  import { getDisplayName } from '../../models';
10
10
  var styles = {
11
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
12
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
13
11
  "recipient": "recipient__recipient___2DmZI",
14
12
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
15
13
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -11,8 +11,6 @@ import ContactSuggestion from './ContactSuggestion';
11
11
  import { extractEmails, validateEmail } from '../helpers/email';
12
12
  import { getDisplayName, getInitials, Contact } from '../models';
13
13
  var styles = {
14
- "CozyTheme--inverted": "autosuggest__CozyTheme--inverted___3qp6I",
15
- "CozyTheme--normal": "autosuggest__CozyTheme--normal___3fMAz",
16
14
  "container": "autosuggest__container___1Yro7",
17
15
  "suggestionsContainer": "autosuggest__suggestionsContainer___3EDuG",
18
16
  "suggestionsContainerOpen": "autosuggest__suggestionsContainerOpen___35OCI",
@@ -30,8 +30,6 @@ var styles = {
30
30
  "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
31
31
  "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
32
32
  "error": "share__error___pwqPO",
33
- "CozyTheme--inverted": "share__CozyTheme--inverted___oxix3",
34
- "CozyTheme--normal": "share__CozyTheme--normal___2PCy8",
35
33
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
36
34
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
37
35
  "share-type-control": "share__share-type-control___1YoRr",
@@ -41,9 +39,7 @@ var styles = {
41
39
  "select-option-desc": "share__select-option-desc___3jOnr",
42
40
  "share-details-created": "share__share-details-created___z3nvO",
43
41
  "share-details-perm": "share__share-details-perm___3HjxK",
44
- "share-details-perm-desc": "share__share-details-perm-desc___3HyHu",
45
- "spin": "share__spin___hhtoM",
46
- "shake": "share__shake___2au1o"
42
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
47
43
  };
48
44
  export var ShareByEmail = function ShareByEmail(_ref) {
49
45
  var contacts = _ref.contacts,
@@ -21,8 +21,6 @@ var styles = {
21
21
  "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
22
22
  "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
23
23
  "error": "share__error___pwqPO",
24
- "CozyTheme--inverted": "share__CozyTheme--inverted___oxix3",
25
- "CozyTheme--normal": "share__CozyTheme--normal___2PCy8",
26
24
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
27
25
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
28
26
  "share-type-control": "share__share-type-control___1YoRr",
@@ -32,9 +30,7 @@ var styles = {
32
30
  "select-option-desc": "share__select-option-desc___3jOnr",
33
31
  "share-details-created": "share__share-details-created___z3nvO",
34
32
  "share-details-perm": "share__share-details-perm___3HjxK",
35
- "share-details-perm-desc": "share__share-details-perm-desc___3HyHu",
36
- "spin": "share__spin___hhtoM",
37
- "shake": "share__shake___2au1o"
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
@@ -16,8 +16,6 @@ var styles = {
16
16
  "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
17
17
  "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
18
18
  "error": "share__error___pwqPO",
19
- "CozyTheme--inverted": "share__CozyTheme--inverted___oxix3",
20
- "CozyTheme--normal": "share__CozyTheme--normal___2PCy8",
21
19
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
22
20
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
23
21
  "share-type-control": "share__share-type-control___1YoRr",
@@ -27,9 +25,7 @@ var styles = {
27
25
  "select-option-desc": "share__select-option-desc___3jOnr",
28
26
  "share-details-created": "share__share-details-created___z3nvO",
29
27
  "share-details-perm": "share__share-details-perm___3HjxK",
30
- "share-details-perm-desc": "share__share-details-perm-desc___3HyHu",
31
- "spin": "share__spin___hhtoM",
32
- "shake": "share__shake___2au1o"
28
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
33
29
  };
34
30
  import OwnerIdentity from '../Recipient/OwnerIdentity';
35
31
  import WhoHasAccess from '../WhoHasAccess';
@@ -25,8 +25,6 @@ var styles = {
25
25
  "coz-form-controls--full": "share__coz-form-controls--full___1oQXF",
26
26
  "coz-form-controls--dispatch": "share__coz-form-controls--dispatch___1zIxt",
27
27
  "error": "share__error___pwqPO",
28
- "CozyTheme--inverted": "share__CozyTheme--inverted___oxix3",
29
- "CozyTheme--normal": "share__CozyTheme--normal___2PCy8",
30
28
  "share-byemail-onlybylink": "share__share-byemail-onlybylink___29W-t",
31
29
  "aligned-dropdown-button": "share__aligned-dropdown-button___3crgG",
32
30
  "share-type-control": "share__share-type-control___1YoRr",
@@ -36,9 +34,7 @@ var styles = {
36
34
  "select-option-desc": "share__select-option-desc___3jOnr",
37
35
  "share-details-created": "share__share-details-created___z3nvO",
38
36
  "share-details-perm": "share__share-details-perm___3HjxK",
39
- "share-details-perm-desc": "share__share-details-perm-desc___3HyHu",
40
- "spin": "share__spin___hhtoM",
41
- "shake": "share__shake___2au1o"
37
+ "share-details-perm-desc": "share__share-details-perm-desc___3HyHu"
42
38
  };
43
39
 
44
40
  var DropdownIndicator = function DropdownIndicator(props) {
@@ -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
  };
@@ -4,8 +4,6 @@ import React from 'react';
4
4
  import RecipientPlusX from './Recipient/RecipientPlusX';
5
5
  import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus';
6
6
  var styles = {
7
- "CozyTheme--inverted": "recipient__CozyTheme--inverted___21SPM",
8
- "CozyTheme--normal": "recipient__CozyTheme--normal___3ABO0",
9
7
  "recipient": "recipient__recipient___2DmZI",
10
8
  "recipients-list-light": "recipient__recipients-list-light___Vq4op",
11
9
  "recipient-idents": "recipient__recipient-idents___3s7rw",
@@ -1,5 +1,15 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+
4
+ /**
5
+ * Fetches the file paths for the given files.
6
+ * Should not be used for directories.
7
+ *
8
+ * @param {Object} client - The cozy-client instance.
9
+ * @param {string} doctype - The type of document.
10
+ * @param {Array} files - The array of files.
11
+ * @returns {Promise<Array>} - The array of file paths.
12
+ */
3
13
  export var fetchFilesPaths = /*#__PURE__*/function () {
4
14
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(client, doctype, files) {
5
15
  var parentDirIds, parentDirs, filePaths;
@@ -13,30 +13,40 @@ export var useFetchDocumentPath = function useFetchDocumentPath(client, document
13
13
  ;
14
14
 
15
15
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
16
- var path;
16
+ var isDirectory, path;
17
17
  return _regeneratorRuntime.wrap(function _callee$(_context) {
18
18
  while (1) switch (_context.prev = _context.next) {
19
19
  case 0:
20
20
  _context.prev = 0;
21
- _context.next = 3;
21
+ isDirectory = document.type === 'directory';
22
+
23
+ if (!isDirectory) {
24
+ _context.next = 4;
25
+ break;
26
+ }
27
+
28
+ return _context.abrupt("return", setDocumentPath(document.path));
29
+
30
+ case 4:
31
+ _context.next = 6;
22
32
  return fetchFilesPaths(client, document._type, [document]);
23
33
 
24
- case 3:
34
+ case 6:
25
35
  path = _context.sent;
26
36
  setDocumentPath(path[0]); // eslint-disable-next-line
27
37
 
28
- _context.next = 9;
38
+ _context.next = 12;
29
39
  break;
30
40
 
31
- case 7:
32
- _context.prev = 7;
41
+ case 10:
42
+ _context.prev = 10;
33
43
  _context.t0 = _context["catch"](0);
34
44
 
35
- case 9:
45
+ case 12:
36
46
  case "end":
37
47
  return _context.stop();
38
48
  }
39
- }, _callee, null, [[0, 7]]);
49
+ }, _callee, null, [[0, 10]]);
40
50
  }))();
41
51
  }, [client, document]);
42
52
  return documentPath;
@@ -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)
@@ -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)