@atlaskit/share 2.0.0 → 3.0.2
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 +24 -0
- package/dist/cjs/clients/ShareServiceClient.js +1 -7
- package/dist/cjs/components/CommentField.js +5 -4
- package/dist/cjs/components/CopyLinkButton.js +20 -11
- package/dist/cjs/components/ErrorBoundary.js +2 -0
- package/dist/cjs/components/IntegrationForm.js +7 -2
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +3 -3
- package/dist/cjs/components/LazyShareForm/lazy.js +2 -2
- package/dist/cjs/components/ShareButton.js +2 -2
- package/dist/cjs/components/ShareDialogContainer.js +9 -8
- package/dist/cjs/components/ShareDialogWithTrigger.js +12 -10
- package/dist/cjs/components/ShareForm.js +28 -9
- package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +2 -2
- package/dist/cjs/components/UserPickerField.js +8 -7
- package/dist/cjs/components/utils.js +2 -5
- package/dist/cjs/i18n.js +0 -10
- package/dist/cjs/types/ShareEntities.js +10 -1
- package/dist/cjs/types/index.js +9 -1
- package/dist/cjs/util/i18n-util.js +3 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/ShareServiceClient.js +1 -7
- package/dist/es2019/components/CommentField.js +3 -2
- package/dist/es2019/components/CopyLinkButton.js +15 -7
- package/dist/es2019/components/ErrorBoundary.js +2 -0
- package/dist/es2019/components/IntegrationForm.js +4 -2
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +2 -2
- package/dist/es2019/components/LazyShareForm/lazy.js +2 -2
- package/dist/es2019/components/MessagesIntlProvider.js +1 -1
- package/dist/es2019/components/ShareButton.js +1 -1
- package/dist/es2019/components/ShareDialogContainer.js +6 -5
- package/dist/es2019/components/ShareDialogWithTrigger.js +11 -7
- package/dist/es2019/components/ShareForm.js +23 -6
- package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
- package/dist/es2019/components/UserPickerField.js +5 -4
- package/dist/es2019/components/utils.js +1 -3
- package/dist/es2019/i18n.js +0 -10
- package/dist/es2019/types/ShareEntities.js +7 -1
- package/dist/es2019/types/index.js +2 -1
- package/dist/es2019/util/i18n-util.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +1 -7
- package/dist/esm/components/CommentField.js +3 -2
- package/dist/esm/components/CopyLinkButton.js +15 -7
- package/dist/esm/components/ErrorBoundary.js +2 -0
- package/dist/esm/components/IntegrationForm.js +7 -2
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +2 -2
- package/dist/esm/components/LazyShareForm/lazy.js +2 -2
- package/dist/esm/components/MessagesIntlProvider.js +1 -1
- package/dist/esm/components/ShareButton.js +1 -1
- package/dist/esm/components/ShareDialogContainer.js +6 -5
- package/dist/esm/components/ShareDialogWithTrigger.js +11 -7
- package/dist/esm/components/ShareForm.js +25 -5
- package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
- package/dist/esm/components/UserPickerField.js +5 -4
- package/dist/esm/components/utils.js +1 -3
- package/dist/esm/i18n.js +0 -10
- package/dist/esm/types/ShareEntities.js +7 -1
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/util/i18n-util.js +3 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/ShareServiceClient.d.ts +2 -2
- package/dist/types/components/CopyLinkButton.d.ts +1 -1
- package/dist/types/components/IntegrationForm.d.ts +2 -1
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
- package/dist/types/components/ShareButton.d.ts +1 -1
- package/dist/types/components/ShareDialogContainer.d.ts +3 -4
- package/dist/types/components/ShareDialogWithTrigger.d.ts +2 -2
- package/dist/types/components/ShareForm.d.ts +4 -1
- package/dist/types/components/UserPickerField.d.ts +1 -1
- package/dist/types/i18n.d.ts +0 -10
- package/dist/types/types/ShareDialogContainer.d.ts +4 -9
- package/dist/types/types/ShareEntities.d.ts +5 -0
- package/dist/types/types/ShareForm.d.ts +2 -2
- package/dist/types/types/index.d.ts +1 -0
- package/docs/0-intro.tsx +4 -4
- package/package.json +24 -2
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { isSafari } from 'react-device-detect';
|
|
5
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
6
|
+
import styled from 'styled-components';
|
|
3
7
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
4
8
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
5
9
|
import Popup from '@atlaskit/popup';
|
|
6
10
|
import { G300 } from '@atlaskit/theme/colors';
|
|
7
11
|
import { layers } from '@atlaskit/theme/constants';
|
|
8
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
11
|
-
import styled from 'styled-components';
|
|
12
|
-
import Button from './styles';
|
|
13
13
|
import { messages } from '../i18n';
|
|
14
14
|
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
15
|
+
import Button from './styles';
|
|
15
16
|
const Z_INDEX = layers.modal();
|
|
16
17
|
const AUTO_DISMISS_SECONDS = 8;
|
|
17
18
|
export const AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
@@ -29,10 +30,13 @@ export const HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden in
|
|
|
29
30
|
position: 'absolute',
|
|
30
31
|
left: '-9999px'
|
|
31
32
|
},
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
"aria-hidden": true,
|
|
32
35
|
ref: ref,
|
|
33
36
|
value: props.text,
|
|
34
37
|
readOnly: true
|
|
35
38
|
}));
|
|
39
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
36
40
|
export class CopyLinkButton extends React.Component {
|
|
37
41
|
constructor(...args) {
|
|
38
42
|
super(...args);
|
|
@@ -86,10 +90,11 @@ export class CopyLinkButton extends React.Component {
|
|
|
86
90
|
isPublicLink
|
|
87
91
|
} = this.props;
|
|
88
92
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
93
|
+
"aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
89
94
|
isDisabled: isDisabled,
|
|
90
95
|
appearance: "subtle-link",
|
|
91
96
|
iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
92
|
-
label:
|
|
97
|
+
label: "",
|
|
93
98
|
size: "medium"
|
|
94
99
|
}),
|
|
95
100
|
onClick: this.handleClick
|
|
@@ -111,13 +116,16 @@ export class CopyLinkButton extends React.Component {
|
|
|
111
116
|
},
|
|
112
117
|
copyTooltipText
|
|
113
118
|
} = this.props;
|
|
114
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
119
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari && /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "assistive",
|
|
121
|
+
"aria-live": "assertive"
|
|
122
|
+
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), /*#__PURE__*/React.createElement(HiddenInput, {
|
|
115
123
|
ref: this.inputRef,
|
|
116
124
|
text: this.props.link
|
|
117
125
|
}), /*#__PURE__*/React.createElement(Popup, {
|
|
118
126
|
zIndex: Z_INDEX,
|
|
119
127
|
content: () => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
120
|
-
label:
|
|
128
|
+
label: "",
|
|
121
129
|
primaryColor: G300
|
|
122
130
|
}), /*#__PURE__*/React.createElement(MessageSpan, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.copiedToClipboardMessage)))),
|
|
123
131
|
isOpen: shouldShowCopiedMessage,
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { CHANNEL_ID, errorEncountered } from './analytics';
|
|
5
5
|
|
|
6
|
+
// ErrorBoundary does not support in functional component
|
|
7
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
6
8
|
class ErrorBoundary extends React.Component {
|
|
7
9
|
constructor(...args) {
|
|
8
10
|
super(...args);
|
|
@@ -31,7 +31,9 @@ export const FormWrapper = styled.div`
|
|
|
31
31
|
`;
|
|
32
32
|
export const IntegrationForm = ({
|
|
33
33
|
Content,
|
|
34
|
-
onIntegrationClose = () => undefined
|
|
34
|
+
onIntegrationClose = () => undefined,
|
|
35
|
+
changeTab = () => undefined
|
|
35
36
|
}) => /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
|
|
36
|
-
onClose: onIntegrationClose
|
|
37
|
+
onClose: onIntegrationClose,
|
|
38
|
+
changeTab: changeTab
|
|
37
39
|
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import { ShareForm } from '../ShareForm';
|
|
4
3
|
import { ANALYTICS_SOURCE } from '../analytics';
|
|
5
4
|
import { IntegrationForm } from '../IntegrationForm';
|
|
6
|
-
import {
|
|
5
|
+
import { ShareForm } from '../ShareForm';
|
|
7
6
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
7
|
+
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A Share form content which is lazy-loaded.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
|
-
import { SpinnerWrapper } from './styled';
|
|
5
4
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
5
|
+
import { SpinnerWrapper } from './styled';
|
|
6
6
|
const LazyShareFormLazy = lazyForPaint(() => import(
|
|
7
7
|
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
8
8
|
'./LazyShareForm'), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import Button from '@atlaskit/button/custom-theme-button';
|
|
4
4
|
export const ShareButton = /*#__PURE__*/React.forwardRef(function ShareButton({
|
|
5
5
|
text,
|
|
6
6
|
...props
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
-
import memoizeOne from 'memoize-one';
|
|
4
2
|
import React from 'react';
|
|
3
|
+
import deepEqual from 'fast-deep-equal';
|
|
4
|
+
import memoizeOne from 'memoize-one';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import assert from 'tiny-invariant';
|
|
7
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
8
|
import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerClient';
|
|
8
9
|
import { ShareServiceClient } from '../clients/ShareServiceClient';
|
|
9
10
|
import { messages } from '../i18n';
|
|
10
11
|
import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics';
|
|
12
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
11
13
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
12
14
|
import { ShareDialogWithTrigger } from './ShareDialogWithTrigger';
|
|
13
15
|
import { optionDataToUsers } from './utils';
|
|
14
|
-
import ErrorBoundary from './ErrorBoundary';
|
|
15
|
-
import deepEqual from 'fast-deep-equal';
|
|
16
16
|
const COPY_LINK_EVENT = copyLinkButtonClicked(0);
|
|
17
17
|
export const defaultConfig = {
|
|
18
18
|
disableSharingToEmails: false
|
|
@@ -26,6 +26,7 @@ function getCurrentPageUrl() {
|
|
|
26
26
|
* This component serves as a Provider to provide customizable implementations
|
|
27
27
|
* to ShareDialogTrigger component
|
|
28
28
|
*/
|
|
29
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
export class ShareDialogContainerInternal extends React.Component {
|
|
@@ -53,7 +54,7 @@ export class ShareDialogContainerInternal extends React.Component {
|
|
|
53
54
|
isFetchingConfig: true
|
|
54
55
|
}, async () => {
|
|
55
56
|
try {
|
|
56
|
-
const config = await this.shareClient.getConfig(this.props.cloudId
|
|
57
|
+
const config = await this.shareClient.getConfig(this.props.cloudId);
|
|
57
58
|
|
|
58
59
|
if (this._isMounted) {
|
|
59
60
|
this.setState({
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
5
|
+
import styled from 'styled-components';
|
|
4
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
-
import SplitButton from './SplitButton';
|
|
6
7
|
import ShareIcon from '@atlaskit/icon/glyph/share';
|
|
7
8
|
import Popup from '@atlaskit/popup';
|
|
8
9
|
import Portal from '@atlaskit/portal';
|
|
9
|
-
import Aktooltip from '@atlaskit/tooltip';
|
|
10
10
|
import { layers } from '@atlaskit/theme/constants';
|
|
11
|
-
import
|
|
12
|
-
import styled from 'styled-components';
|
|
11
|
+
import Aktooltip from '@atlaskit/tooltip';
|
|
13
12
|
import { messages } from '../i18n';
|
|
14
13
|
import { OBJECT_SHARED } from '../types';
|
|
15
|
-
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked,
|
|
14
|
+
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
|
|
15
|
+
} from './analytics'; // eslint-disable-next-line no-duplicate-imports
|
|
16
|
+
|
|
17
|
+
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
16
18
|
import ShareButton from './ShareButton';
|
|
19
|
+
import SplitButton from './SplitButton';
|
|
17
20
|
import { generateSelectZIndex } from './utils';
|
|
18
|
-
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
19
21
|
const ShareButtonWrapper = styled.div`
|
|
20
22
|
display: inline-flex;
|
|
21
23
|
outline: none;
|
|
@@ -27,6 +29,7 @@ export const defaultShareContentState = {
|
|
|
27
29
|
value: ''
|
|
28
30
|
}
|
|
29
31
|
};
|
|
32
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
33
|
export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
31
34
|
constructor(...args) {
|
|
32
35
|
super(...args);
|
|
@@ -308,9 +311,10 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
308
311
|
button = /*#__PURE__*/React.createElement(ShareButton, _extends({
|
|
309
312
|
appearance: triggerButtonAppearance,
|
|
310
313
|
text: triggerButtonStyle !== 'icon-only' ? /*#__PURE__*/React.createElement(FormattedMessage, messages.shareTriggerButtonText) : null,
|
|
314
|
+
"aria-label": formatMessage(messages.shareTriggerButtonText),
|
|
311
315
|
onClick: this.onTriggerClick,
|
|
312
316
|
iconBefore: triggerButtonStyle !== 'text-only' ? /*#__PURE__*/React.createElement(ShareButtonIcon, {
|
|
313
|
-
label:
|
|
317
|
+
label: ""
|
|
314
318
|
}) : undefined,
|
|
315
319
|
isSelected: isDialogOpen,
|
|
316
320
|
isDisabled: isDisabled
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
5
|
+
import styled from 'styled-components';
|
|
4
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
7
|
import Form from '@atlaskit/form';
|
|
6
8
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
9
|
+
import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
|
|
7
10
|
import { R400 } from '@atlaskit/theme/colors';
|
|
8
11
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
|
|
11
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
12
|
-
import styled from 'styled-components';
|
|
13
13
|
import { messages } from '../i18n';
|
|
14
|
+
import { TabType } from '../types';
|
|
14
15
|
import { CommentField } from './CommentField';
|
|
15
16
|
import CopyLinkButton from './CopyLinkButton';
|
|
17
|
+
import { IntegrationForm } from './IntegrationForm';
|
|
16
18
|
import { ShareHeader } from './ShareHeader';
|
|
17
19
|
import { UserPickerField } from './UserPickerField';
|
|
18
|
-
import { IntegrationForm } from './IntegrationForm';
|
|
19
20
|
const SubmitButtonWrapper = styled.div`
|
|
20
21
|
display: flex;
|
|
21
22
|
margin-left: auto;
|
|
@@ -60,10 +61,15 @@ const integrationTabText = integrationName => /*#__PURE__*/React.createElement(F
|
|
|
60
61
|
}
|
|
61
62
|
}));
|
|
62
63
|
|
|
64
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
63
65
|
class InternalForm extends React.PureComponent {
|
|
64
66
|
constructor(...args) {
|
|
65
67
|
super(...args);
|
|
66
68
|
|
|
69
|
+
_defineProperty(this, "state", {
|
|
70
|
+
selectedTab: TabType.default
|
|
71
|
+
});
|
|
72
|
+
|
|
67
73
|
_defineProperty(this, "renderShareForm", () => {
|
|
68
74
|
const {
|
|
69
75
|
formProps,
|
|
@@ -164,6 +170,12 @@ class InternalForm extends React.PureComponent {
|
|
|
164
170
|
};
|
|
165
171
|
return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
|
|
166
172
|
});
|
|
173
|
+
|
|
174
|
+
_defineProperty(this, "changeTab", tab => {
|
|
175
|
+
this.setState({
|
|
176
|
+
selectedTab: tab
|
|
177
|
+
});
|
|
178
|
+
});
|
|
167
179
|
}
|
|
168
180
|
|
|
169
181
|
componentWillUnmount() {
|
|
@@ -195,8 +207,10 @@ class InternalForm extends React.PureComponent {
|
|
|
195
207
|
return /*#__PURE__*/React.createElement(Tabs, {
|
|
196
208
|
id: "ShareForm-Tabs-Integrations",
|
|
197
209
|
onChange: index => {
|
|
210
|
+
this.changeTab(index);
|
|
198
211
|
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
199
|
-
}
|
|
212
|
+
},
|
|
213
|
+
selected: this.state.selectedTab
|
|
200
214
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
201
215
|
key: `share-tab-default`
|
|
202
216
|
}, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
|
|
@@ -211,7 +225,10 @@ class InternalForm extends React.PureComponent {
|
|
|
211
225
|
isMainShare: false
|
|
212
226
|
}, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
213
227
|
Content: firstIntegration.Content,
|
|
214
|
-
onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog()
|
|
228
|
+
onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
|
|
229
|
+
changeTab: index => {
|
|
230
|
+
this.changeTab(index);
|
|
231
|
+
}
|
|
215
232
|
}))));
|
|
216
233
|
}
|
|
217
234
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InlineDialogFormWrapper, InlineDialogContentWrapper } from './styled';
|
|
3
2
|
import { ShareHeader } from '../ShareHeader';
|
|
3
|
+
import { InlineDialogContentWrapper, InlineDialogFormWrapper } from './styled';
|
|
4
4
|
|
|
5
5
|
const ShareFormWrapper = ({
|
|
6
6
|
shareFormTitle,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
3
5
|
import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
|
|
4
6
|
import UserPicker, { isValidEmail, SmartUserPicker } from '@atlaskit/user-picker';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { injectIntl, FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import { messages } from '../i18n';
|
|
8
|
-
import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
|
|
9
8
|
import { MAX_PICKER_HEIGHT } from './styles';
|
|
9
|
+
import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
|
|
10
10
|
export const REQUIRED = 'REQUIRED';
|
|
11
11
|
const DEBOUNCE_MS = 150;
|
|
12
12
|
|
|
@@ -58,7 +58,8 @@ const requiredMessagesWithoutEmail = {
|
|
|
58
58
|
const getRequiredMessage = (product, allowEmail) => {
|
|
59
59
|
const messages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
|
|
60
60
|
return messages[product];
|
|
61
|
-
};
|
|
61
|
+
}; // eslint-disable-next-line @repo/internal/react/no-class-components
|
|
62
|
+
|
|
62
63
|
|
|
63
64
|
export class UserPickerFieldComponent extends React.Component {
|
|
64
65
|
constructor(...args) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
3
|
-
import { layers } from '@atlaskit/theme';
|
|
1
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* We need to generate correct zIndex, for the PopUp and for the Select inside it.
|
package/dist/es2019/i18n.js
CHANGED
|
@@ -100,11 +100,6 @@ export const messages = defineMessages({
|
|
|
100
100
|
defaultMessage: 'Invite',
|
|
101
101
|
description: 'Button label for when the sharee action is set to "edit".'
|
|
102
102
|
},
|
|
103
|
-
copyLinkButtonIconLabel: {
|
|
104
|
-
id: 'fabric.elements.share.copylink.button.icon.label',
|
|
105
|
-
defaultMessage: 'Copy link icon',
|
|
106
|
-
description: 'Default text for the aria-label of the copy Link icon'
|
|
107
|
-
},
|
|
108
103
|
copyLinkButtonText: {
|
|
109
104
|
id: 'fabric.elements.share.copylink.button.text',
|
|
110
105
|
defaultMessage: 'Copy link',
|
|
@@ -115,11 +110,6 @@ export const messages = defineMessages({
|
|
|
115
110
|
defaultMessage: 'Copy public link',
|
|
116
111
|
description: 'Default text for the Copy Link button when the link is public'
|
|
117
112
|
},
|
|
118
|
-
copiedToClipboardIconLabel: {
|
|
119
|
-
id: 'fabric.elements.share.copied.to.clipboard.icon.label',
|
|
120
|
-
defaultMessage: 'Copy link success icon',
|
|
121
|
-
description: 'Default text for the aria-label of the copied link icon'
|
|
122
|
-
},
|
|
123
113
|
copiedToClipboardMessage: {
|
|
124
114
|
id: 'fabric.elements.share.copied.to.clipboard.message',
|
|
125
115
|
defaultMessage: 'Link copied to clipboard',
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { ADMIN_NOTIFIED, OBJECT_SHARED } from './Flag';
|
|
1
|
+
export { ADMIN_NOTIFIED, OBJECT_SHARED } from './Flag';
|
|
2
|
+
export { TabType } from './ShareEntities';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Cannot import from `../i18n` because there is `../i18n.tsx` file there.
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @atlassian/tangerine/import/no-dangling-index */
|
|
1
4
|
import { cs, da, de, en, en_GB, es, et, fi, fr, hu, is, it, ja, ko, nb, nl, pl, pt_BR, pt_PT, ro, ru, sk, sv, zh } from '../i18n/index';
|
|
2
5
|
const localesMessagesMap = {
|
|
3
6
|
cs,
|
package/dist/es2019/version.json
CHANGED
|
@@ -21,13 +21,7 @@ export var ShareServiceClient = /*#__PURE__*/function () {
|
|
|
21
21
|
|
|
22
22
|
_createClass(ShareServiceClient, [{
|
|
23
23
|
key: "getConfig",
|
|
24
|
-
value: function getConfig(cloudId
|
|
25
|
-
if (!enableEmailPermissionCheck) {
|
|
26
|
-
return Promise.resolve({
|
|
27
|
-
disableSharingToEmails: false
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
24
|
+
value: function getConfig(cloudId) {
|
|
31
25
|
var options = {
|
|
32
26
|
path: SHARE_CONFIG_PATH,
|
|
33
27
|
queryParams: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
+
|
|
2
5
|
import FieldTextArea from '@atlaskit/field-text-area';
|
|
3
6
|
import { Field } from '@atlaskit/form';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { useIntl } from 'react-intl-next';
|
|
6
7
|
import { messages } from '../i18n';
|
|
7
8
|
export var CommentField = function CommentField(_ref) {
|
|
8
9
|
var defaultValue = _ref.defaultValue;
|
|
@@ -14,18 +14,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
14
14
|
|
|
15
15
|
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; } }
|
|
16
16
|
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { isSafari } from 'react-device-detect';
|
|
19
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
20
|
+
import styled from 'styled-components';
|
|
17
21
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
18
22
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
19
23
|
import Popup from '@atlaskit/popup';
|
|
20
24
|
import { G300 } from '@atlaskit/theme/colors';
|
|
21
25
|
import { layers } from '@atlaskit/theme/constants';
|
|
22
26
|
import Tooltip from '@atlaskit/tooltip';
|
|
23
|
-
import React from 'react';
|
|
24
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
25
|
-
import styled from 'styled-components';
|
|
26
|
-
import Button from './styles';
|
|
27
27
|
import { messages } from '../i18n';
|
|
28
28
|
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
29
|
+
import Button from './styles';
|
|
29
30
|
var Z_INDEX = layers.modal();
|
|
30
31
|
var AUTO_DISMISS_SECONDS = 8;
|
|
31
32
|
export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
@@ -38,11 +39,14 @@ function (props, ref) {
|
|
|
38
39
|
position: 'absolute',
|
|
39
40
|
left: '-9999px'
|
|
40
41
|
},
|
|
42
|
+
tabIndex: -1,
|
|
43
|
+
"aria-hidden": true,
|
|
41
44
|
ref: ref,
|
|
42
45
|
value: props.text,
|
|
43
46
|
readOnly: true
|
|
44
47
|
});
|
|
45
48
|
});
|
|
49
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
46
50
|
export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
47
51
|
_inherits(CopyLinkButton, _React$Component);
|
|
48
52
|
|
|
@@ -108,10 +112,11 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
108
112
|
isDisabled = _this$props.isDisabled,
|
|
109
113
|
isPublicLink = _this$props.isPublicLink;
|
|
110
114
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
115
|
+
"aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
111
116
|
isDisabled: isDisabled,
|
|
112
117
|
appearance: "subtle-link",
|
|
113
118
|
iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
114
|
-
label:
|
|
119
|
+
label: "",
|
|
115
120
|
size: "medium"
|
|
116
121
|
}),
|
|
117
122
|
onClick: _this.handleClick
|
|
@@ -135,14 +140,17 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
135
140
|
var _this$props2 = this.props,
|
|
136
141
|
formatMessage = _this$props2.intl.formatMessage,
|
|
137
142
|
copyTooltipText = _this$props2.copyTooltipText;
|
|
138
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
143
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari && /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "assistive",
|
|
145
|
+
"aria-live": "assertive"
|
|
146
|
+
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), /*#__PURE__*/React.createElement(HiddenInput, {
|
|
139
147
|
ref: this.inputRef,
|
|
140
148
|
text: this.props.link
|
|
141
149
|
}), /*#__PURE__*/React.createElement(Popup, {
|
|
142
150
|
zIndex: Z_INDEX,
|
|
143
151
|
content: function content() {
|
|
144
152
|
return /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
145
|
-
label:
|
|
153
|
+
label: "",
|
|
146
154
|
primaryColor: G300
|
|
147
155
|
}), /*#__PURE__*/React.createElement(MessageSpan, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.copiedToClipboardMessage))));
|
|
148
156
|
},
|
|
@@ -14,6 +14,8 @@ import React from 'react';
|
|
|
14
14
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
15
15
|
import { CHANNEL_ID, errorEncountered } from './analytics';
|
|
16
16
|
|
|
17
|
+
// ErrorBoundary does not support in functional component
|
|
18
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
17
19
|
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
18
20
|
_inherits(ErrorBoundary, _React$Component);
|
|
19
21
|
|
|
@@ -11,8 +11,13 @@ export var IntegrationForm = function IntegrationForm(_ref) {
|
|
|
11
11
|
_ref$onIntegrationClo = _ref.onIntegrationClose,
|
|
12
12
|
onIntegrationClose = _ref$onIntegrationClo === void 0 ? function () {
|
|
13
13
|
return undefined;
|
|
14
|
-
} : _ref$onIntegrationClo
|
|
14
|
+
} : _ref$onIntegrationClo,
|
|
15
|
+
_ref$changeTab = _ref.changeTab,
|
|
16
|
+
changeTab = _ref$changeTab === void 0 ? function () {
|
|
17
|
+
return undefined;
|
|
18
|
+
} : _ref$changeTab;
|
|
15
19
|
return /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
|
|
16
|
-
onClose: onIntegrationClose
|
|
20
|
+
onClose: onIntegrationClose,
|
|
21
|
+
changeTab: changeTab
|
|
17
22
|
}));
|
|
18
23
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import { ShareForm } from '../ShareForm';
|
|
4
3
|
import { ANALYTICS_SOURCE } from '../analytics';
|
|
5
4
|
import { IntegrationForm } from '../IntegrationForm';
|
|
6
|
-
import {
|
|
5
|
+
import { ShareForm } from '../ShareForm';
|
|
7
6
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
7
|
+
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A Share form content which is lazy-loaded.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
|
-
import { SpinnerWrapper } from './styled';
|
|
5
4
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
5
|
+
import { SpinnerWrapper } from './styled';
|
|
6
6
|
var LazyShareFormLazy = lazyForPaint(function () {
|
|
7
7
|
return import(
|
|
8
8
|
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
9
9
|
import { getMessagesForLocale } from '../util/i18n-util';
|
|
10
10
|
|
|
11
11
|
var MessagesIntlProvider = function MessagesIntlProvider(_ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
4
3
|
import React from 'react';
|
|
4
|
+
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
5
|
export var ShareButton = /*#__PURE__*/React.forwardRef(function ShareButton(_ref, ref) {
|
|
6
6
|
var text = _ref.text,
|
|
7
7
|
props = _objectWithoutProperties(_ref, ["text"]);
|
|
@@ -16,20 +16,20 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
16
16
|
|
|
17
17
|
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; } }
|
|
18
18
|
|
|
19
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
20
|
-
import memoizeOne from 'memoize-one';
|
|
21
19
|
import React from 'react';
|
|
20
|
+
import deepEqual from 'fast-deep-equal';
|
|
21
|
+
import memoizeOne from 'memoize-one';
|
|
22
22
|
import { FormattedMessage } from 'react-intl-next';
|
|
23
23
|
import assert from 'tiny-invariant';
|
|
24
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
24
25
|
import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerClient';
|
|
25
26
|
import { ShareServiceClient } from '../clients/ShareServiceClient';
|
|
26
27
|
import { messages } from '../i18n';
|
|
27
28
|
import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics';
|
|
29
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
28
30
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
29
31
|
import { ShareDialogWithTrigger } from './ShareDialogWithTrigger';
|
|
30
32
|
import { optionDataToUsers } from './utils';
|
|
31
|
-
import ErrorBoundary from './ErrorBoundary';
|
|
32
|
-
import deepEqual from 'fast-deep-equal';
|
|
33
33
|
var COPY_LINK_EVENT = copyLinkButtonClicked(0);
|
|
34
34
|
export var defaultConfig = {
|
|
35
35
|
disableSharingToEmails: false
|
|
@@ -45,6 +45,7 @@ function getCurrentPageUrl() {
|
|
|
45
45
|
* This component serves as a Provider to provide customizable implementations
|
|
46
46
|
* to ShareDialogTrigger component
|
|
47
47
|
*/
|
|
48
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
|
|
@@ -84,7 +85,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
84
85
|
case 0:
|
|
85
86
|
_context.prev = 0;
|
|
86
87
|
_context.next = 3;
|
|
87
|
-
return _this.shareClient.getConfig(_this.props.cloudId
|
|
88
|
+
return _this.shareClient.getConfig(_this.props.cloudId);
|
|
88
89
|
|
|
89
90
|
case 3:
|
|
90
91
|
config = _context.sent;
|