@atlaskit/share 3.3.1 → 3.4.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 +18 -0
- package/dist/cjs/components/CopyLinkButton.js +21 -19
- package/dist/cjs/components/IntegrationButton.js +10 -10
- package/dist/cjs/components/IntegrationForm.js +7 -6
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +5 -0
- package/dist/cjs/components/LazyShareForm/lazy.js +9 -2
- package/dist/cjs/components/ShareDialogWithTrigger.js +49 -33
- package/dist/cjs/components/ShareForm.js +53 -42
- package/dist/cjs/components/ShareHeader.js +14 -7
- package/dist/cjs/components/SplitButton.js +19 -15
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/CopyLinkButton.js +20 -13
- package/dist/es2019/components/IntegrationButton.js +11 -8
- package/dist/es2019/components/IntegrationForm.js +6 -3
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +4 -0
- package/dist/es2019/components/LazyShareForm/lazy.js +14 -7
- package/dist/es2019/components/ShareDialogWithTrigger.js +39 -21
- package/dist/es2019/components/ShareForm.js +51 -31
- package/dist/es2019/components/ShareHeader.js +13 -5
- package/dist/es2019/components/SplitButton.js +21 -13
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/CopyLinkButton.js +19 -13
- package/dist/esm/components/IntegrationButton.js +11 -9
- package/dist/esm/components/IntegrationForm.js +6 -3
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +4 -0
- package/dist/esm/components/LazyShareForm/lazy.js +7 -2
- package/dist/esm/components/ShareDialogWithTrigger.js +51 -31
- package/dist/esm/components/ShareForm.js +50 -30
- package/dist/esm/components/ShareHeader.js +12 -4
- package/dist/esm/components/SplitButton.js +20 -13
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/CopyLinkButton.d.ts +5 -3
- package/dist/types/components/IntegrationButton.d.ts +1 -0
- package/dist/types/components/IntegrationForm.d.ts +4 -2
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -0
- package/dist/types/components/ShareDialogWithTrigger.d.ts +5 -1
- package/dist/types/components/ShareForm.d.ts +3 -2
- package/dist/types/components/ShareHeader.d.ts +3 -1
- package/dist/types/components/SplitButton.d.ts +1 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -0
- package/package.json +4 -3
- package/tsconfig.json +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import React from 'react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
4
7
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
8
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
7
9
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
8
10
|
import Form from '@atlaskit/form';
|
|
@@ -20,11 +22,11 @@ import CopyLinkButton from './CopyLinkButton';
|
|
|
20
22
|
import { IntegrationForm } from './IntegrationForm';
|
|
21
23
|
import { ShareHeader } from './ShareHeader';
|
|
22
24
|
import { UserPickerField } from './UserPickerField';
|
|
23
|
-
const
|
|
25
|
+
const submitButtonWrapperStyles = css`
|
|
24
26
|
display: flex;
|
|
25
27
|
margin-left: auto;
|
|
26
28
|
`;
|
|
27
|
-
const
|
|
29
|
+
const centerAlignedIconWrapperStyles = css`
|
|
28
30
|
display: flex;
|
|
29
31
|
align-self: center;
|
|
30
32
|
padding: 0 10px;
|
|
@@ -33,7 +35,7 @@ const CenterAlignedIconWrapper = styled.div`
|
|
|
33
35
|
line-height: 1;
|
|
34
36
|
}
|
|
35
37
|
`;
|
|
36
|
-
export const
|
|
38
|
+
export const formWrapperStyles = css`
|
|
37
39
|
margin-top: ${gridSize()}px;
|
|
38
40
|
width: 100%;
|
|
39
41
|
|
|
@@ -42,24 +44,23 @@ export const FormWrapper = styled.div`
|
|
|
42
44
|
margin-top: 0;
|
|
43
45
|
}
|
|
44
46
|
`;
|
|
45
|
-
export const
|
|
46
|
-
margin-bottom: ${gridSize}px;
|
|
47
|
+
export const formFooterStyles = css`
|
|
47
48
|
display: flex;
|
|
48
49
|
justify-content: flex-start;
|
|
49
50
|
`;
|
|
50
|
-
const
|
|
51
|
+
const formFieldStyles = css`
|
|
51
52
|
margin-bottom: 12px;
|
|
52
53
|
`;
|
|
53
|
-
const
|
|
54
|
+
const integrationWrapperStyles = css`
|
|
54
55
|
display: flex;
|
|
55
56
|
align-items: center;
|
|
56
57
|
`;
|
|
57
|
-
const
|
|
58
|
+
const integrationIconWrapperStyles = css`
|
|
58
59
|
margin-bottom: -6px;
|
|
59
60
|
margin-right: 5px;
|
|
60
61
|
`;
|
|
61
62
|
|
|
62
|
-
const integrationTabText = integrationName =>
|
|
63
|
+
const integrationTabText = integrationName => jsx(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
|
|
63
64
|
values: {
|
|
64
65
|
integrationName
|
|
65
66
|
}
|
|
@@ -99,13 +100,15 @@ class InternalForm extends React.PureComponent {
|
|
|
99
100
|
helperMessage,
|
|
100
101
|
orgId
|
|
101
102
|
} = this.props;
|
|
102
|
-
return
|
|
103
|
+
return jsx(AnalyticsContext, {
|
|
103
104
|
data: {
|
|
104
105
|
source: ANALYTICS_SOURCE
|
|
105
106
|
}
|
|
106
|
-
},
|
|
107
|
+
}, jsx("form", formProps, showTitle && jsx(ShareHeader, {
|
|
107
108
|
title: title
|
|
108
|
-
}),
|
|
109
|
+
}), jsx("div", {
|
|
110
|
+
css: formFieldStyles
|
|
111
|
+
}, jsx(UserPickerField, {
|
|
109
112
|
onInputChange: onUserInputChange,
|
|
110
113
|
onChange: onUserSelectionChange,
|
|
111
114
|
loadOptions: loadOptions,
|
|
@@ -120,9 +123,14 @@ class InternalForm extends React.PureComponent {
|
|
|
120
123
|
isPublicLink: isPublicLink,
|
|
121
124
|
helperMessage: helperMessage,
|
|
122
125
|
orgId: orgId
|
|
123
|
-
})),
|
|
126
|
+
})), jsx("div", {
|
|
127
|
+
css: formFieldStyles
|
|
128
|
+
}, jsx(CommentField, {
|
|
124
129
|
defaultValue: defaultValue && defaultValue.comment
|
|
125
|
-
})), fieldsFooter,
|
|
130
|
+
})), fieldsFooter, jsx("div", {
|
|
131
|
+
css: formFooterStyles,
|
|
132
|
+
"data-testid": "form-footer"
|
|
133
|
+
}, jsx(CopyLinkButton, {
|
|
126
134
|
isDisabled: isDisabled,
|
|
127
135
|
onLinkCopy: onLinkCopy,
|
|
128
136
|
link: copyLink,
|
|
@@ -151,18 +159,22 @@ class InternalForm extends React.PureComponent {
|
|
|
151
159
|
const sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
152
160
|
const buttonLabel = shareError ? messages.formRetry : sendLabel;
|
|
153
161
|
const ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
|
|
154
|
-
return
|
|
155
|
-
|
|
162
|
+
return jsx("div", {
|
|
163
|
+
css: submitButtonWrapperStyles
|
|
164
|
+
}, jsx("div", {
|
|
165
|
+
css: centerAlignedIconWrapperStyles
|
|
166
|
+
}, shouldShowWarning && jsx(Tooltip, {
|
|
167
|
+
content: jsx(FormattedMessage, messages.shareFailureMessage),
|
|
156
168
|
position: "top"
|
|
157
|
-
},
|
|
169
|
+
}, jsx(ErrorIcon, {
|
|
158
170
|
label: formatMessage(messages.shareFailureIconLabel),
|
|
159
171
|
primaryColor: token('color.icon.danger', R400)
|
|
160
|
-
}))),
|
|
172
|
+
}))), jsx(Button, {
|
|
161
173
|
appearance: buttonAppearance,
|
|
162
174
|
type: "submit",
|
|
163
175
|
isLoading: isSharing,
|
|
164
176
|
isDisabled: isDisabled
|
|
165
|
-
},
|
|
177
|
+
}, jsx(ButtonLabelWrapper, null, submitButtonLabel || jsx(FormattedMessage, buttonLabel))));
|
|
166
178
|
});
|
|
167
179
|
|
|
168
180
|
_defineProperty(this, "renderMainTabTitle", () => {
|
|
@@ -176,13 +188,13 @@ class InternalForm extends React.PureComponent {
|
|
|
176
188
|
}
|
|
177
189
|
|
|
178
190
|
if (!product) {
|
|
179
|
-
return
|
|
191
|
+
return jsx(FormattedMessage, messages.formTitle);
|
|
180
192
|
}
|
|
181
193
|
|
|
182
194
|
const productShareType = product === 'jira' ? { ...messages.shareMainTabTextJira
|
|
183
195
|
} : { ...messages.shareMainTabTextConfluence
|
|
184
196
|
};
|
|
185
|
-
return
|
|
197
|
+
return jsx(FormattedMessage, productShareType);
|
|
186
198
|
});
|
|
187
199
|
|
|
188
200
|
_defineProperty(this, "changeTab", tab => {
|
|
@@ -220,23 +232,31 @@ class InternalForm extends React.PureComponent {
|
|
|
220
232
|
const firstIntegration = shareIntegrations[0];
|
|
221
233
|
|
|
222
234
|
if (integrationMode === 'tabs') {
|
|
223
|
-
return
|
|
235
|
+
return jsx(Tabs, {
|
|
224
236
|
id: "ShareForm-Tabs-Integrations",
|
|
225
237
|
onChange: this.changeTab,
|
|
226
238
|
selected: this.state.selectedTab
|
|
227
|
-
},
|
|
239
|
+
}, jsx(TabList, null, jsx(Tab, {
|
|
228
240
|
key: `share-tab-default`
|
|
229
|
-
}, this.renderMainTabTitle()),
|
|
241
|
+
}, this.renderMainTabTitle()), jsx(Tab, {
|
|
230
242
|
key: `share-tab-${firstIntegration.type}`
|
|
231
|
-
},
|
|
243
|
+
}, jsx("div", {
|
|
244
|
+
css: integrationWrapperStyles
|
|
245
|
+
}, jsx("span", {
|
|
246
|
+
css: integrationIconWrapperStyles
|
|
247
|
+
}, jsx(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), jsx(TabPanel, {
|
|
232
248
|
key: `share-tabPanel-default`
|
|
233
|
-
},
|
|
249
|
+
}, jsx("div", {
|
|
250
|
+
css: formWrapperStyles
|
|
251
|
+
}, this.renderShareForm())), jsx(TabPanel, {
|
|
234
252
|
key: `share-tabPanel-integration`
|
|
235
|
-
},
|
|
253
|
+
}, jsx(AnalyticsContext, {
|
|
236
254
|
data: {
|
|
237
255
|
source: INTEGRATION_MODAL_SOURCE
|
|
238
256
|
}
|
|
239
|
-
},
|
|
257
|
+
}, jsx("div", {
|
|
258
|
+
css: formWrapperStyles
|
|
259
|
+
}, jsx(IntegrationForm, {
|
|
240
260
|
Content: firstIntegration.Content,
|
|
241
261
|
onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
|
|
242
262
|
changeTab: this.changeTab
|
|
@@ -253,12 +273,12 @@ _defineProperty(InternalForm, "defaultProps", {
|
|
|
253
273
|
});
|
|
254
274
|
|
|
255
275
|
const InternalFormWithIntl = injectIntl(InternalForm);
|
|
256
|
-
export const ShareForm = props =>
|
|
276
|
+
export const ShareForm = props => jsx(Form, {
|
|
257
277
|
onSubmit: props.onSubmit
|
|
258
278
|
}, ({
|
|
259
279
|
formProps,
|
|
260
280
|
getValues
|
|
261
|
-
}) =>
|
|
281
|
+
}) => jsx(InternalFormWithIntl, _extends({}, props, {
|
|
262
282
|
formProps: formProps,
|
|
263
283
|
getValues: getValues
|
|
264
284
|
})));
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { css, jsx, useTheme } from '@emotion/react';
|
|
2
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
6
|
import { h500 } from '@atlaskit/theme/typography';
|
|
6
7
|
import { messages } from '../i18n';
|
|
7
|
-
const
|
|
8
|
+
const headerWrapperStyles = css`
|
|
8
9
|
display: flex;
|
|
9
10
|
justify-content: space-between;
|
|
10
11
|
`;
|
|
11
|
-
export const
|
|
12
|
-
${h500}
|
|
12
|
+
export const getFormHeaderTitleStyles = theme => css`
|
|
13
|
+
${h500(theme)}
|
|
13
14
|
line-height: ${gridSize() * 4}px;
|
|
14
15
|
margin-right: ${gridSize() * 4}px;
|
|
15
16
|
margin-top: ${gridSize() * 4}px;
|
|
@@ -23,4 +24,11 @@ export const FormHeaderTitle = styled.h1`
|
|
|
23
24
|
`;
|
|
24
25
|
export const ShareHeader = ({
|
|
25
26
|
title
|
|
26
|
-
}) =>
|
|
27
|
+
}) => {
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
return jsx("div", {
|
|
30
|
+
css: headerWrapperStyles
|
|
31
|
+
}, jsx("h1", {
|
|
32
|
+
css: getFormHeaderTitleStyles(theme)
|
|
33
|
+
}, title || jsx(FormattedMessage, messages.formTitle)));
|
|
34
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React, { useCallback } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
7
|
import Button from '@atlaskit/button/standard-button';
|
|
6
8
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
7
9
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -11,7 +13,7 @@ import { token } from '@atlaskit/tokens';
|
|
|
11
13
|
import { messages } from '../i18n';
|
|
12
14
|
import { shareIntegrationButtonEvent } from './analytics/analytics';
|
|
13
15
|
import IntegrationButton from './IntegrationButton';
|
|
14
|
-
const
|
|
16
|
+
const splitButtonWrapperStyles = css`
|
|
15
17
|
display: flex;
|
|
16
18
|
button {
|
|
17
19
|
border-radius: ${borderRadius()}px 0 0 ${borderRadius()}px;
|
|
@@ -20,7 +22,7 @@ const SplitButtonWrapper = styled.div`
|
|
|
20
22
|
border-radius: ${borderRadius()}px 0 0 ${borderRadius()}px;
|
|
21
23
|
}
|
|
22
24
|
`;
|
|
23
|
-
const
|
|
25
|
+
const dropdownMenuWrapperStyles = css`
|
|
24
26
|
margin-left: 1px;
|
|
25
27
|
button {
|
|
26
28
|
border-radius: 0 ${borderRadius()}px ${borderRadius()}px 0;
|
|
@@ -28,14 +30,15 @@ const DropdownMenuWrapper = styled.div`
|
|
|
28
30
|
button:hover {
|
|
29
31
|
border-radius: 0 ${borderRadius()}px ${borderRadius()}px 0;
|
|
30
32
|
}
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
+
`; // span
|
|
34
|
+
|
|
35
|
+
const dropDownIntegrationButtonWrapperStyles = css`
|
|
33
36
|
button:hover {
|
|
34
37
|
background: transparent;
|
|
35
38
|
}
|
|
36
39
|
`;
|
|
37
40
|
|
|
38
|
-
const integrationButtonText = integrationName =>
|
|
41
|
+
const integrationButtonText = integrationName => jsx(FormattedMessage, _extends({}, messages.shareToIntegrationButtonText, {
|
|
39
42
|
values: {
|
|
40
43
|
integrationName
|
|
41
44
|
}
|
|
@@ -64,14 +67,16 @@ const SplitButtonDropdown = props => {
|
|
|
64
67
|
onIntegrationClick(integration);
|
|
65
68
|
createAndFireEvent(shareIntegrationButtonEvent(integration.type));
|
|
66
69
|
}, [createAndFireEvent, onIntegrationClick]);
|
|
67
|
-
return
|
|
70
|
+
return jsx("div", {
|
|
71
|
+
css: dropdownMenuWrapperStyles
|
|
72
|
+
}, jsx(DropdownMenu, {
|
|
68
73
|
testId: "split-button-dropdown",
|
|
69
74
|
trigger: ({
|
|
70
75
|
triggerRef,
|
|
71
76
|
...providedProps
|
|
72
|
-
}) =>
|
|
77
|
+
}) => jsx(Button, _extends({}, providedProps, {
|
|
73
78
|
ref: triggerRef,
|
|
74
|
-
iconBefore:
|
|
79
|
+
iconBefore: jsx(ChevronDownIcon, {
|
|
75
80
|
label: ""
|
|
76
81
|
}),
|
|
77
82
|
appearance: triggerButtonAppearance
|
|
@@ -79,10 +84,12 @@ const SplitButtonDropdown = props => {
|
|
|
79
84
|
placement: "bottom-end",
|
|
80
85
|
isOpen: isUsingSplitButton,
|
|
81
86
|
onOpenChange: onOpenChange
|
|
82
|
-
},
|
|
87
|
+
}, jsx(DropdownItemGroup, null, shareIntegrations.map(integration => jsx(DropdownItem, {
|
|
83
88
|
key: integration.type,
|
|
84
89
|
testId: `split-button-dropdownitem-${integration.type}`
|
|
85
|
-
},
|
|
90
|
+
}, jsx("span", {
|
|
91
|
+
css: dropDownIntegrationButtonWrapperStyles
|
|
92
|
+
}, jsx(IntegrationButton, {
|
|
86
93
|
textColor: token('color.text', N800),
|
|
87
94
|
appearance: "subtle",
|
|
88
95
|
onClick: () => onIntegrationButtonClick(integration),
|
|
@@ -105,9 +112,10 @@ export default function SplitButton({
|
|
|
105
112
|
dialogPlacement,
|
|
106
113
|
createAndFireEvent
|
|
107
114
|
}) {
|
|
108
|
-
return
|
|
115
|
+
return jsx("div", {
|
|
116
|
+
css: splitButtonWrapperStyles,
|
|
109
117
|
"data-testid": "split-button"
|
|
110
|
-
}, shareButton,
|
|
118
|
+
}, shareButton, jsx(SplitButtonDropdown, {
|
|
111
119
|
shareIntegrations: shareIntegrations,
|
|
112
120
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
113
121
|
isUsingSplitButton: isUsingSplitButton,
|
package/dist/es2019/version.json
CHANGED
|
@@ -14,9 +14,10 @@ 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
|
+
/** @jsx jsx */
|
|
17
18
|
import React from 'react';
|
|
19
|
+
import { css, jsx } from '@emotion/react';
|
|
18
20
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
19
|
-
import styled from 'styled-components';
|
|
20
21
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
21
22
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
22
23
|
import Popup from '@atlaskit/popup';
|
|
@@ -30,12 +31,12 @@ import Button from './styles';
|
|
|
30
31
|
var Z_INDEX = layers.modal();
|
|
31
32
|
var AUTO_DISMISS_SECONDS = 8;
|
|
32
33
|
export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
33
|
-
export var
|
|
34
|
+
export var messageContainerStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: -8px -16px;\n"])));
|
|
34
35
|
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
35
|
-
var
|
|
36
|
+
var messageTextStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-indent: 6px;\n"])));
|
|
36
37
|
export var HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
|
|
37
38
|
function (props, ref) {
|
|
38
|
-
return
|
|
39
|
+
return jsx("input", {
|
|
39
40
|
style: {
|
|
40
41
|
position: 'absolute',
|
|
41
42
|
left: '-9999px'
|
|
@@ -112,16 +113,16 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
112
113
|
formatMessage = _this$props.intl.formatMessage,
|
|
113
114
|
isDisabled = _this$props.isDisabled,
|
|
114
115
|
isPublicLink = _this$props.isPublicLink;
|
|
115
|
-
return
|
|
116
|
+
return jsx(Button, _extends({
|
|
116
117
|
"aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
117
118
|
isDisabled: isDisabled,
|
|
118
119
|
appearance: "subtle-link",
|
|
119
|
-
iconBefore:
|
|
120
|
+
iconBefore: jsx(LinkFilledIcon, {
|
|
120
121
|
label: "",
|
|
121
122
|
size: "medium"
|
|
122
123
|
}),
|
|
123
124
|
onClick: _this.handleClick
|
|
124
|
-
}, triggerProps),
|
|
125
|
+
}, triggerProps), jsx(FormattedMessage, isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText));
|
|
125
126
|
});
|
|
126
127
|
|
|
127
128
|
return _this;
|
|
@@ -141,25 +142,30 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
141
142
|
var _this$props2 = this.props,
|
|
142
143
|
formatMessage = _this$props2.intl.formatMessage,
|
|
143
144
|
copyTooltipText = _this$props2.copyTooltipText;
|
|
144
|
-
return
|
|
145
|
+
return jsx(React.Fragment, null, isSafari && jsx("div", {
|
|
145
146
|
className: "assistive",
|
|
146
147
|
"aria-live": "assertive"
|
|
147
|
-
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)),
|
|
148
|
+
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), jsx(HiddenInput, {
|
|
148
149
|
ref: this.inputRef,
|
|
149
150
|
text: this.props.link
|
|
150
|
-
}),
|
|
151
|
+
}), jsx(Popup, {
|
|
151
152
|
zIndex: Z_INDEX,
|
|
152
153
|
content: function content() {
|
|
153
|
-
return
|
|
154
|
+
return jsx(InlineDialogContentWrapper, null, jsx("div", {
|
|
155
|
+
css: messageContainerStyle,
|
|
156
|
+
"data-testid": "message-container"
|
|
157
|
+
}, jsx(CheckCircleIcon, {
|
|
154
158
|
label: "",
|
|
155
159
|
primaryColor: token('color.icon.success', G300)
|
|
156
|
-
}),
|
|
160
|
+
}), jsx("span", {
|
|
161
|
+
css: messageTextStyle
|
|
162
|
+
}, jsx(FormattedMessage, messages.copiedToClipboardMessage))));
|
|
157
163
|
},
|
|
158
164
|
isOpen: shouldShowCopiedMessage,
|
|
159
165
|
onClose: this.handleDismissCopiedMessage,
|
|
160
166
|
placement: "top-start",
|
|
161
167
|
trigger: function trigger(triggerProps) {
|
|
162
|
-
return copyTooltipText ?
|
|
168
|
+
return copyTooltipText ? jsx(Tooltip, {
|
|
163
169
|
content: copyTooltipText,
|
|
164
170
|
position: "bottom-start"
|
|
165
171
|
}, _this2.renderTriggerButton(triggerProps)) : _this2.renderTriggerButton(triggerProps);
|
|
@@ -4,15 +4,14 @@ var _excluded = ["text", "textColor", "IntegrationIcon"];
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
6
|
|
|
7
|
+
/** @jsx jsx */
|
|
7
8
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
9
10
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
10
11
|
import { N500 } from '@atlaskit/theme/colors';
|
|
11
12
|
import { token } from '@atlaskit/tokens';
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
var IntegrationIconWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 1px 8px 0 0;\n"])));
|
|
13
|
+
var integrationButtonCopyWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: left;\n"])));
|
|
14
|
+
var integrationIconWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 1px 8px 0 0;\n"])));
|
|
16
15
|
|
|
17
16
|
var IntegrationButton = function IntegrationButton(props) {
|
|
18
17
|
var text = props.text,
|
|
@@ -20,11 +19,14 @@ var IntegrationButton = function IntegrationButton(props) {
|
|
|
20
19
|
IntegrationIcon = props.IntegrationIcon,
|
|
21
20
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
22
21
|
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
return jsx(Button, restProps, jsx("span", {
|
|
23
|
+
css: integrationButtonCopyWrapperStyle,
|
|
24
|
+
style: {
|
|
25
|
+
color: textColor || token('color.text', N500)
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, jsx("span", {
|
|
28
|
+
css: integrationIconWrapperStyle
|
|
29
|
+
}, jsx(IntegrationIcon, null)), jsx("span", null, text)));
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
IntegrationButton.displayName = 'IntegrationButton';
|
|
@@ -2,10 +2,11 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
+
/** @jsx jsx */
|
|
5
6
|
import React from 'react';
|
|
6
|
-
import
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
7
8
|
import { h500 } from '@atlaskit/theme/typography';
|
|
8
|
-
export var
|
|
9
|
+
export var formWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top: 0px;\n }\n\n [class^='FormFooter__FormFooterWrapper'] {\n justify-content: space-between;\n margin-top: 12px;\n margin-bottom: 24px;\n }\n\n [class^='Field__FieldWrapper']:not(:first-child) {\n margin-top: 12px;\n }\n"])), h500());
|
|
9
10
|
export var IntegrationForm = function IntegrationForm(_ref) {
|
|
10
11
|
var Content = _ref.Content,
|
|
11
12
|
_ref$onIntegrationClo = _ref.onIntegrationClose,
|
|
@@ -16,7 +17,9 @@ export var IntegrationForm = function IntegrationForm(_ref) {
|
|
|
16
17
|
changeTab = _ref$changeTab === void 0 ? function () {
|
|
17
18
|
return undefined;
|
|
18
19
|
} : _ref$changeTab;
|
|
19
|
-
return
|
|
20
|
+
return jsx("div", {
|
|
21
|
+
css: formWrapperStyle
|
|
22
|
+
}, Content && jsx(Content, {
|
|
20
23
|
onClose: onIntegrationClose,
|
|
21
24
|
changeTab: changeTab
|
|
22
25
|
}));
|
|
@@ -14,6 +14,7 @@ function LazyShareForm(props) {
|
|
|
14
14
|
var copyLink = props.copyLink,
|
|
15
15
|
config = props.config,
|
|
16
16
|
isFetchingConfig = props.isFetchingConfig,
|
|
17
|
+
setIsLoading = props.setIsLoading,
|
|
17
18
|
loadOptions = props.loadOptions,
|
|
18
19
|
shareFormTitle = props.shareFormTitle,
|
|
19
20
|
shareFormHelperMessage = props.shareFormHelperMessage,
|
|
@@ -44,6 +45,9 @@ function LazyShareForm(props) {
|
|
|
44
45
|
showTitle = props.showTitle,
|
|
45
46
|
orgId = props.orgId;
|
|
46
47
|
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
setIsLoading(false);
|
|
50
|
+
});
|
|
47
51
|
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
48
52
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
49
53
|
// so we don't need to show title via ShareFormWrapper
|
|
@@ -13,7 +13,11 @@ var LazyShareFormLazy = lazyForPaint(function () {
|
|
|
13
13
|
|
|
14
14
|
var LoadingDialog = function LoadingDialog(_ref) {
|
|
15
15
|
var shareFormTitle = _ref.shareFormTitle,
|
|
16
|
-
showTitle = _ref.showTitle
|
|
16
|
+
showTitle = _ref.showTitle,
|
|
17
|
+
setIsLoading = _ref.setIsLoading;
|
|
18
|
+
React.useEffect(function () {
|
|
19
|
+
setIsLoading(true);
|
|
20
|
+
});
|
|
17
21
|
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
18
22
|
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
19
23
|
,
|
|
@@ -25,7 +29,8 @@ export default (function (props) {
|
|
|
25
29
|
return /*#__PURE__*/React.createElement(LazySuspense, {
|
|
26
30
|
fallback: /*#__PURE__*/React.createElement(LoadingDialog, {
|
|
27
31
|
shareFormTitle: props.shareFormTitle,
|
|
28
|
-
showTitle: props.showTitle
|
|
32
|
+
showTitle: props.showTitle,
|
|
33
|
+
setIsLoading: props.setIsLoading
|
|
29
34
|
})
|
|
30
35
|
}, /*#__PURE__*/React.createElement(LazyShareFormLazy, props));
|
|
31
36
|
});
|