@atlaskit/share 3.0.4 → 3.0.8
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 +13 -6
- 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/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 +11 -5
- package/dist/es2019/components/ShareForm.js +28 -21
- package/dist/es2019/components/analytics.js +1 -1
- 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 +14 -7
- 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/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/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 +1 -1
|
@@ -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,7 +54,7 @@ const IntegrationWrapper = styled.div`
|
|
|
52
54
|
align-items: center;
|
|
53
55
|
`;
|
|
54
56
|
const IntegrationIconWrapper = styled.span`
|
|
55
|
-
margin-bottom: -
|
|
57
|
+
margin-bottom: -6px;
|
|
56
58
|
margin-right: 5px;
|
|
57
59
|
`;
|
|
58
60
|
|
|
@@ -95,7 +97,11 @@ class InternalForm extends React.PureComponent {
|
|
|
95
97
|
copyTooltipText,
|
|
96
98
|
helperMessage
|
|
97
99
|
} = this.props;
|
|
98
|
-
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, {
|
|
99
105
|
title: title
|
|
100
106
|
}), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(UserPickerField, {
|
|
101
107
|
onInputChange: onUserInputChange,
|
|
@@ -119,7 +125,7 @@ class InternalForm extends React.PureComponent {
|
|
|
119
125
|
link: copyLink,
|
|
120
126
|
isPublicLink: isPublicLink,
|
|
121
127
|
copyTooltipText: copyTooltipText
|
|
122
|
-
}), this.renderSubmitButton()));
|
|
128
|
+
}), this.renderSubmitButton())));
|
|
123
129
|
});
|
|
124
130
|
|
|
125
131
|
_defineProperty(this, "renderSubmitButton", () => {
|
|
@@ -131,11 +137,15 @@ class InternalForm extends React.PureComponent {
|
|
|
131
137
|
shareError,
|
|
132
138
|
submitButtonLabel,
|
|
133
139
|
isDisabled,
|
|
134
|
-
isPublicLink
|
|
140
|
+
isPublicLink,
|
|
141
|
+
integrationMode
|
|
135
142
|
} = this.props;
|
|
136
143
|
const shouldShowWarning = shareError && !isSharing;
|
|
137
144
|
const buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
138
|
-
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;
|
|
139
149
|
const buttonLabel = shareError ? messages.formRetry : sendLabel;
|
|
140
150
|
const ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
|
|
141
151
|
return /*#__PURE__*/React.createElement(SubmitButtonWrapper, null, /*#__PURE__*/React.createElement(CenterAlignedIconWrapper, null, shouldShowWarning && /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -173,9 +183,12 @@ class InternalForm extends React.PureComponent {
|
|
|
173
183
|
});
|
|
174
184
|
|
|
175
185
|
_defineProperty(this, "changeTab", tab => {
|
|
186
|
+
var _this$props$onTabChan, _this$props;
|
|
187
|
+
|
|
176
188
|
this.setState({
|
|
177
189
|
selectedTab: tab
|
|
178
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);
|
|
179
192
|
});
|
|
180
193
|
}
|
|
181
194
|
|
|
@@ -194,7 +207,6 @@ class InternalForm extends React.PureComponent {
|
|
|
194
207
|
const {
|
|
195
208
|
integrationMode = 'off',
|
|
196
209
|
shareIntegrations,
|
|
197
|
-
onTabChange,
|
|
198
210
|
handleCloseDialog
|
|
199
211
|
} = this.props;
|
|
200
212
|
|
|
@@ -207,10 +219,7 @@ class InternalForm extends React.PureComponent {
|
|
|
207
219
|
if (integrationMode === 'tabs') {
|
|
208
220
|
return /*#__PURE__*/React.createElement(Tabs, {
|
|
209
221
|
id: "ShareForm-Tabs-Integrations",
|
|
210
|
-
onChange:
|
|
211
|
-
this.changeTab(index);
|
|
212
|
-
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
213
|
-
},
|
|
222
|
+
onChange: this.changeTab,
|
|
214
223
|
selected: this.state.selectedTab
|
|
215
224
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
216
225
|
key: `share-tab-default`
|
|
@@ -218,19 +227,17 @@ class InternalForm extends React.PureComponent {
|
|
|
218
227
|
key: `share-tab-${firstIntegration.type}`
|
|
219
228
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
220
229
|
key: `share-tabPanel-default`
|
|
221
|
-
}, /*#__PURE__*/React.createElement(FormWrapper, {
|
|
222
|
-
isMainShare: true
|
|
223
|
-
}, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
230
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
224
231
|
key: `share-tabPanel-integration`
|
|
225
|
-
}, /*#__PURE__*/React.createElement(
|
|
226
|
-
|
|
227
|
-
|
|
232
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
233
|
+
data: {
|
|
234
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
228
237
|
Content: firstIntegration.Content,
|
|
229
238
|
onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
|
|
230
|
-
changeTab:
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
}))));
|
|
239
|
+
changeTab: this.changeTab
|
|
240
|
+
})))));
|
|
234
241
|
}
|
|
235
242
|
|
|
236
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, {
|
|
@@ -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 () {
|
|
@@ -228,7 +233,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
228
233
|
_this.setState({
|
|
229
234
|
isDialogOpen: false,
|
|
230
235
|
showIntegrationForm: false,
|
|
231
|
-
selectedIntegration: null
|
|
236
|
+
selectedIntegration: null,
|
|
237
|
+
tabIndex: 0
|
|
232
238
|
});
|
|
233
239
|
});
|
|
234
240
|
|
|
@@ -436,7 +442,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
436
442
|
shareIntegrations = _this$props7.shareIntegrations;
|
|
437
443
|
var style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
438
444
|
outline: 'none'
|
|
439
|
-
} : undefined;
|
|
445
|
+
} : undefined;
|
|
446
|
+
var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
440
447
|
|
|
441
448
|
return /*#__PURE__*/React.createElement(ShareButtonWrapper, {
|
|
442
449
|
tabIndex: tabIndex,
|
|
@@ -452,7 +459,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
452
459
|
copyLink: copyLink,
|
|
453
460
|
showIntegrationForm: showIntegrationForm,
|
|
454
461
|
bottomMessage: bottomMessage,
|
|
455
|
-
customFooter:
|
|
462
|
+
customFooter: footer,
|
|
456
463
|
loadOptions: loadUserOptions,
|
|
457
464
|
isSharing: isSharing,
|
|
458
465
|
shareFormTitle: shareFormTitle,
|
|
@@ -10,9 +10,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
10
10
|
|
|
11
11
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
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
|
|
|
@@ -21,6 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
23
23
|
import styled from 'styled-components';
|
|
24
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
24
25
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
25
26
|
import Form from '@atlaskit/form';
|
|
26
27
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
@@ -30,6 +31,7 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
30
31
|
import Tooltip from '@atlaskit/tooltip';
|
|
31
32
|
import { messages } from '../i18n';
|
|
32
33
|
import { TabType } from '../types';
|
|
34
|
+
import { ANALYTICS_SOURCE, INTEGRATION_MODAL_SOURCE } from './analytics';
|
|
33
35
|
import { CommentField } from './CommentField';
|
|
34
36
|
import CopyLinkButton from './CopyLinkButton';
|
|
35
37
|
import { IntegrationForm } from './IntegrationForm';
|
|
@@ -37,13 +39,11 @@ import { ShareHeader } from './ShareHeader';
|
|
|
37
39
|
import { UserPickerField } from './UserPickerField';
|
|
38
40
|
var SubmitButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
|
|
39
41
|
var CenterAlignedIconWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding: 0 10px;\n\n > div {\n line-height: 1;\n }\n"])));
|
|
40
|
-
export var FormWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n width: 100%;\n\n /* jira has a class override font settings on h1 in gh-custom-field-pickers.css */\n #ghx-modes-tools #ghx-share & h1:first-child {\n margin-top: 0;\n }\n"])),
|
|
41
|
-
return props.isMainShare ? gridSize() : gridSize() * 2;
|
|
42
|
-
});
|
|
42
|
+
export var FormWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n width: 100%;\n\n /* jira has a class override font settings on h1 in gh-custom-field-pickers.css */\n #ghx-modes-tools #ghx-share & h1:first-child {\n margin-top: 0;\n }\n"])), gridSize());
|
|
43
43
|
export var FormFooter = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n display: flex;\n justify-content: flex-start;\n"])), gridSize);
|
|
44
44
|
var FormField = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
|
|
45
45
|
var IntegrationWrapper = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
46
|
-
var IntegrationIconWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: -
|
|
46
|
+
var IntegrationIconWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
47
47
|
|
|
48
48
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
49
49
|
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
|
|
@@ -98,7 +98,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
98
|
isPublicLink = _this$props.isPublicLink,
|
|
99
99
|
copyTooltipText = _this$props.copyTooltipText,
|
|
100
100
|
helperMessage = _this$props.helperMessage;
|
|
101
|
-
return /*#__PURE__*/React.createElement(
|
|
101
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
102
|
+
data: {
|
|
103
|
+
source: ANALYTICS_SOURCE
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/React.createElement("form", formProps, showTitle && /*#__PURE__*/React.createElement(ShareHeader, {
|
|
102
106
|
title: title
|
|
103
107
|
}), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(UserPickerField, {
|
|
104
108
|
onInputChange: onUserInputChange,
|
|
@@ -122,7 +126,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
122
126
|
link: copyLink,
|
|
123
127
|
isPublicLink: isPublicLink,
|
|
124
128
|
copyTooltipText: copyTooltipText
|
|
125
|
-
}), _this.renderSubmitButton()));
|
|
129
|
+
}), _this.renderSubmitButton())));
|
|
126
130
|
});
|
|
127
131
|
|
|
128
132
|
_defineProperty(_assertThisInitialized(_this), "renderSubmitButton", function () {
|
|
@@ -132,10 +136,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
132
136
|
shareError = _this$props2.shareError,
|
|
133
137
|
submitButtonLabel = _this$props2.submitButtonLabel,
|
|
134
138
|
isDisabled = _this$props2.isDisabled,
|
|
135
|
-
isPublicLink = _this$props2.isPublicLink
|
|
139
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
140
|
+
integrationMode = _this$props2.integrationMode;
|
|
136
141
|
var shouldShowWarning = shareError && !isSharing;
|
|
137
142
|
var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
138
|
-
var
|
|
143
|
+
var tabMode = integrationMode === 'tabs';
|
|
144
|
+
var formPublicLabel = tabMode ? messages.formSharePublic : messages.formSendPublic;
|
|
145
|
+
var formSendLabel = tabMode ? messages.formShare : messages.formSend;
|
|
146
|
+
var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
139
147
|
var buttonLabel = shareError ? messages.formRetry : sendLabel;
|
|
140
148
|
var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
|
|
141
149
|
return /*#__PURE__*/React.createElement(SubmitButtonWrapper, null, /*#__PURE__*/React.createElement(CenterAlignedIconWrapper, null, shouldShowWarning && /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -170,9 +178,13 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
170
178
|
});
|
|
171
179
|
|
|
172
180
|
_defineProperty(_assertThisInitialized(_this), "changeTab", function (tab) {
|
|
181
|
+
var _this$props$onTabChan, _this$props4;
|
|
182
|
+
|
|
173
183
|
_this.setState({
|
|
174
184
|
selectedTab: tab
|
|
175
185
|
});
|
|
186
|
+
|
|
187
|
+
(_this$props$onTabChan = (_this$props4 = _this.props).onTabChange) === null || _this$props$onTabChan === void 0 ? void 0 : _this$props$onTabChan.call(_this$props4, tab);
|
|
176
188
|
});
|
|
177
189
|
|
|
178
190
|
return _this;
|
|
@@ -181,9 +193,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
181
193
|
_createClass(InternalForm, [{
|
|
182
194
|
key: "componentWillUnmount",
|
|
183
195
|
value: function componentWillUnmount() {
|
|
184
|
-
var _this$
|
|
185
|
-
onDismiss = _this$
|
|
186
|
-
getValues = _this$
|
|
196
|
+
var _this$props5 = this.props,
|
|
197
|
+
onDismiss = _this$props5.onDismiss,
|
|
198
|
+
getValues = _this$props5.getValues;
|
|
187
199
|
|
|
188
200
|
if (onDismiss) {
|
|
189
201
|
onDismiss(getValues());
|
|
@@ -192,14 +204,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
192
204
|
}, {
|
|
193
205
|
key: "render",
|
|
194
206
|
value: function render() {
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
shareIntegrations = _this$props5.shareIntegrations,
|
|
201
|
-
onTabChange = _this$props5.onTabChange,
|
|
202
|
-
handleCloseDialog = _this$props5.handleCloseDialog;
|
|
207
|
+
var _this$props6 = this.props,
|
|
208
|
+
_this$props6$integrat = _this$props6.integrationMode,
|
|
209
|
+
integrationMode = _this$props6$integrat === void 0 ? 'off' : _this$props6$integrat,
|
|
210
|
+
shareIntegrations = _this$props6.shareIntegrations,
|
|
211
|
+
handleCloseDialog = _this$props6.handleCloseDialog;
|
|
203
212
|
|
|
204
213
|
if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
|
|
205
214
|
return this.renderShareForm();
|
|
@@ -210,11 +219,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
210
219
|
if (integrationMode === 'tabs') {
|
|
211
220
|
return /*#__PURE__*/React.createElement(Tabs, {
|
|
212
221
|
id: "ShareForm-Tabs-Integrations",
|
|
213
|
-
onChange:
|
|
214
|
-
_this2.changeTab(index);
|
|
215
|
-
|
|
216
|
-
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
217
|
-
},
|
|
222
|
+
onChange: this.changeTab,
|
|
218
223
|
selected: this.state.selectedTab
|
|
219
224
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
220
225
|
key: "share-tab-default"
|
|
@@ -222,21 +227,19 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
222
227
|
key: "share-tab-".concat(firstIntegration.type)
|
|
223
228
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
224
229
|
key: "share-tabPanel-default"
|
|
225
|
-
}, /*#__PURE__*/React.createElement(FormWrapper, {
|
|
226
|
-
isMainShare: true
|
|
227
|
-
}, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
230
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
|
|
228
231
|
key: "share-tabPanel-integration"
|
|
229
|
-
}, /*#__PURE__*/React.createElement(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
233
|
+
data: {
|
|
234
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
232
237
|
Content: firstIntegration.Content,
|
|
233
238
|
onIntegrationClose: function onIntegrationClose() {
|
|
234
239
|
return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
|
|
235
240
|
},
|
|
236
|
-
changeTab:
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
}))));
|
|
241
|
+
changeTab: this.changeTab
|
|
242
|
+
})))));
|
|
240
243
|
}
|
|
241
244
|
|
|
242
245
|
return this.renderShareForm();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["triggerRef"];
|
|
4
5
|
|
|
5
6
|
var _templateObject, _templateObject2, _templateObject3;
|
|
6
7
|
|
|
@@ -52,7 +53,7 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
52
53
|
testId: "split-button-dropdown",
|
|
53
54
|
trigger: function trigger(_ref2) {
|
|
54
55
|
var triggerRef = _ref2.triggerRef,
|
|
55
|
-
providedProps = _objectWithoutProperties(_ref2,
|
|
56
|
+
providedProps = _objectWithoutProperties(_ref2, _excluded);
|
|
56
57
|
|
|
57
58
|
return /*#__PURE__*/React.createElement(Button, _extends({}, providedProps, {
|
|
58
59
|
ref: triggerRef,
|
|
@@ -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 { isEmail, isTeam, isUser } from '@atlaskit/user-picker';
|
|
8
8
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
@@ -38,7 +38,7 @@ var createScreenEvent = function createScreenEvent(name) {
|
|
|
38
38
|
|
|
39
39
|
export var CHANNEL_ID = 'fabric-elements';
|
|
40
40
|
export var ANALYTICS_SOURCE = 'shareModal';
|
|
41
|
-
export var INTEGRATION_MODAL_SOURCE = '
|
|
41
|
+
export var INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
|
|
42
42
|
export var screenEvent = function screenEvent(_ref) {
|
|
43
43
|
var _ref$isPublicLink = _ref.isPublicLink,
|
|
44
44
|
isPublicLink = _ref$isPublicLink === void 0 ? false : _ref$isPublicLink;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["buttonStyles"];
|
|
4
5
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
6
|
+
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
7
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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; }
|
|
8
9
|
|
|
9
10
|
import React from 'react';
|
|
10
11
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -16,7 +17,7 @@ var StyledButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
16
17
|
theme: function theme(currentTheme, themeProps) {
|
|
17
18
|
var _currentTheme = currentTheme(themeProps),
|
|
18
19
|
buttonStyles = _currentTheme.buttonStyles,
|
|
19
|
-
rest = _objectWithoutProperties(_currentTheme,
|
|
20
|
+
rest = _objectWithoutProperties(_currentTheme, _excluded);
|
|
20
21
|
|
|
21
22
|
return _objectSpread({
|
|
22
23
|
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), {}, {
|
|
@@ -53,4 +53,9 @@ export var optionDataToUsers = function optionDataToUsers(optionDataArray) {
|
|
|
53
53
|
};
|
|
54
54
|
export var allowEmails = function allowEmails(config) {
|
|
55
55
|
return !(config && config.disableSharingToEmails);
|
|
56
|
+
};
|
|
57
|
+
export var resolveShareFooter = function resolveShareFooter(integrationMode, tabIndex, customFooter) {
|
|
58
|
+
if (integrationMode === 'tabs' && tabIndex === 0 && customFooter) {
|
|
59
|
+
return customFooter;
|
|
60
|
+
}
|
|
56
61
|
};
|