@atlaskit/share 3.2.6 → 3.4.0
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 +19 -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/ShareDialogWithTrigger.js +15 -15
- package/dist/cjs/components/ShareForm.js +54 -43
- 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/ShareDialogWithTrigger.js +16 -13
- package/dist/es2019/components/ShareForm.js +52 -32
- 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/ShareDialogWithTrigger.js +15 -13
- package/dist/esm/components/ShareForm.js +51 -31
- 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/ShareDialogWithTrigger.d.ts +3 -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/package.json +9 -8
- package/report.api.md +177 -68
- package/tsconfig.json +0 -1
|
@@ -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
|
}));
|
|
@@ -18,9 +18,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
18
18
|
|
|
19
19
|
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; } }
|
|
20
20
|
|
|
21
|
+
/** @jsx jsx */
|
|
21
22
|
import React from 'react';
|
|
23
|
+
import { css, jsx } from '@emotion/react';
|
|
22
24
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
23
|
-
import styled from 'styled-components';
|
|
24
25
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
25
26
|
import ShareIcon from '@atlaskit/icon/glyph/share';
|
|
26
27
|
import Popup from '@atlaskit/popup';
|
|
@@ -38,7 +39,7 @@ import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
|
38
39
|
import ShareButton from './ShareButton';
|
|
39
40
|
import SplitButton from './SplitButton';
|
|
40
41
|
import { generateSelectZIndex, resolveShareFooter } from './utils';
|
|
41
|
-
var
|
|
42
|
+
var shareButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n outline: none;\n"])));
|
|
42
43
|
export var defaultShareContentState = {
|
|
43
44
|
users: [],
|
|
44
45
|
comment: {
|
|
@@ -348,12 +349,12 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
348
349
|
onClick: _this.onTriggerClick
|
|
349
350
|
}, triggerProps);
|
|
350
351
|
} else {
|
|
351
|
-
button =
|
|
352
|
+
button = jsx(ShareButton, _extends({
|
|
352
353
|
appearance: triggerButtonAppearance,
|
|
353
|
-
text: triggerButtonStyle !== 'icon-only' ?
|
|
354
|
+
text: triggerButtonStyle !== 'icon-only' ? jsx(FormattedMessage, messages.shareTriggerButtonText) : null,
|
|
354
355
|
"aria-label": formatMessage(messages.shareTriggerButtonText),
|
|
355
356
|
onClick: _this.onTriggerClick,
|
|
356
|
-
iconBefore: triggerButtonStyle !== 'text-only' ?
|
|
357
|
+
iconBefore: triggerButtonStyle !== 'text-only' ? jsx(ShareButtonIcon, {
|
|
357
358
|
label: ""
|
|
358
359
|
}) : undefined,
|
|
359
360
|
isSelected: isDialogOpen,
|
|
@@ -363,7 +364,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
363
364
|
|
|
364
365
|
|
|
365
366
|
if (triggerButtonStyle === 'icon-only') {
|
|
366
|
-
button =
|
|
367
|
+
button = jsx(Aktooltip, {
|
|
367
368
|
content: !isUsingSplitButton ? triggerButtonTooltipText || formatMessage(messages.shareTriggerButtonTooltipText) : null,
|
|
368
369
|
position: triggerButtonTooltipPosition,
|
|
369
370
|
hideTooltipOnClick: true
|
|
@@ -372,7 +373,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
372
373
|
|
|
373
374
|
|
|
374
375
|
if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
|
|
375
|
-
button =
|
|
376
|
+
button = jsx(SplitButton, {
|
|
376
377
|
shareButton: button,
|
|
377
378
|
handleOpenSplitButton: _this.handleOpenSplitButton,
|
|
378
379
|
handleCloseSplitButton: _this.handleCloseSplitButton,
|
|
@@ -463,15 +464,16 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
463
464
|
} : undefined;
|
|
464
465
|
var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
465
466
|
|
|
466
|
-
return
|
|
467
|
+
return jsx("div", {
|
|
468
|
+
css: shareButtonWrapperStyles,
|
|
467
469
|
tabIndex: tabIndex,
|
|
468
470
|
onKeyDown: this.handleKeyDown,
|
|
469
471
|
style: style
|
|
470
|
-
},
|
|
472
|
+
}, jsx(Popup, {
|
|
471
473
|
content: function content() {
|
|
472
|
-
return
|
|
474
|
+
return jsx("div", {
|
|
473
475
|
ref: _this2.containerRef
|
|
474
|
-
},
|
|
476
|
+
}, jsx(LazyShareFormLazy, {
|
|
475
477
|
Content: selectedIntegration && selectedIntegration.Content,
|
|
476
478
|
selectedIntegration: selectedIntegration,
|
|
477
479
|
copyLink: copyLink,
|
|
@@ -514,9 +516,9 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
514
516
|
placement: dialogPlacement,
|
|
515
517
|
trigger: this.renderShareTriggerButton,
|
|
516
518
|
zIndex: dialogZIndex
|
|
517
|
-
}),
|
|
519
|
+
}), jsx(Portal, {
|
|
518
520
|
zIndex: generateSelectZIndex(dialogZIndex)
|
|
519
|
-
},
|
|
521
|
+
}, jsx("div", {
|
|
520
522
|
ref: this.selectPortalRef
|
|
521
523
|
})));
|
|
522
524
|
}
|
|
@@ -18,9 +18,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
18
18
|
|
|
19
19
|
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; } }
|
|
20
20
|
|
|
21
|
+
/** @jsx jsx */
|
|
21
22
|
import React from 'react';
|
|
23
|
+
import { css, jsx } from '@emotion/react';
|
|
22
24
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
23
|
-
import styled from 'styled-components';
|
|
24
25
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
25
26
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
26
27
|
import Form from '@atlaskit/form';
|
|
@@ -38,16 +39,16 @@ import CopyLinkButton from './CopyLinkButton';
|
|
|
38
39
|
import { IntegrationForm } from './IntegrationForm';
|
|
39
40
|
import { ShareHeader } from './ShareHeader';
|
|
40
41
|
import { UserPickerField } from './UserPickerField';
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
export var
|
|
44
|
-
export var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
42
|
+
var submitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
|
|
43
|
+
var centerAlignedIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding: 0 10px;\n\n > div {\n line-height: 1;\n }\n"])));
|
|
44
|
+
export var formWrapperStyles = css(_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());
|
|
45
|
+
export var formFooterStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-start;\n"])));
|
|
46
|
+
var formFieldStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
|
|
47
|
+
var integrationWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
48
|
+
var integrationIconWrapperStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
48
49
|
|
|
49
50
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
50
|
-
return
|
|
51
|
+
return jsx(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
|
|
51
52
|
values: {
|
|
52
53
|
integrationName: integrationName
|
|
53
54
|
}
|
|
@@ -100,13 +101,15 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
100
101
|
copyTooltipText = _this$props.copyTooltipText,
|
|
101
102
|
helperMessage = _this$props.helperMessage,
|
|
102
103
|
orgId = _this$props.orgId;
|
|
103
|
-
return
|
|
104
|
+
return jsx(AnalyticsContext, {
|
|
104
105
|
data: {
|
|
105
106
|
source: ANALYTICS_SOURCE
|
|
106
107
|
}
|
|
107
|
-
},
|
|
108
|
+
}, jsx("form", formProps, showTitle && jsx(ShareHeader, {
|
|
108
109
|
title: title
|
|
109
|
-
}),
|
|
110
|
+
}), jsx("div", {
|
|
111
|
+
css: formFieldStyles
|
|
112
|
+
}, jsx(UserPickerField, {
|
|
110
113
|
onInputChange: onUserInputChange,
|
|
111
114
|
onChange: onUserSelectionChange,
|
|
112
115
|
loadOptions: loadOptions,
|
|
@@ -121,9 +124,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
124
|
isPublicLink: isPublicLink,
|
|
122
125
|
helperMessage: helperMessage,
|
|
123
126
|
orgId: orgId
|
|
124
|
-
})),
|
|
127
|
+
})), jsx("div", {
|
|
128
|
+
css: formFieldStyles
|
|
129
|
+
}, jsx(CommentField, {
|
|
125
130
|
defaultValue: defaultValue && defaultValue.comment
|
|
126
|
-
})), fieldsFooter,
|
|
131
|
+
})), fieldsFooter, jsx("div", {
|
|
132
|
+
css: formFooterStyles,
|
|
133
|
+
"data-testid": "form-footer"
|
|
134
|
+
}, jsx(CopyLinkButton, {
|
|
127
135
|
isDisabled: isDisabled,
|
|
128
136
|
onLinkCopy: onLinkCopy,
|
|
129
137
|
link: copyLink,
|
|
@@ -145,22 +153,26 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
153
|
var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
146
154
|
var tabMode = integrationMode === 'tabs';
|
|
147
155
|
var formPublicLabel = tabMode ? messages.formSharePublic : messages.formSendPublic;
|
|
148
|
-
var formSendLabel =
|
|
156
|
+
var formSendLabel = messages.formShare;
|
|
149
157
|
var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
150
158
|
var buttonLabel = shareError ? messages.formRetry : sendLabel;
|
|
151
159
|
var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
|
|
152
|
-
return
|
|
153
|
-
|
|
160
|
+
return jsx("div", {
|
|
161
|
+
css: submitButtonWrapperStyles
|
|
162
|
+
}, jsx("div", {
|
|
163
|
+
css: centerAlignedIconWrapperStyles
|
|
164
|
+
}, shouldShowWarning && jsx(Tooltip, {
|
|
165
|
+
content: jsx(FormattedMessage, messages.shareFailureMessage),
|
|
154
166
|
position: "top"
|
|
155
|
-
},
|
|
167
|
+
}, jsx(ErrorIcon, {
|
|
156
168
|
label: formatMessage(messages.shareFailureIconLabel),
|
|
157
169
|
primaryColor: token('color.icon.danger', R400)
|
|
158
|
-
}))),
|
|
170
|
+
}))), jsx(Button, {
|
|
159
171
|
appearance: buttonAppearance,
|
|
160
172
|
type: "submit",
|
|
161
173
|
isLoading: isSharing,
|
|
162
174
|
isDisabled: isDisabled
|
|
163
|
-
},
|
|
175
|
+
}, jsx(ButtonLabelWrapper, null, submitButtonLabel || jsx(FormattedMessage, buttonLabel))));
|
|
164
176
|
});
|
|
165
177
|
|
|
166
178
|
_defineProperty(_assertThisInitialized(_this), "renderMainTabTitle", function () {
|
|
@@ -173,11 +185,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
if (!product) {
|
|
176
|
-
return
|
|
188
|
+
return jsx(FormattedMessage, messages.formTitle);
|
|
177
189
|
}
|
|
178
190
|
|
|
179
191
|
var productShareType = product === 'jira' ? _objectSpread({}, messages.shareMainTabTextJira) : _objectSpread({}, messages.shareMainTabTextConfluence);
|
|
180
|
-
return
|
|
192
|
+
return jsx(FormattedMessage, productShareType);
|
|
181
193
|
});
|
|
182
194
|
|
|
183
195
|
_defineProperty(_assertThisInitialized(_this), "changeTab", function (tab) {
|
|
@@ -220,23 +232,31 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
220
232
|
var 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-".concat(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: function onIntegrationClose() {
|
|
242
262
|
return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
|
|
@@ -258,12 +278,12 @@ _defineProperty(InternalForm, "defaultProps", {
|
|
|
258
278
|
|
|
259
279
|
var InternalFormWithIntl = injectIntl(InternalForm);
|
|
260
280
|
export var ShareForm = function ShareForm(props) {
|
|
261
|
-
return
|
|
281
|
+
return jsx(Form, {
|
|
262
282
|
onSubmit: props.onSubmit
|
|
263
283
|
}, function (_ref) {
|
|
264
284
|
var formProps = _ref.formProps,
|
|
265
285
|
getValues = _ref.getValues;
|
|
266
|
-
return
|
|
286
|
+
return jsx(InternalFormWithIntl, _extends({}, props, {
|
|
267
287
|
formProps: formProps,
|
|
268
288
|
getValues: getValues
|
|
269
289
|
}));
|
|
@@ -2,15 +2,23 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
+
/** @jsx jsx */
|
|
5
6
|
import React from 'react';
|
|
7
|
+
import { css, jsx, useTheme } from '@emotion/react';
|
|
6
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
9
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
10
|
import { h500 } from '@atlaskit/theme/typography';
|
|
10
11
|
import { messages } from '../i18n';
|
|
11
|
-
var
|
|
12
|
-
export var
|
|
12
|
+
var headerWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
13
|
+
export var getFormHeaderTitleStyles = function getFormHeaderTitleStyles(theme) {
|
|
14
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n line-height: ", "px;\n margin-right: ", "px;\n margin-top: ", "px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), h500(theme), gridSize() * 4, gridSize() * 4, gridSize() * 4);
|
|
15
|
+
};
|
|
13
16
|
export var ShareHeader = function ShareHeader(_ref) {
|
|
14
17
|
var title = _ref.title;
|
|
15
|
-
|
|
18
|
+
var theme = useTheme();
|
|
19
|
+
return jsx("div", {
|
|
20
|
+
css: headerWrapperStyles
|
|
21
|
+
}, jsx("h1", {
|
|
22
|
+
css: getFormHeaderTitleStyles(theme)
|
|
23
|
+
}, title || jsx(FormattedMessage, messages.formTitle)));
|
|
16
24
|
};
|
|
@@ -5,9 +5,10 @@ var _excluded = ["triggerRef"];
|
|
|
5
5
|
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3;
|
|
7
7
|
|
|
8
|
+
/** @jsx jsx */
|
|
8
9
|
import React, { useCallback } from 'react';
|
|
10
|
+
import { css, jsx } from '@emotion/react';
|
|
9
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
12
|
import Button from '@atlaskit/button/standard-button';
|
|
12
13
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
13
14
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -17,12 +18,13 @@ import { token } from '@atlaskit/tokens';
|
|
|
17
18
|
import { messages } from '../i18n';
|
|
18
19
|
import { shareIntegrationButtonEvent } from './analytics/analytics';
|
|
19
20
|
import IntegrationButton from './IntegrationButton';
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
21
|
+
var splitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n button {\n border-radius: ", "px 0 0 ", "px;\n }\n button:hover {\n border-radius: ", "px 0 0 ", "px;\n }\n"])), borderRadius(), borderRadius(), borderRadius(), borderRadius());
|
|
22
|
+
var dropdownMenuWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 1px;\n button {\n border-radius: 0 ", "px ", "px 0;\n }\n button:hover {\n border-radius: 0 ", "px ", "px 0;\n }\n"])), borderRadius(), borderRadius(), borderRadius(), borderRadius()); // span
|
|
23
|
+
|
|
24
|
+
var dropDownIntegrationButtonWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n button:hover {\n background: transparent;\n }\n"])));
|
|
23
25
|
|
|
24
26
|
var integrationButtonText = function integrationButtonText(integrationName) {
|
|
25
|
-
return
|
|
27
|
+
return jsx(FormattedMessage, _extends({}, messages.shareToIntegrationButtonText, {
|
|
26
28
|
values: {
|
|
27
29
|
integrationName: integrationName
|
|
28
30
|
}
|
|
@@ -50,15 +52,17 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
50
52
|
onIntegrationClick(integration);
|
|
51
53
|
createAndFireEvent(shareIntegrationButtonEvent(integration.type));
|
|
52
54
|
}, [createAndFireEvent, onIntegrationClick]);
|
|
53
|
-
return
|
|
55
|
+
return jsx("div", {
|
|
56
|
+
css: dropdownMenuWrapperStyles
|
|
57
|
+
}, jsx(DropdownMenu, {
|
|
54
58
|
testId: "split-button-dropdown",
|
|
55
59
|
trigger: function trigger(_ref2) {
|
|
56
60
|
var triggerRef = _ref2.triggerRef,
|
|
57
61
|
providedProps = _objectWithoutProperties(_ref2, _excluded);
|
|
58
62
|
|
|
59
|
-
return
|
|
63
|
+
return jsx(Button, _extends({}, providedProps, {
|
|
60
64
|
ref: triggerRef,
|
|
61
|
-
iconBefore:
|
|
65
|
+
iconBefore: jsx(ChevronDownIcon, {
|
|
62
66
|
label: ""
|
|
63
67
|
}),
|
|
64
68
|
appearance: triggerButtonAppearance
|
|
@@ -67,11 +71,13 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
67
71
|
placement: "bottom-end",
|
|
68
72
|
isOpen: isUsingSplitButton,
|
|
69
73
|
onOpenChange: onOpenChange
|
|
70
|
-
},
|
|
71
|
-
return
|
|
74
|
+
}, jsx(DropdownItemGroup, null, shareIntegrations.map(function (integration) {
|
|
75
|
+
return jsx(DropdownItem, {
|
|
72
76
|
key: integration.type,
|
|
73
77
|
testId: "split-button-dropdownitem-".concat(integration.type)
|
|
74
|
-
},
|
|
78
|
+
}, jsx("span", {
|
|
79
|
+
css: dropDownIntegrationButtonWrapperStyles
|
|
80
|
+
}, jsx(IntegrationButton, {
|
|
75
81
|
textColor: token('color.text', N800),
|
|
76
82
|
appearance: "subtle",
|
|
77
83
|
onClick: function onClick() {
|
|
@@ -96,9 +102,10 @@ export default function SplitButton(_ref3) {
|
|
|
96
102
|
dialogZIndex = _ref3.dialogZIndex,
|
|
97
103
|
dialogPlacement = _ref3.dialogPlacement,
|
|
98
104
|
createAndFireEvent = _ref3.createAndFireEvent;
|
|
99
|
-
return
|
|
105
|
+
return jsx("div", {
|
|
106
|
+
css: splitButtonWrapperStyles,
|
|
100
107
|
"data-testid": "split-button"
|
|
101
|
-
}, shareButton,
|
|
108
|
+
}, shareButton, jsx(SplitButtonDropdown, {
|
|
102
109
|
shareIntegrations: shareIntegrations,
|
|
103
110
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
104
111
|
isUsingSplitButton: isUsingSplitButton,
|
|
@@ -10,7 +10,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
10
10
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
11
|
return _objectSpread({
|
|
12
12
|
packageName: "@atlaskit/share",
|
|
13
|
-
packageVersion: "3.
|
|
13
|
+
packageVersion: "3.4.0"
|
|
14
14
|
}, attributes);
|
|
15
15
|
};
|
|
16
16
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
5
|
import { TriggerProps } from '@atlaskit/popup';
|
|
4
6
|
export declare const AUTO_DISMISS_MS: number;
|
|
5
|
-
export declare const
|
|
7
|
+
export declare const messageContainerStyle: import("@emotion/react").SerializedStyles;
|
|
6
8
|
declare type InputProps = {
|
|
7
9
|
text: string;
|
|
8
10
|
};
|
|
@@ -27,8 +29,8 @@ export declare class CopyLinkButton extends React.Component<Props & WrappedCompo
|
|
|
27
29
|
private clearAutoDismiss;
|
|
28
30
|
private handleClick;
|
|
29
31
|
private handleDismissCopiedMessage;
|
|
30
|
-
renderTriggerButton: (triggerProps: TriggerProps) => JSX.Element;
|
|
31
|
-
render(): JSX.Element;
|
|
32
|
+
renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
|
|
33
|
+
render(): jsx.JSX.Element;
|
|
32
34
|
}
|
|
33
35
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
34
36
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { IntegrationContentProps } from '../types';
|
|
3
|
-
export declare const
|
|
5
|
+
export declare const formWrapperStyle: import("@emotion/react").SerializedStyles;
|
|
4
6
|
export declare type IntegrationFormProps = {
|
|
5
7
|
Content: React.ComponentType<IntegrationContentProps> | null;
|
|
6
8
|
onIntegrationClose?: () => void;
|
|
7
9
|
changeTab?: (index: number) => void;
|
|
8
10
|
};
|
|
9
|
-
export declare const IntegrationForm: ({ Content, onIntegrationClose, changeTab, }: IntegrationFormProps) => JSX.Element;
|
|
11
|
+
export declare const IntegrationForm: ({ Content, onIntegrationClose, changeTab, }: IntegrationFormProps) => jsx.JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
5
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
6
|
import { TriggerProps } from '@atlaskit/popup';
|
|
@@ -33,7 +35,7 @@ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<
|
|
|
33
35
|
renderShareTriggerButton: (triggerProps: TriggerProps) => React.ReactNode;
|
|
34
36
|
handleOpenSplitButton: () => void;
|
|
35
37
|
handleCloseSplitButton: () => void;
|
|
36
|
-
render(): JSX.Element;
|
|
38
|
+
render(): jsx.JSX.Element;
|
|
37
39
|
}
|
|
38
40
|
export declare const ShareDialogWithTrigger: React.ComponentType<ShareDialogWithTriggerProps>;
|
|
39
41
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
4
|
import { FormChildrenArgs, ShareData, ShareFormProps, TabType } from '../types';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const formWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const formFooterStyles: import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare type State = {
|
|
7
8
|
selectedTab: TabType;
|
|
8
9
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { Theme } from '@emotion/react';
|
|
2
4
|
export declare type Props = {
|
|
3
5
|
title?: React.ReactNode;
|
|
4
6
|
};
|
|
5
|
-
export declare const
|
|
7
|
+
export declare const getFormHeaderTitleStyles: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
6
8
|
export declare const ShareHeader: React.StatelessComponent<Props>;
|