cozy-sharing 7.0.0 → 7.0.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.
- package/CHANGELOG.md +8 -0
- package/dist/ConfirmTrustedRecipientsDialog.js +1 -1
- package/dist/RefreshableSharings.spec.js +2 -2
- package/dist/ShareButton.js +1 -1
- package/dist/ShareButton.spec.js +1 -1
- package/dist/ShareButtonWithRecipients.js +3 -3
- package/dist/ShareModal.js +2 -2
- 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/SharingBanner/components/PublicBanner.js +1 -1
- package/dist/SharingBanner/components/PublicBanner.spec.js +3 -3
- package/dist/SharingBanner/components/SharingBanner.js +1 -1
- package/dist/SharingBanner/hooks/useSharingInfos.js +1 -1
- package/dist/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
- package/dist/SharingBanner/index.js +3 -3
- package/dist/SharingBanner/test/AppLike.js +6 -6
- package/dist/SharingDetailsModal.js +8 -8
- package/dist/SharingOwnerAvatar.js +1 -1
- package/dist/SharingProvider.js +2 -2
- package/dist/SharingProvider.spec.js +4 -4
- package/dist/components/ContactSuggestion.js +4 -4
- package/dist/components/ContactSuggestion.spec.js +2 -2
- package/dist/components/CozyPassFingerprintDialogContent.js +4 -4
- package/dist/components/CozyPassFingerprintDialogContent.spec.js +2 -2
- package/dist/components/EditLinkPermissionDialog.js +5 -5
- package/dist/components/EditLinkPermissionDialog.spec.js +2 -2
- package/dist/components/EditableSharingModal.js +3 -3
- package/dist/components/EditableSharingModal.spec.js +4 -4
- package/dist/components/Recipient/AvatarPlusX.js +2 -2
- package/dist/components/Recipient/Identity.js +2 -2
- package/dist/components/Recipient/LinkRecipient.js +8 -8
- package/dist/components/Recipient/LinkRecipientPermissions.js +5 -5
- package/dist/components/Recipient/OwnerIdentity.js +1 -1
- package/dist/components/Recipient/OwnerRecipient.js +2 -2
- package/dist/components/Recipient/Recipient.js +6 -6
- package/dist/components/Recipient/Recipient.spec.js +2 -2
- package/dist/components/Recipient/RecipientConfirm.js +2 -2
- package/dist/components/Recipient/RecipientPermissions.js +5 -5
- package/dist/components/Recipient/RecipientPlusX.js +2 -2
- package/dist/components/Recipient/RecipientStatus.js +3 -3
- package/dist/components/Recipient/RecipientWithoutStatus.js +1 -1
- package/dist/components/Recipient/RecipientsAvatars.js +2 -2
- package/dist/components/Recipient/RecipientsAvatars.spec.js +1 -1
- package/dist/components/ShareAutosuggest.js +5 -5
- package/dist/components/ShareAutosuggest.spec.js +1 -1
- package/dist/components/ShareButton.js +3 -3
- package/dist/components/ShareByEmail.js +6 -6
- package/dist/components/ShareByEmail.spec.js +2 -2
- package/dist/components/ShareByLink.js +7 -7
- package/dist/components/ShareDialogCozyToCozy.js +3 -3
- package/dist/components/ShareDialogCozyToCozy.spec.js +3 -3
- package/dist/components/ShareDialogOnlyByLink.js +1 -1
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +1 -1
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +3 -3
- package/dist/components/ShareModal.js +2 -2
- package/dist/components/ShareModal.spec.js +2 -2
- package/dist/components/ShareRecipientsInput.js +2 -2
- package/dist/components/ShareRecipientsInput.spec.js +1 -1
- package/dist/components/SharedBadge.js +3 -3
- package/dist/components/SharedDocuments.js +2 -2
- package/dist/components/SharedStatus.js +2 -2
- package/dist/components/SharedStatus.spec.js +1 -1
- package/dist/components/Sharesubmit.js +1 -1
- package/dist/components/Sharetypeselect.js +5 -5
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/WhoHasAccess.js +5 -5
- package/dist/components/WhoHasAccessLight.js +2 -2
- package/dist/helpers/sharings.js +1 -1
- package/dist/helpers/successMessage.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/preprocess.js +1 -0
- package/src/ConfirmTrustedRecipientsDialog.jsx +1 -1
- package/src/RefreshableSharings.spec.jsx +2 -2
- package/src/ShareButton.jsx +2 -2
- package/src/ShareButton.spec.jsx +2 -1
- package/src/ShareButtonWithRecipients.jsx +5 -3
- package/src/ShareModal.jsx +2 -2
- 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/SharingBanner/components/PublicBanner.jsx +1 -2
- package/src/SharingBanner/components/PublicBanner.spec.jsx +5 -3
- package/src/SharingBanner/components/SharingBanner.jsx +1 -1
- package/src/SharingBanner/hooks/useSharingInfos.jsx +1 -1
- package/src/SharingBanner/hooks/useSharingInfos.spec.js +1 -1
- package/src/SharingBanner/index.jsx +3 -3
- package/src/SharingBanner/test/AppLike.jsx +7 -7
- package/src/SharingDetailsModal.jsx +3 -3
- package/src/SharingOwnerAvatar.jsx +1 -1
- package/src/SharingProvider.jsx +9 -9
- package/src/SharingProvider.spec.jsx +5 -5
- package/src/components/ConfirmTrustedRecipientsDialog.jsx +1 -1
- package/src/components/ContactSuggestion.jsx +4 -4
- package/src/components/ContactSuggestion.spec.jsx +2 -2
- package/src/components/CozyPassFingerprintDialogContent.jsx +4 -5
- package/src/components/CozyPassFingerprintDialogContent.spec.jsx +2 -2
- package/src/components/EditLinkPermissionDialog.jsx +5 -5
- package/src/components/EditLinkPermissionDialog.spec.jsx +3 -2
- package/src/components/EditableSharingModal.jsx +4 -3
- package/src/components/EditableSharingModal.spec.jsx +4 -4
- package/src/components/Recipient/AvatarPlusX.jsx +2 -2
- package/src/components/Recipient/Identity.jsx +2 -2
- package/src/components/Recipient/LinkRecipient.jsx +8 -8
- package/src/components/Recipient/LinkRecipientPermissions.jsx +5 -6
- package/src/components/Recipient/OwnerIdentity.jsx +1 -1
- package/src/components/Recipient/OwnerRecipient.jsx +2 -2
- package/src/components/Recipient/Recipient.jsx +6 -6
- package/src/components/Recipient/Recipient.spec.jsx +4 -2
- package/src/components/Recipient/RecipientAvatar.jsx +1 -1
- package/src/components/Recipient/RecipientConfirm.jsx +2 -2
- package/src/components/Recipient/RecipientPermissions.jsx +6 -6
- package/src/components/Recipient/RecipientPlusX.jsx +2 -2
- package/src/components/Recipient/RecipientStatus.jsx +3 -3
- package/src/components/Recipient/RecipientWithoutStatus.jsx +1 -1
- package/src/components/Recipient/RecipientsAvatars.jsx +3 -3
- package/src/components/Recipient/RecipientsAvatars.spec.jsx +2 -1
- package/src/components/ShareAutosuggest.jsx +5 -6
- package/src/components/ShareAutosuggest.spec.jsx +1 -1
- package/src/components/ShareButton.jsx +4 -4
- package/src/components/ShareByEmail.jsx +6 -7
- package/src/components/ShareByEmail.spec.jsx +3 -2
- package/src/components/ShareByLink.jsx +8 -7
- package/src/components/ShareDialogCozyToCozy.jsx +4 -5
- package/src/components/ShareDialogCozyToCozy.spec.jsx +5 -3
- package/src/components/ShareDialogOnlyByLink.jsx +2 -1
- package/src/components/ShareDialogTwoStepsConfirmationContainer.jsx +2 -1
- package/src/components/ShareDialogTwoStepsConfirmationContainer.spec.jsx +5 -3
- package/src/components/ShareModal.jsx +3 -3
- package/src/components/ShareModal.spec.js +4 -2
- package/src/components/ShareRecipientsInput.jsx +2 -2
- package/src/components/ShareRecipientsInput.spec.jsx +1 -1
- package/src/components/SharedBadge.jsx +4 -3
- package/src/components/SharedDocuments.jsx +3 -2
- package/src/components/SharedStatus.jsx +4 -3
- package/src/components/SharedStatus.spec.js +2 -1
- package/src/components/Sharesubmit.jsx +2 -1
- package/src/components/Sharetypeselect.jsx +5 -7
- package/src/components/Tooltip.jsx +2 -1
- package/src/components/WhoHasAccess.jsx +6 -5
- package/src/components/WhoHasAccessLight.jsx +3 -3
- package/src/components/useFetchDocumentPath.jsx +1 -0
- package/src/helpers/permissions.js +1 -0
- package/src/helpers/sharings.js +1 -2
- package/src/helpers/successMessage.js +2 -1
- package/src/index.jsx +1 -1
- package/src/state.spec.js +0 -1
- package/src/withLocales.jsx +1 -0
- package/test/AppLike.jsx +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import AvatarPlusX from './AvatarPlusX';
|
|
4
|
+
import Identity from './Identity';
|
|
4
5
|
var styles = {
|
|
5
6
|
"CozyTheme--inverted": "recipient__CozyTheme--inverted___2Hb9c",
|
|
6
7
|
"CozyTheme--normal": "recipient__CozyTheme--normal___3WdEw",
|
|
@@ -21,7 +22,6 @@ var styles = {
|
|
|
21
22
|
"shake": "recipient__shake___TrWC0"
|
|
22
23
|
};
|
|
23
24
|
import { getDisplayName } from '../../models';
|
|
24
|
-
import Identity from './Identity';
|
|
25
25
|
|
|
26
26
|
var RecipientPlusX = function RecipientPlusX(_ref, _ref2) {
|
|
27
27
|
var extraRecipients = _ref.extraRecipients;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
3
|
-
import { Media, Img, Bd } from 'cozy-ui/transpiled/react/Media';
|
|
4
|
-
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
5
3
|
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
4
|
+
import EyeIcon from 'cozy-ui/transpiled/react/Icons/Eye';
|
|
6
5
|
import PaperplaneIcon from 'cozy-ui/transpiled/react/Icons/Paperplane';
|
|
7
6
|
import ToTheCloudIcon from 'cozy-ui/transpiled/react/Icons/ToTheCloud';
|
|
8
|
-
import
|
|
7
|
+
import { Media, Img, Bd } from 'cozy-ui/transpiled/react/Media';
|
|
8
|
+
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
9
9
|
var styles = {
|
|
10
10
|
"CozyTheme--inverted": "recipient__CozyTheme--inverted___2Hb9c",
|
|
11
11
|
"CozyTheme--normal": "recipient__CozyTheme--normal___3WdEw",
|
|
@@ -2,6 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
var _excluded = ["instance"];
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Avatar from 'cozy-ui/transpiled/react/Avatar';
|
|
5
|
+
import Identity from './Identity';
|
|
5
6
|
var styles = {
|
|
6
7
|
"CozyTheme--inverted": "recipient__CozyTheme--inverted___2Hb9c",
|
|
7
8
|
"CozyTheme--normal": "recipient__CozyTheme--normal___3WdEw",
|
|
@@ -22,7 +23,6 @@ var styles = {
|
|
|
22
23
|
"shake": "recipient__shake___TrWC0"
|
|
23
24
|
};
|
|
24
25
|
import { getDisplayName, getInitials } from '../../models';
|
|
25
|
-
import Identity from './Identity';
|
|
26
26
|
|
|
27
27
|
var RecipientWithoutStatus = function RecipientWithoutStatus(_ref) {
|
|
28
28
|
var instance = _ref.instance,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import cx from 'classnames';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { useClient } from 'cozy-client';
|
|
5
5
|
import Avatar from 'cozy-ui/transpiled/react/Avatar';
|
|
6
6
|
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link';
|
|
7
|
-
import RecipientAvatar from './RecipientAvatar';
|
|
8
7
|
import AvatarPlusX from './AvatarPlusX';
|
|
8
|
+
import RecipientAvatar from './RecipientAvatar';
|
|
9
9
|
var styles = {
|
|
10
10
|
"CozyTheme--inverted": "recipient__CozyTheme--inverted___2Hb9c",
|
|
11
11
|
"CozyTheme--normal": "recipient__CozyTheme--normal___3WdEw",
|
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
var _excluded = ["recipients", "link", "isOwner", "onClick"];
|
|
5
|
+
import { render } from '@testing-library/react';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { createMockClient } from 'cozy-client';
|
|
7
|
-
import { render } from '@testing-library/react';
|
|
8
8
|
import RecipientsAvatars, { MAX_DISPLAYED_RECIPIENTS, excludeMeAsOwnerFromRecipients } from './RecipientsAvatars';
|
|
9
9
|
import AppLike from '../../../test/AppLike';
|
|
10
10
|
var mockRecipients = new Array(MAX_DISPLAYED_RECIPIENTS - 1).fill({
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import React, { useState, useRef } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import React, { useState, useRef } from 'react';
|
|
5
5
|
import Autosuggest from 'react-autosuggest';
|
|
6
|
+
import Avatar from 'cozy-ui/transpiled/react/Avatar';
|
|
7
|
+
import Chip from 'cozy-ui/transpiled/react/Chips';
|
|
6
8
|
import { Spinner } from 'cozy-ui/transpiled/react/Spinner';
|
|
7
9
|
import palette from 'cozy-ui/transpiled/react/palette';
|
|
8
|
-
import
|
|
9
|
-
import Avatar from 'cozy-ui/transpiled/react/Avatar';
|
|
10
|
+
import ContactSuggestion from './ContactSuggestion';
|
|
10
11
|
var styles = {
|
|
11
12
|
"CozyTheme--inverted": "autosuggest__CozyTheme--inverted___QJCUa",
|
|
12
13
|
"CozyTheme--normal": "autosuggest__CozyTheme--normal___1-_dN",
|
|
@@ -19,10 +20,9 @@ var styles = {
|
|
|
19
20
|
"recipientsContainer": "autosuggest__recipientsContainer___15b1_",
|
|
20
21
|
"recipientChip": "autosuggest__recipientChip___oRxU-"
|
|
21
22
|
};
|
|
23
|
+
import { extractEmails, validateEmail } from '../helpers/email';
|
|
22
24
|
import { getDisplayName, getInitials, Contact } from '../models';
|
|
23
25
|
import { cozyUrlMatch, emailMatch, groupNameMatch, fullnameMatch } from '../suggestionMatchers';
|
|
24
|
-
import ContactSuggestion from './ContactSuggestion';
|
|
25
|
-
import { extractEmails, validateEmail } from '../helpers/email';
|
|
26
26
|
|
|
27
27
|
var ShareAutocomplete = function ShareAutocomplete(_ref) {
|
|
28
28
|
var loading = _ref.loading,
|
|
@@ -3,15 +3,15 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["label", "onClick", "className"],
|
|
4
4
|
_excluded2 = ["label", "onClick", "className"],
|
|
5
5
|
_excluded3 = ["label", "onClick", "className"];
|
|
6
|
-
import React from 'react';
|
|
7
6
|
import classNames from 'classnames';
|
|
7
|
+
import React from 'react';
|
|
8
8
|
import { Button } from 'cozy-ui/transpiled/react/Button';
|
|
9
|
+
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
10
|
+
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share';
|
|
9
11
|
var styles = {
|
|
10
12
|
"coz-btn-shared": "button__coz-btn-shared___2BoMk",
|
|
11
13
|
"coz-btn-sharedWithMe": "button__coz-btn-sharedWithMe___2Vjfh"
|
|
12
14
|
};
|
|
13
|
-
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share';
|
|
14
|
-
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
15
15
|
export var ShareButton = function ShareButton(_ref) {
|
|
16
16
|
var label = _ref.label,
|
|
17
17
|
_onClick = _ref.onClick,
|
|
@@ -2,17 +2,19 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
5
|
import get from 'lodash/get';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
8
|
import { useClient } from 'cozy-client';
|
|
9
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
10
9
|
import Alerter from 'cozy-ui/transpiled/react/Alerter';
|
|
10
|
+
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
11
|
+
import ShareRecipientsInput from './ShareRecipientsInput';
|
|
11
12
|
import ShareSubmit from './Sharesubmit';
|
|
12
13
|
import ShareTypeSelect from './Sharetypeselect';
|
|
14
|
+
import { getOrCreateFromArray } from '../helpers/contacts';
|
|
15
|
+
import { getSuccessMessage } from '../helpers/successMessage';
|
|
13
16
|
import { Group } from '../models';
|
|
14
17
|
import { contactsResponseType, groupsResponseType } from '../propTypes';
|
|
15
|
-
import ShareRecipientsInput from './ShareRecipientsInput';
|
|
16
18
|
var styles = {
|
|
17
19
|
"share-modal-content": "share__share-modal-content___XTtaK",
|
|
18
20
|
"coz-form": "share__coz-form___33NYF",
|
|
@@ -40,8 +42,6 @@ var styles = {
|
|
|
40
42
|
"spin": "share__spin___1P7nU",
|
|
41
43
|
"shake": "share__shake___1EeCI"
|
|
42
44
|
};
|
|
43
|
-
import { getSuccessMessage } from '../helpers/successMessage';
|
|
44
|
-
import { getOrCreateFromArray } from '../helpers/contacts';
|
|
45
45
|
import { isReadOnlySharing } from '../state';
|
|
46
46
|
export var ShareByEmail = function ShareByEmail(_ref) {
|
|
47
47
|
var contacts = _ref.contacts,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import { render, fireEvent, waitFor } from '@testing-library/react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { act } from 'react-dom/test-utils';
|
|
5
6
|
import { ShareByEmail } from './ShareByEmail';
|
|
6
7
|
import AppLike from '../../test/AppLike';
|
|
7
|
-
import { act } from 'react-dom/test-utils';
|
|
8
8
|
jest.mock('../helpers/contacts', function () {
|
|
9
9
|
return {
|
|
10
10
|
getOrCreateFromArray: function getOrCreateFromArray(client, recipients) {
|
|
@@ -7,19 +7,19 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
import React, { useState, useEffect, useCallback } from 'react';
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
10
|
import copy from 'copy-text-to-clipboard';
|
|
13
|
-
import
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
12
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
13
|
+
import Alert from 'cozy-ui/transpiled/react/Alert';
|
|
14
14
|
import Button from 'cozy-ui/transpiled/react/Buttons';
|
|
15
|
+
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
15
16
|
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
16
|
-
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link';
|
|
17
17
|
import CopyIcon from 'cozy-ui/transpiled/react/Icons/Copy';
|
|
18
|
+
import LinkIcon from 'cozy-ui/transpiled/react/Icons/Link';
|
|
18
19
|
import Snackbar from 'cozy-ui/transpiled/react/Snackbar';
|
|
19
|
-
import
|
|
20
|
-
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
21
|
-
import { isOnlyReadOnlyLinkAllowed } from '../helpers/link';
|
|
20
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints';
|
|
22
21
|
import EditLinkPermissionDialog from './EditLinkPermissionDialog';
|
|
22
|
+
import { isOnlyReadOnlyLinkAllowed } from '../helpers/link';
|
|
23
23
|
import logger from '../logger';
|
|
24
24
|
|
|
25
25
|
var ShareByLink = function ShareByLink(_ref) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["showShareByLink", "documentType", "document"];
|
|
4
|
+
import cx from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
6
7
|
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
7
|
-
import { default as DumbShareByLink } from './ShareByLink';
|
|
8
8
|
import { default as DumbShareByEmail } from './ShareByEmail';
|
|
9
|
+
import { default as DumbShareByLink } from './ShareByLink';
|
|
10
|
+
import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer';
|
|
9
11
|
import WhoHasAccess from './WhoHasAccess';
|
|
10
|
-
import cx from 'classnames';
|
|
11
12
|
var styles = {
|
|
12
13
|
"share-modal-content": "share__share-modal-content___XTtaK",
|
|
13
14
|
"coz-form": "share__coz-form___33NYF",
|
|
@@ -35,7 +36,6 @@ var styles = {
|
|
|
35
36
|
"spin": "share__spin___1P7nU",
|
|
36
37
|
"shake": "share__shake___1EeCI"
|
|
37
38
|
};
|
|
38
|
-
import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer';
|
|
39
39
|
/**
|
|
40
40
|
* Displays the sharing interface that can be used when ShareDialogCozyToCozy is in sharing state
|
|
41
41
|
*/
|
|
@@ -6,12 +6,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
|
+
import { act, render, fireEvent } from '@testing-library/react';
|
|
9
10
|
import React from 'react';
|
|
10
|
-
import
|
|
11
|
+
import { createMockClient } from 'cozy-client';
|
|
11
12
|
import { CozyPassFingerprintDialogContent } from './CozyPassFingerprintDialogContent';
|
|
13
|
+
import ShareDialogCozyToCozy from './ShareDialogCozyToCozy';
|
|
12
14
|
import AppLike from '../../test/AppLike';
|
|
13
|
-
import { createMockClient } from 'cozy-client';
|
|
14
|
-
import { act, render, fireEvent } from '@testing-library/react';
|
|
15
15
|
jest.mock('cozy-client', function () {
|
|
16
16
|
return _objectSpread(_objectSpread({}, jest.requireActual('cozy-client')), {}, {
|
|
17
17
|
useQuery: jest.fn().mockReturnValue({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Dialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
3
3
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
4
|
+
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
4
5
|
import { default as DumbShareByLink } from './ShareByLink';
|
|
5
6
|
import WhoHasAccess from './WhoHasAccess';
|
|
6
|
-
import Typography from 'cozy-ui/transpiled/react/Typography';
|
|
7
7
|
|
|
8
8
|
var ShareDialogOnlyByLink = function ShareDialogOnlyByLink(_ref) {
|
|
9
9
|
var isOwner = _ref.isOwner,
|
|
@@ -2,9 +2,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import Button from 'cozy-ui/transpiled/react/Button';
|
|
5
6
|
import { FixedDialog } from 'cozy-ui/transpiled/react/CozyDialogs';
|
|
6
7
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
7
|
-
import Button from 'cozy-ui/transpiled/react/Button';
|
|
8
8
|
import Spinner from 'cozy-ui/transpiled/react/Spinner';
|
|
9
9
|
import { useSafeState } from '../helpers/hooks';
|
|
10
10
|
/**
|
|
@@ -7,12 +7,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
7
|
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
|
|
10
|
+
import { act, render, fireEvent } from '@testing-library/react';
|
|
10
11
|
import React from 'react';
|
|
11
|
-
import
|
|
12
|
+
import { createMockClient } from 'cozy-client';
|
|
12
13
|
import { CozyPassFingerprintDialogContent } from './CozyPassFingerprintDialogContent';
|
|
14
|
+
import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer';
|
|
13
15
|
import AppLike from '../../test/AppLike';
|
|
14
|
-
import { createMockClient } from 'cozy-client';
|
|
15
|
-
import { act, render, fireEvent } from '@testing-library/react';
|
|
16
16
|
|
|
17
17
|
var FakeSharingContent = function FakeSharingContent(_ref) {
|
|
18
18
|
var recipientsToBeConfirmed = _ref.recipientsToBeConfirmed,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import flag from 'cozy-flags';
|
|
4
|
-
import { contactsResponseType, groupsResponseType } from '../propTypes';
|
|
5
4
|
import ShareDialogCozyToCozy from './ShareDialogCozyToCozy';
|
|
6
5
|
import ShareDialogOnlyByLink from './ShareDialogOnlyByLink';
|
|
6
|
+
import { contactsResponseType, groupsResponseType } from '../propTypes';
|
|
7
7
|
export var ShareModal = function ShareModal(_ref) {
|
|
8
8
|
var contacts = _ref.contacts,
|
|
9
9
|
createContact = _ref.createContact,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { render } from '@testing-library/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import flag from 'cozy-flags';
|
|
3
4
|
import { ShareModal } from './ShareModal';
|
|
4
5
|
import AppLike from '../../test/AppLike';
|
|
5
|
-
import flag from 'cozy-flags';
|
|
6
6
|
jest.mock('./ShareDialogCozyToCozy', function () {
|
|
7
7
|
return function () {
|
|
8
8
|
return /*#__PURE__*/React.createElement(React.Fragment, null, "ShareDialogCozyToCozy");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import React, { useState, useEffect } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
4
|
+
import React, { useState, useEffect } from 'react';
|
|
6
5
|
import ShareAutosuggest from './ShareAutosuggest';
|
|
6
|
+
import { contactsResponseType, groupsResponseType } from '../propTypes';
|
|
7
7
|
|
|
8
8
|
var ShareRecipientsInput = function ShareRecipientsInput(_ref) {
|
|
9
9
|
var contacts = _ref.contacts,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
5
|
+
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share';
|
|
6
|
+
import palette from 'cozy-ui/transpiled/react/palette';
|
|
5
7
|
var styles = {
|
|
6
8
|
"shared-badge": "badge__shared-badge___2QYc_",
|
|
7
9
|
"--small": "badge__--small___3i2p8",
|
|
@@ -10,8 +12,6 @@ var styles = {
|
|
|
10
12
|
"--by-me": "badge__--by-me___3zfDg",
|
|
11
13
|
"--with-me": "badge__--with-me___30u7z"
|
|
12
14
|
};
|
|
13
|
-
import palette from 'cozy-ui/transpiled/react/palette';
|
|
14
|
-
import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share';
|
|
15
15
|
|
|
16
16
|
var SharedBadge = function SharedBadge(_ref) {
|
|
17
17
|
var byMe = _ref.byMe,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
1
|
import uniq from 'lodash/uniq';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import SharingContext from '../context';
|
|
5
5
|
export var SharedDocuments = function SharedDocuments(_ref) {
|
|
6
6
|
var children = _ref.children;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
3
4
|
import palette from 'cozy-ui/transpiled/react/palette';
|
|
4
5
|
import { SharingTooltip, TooltipRecipientList } from './Tooltip';
|
|
5
|
-
import cx from 'classnames';
|
|
6
|
-
import { getDisplayName } from '../models';
|
|
7
6
|
var styles = {
|
|
8
7
|
"shared-status": "status__shared-status___J15Fy",
|
|
9
8
|
"shared-status-label": "status__shared-status-label___2AWic"
|
|
@@ -26,6 +25,7 @@ LinkIcon.defaultProps = {
|
|
|
26
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
27
26
|
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
28
27
|
};
|
|
28
|
+
import { getDisplayName } from '../models';
|
|
29
29
|
export var SharedStatus = function SharedStatus(_ref) {
|
|
30
30
|
var className = _ref.className,
|
|
31
31
|
docId = _ref.docId,
|
|
@@ -4,12 +4,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import React from 'react';
|
|
8
7
|
import cx from 'classnames';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import Icon from 'cozy-ui/transpiled/react/Icon';
|
|
11
|
+
import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom';
|
|
12
|
+
import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check';
|
|
10
13
|
import SelectBox, { components } from 'cozy-ui/transpiled/react/SelectBox';
|
|
11
14
|
import palette from 'cozy-ui/transpiled/react/palette';
|
|
12
|
-
import
|
|
15
|
+
import logger from '../logger';
|
|
13
16
|
var styles = {
|
|
14
17
|
"share-modal-content": "share__share-modal-content___XTtaK",
|
|
15
18
|
"coz-form": "share__coz-form___33NYF",
|
|
@@ -37,9 +40,6 @@ var styles = {
|
|
|
37
40
|
"spin": "share__spin___1P7nU",
|
|
38
41
|
"shake": "share__shake___1EeCI"
|
|
39
42
|
};
|
|
40
|
-
import logger from '../logger';
|
|
41
|
-
import BottomIcon from 'cozy-ui/transpiled/react/Icons/Bottom';
|
|
42
|
-
import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check';
|
|
43
43
|
|
|
44
44
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
45
45
|
return /*#__PURE__*/React.createElement(components.DropdownIndicator, props, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -10,8 +10,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
14
|
+
import React from 'react';
|
|
15
15
|
import ReactTooltip from 'react-tooltip';
|
|
16
16
|
var styles = {
|
|
17
17
|
"shared-tooltip": "tooltip__shared-tooltip___33CoC",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
5
|
-
import LinkRecipient from './Recipient/LinkRecipient';
|
|
3
|
+
import React from 'react';
|
|
6
4
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n';
|
|
7
5
|
import List from 'cozy-ui/transpiled/react/MuiCozyTheme/List';
|
|
8
|
-
import
|
|
9
|
-
import { usePrevious } from '../helpers/hooks';
|
|
6
|
+
import LinkRecipient from './Recipient/LinkRecipient';
|
|
10
7
|
import OwnerRecipient from './Recipient/OwnerRecipient';
|
|
8
|
+
import Recipient from './Recipient/Recipient';
|
|
9
|
+
import { usePrevious } from '../helpers/hooks';
|
|
10
|
+
import { filterAndReworkRecipients } from '../helpers/recipients';
|
|
11
11
|
/**
|
|
12
12
|
* Displays a warning if some contacts are waiting for confirmation of their sharing
|
|
13
13
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import cx from 'classnames';
|
|
4
|
-
import
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import RecipientPlusX from './Recipient/RecipientPlusX';
|
|
5
|
+
import RecipientWithoutStatus from './Recipient/RecipientWithoutStatus';
|
|
6
6
|
var styles = {};
|
|
7
7
|
var MAX_DISPLAYED_RECIPIENTS = 2;
|
|
8
8
|
|
package/dist/helpers/sharings.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { Q } from 'cozy-client';
|
|
4
|
+
import { fetchFilesPaths } from './files';
|
|
4
5
|
import { updateInternalObjectFromRealtime, normalizeDocFromRealtime } from './realtime';
|
|
5
6
|
import { addSharing, updateSharing } from '../state';
|
|
6
|
-
import { fetchFilesPaths } from './files';
|
|
7
7
|
export var getSharingObject = function getSharingObject(internalSharing, sharing) {
|
|
8
8
|
if (internalSharing) {
|
|
9
9
|
return updateInternalObjectFromRealtime(internalSharing, sharing);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Contact } from '../models';
|
|
2
1
|
import { models } from 'cozy-client';
|
|
2
|
+
import { Contact } from '../models';
|
|
3
3
|
export var countNewRecipients = function countNewRecipients(currentRecipients, newRecipients) {
|
|
4
4
|
return newRecipients.filter(function (contact) {
|
|
5
5
|
var email = models.contact.getPrimaryEmail(contact);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import SharingProvider from './SharingProvider';
|
|
1
2
|
import SharingContext from './context';
|
|
2
3
|
import withLocales from './withLocales';
|
|
3
|
-
import SharingProvider from './SharingProvider';
|
|
4
4
|
export default SharingProvider;
|
|
5
5
|
export { SharingContext, withLocales };
|
|
6
6
|
export { SharedDocument } from './SharedDocument';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-sharing",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Provides sharing login for React applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "Cozy",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"sideEffects": [
|
|
62
62
|
"*.css"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "ac43bba079492607aa8af9bd337e5c8bb1b00364"
|
|
65
65
|
}
|
package/preprocess.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
+
import { default as DumbConfirmTrustedRecipientsDialog } from './components/ConfirmTrustedRecipientsDialog'
|
|
3
4
|
import SharingContext from './context'
|
|
4
5
|
import withLocales from './withLocales'
|
|
5
|
-
import { default as DumbConfirmTrustedRecipientsDialog } from './components/ConfirmTrustedRecipientsDialog'
|
|
6
6
|
|
|
7
7
|
export const ConfirmTrustedRecipientsDialog = withLocales(
|
|
8
8
|
({ document, ...rest }) => (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { mount } from 'enzyme'
|
|
2
|
+
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { createMockClient } from 'cozy-client'
|
|
5
5
|
|
|
6
|
-
import AppLike from '../test/AppLike'
|
|
7
6
|
import { RefreshableSharings } from './RefreshableSharings'
|
|
8
7
|
import { SharingProvider } from './SharingProvider'
|
|
8
|
+
import AppLike from '../test/AppLike'
|
|
9
9
|
|
|
10
10
|
const DumbComponent = () => {
|
|
11
11
|
return <div>test </div>
|
package/src/ShareButton.jsx
CHANGED
|
@@ -2,13 +2,13 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
|
|
4
4
|
|
|
5
|
-
import SharingContext from './context'
|
|
6
|
-
import withLocales from './withLocales'
|
|
7
5
|
import {
|
|
8
6
|
default as DumbShareButton,
|
|
9
7
|
SharedByMeButton,
|
|
10
8
|
SharedWithMeButton
|
|
11
9
|
} from './components/ShareButton'
|
|
10
|
+
import SharingContext from './context'
|
|
11
|
+
import withLocales from './withLocales'
|
|
12
12
|
|
|
13
13
|
export const ShareButton = withLocales(({ docId, useShortLabel, ...rest }) => {
|
|
14
14
|
const { t } = useI18n()
|
package/src/ShareButton.spec.jsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import Grid from 'cozy-ui/transpiled/react/MuiCozyTheme/Grid'
|
|
4
|
+
import Skeleton from 'cozy-ui/transpiled/react/Skeleton'
|
|
5
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
|
|
6
|
+
|
|
2
7
|
import { ShareButton } from './ShareButton'
|
|
3
8
|
import { SharedRecipients } from './SharedRecipients'
|
|
4
|
-
import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
|
|
5
9
|
import SharingContext from './context'
|
|
6
|
-
import Grid from 'cozy-ui/transpiled/react/MuiCozyTheme/Grid'
|
|
7
|
-
import Skeleton from 'cozy-ui/transpiled/react/Skeleton'
|
|
8
10
|
|
|
9
11
|
export const ShareButtonWithRecipients = ({ docId, onClick, ...props }) => {
|
|
10
12
|
const { isMobile } = useBreakpoints()
|
package/src/ShareModal.jsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import omit from 'lodash/omit'
|
|
2
|
+
import React from 'react'
|
|
3
3
|
import { useLocation } from 'react-router'
|
|
4
4
|
|
|
5
|
+
import { SharingDetailsModal } from './SharingDetailsModal'
|
|
5
6
|
import EditableSharingModal from './components/EditableSharingModal'
|
|
6
7
|
import SharingContext from './context'
|
|
7
8
|
import withLocales from './withLocales'
|
|
8
|
-
import { SharingDetailsModal } from './SharingDetailsModal'
|
|
9
9
|
|
|
10
10
|
const SharingModal = ({ document, ...rest }) => (
|
|
11
11
|
<SharingContext.Consumer>
|