@atlaskit/share 3.0.3 → 3.0.7
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 +2 -2
- package/dist/cjs/components/IntegrationButton.js +3 -1
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +9 -9
- package/dist/cjs/components/MessagesIntlProvider.js +2 -2
- package/dist/cjs/components/ShareButton.js +3 -1
- package/dist/cjs/components/ShareDialogContainer.js +2 -2
- package/dist/cjs/components/ShareDialogWithTrigger.js +11 -5
- package/dist/cjs/components/ShareForm.js +41 -36
- package/dist/cjs/components/SplitButton.js +3 -1
- package/dist/cjs/components/analytics.js +3 -3
- package/dist/cjs/components/colorSlackIcon.js +67 -0
- package/dist/cjs/components/styles.js +5 -3
- package/dist/cjs/components/utils.js +10 -2
- package/dist/cjs/i18n.js +10 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +10 -10
- package/dist/es2019/components/ShareDialogWithTrigger.js +9 -4
- package/dist/es2019/components/ShareForm.js +28 -20
- package/dist/es2019/components/analytics.js +1 -1
- package/dist/es2019/components/colorSlackIcon.js +57 -0
- package/dist/es2019/components/utils.js +6 -1
- package/dist/es2019/i18n.js +10 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +2 -2
- package/dist/esm/components/IntegrationButton.js +2 -1
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +10 -10
- package/dist/esm/components/MessagesIntlProvider.js +2 -2
- package/dist/esm/components/ShareButton.js +2 -1
- package/dist/esm/components/ShareDialogContainer.js +2 -2
- package/dist/esm/components/ShareDialogWithTrigger.js +12 -6
- package/dist/esm/components/ShareForm.js +39 -36
- package/dist/esm/components/SplitButton.js +2 -1
- package/dist/esm/components/analytics.js +3 -3
- package/dist/esm/components/colorSlackIcon.js +57 -0
- package/dist/esm/components/styles.js +4 -3
- package/dist/esm/components/utils.js +5 -0
- package/dist/esm/i18n.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ShareForm.d.ts +1 -5
- package/dist/types/components/analytics.d.ts +1 -1
- package/dist/types/components/colorSlackIcon.d.ts +3 -0
- package/dist/types/components/utils.d.ts +2 -0
- package/dist/types/i18n.d.ts +10 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -0
- package/package.json +7 -7
|
@@ -17,7 +17,7 @@ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, scr
|
|
|
17
17
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
18
18
|
import ShareButton from './ShareButton';
|
|
19
19
|
import SplitButton from './SplitButton';
|
|
20
|
-
import { generateSelectZIndex } from './utils';
|
|
20
|
+
import { generateSelectZIndex, resolveShareFooter } from './utils';
|
|
21
21
|
const ShareButtonWrapper = styled.div`
|
|
22
22
|
display: inline-flex;
|
|
23
23
|
outline: none;
|
|
@@ -47,7 +47,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
47
47
|
defaultValue: defaultShareContentState,
|
|
48
48
|
isUsingSplitButton: false,
|
|
49
49
|
showIntegrationForm: false,
|
|
50
|
-
selectedIntegration: null
|
|
50
|
+
selectedIntegration: null,
|
|
51
|
+
tabIndex: 0
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
_defineProperty(this, "closeAndResetDialog", () => {
|
|
@@ -96,6 +97,9 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
this.createAndFireEvent(shareTabClicked(subjectId));
|
|
100
|
+
this.setState({
|
|
101
|
+
tabIndex: index
|
|
102
|
+
});
|
|
99
103
|
});
|
|
100
104
|
|
|
101
105
|
_defineProperty(this, "getFlags", () => {
|
|
@@ -410,7 +414,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
410
414
|
} = this.props;
|
|
411
415
|
const style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
412
416
|
outline: 'none'
|
|
413
|
-
} : undefined;
|
|
417
|
+
} : undefined;
|
|
418
|
+
const footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
414
419
|
|
|
415
420
|
return /*#__PURE__*/React.createElement(ShareButtonWrapper, {
|
|
416
421
|
tabIndex: tabIndex,
|
|
@@ -425,7 +430,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
425
430
|
copyLink: copyLink,
|
|
426
431
|
showIntegrationForm: showIntegrationForm,
|
|
427
432
|
bottomMessage: bottomMessage,
|
|
428
|
-
customFooter:
|
|
433
|
+
customFooter: footer,
|
|
429
434
|
loadOptions: loadUserOptions,
|
|
430
435
|
isSharing: isSharing,
|
|
431
436
|
shareFormTitle: shareFormTitle,
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
6
7
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
7
8
|
import Form from '@atlaskit/form';
|
|
8
9
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
@@ -12,6 +13,7 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
12
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
14
|
import { messages } from '../i18n';
|
|
14
15
|
import { TabType } from '../types';
|
|
16
|
+
import { ANALYTICS_SOURCE, INTEGRATION_MODAL_SOURCE } from './analytics';
|
|
15
17
|
import { CommentField } from './CommentField';
|
|
16
18
|
import CopyLinkButton from './CopyLinkButton';
|
|
17
19
|
import { IntegrationForm } from './IntegrationForm';
|
|
@@ -31,7 +33,7 @@ const CenterAlignedIconWrapper = styled.div`
|
|
|
31
33
|
}
|
|
32
34
|
`;
|
|
33
35
|
export const FormWrapper = styled.div`
|
|
34
|
-
margin-top: ${
|
|
36
|
+
margin-top: ${gridSize()}px;
|
|
35
37
|
width: 100%;
|
|
36
38
|
|
|
37
39
|
/* jira has a class override font settings on h1 in gh-custom-field-pickers.css */
|
|
@@ -52,6 +54,7 @@ const IntegrationWrapper = styled.div`
|
|
|
52
54
|
align-items: center;
|
|
53
55
|
`;
|
|
54
56
|
const IntegrationIconWrapper = styled.span`
|
|
57
|
+
margin-bottom: -6px;
|
|
55
58
|
margin-right: 5px;
|
|
56
59
|
`;
|
|
57
60
|
|
|
@@ -94,7 +97,11 @@ class InternalForm extends React.PureComponent {
|
|
|
94
97
|
copyTooltipText,
|
|
95
98
|
helperMessage
|
|
96
99
|
} = this.props;
|
|
97
|
-
return /*#__PURE__*/React.createElement(
|
|
100
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
101
|
+
data: {
|
|
102
|
+
source: ANALYTICS_SOURCE
|
|
103
|
+
}
|
|
104
|
+
}, /*#__PURE__*/React.createElement("form", formProps, showTitle && /*#__PURE__*/React.createElement(ShareHeader, {
|
|
98
105
|
title: title
|
|
99
106
|
}), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(UserPickerField, {
|
|
100
107
|
onInputChange: onUserInputChange,
|
|
@@ -118,7 +125,7 @@ class InternalForm extends React.PureComponent {
|
|
|
118
125
|
link: copyLink,
|
|
119
126
|
isPublicLink: isPublicLink,
|
|
120
127
|
copyTooltipText: copyTooltipText
|
|
121
|
-
}), this.renderSubmitButton()));
|
|
128
|
+
}), this.renderSubmitButton())));
|
|
122
129
|
});
|
|
123
130
|
|
|
124
131
|
_defineProperty(this, "renderSubmitButton", () => {
|
|
@@ -130,11 +137,15 @@ class InternalForm extends React.PureComponent {
|
|
|
130
137
|
shareError,
|
|
131
138
|
submitButtonLabel,
|
|
132
139
|
isDisabled,
|
|
133
|
-
isPublicLink
|
|
140
|
+
isPublicLink,
|
|
141
|
+
integrationMode
|
|
134
142
|
} = this.props;
|
|
135
143
|
const shouldShowWarning = shareError && !isSharing;
|
|
136
144
|
const buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
137
|
-
const
|
|
145
|
+
const tabMode = integrationMode === 'tabs';
|
|
146
|
+
const formPublicLabel = tabMode ? messages.formSharePublic : messages.formSendPublic;
|
|
147
|
+
const formSendLabel = tabMode ? messages.formShare : messages.formSend;
|
|
148
|
+
const sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
138
149
|
const buttonLabel = shareError ? messages.formRetry : sendLabel;
|
|
139
150
|
const ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
|
|
140
151
|
return /*#__PURE__*/React.createElement(SubmitButtonWrapper, null, /*#__PURE__*/React.createElement(CenterAlignedIconWrapper, null, shouldShowWarning && /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -172,9 +183,12 @@ class InternalForm extends React.PureComponent {
|
|
|
172
183
|
});
|
|
173
184
|
|
|
174
185
|
_defineProperty(this, "changeTab", tab => {
|
|
186
|
+
var _this$props$onTabChan, _this$props;
|
|
187
|
+
|
|
175
188
|
this.setState({
|
|
176
189
|
selectedTab: tab
|
|
177
190
|
});
|
|
191
|
+
(_this$props$onTabChan = (_this$props = this.props).onTabChange) === null || _this$props$onTabChan === void 0 ? void 0 : _this$props$onTabChan.call(_this$props, tab);
|
|
178
192
|
});
|
|
179
193
|
}
|
|
180
194
|
|
|
@@ -193,7 +207,6 @@ class InternalForm extends React.PureComponent {
|
|
|
193
207
|
const {
|
|
194
208
|
integrationMode = 'off',
|
|
195
209
|
shareIntegrations,
|
|
196
|
-
onTabChange,
|
|
197
210
|
handleCloseDialog
|
|
198
211
|
} = this.props;
|
|
199
212
|
|
|
@@ -206,10 +219,7 @@ class InternalForm extends React.PureComponent {
|
|
|
206
219
|
if (integrationMode === 'tabs') {
|
|
207
220
|
return /*#__PURE__*/React.createElement(Tabs, {
|
|
208
221
|
id: "ShareForm-Tabs-Integrations",
|
|
209
|
-
onChange:
|
|
210
|
-
this.changeTab(index);
|
|
211
|
-
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
212
|
-
},
|
|
222
|
+
onChange: this.changeTab,
|
|
213
223
|
selected: this.state.selectedTab
|
|
214
224
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
215
225
|
key: `share-tab-default`
|
|
@@ -217,19 +227,17 @@ class InternalForm extends React.PureComponent {
|
|
|
217
227
|
key: `share-tab-${firstIntegration.type}`
|
|
218
228
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
219
229
|
key: `share-tabPanel-default`
|
|
220
|
-
}, /*#__PURE__*/React.createElement(FormWrapper, {
|
|
221
|
-
isMainShare: true
|
|
222
|
-
}, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
230
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
223
231
|
key: `share-tabPanel-integration`
|
|
224
|
-
}, /*#__PURE__*/React.createElement(
|
|
225
|
-
|
|
226
|
-
|
|
232
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
233
|
+
data: {
|
|
234
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
227
237
|
Content: firstIntegration.Content,
|
|
228
238
|
onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
|
|
229
|
-
changeTab:
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
}))));
|
|
239
|
+
changeTab: this.changeTab
|
|
240
|
+
})))));
|
|
233
241
|
}
|
|
234
242
|
|
|
235
243
|
return this.renderShareForm();
|
|
@@ -24,7 +24,7 @@ const createScreenEvent = (name, attributes = {}) => ({
|
|
|
24
24
|
|
|
25
25
|
export const CHANNEL_ID = 'fabric-elements';
|
|
26
26
|
export const ANALYTICS_SOURCE = 'shareModal';
|
|
27
|
-
export const INTEGRATION_MODAL_SOURCE = '
|
|
27
|
+
export const INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
|
|
28
28
|
export const screenEvent = ({
|
|
29
29
|
isPublicLink = false
|
|
30
30
|
}) => createScreenEvent(ANALYTICS_SOURCE, {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const SlackIcon = () => {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
5
|
+
width: "16",
|
|
6
|
+
height: "16",
|
|
7
|
+
viewBox: "0 0 125 125"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("style", null, '.prefix__st0{fill:#e01e5a}.prefix__st1{fill:#36c5f0}.prefix__st2{fill:#2eb67d}.prefix__st3{fill:#ecb22e}'), /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
fill: "none",
|
|
10
|
+
id: "prefix__canvas_background",
|
|
11
|
+
d: "M-1-1h127v127H-1z"
|
|
12
|
+
}), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
13
|
+
id: "prefix__svg_1"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
15
|
+
id: "prefix__svg_2"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
id: "prefix__svg_3",
|
|
18
|
+
d: "M27.4 79.2c0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9h12.9v12.9z",
|
|
19
|
+
className: "prefix__st0"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21
|
+
id: "prefix__svg_4",
|
|
22
|
+
d: "M33.9 79.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V79.2z",
|
|
23
|
+
className: "prefix__st0"
|
|
24
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
25
|
+
id: "prefix__svg_5"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
id: "prefix__svg_6",
|
|
28
|
+
d: "M46.8 27.4c-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v12.9H46.8z",
|
|
29
|
+
className: "prefix__st1"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
id: "prefix__svg_7",
|
|
32
|
+
d: "M46.8 33.9c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H14.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3z",
|
|
33
|
+
className: "prefix__st1"
|
|
34
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
35
|
+
id: "prefix__svg_8"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
id: "prefix__svg_9",
|
|
38
|
+
d: "M98.6 46.8c0-7.1 5.8-12.9 12.9-12.9 7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H98.6V46.8z",
|
|
39
|
+
className: "prefix__st2"
|
|
40
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
id: "prefix__svg_10",
|
|
42
|
+
d: "M92.1 46.8c0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9V14.5c0-7.1 5.8-12.9 12.9-12.9 7.1 0 12.9 5.8 12.9 12.9v32.3z",
|
|
43
|
+
className: "prefix__st2"
|
|
44
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
45
|
+
id: "prefix__svg_11"
|
|
46
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
47
|
+
id: "prefix__svg_12",
|
|
48
|
+
d: "M79.2 98.6c7.1 0 12.9 5.8 12.9 12.9 0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9V98.6h12.9z",
|
|
49
|
+
className: "prefix__st3"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
51
|
+
id: "prefix__svg_13",
|
|
52
|
+
d: "M79.2 92.1c-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9 0 7.1-5.8 12.9-12.9 12.9H79.2z",
|
|
53
|
+
className: "prefix__st3"
|
|
54
|
+
})))));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default SlackIcon;
|
|
@@ -49,4 +49,9 @@ export const optionDataToUsers = optionDataArray => optionDataArray.map(optionDa
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
export const allowEmails = config => !(config && config.disableSharingToEmails);
|
|
52
|
+
export const allowEmails = config => !(config && config.disableSharingToEmails);
|
|
53
|
+
export const resolveShareFooter = (integrationMode, tabIndex, customFooter) => {
|
|
54
|
+
if (integrationMode === 'tabs' && tabIndex === 0 && customFooter) {
|
|
55
|
+
return customFooter;
|
|
56
|
+
}
|
|
57
|
+
};
|
package/dist/es2019/i18n.js
CHANGED
|
@@ -10,11 +10,21 @@ export const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Send',
|
|
11
11
|
description: 'Label for Share form submit button.'
|
|
12
12
|
},
|
|
13
|
+
formShare: {
|
|
14
|
+
id: 'fabric.elements.share.form.share',
|
|
15
|
+
defaultMessage: 'Share',
|
|
16
|
+
description: 'Label for Share form submit button.'
|
|
17
|
+
},
|
|
13
18
|
formSendPublic: {
|
|
14
19
|
id: 'fabric.elements.share.form.public.send',
|
|
15
20
|
defaultMessage: 'Send public link',
|
|
16
21
|
description: 'Label for Share form submit button when link is public.'
|
|
17
22
|
},
|
|
23
|
+
formSharePublic: {
|
|
24
|
+
id: 'fabric.elements.share.form.public.share',
|
|
25
|
+
defaultMessage: 'Share public link',
|
|
26
|
+
description: 'Label for Share form submit button when link is public.'
|
|
27
|
+
},
|
|
18
28
|
formRetry: {
|
|
19
29
|
id: 'fabric.elements.share.form.retry',
|
|
20
30
|
defaultMessage: 'Retry',
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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 { utils } from '@atlaskit/util-service-support';
|
|
10
10
|
export var DEFAULT_SHARE_PATH = 'share';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
var _excluded = ["text", "textColor", "IntegrationIcon"];
|
|
3
4
|
|
|
4
5
|
var _templateObject, _templateObject2;
|
|
5
6
|
|
|
@@ -16,7 +17,7 @@ var IntegrationButton = function IntegrationButton(props) {
|
|
|
16
17
|
var text = props.text,
|
|
17
18
|
textColor = props.textColor,
|
|
18
19
|
IntegrationIcon = props.IntegrationIcon,
|
|
19
|
-
restProps = _objectWithoutProperties(props,
|
|
20
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
20
21
|
|
|
21
22
|
return /*#__PURE__*/React.createElement(Button, restProps, /*#__PURE__*/React.createElement(IntegrationButtonCopyWrapper, {
|
|
22
23
|
theme: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import {
|
|
3
|
+
import { INTEGRATION_MODAL_SOURCE } from '../analytics';
|
|
4
4
|
import { IntegrationForm } from '../IntegrationForm';
|
|
5
5
|
import { ShareForm } from '../ShareForm';
|
|
6
6
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
@@ -42,20 +42,20 @@ function LazyShareForm(props) {
|
|
|
42
42
|
shareError = props.shareError,
|
|
43
43
|
defaultValue = props.defaultValue,
|
|
44
44
|
showTitle = props.showTitle;
|
|
45
|
-
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
46
|
-
return /*#__PURE__*/React.createElement(
|
|
47
|
-
data: {
|
|
48
|
-
source: ANALYTICS_SOURCE
|
|
49
|
-
}
|
|
50
|
-
}, /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
45
|
+
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
46
|
+
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
51
47
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
52
48
|
// so we don't need to show title via ShareFormWrapper
|
|
53
49
|
,
|
|
54
50
|
shouldShowTitle: false
|
|
55
|
-
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(
|
|
51
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
52
|
+
data: {
|
|
53
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
56
56
|
Content: selectedIntegration.Content,
|
|
57
57
|
onIntegrationClose: onDialogClose
|
|
58
|
-
}) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
58
|
+
})) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
59
59
|
copyLink: copyLink,
|
|
60
60
|
loadOptions: loadOptions,
|
|
61
61
|
title: shareFormTitle,
|
|
@@ -83,7 +83,7 @@ function LazyShareForm(props) {
|
|
|
83
83
|
onUserSelectionChange: onUserSelectionChange,
|
|
84
84
|
handleCloseDialog: onDialogClose,
|
|
85
85
|
onTabChange: onTabChange
|
|
86
|
-
}))
|
|
86
|
+
}));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export default LazyShareForm;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["text"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
6
|
export var ShareButton = /*#__PURE__*/React.forwardRef(function ShareButton(_ref, ref) {
|
|
6
7
|
var text = _ref.text,
|
|
7
|
-
props = _objectWithoutProperties(_ref,
|
|
8
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
8
9
|
|
|
9
10
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
10
11
|
ref: ref,
|
|
@@ -8,9 +8,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
12
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
13
|
+
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; }
|
|
14
14
|
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
16
|
|
|
@@ -10,9 +10,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
10
10
|
|
|
11
11
|
var _templateObject;
|
|
12
12
|
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
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; }
|
|
16
16
|
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
18
|
|
|
@@ -35,7 +35,7 @@ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, scr
|
|
|
35
35
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
36
36
|
import ShareButton from './ShareButton';
|
|
37
37
|
import SplitButton from './SplitButton';
|
|
38
|
-
import { generateSelectZIndex } from './utils';
|
|
38
|
+
import { generateSelectZIndex, resolveShareFooter } from './utils';
|
|
39
39
|
var ShareButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n outline: none;\n"])));
|
|
40
40
|
export var defaultShareContentState = {
|
|
41
41
|
users: [],
|
|
@@ -74,7 +74,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
74
74
|
defaultValue: defaultShareContentState,
|
|
75
75
|
isUsingSplitButton: false,
|
|
76
76
|
showIntegrationForm: false,
|
|
77
|
-
selectedIntegration: null
|
|
77
|
+
selectedIntegration: null,
|
|
78
|
+
tabIndex: 0
|
|
78
79
|
});
|
|
79
80
|
|
|
80
81
|
_defineProperty(_assertThisInitialized(_this), "closeAndResetDialog", function () {
|
|
@@ -122,6 +123,10 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
_this.createAndFireEvent(shareTabClicked(subjectId));
|
|
126
|
+
|
|
127
|
+
_this.setState({
|
|
128
|
+
tabIndex: index
|
|
129
|
+
});
|
|
125
130
|
});
|
|
126
131
|
|
|
127
132
|
_defineProperty(_assertThisInitialized(_this), "getFlags", function () {
|
|
@@ -436,7 +441,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
436
441
|
shareIntegrations = _this$props7.shareIntegrations;
|
|
437
442
|
var style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
438
443
|
outline: 'none'
|
|
439
|
-
} : undefined;
|
|
444
|
+
} : undefined;
|
|
445
|
+
var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
440
446
|
|
|
441
447
|
return /*#__PURE__*/React.createElement(ShareButtonWrapper, {
|
|
442
448
|
tabIndex: tabIndex,
|
|
@@ -452,7 +458,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
452
458
|
copyLink: copyLink,
|
|
453
459
|
showIntegrationForm: showIntegrationForm,
|
|
454
460
|
bottomMessage: bottomMessage,
|
|
455
|
-
customFooter:
|
|
461
|
+
customFooter: footer,
|
|
456
462
|
loadOptions: loadUserOptions,
|
|
457
463
|
isSharing: isSharing,
|
|
458
464
|
shareFormTitle: shareFormTitle,
|