@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
8
|
+
|
|
9
|
+
## 3.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`620f202bc02`](https://bitbucket.org/atlassian/atlassian-frontend/commits/620f202bc02) - Prevent event propagation in Share loading state
|
|
14
|
+
|
|
15
|
+
## 3.4.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`e5aa0ac9b74`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e5aa0ac9b74) - [ux] ED-15329 migrates @atlaskit/share to emotion -- fixes a spacing bug with bottom margin on share button.
|
|
20
|
+
|
|
3
21
|
## 3.3.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.messageContainerStyle = exports.default = exports.HiddenInput = exports.CopyLinkButton = exports.AUTO_DISMISS_MS = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -27,9 +27,9 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
27
27
|
|
|
28
28
|
var _react = _interopRequireDefault(require("react"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _reactIntlNext = require("react-intl-next");
|
|
33
33
|
|
|
34
34
|
var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/check-circle"));
|
|
35
35
|
|
|
@@ -62,17 +62,14 @@ var Z_INDEX = _constants.layers.modal();
|
|
|
62
62
|
var AUTO_DISMISS_SECONDS = 8;
|
|
63
63
|
var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
64
64
|
exports.AUTO_DISMISS_MS = AUTO_DISMISS_MS;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
exports.MessageContainer = MessageContainer;
|
|
65
|
+
var messageContainerStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n margin: -8px -16px;\n"])));
|
|
66
|
+
exports.messageContainerStyle = messageContainerStyle;
|
|
69
67
|
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
70
|
-
|
|
71
|
-
var MessageSpan = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-indent: 6px;\n"])));
|
|
68
|
+
var messageTextStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-indent: 6px;\n"])));
|
|
72
69
|
|
|
73
70
|
var HiddenInput = /*#__PURE__*/_react.default.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
|
|
74
71
|
function (props, ref) {
|
|
75
|
-
return
|
|
72
|
+
return (0, _react2.jsx)("input", {
|
|
76
73
|
style: {
|
|
77
74
|
position: 'absolute',
|
|
78
75
|
left: '-9999px'
|
|
@@ -146,16 +143,16 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
146
143
|
formatMessage = _this$props.intl.formatMessage,
|
|
147
144
|
isDisabled = _this$props.isDisabled,
|
|
148
145
|
isPublicLink = _this$props.isPublicLink;
|
|
149
|
-
return
|
|
146
|
+
return (0, _react2.jsx)(_styles.default, (0, _extends2.default)({
|
|
150
147
|
"aria-label": formatMessage(isPublicLink ? _i18n.messages.copyPublicLinkButtonText : _i18n.messages.copyLinkButtonText),
|
|
151
148
|
isDisabled: isDisabled,
|
|
152
149
|
appearance: "subtle-link",
|
|
153
|
-
iconBefore:
|
|
150
|
+
iconBefore: (0, _react2.jsx)(_linkFilled.default, {
|
|
154
151
|
label: "",
|
|
155
152
|
size: "medium"
|
|
156
153
|
}),
|
|
157
154
|
onClick: _this.handleClick
|
|
158
|
-
}, triggerProps),
|
|
155
|
+
}, triggerProps), (0, _react2.jsx)(_reactIntlNext.FormattedMessage, isPublicLink ? _i18n.messages.copyPublicLinkButtonText : _i18n.messages.copyLinkButtonText));
|
|
159
156
|
});
|
|
160
157
|
return _this;
|
|
161
158
|
}
|
|
@@ -174,25 +171,30 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
174
171
|
var _this$props2 = this.props,
|
|
175
172
|
formatMessage = _this$props2.intl.formatMessage,
|
|
176
173
|
copyTooltipText = _this$props2.copyTooltipText;
|
|
177
|
-
return
|
|
174
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, isSafari && (0, _react2.jsx)("div", {
|
|
178
175
|
className: "assistive",
|
|
179
176
|
"aria-live": "assertive"
|
|
180
|
-
}, shouldShowCopiedMessage && formatMessage(_i18n.messages.copiedToClipboardMessage)),
|
|
177
|
+
}, shouldShowCopiedMessage && formatMessage(_i18n.messages.copiedToClipboardMessage)), (0, _react2.jsx)(HiddenInput, {
|
|
181
178
|
ref: this.inputRef,
|
|
182
179
|
text: this.props.link
|
|
183
|
-
}),
|
|
180
|
+
}), (0, _react2.jsx)(_popup.default, {
|
|
184
181
|
zIndex: Z_INDEX,
|
|
185
182
|
content: function content() {
|
|
186
|
-
return
|
|
183
|
+
return (0, _react2.jsx)(_styled.InlineDialogContentWrapper, null, (0, _react2.jsx)("div", {
|
|
184
|
+
css: messageContainerStyle,
|
|
185
|
+
"data-testid": "message-container"
|
|
186
|
+
}, (0, _react2.jsx)(_checkCircle.default, {
|
|
187
187
|
label: "",
|
|
188
188
|
primaryColor: (0, _tokens.token)('color.icon.success', _colors.G300)
|
|
189
|
-
}),
|
|
189
|
+
}), (0, _react2.jsx)("span", {
|
|
190
|
+
css: messageTextStyle
|
|
191
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.copiedToClipboardMessage))));
|
|
190
192
|
},
|
|
191
193
|
isOpen: shouldShowCopiedMessage,
|
|
192
194
|
onClose: this.handleDismissCopiedMessage,
|
|
193
195
|
placement: "top-start",
|
|
194
196
|
trigger: function trigger(triggerProps) {
|
|
195
|
-
return copyTooltipText ?
|
|
197
|
+
return copyTooltipText ? (0, _react2.jsx)(_tooltip.default, {
|
|
196
198
|
content: copyTooltipText,
|
|
197
199
|
position: "bottom-start"
|
|
198
200
|
}, _this2.renderTriggerButton(triggerProps)) : _this2.renderTriggerButton(triggerProps);
|
|
@@ -13,7 +13,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
18
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
19
19
|
|
|
@@ -25,22 +25,22 @@ var _excluded = ["text", "textColor", "IntegrationIcon"];
|
|
|
25
25
|
|
|
26
26
|
var _templateObject, _templateObject2;
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
var IntegrationIconWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px 8px 0 0;\n"])));
|
|
28
|
+
var integrationButtonCopyWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: left;\n"])));
|
|
29
|
+
var integrationIconWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px 8px 0 0;\n"])));
|
|
33
30
|
|
|
34
31
|
var IntegrationButton = function IntegrationButton(props) {
|
|
35
32
|
var text = props.text,
|
|
36
33
|
textColor = props.textColor,
|
|
37
34
|
IntegrationIcon = props.IntegrationIcon,
|
|
38
35
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
return (0, _react2.jsx)(_customThemeButton.default, restProps, (0, _react2.jsx)("span", {
|
|
37
|
+
css: integrationButtonCopyWrapperStyle,
|
|
38
|
+
style: {
|
|
39
|
+
color: textColor || (0, _tokens.token)('color.text', _colors.N500)
|
|
42
40
|
}
|
|
43
|
-
},
|
|
41
|
+
}, (0, _react2.jsx)("span", {
|
|
42
|
+
css: integrationIconWrapperStyle
|
|
43
|
+
}, (0, _react2.jsx)(IntegrationIcon, null)), (0, _react2.jsx)("span", null, text)));
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
IntegrationButton.displayName = 'IntegrationButton';
|
|
@@ -5,21 +5,20 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.formWrapperStyle = exports.IntegrationForm = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _typography = require("@atlaskit/theme/typography");
|
|
17
17
|
|
|
18
18
|
var _templateObject;
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
exports.FormWrapper = FormWrapper;
|
|
20
|
+
var formWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _typography.h500)());
|
|
21
|
+
exports.formWrapperStyle = formWrapperStyle;
|
|
23
22
|
|
|
24
23
|
var IntegrationForm = function IntegrationForm(_ref) {
|
|
25
24
|
var Content = _ref.Content,
|
|
@@ -31,7 +30,9 @@ var IntegrationForm = function IntegrationForm(_ref) {
|
|
|
31
30
|
changeTab = _ref$changeTab === void 0 ? function () {
|
|
32
31
|
return undefined;
|
|
33
32
|
} : _ref$changeTab;
|
|
34
|
-
return
|
|
33
|
+
return (0, _react2.jsx)("div", {
|
|
34
|
+
css: formWrapperStyle
|
|
35
|
+
}, Content && (0, _react2.jsx)(Content, {
|
|
35
36
|
onClose: onIntegrationClose,
|
|
36
37
|
changeTab: changeTab
|
|
37
38
|
}));
|
|
@@ -29,6 +29,7 @@ function LazyShareForm(props) {
|
|
|
29
29
|
var copyLink = props.copyLink,
|
|
30
30
|
config = props.config,
|
|
31
31
|
isFetchingConfig = props.isFetchingConfig,
|
|
32
|
+
setIsLoading = props.setIsLoading,
|
|
32
33
|
loadOptions = props.loadOptions,
|
|
33
34
|
shareFormTitle = props.shareFormTitle,
|
|
34
35
|
shareFormHelperMessage = props.shareFormHelperMessage,
|
|
@@ -61,6 +62,10 @@ function LazyShareForm(props) {
|
|
|
61
62
|
|
|
62
63
|
var footer = /*#__PURE__*/_react.default.createElement("div", null, bottomMessage ? /*#__PURE__*/_react.default.createElement(_styled.BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/_react.default.createElement(_styled.CustomFooterWrapper, null, customFooter));
|
|
63
64
|
|
|
65
|
+
_react.default.useEffect(function () {
|
|
66
|
+
setIsLoading(false);
|
|
67
|
+
});
|
|
68
|
+
|
|
64
69
|
return /*#__PURE__*/_react.default.createElement(_ShareFormWrapper.ShareFormWrapper, {
|
|
65
70
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
66
71
|
// so we don't need to show title via ShareFormWrapper
|
|
@@ -33,7 +33,13 @@ var LazyShareFormLazy = (0, _reactLooselyLazy.lazyForPaint)(function () {
|
|
|
33
33
|
|
|
34
34
|
var LoadingDialog = function LoadingDialog(_ref) {
|
|
35
35
|
var shareFormTitle = _ref.shareFormTitle,
|
|
36
|
-
showTitle = _ref.showTitle
|
|
36
|
+
showTitle = _ref.showTitle,
|
|
37
|
+
setIsLoading = _ref.setIsLoading;
|
|
38
|
+
|
|
39
|
+
_react.default.useEffect(function () {
|
|
40
|
+
setIsLoading(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
37
43
|
return /*#__PURE__*/_react.default.createElement(_ShareFormWrapper.ShareFormWrapper, {
|
|
38
44
|
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
39
45
|
,
|
|
@@ -45,7 +51,8 @@ var _default = function _default(props) {
|
|
|
45
51
|
return /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
|
|
46
52
|
fallback: /*#__PURE__*/_react.default.createElement(LoadingDialog, {
|
|
47
53
|
shareFormTitle: props.shareFormTitle,
|
|
48
|
-
showTitle: props.showTitle
|
|
54
|
+
showTitle: props.showTitle,
|
|
55
|
+
setIsLoading: props.setIsLoading
|
|
49
56
|
})
|
|
50
57
|
}, /*#__PURE__*/_react.default.createElement(LazyShareFormLazy, props));
|
|
51
58
|
};
|
|
@@ -27,9 +27,9 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
27
27
|
|
|
28
28
|
var _react = _interopRequireDefault(require("react"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _reactIntlNext = require("react-intl-next");
|
|
33
33
|
|
|
34
34
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
35
35
|
|
|
@@ -71,8 +71,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
71
71
|
|
|
72
72
|
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; } }
|
|
73
73
|
|
|
74
|
-
var
|
|
75
|
-
|
|
74
|
+
var shareButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n outline: none;\n"])));
|
|
76
75
|
var defaultShareContentState = {
|
|
77
76
|
users: [],
|
|
78
77
|
comment: {
|
|
@@ -109,7 +108,8 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
109
108
|
isUsingSplitButton: false,
|
|
110
109
|
showIntegrationForm: false,
|
|
111
110
|
selectedIntegration: null,
|
|
112
|
-
tabIndex: 0
|
|
111
|
+
tabIndex: 0,
|
|
112
|
+
isLoading: false
|
|
113
113
|
});
|
|
114
114
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closeAndResetDialog", function () {
|
|
115
115
|
_this.setState({
|
|
@@ -176,10 +176,28 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
176
176
|
type: _types.OBJECT_SHARED
|
|
177
177
|
}];
|
|
178
178
|
});
|
|
179
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setIsLoading", function (isLoading) {
|
|
180
|
+
_this.setState({
|
|
181
|
+
isLoading: isLoading
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focus", function () {
|
|
185
|
+
if (_this.containerRef.current) {
|
|
186
|
+
_this.containerRef.current.focus();
|
|
187
|
+
}
|
|
188
|
+
});
|
|
179
189
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
|
|
180
|
-
var
|
|
190
|
+
var _this$state = _this.state,
|
|
191
|
+
isLoading = _this$state.isLoading,
|
|
192
|
+
isDialogOpen = _this$state.isDialogOpen;
|
|
181
193
|
var shouldCloseOnEscapePress = _this.props.shouldCloseOnEscapePress;
|
|
182
194
|
|
|
195
|
+
if (isLoading) {
|
|
196
|
+
event.stopPropagation();
|
|
197
|
+
|
|
198
|
+
_this.focus();
|
|
199
|
+
}
|
|
200
|
+
|
|
183
201
|
if (isDialogOpen) {
|
|
184
202
|
switch (event.key) {
|
|
185
203
|
case 'Esc':
|
|
@@ -191,9 +209,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
191
209
|
event.stopPropagation(); // put the focus back onto the share dialog so that
|
|
192
210
|
// the user can press the escape key again to close the dialog
|
|
193
211
|
|
|
194
|
-
|
|
195
|
-
_this.containerRef.current.focus();
|
|
196
|
-
}
|
|
212
|
+
_this.focus();
|
|
197
213
|
|
|
198
214
|
return;
|
|
199
215
|
} // The dialog will auto-close in @atlaskit/popup, we just need to fire
|
|
@@ -239,9 +255,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
239
255
|
onDialogOpen();
|
|
240
256
|
}
|
|
241
257
|
|
|
242
|
-
|
|
243
|
-
_this.containerRef.current.focus();
|
|
244
|
-
}
|
|
258
|
+
_this.focus();
|
|
245
259
|
}
|
|
246
260
|
});
|
|
247
261
|
});
|
|
@@ -340,9 +354,9 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
340
354
|
});
|
|
341
355
|
});
|
|
342
356
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderShareTriggerButton", function (triggerProps) {
|
|
343
|
-
var _this$
|
|
344
|
-
isDialogOpen = _this$
|
|
345
|
-
isUsingSplitButton = _this$
|
|
357
|
+
var _this$state2 = _this.state,
|
|
358
|
+
isDialogOpen = _this$state2.isDialogOpen,
|
|
359
|
+
isUsingSplitButton = _this$state2.isUsingSplitButton;
|
|
346
360
|
var _this$props6 = _this.props,
|
|
347
361
|
formatMessage = _this$props6.intl.formatMessage,
|
|
348
362
|
isDisabled = _this$props6.isDisabled,
|
|
@@ -368,12 +382,12 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
368
382
|
onClick: _this.onTriggerClick
|
|
369
383
|
}, triggerProps);
|
|
370
384
|
} else {
|
|
371
|
-
button =
|
|
385
|
+
button = (0, _react2.jsx)(_ShareButton.default, (0, _extends2.default)({
|
|
372
386
|
appearance: triggerButtonAppearance,
|
|
373
|
-
text: triggerButtonStyle !== 'icon-only' ?
|
|
387
|
+
text: triggerButtonStyle !== 'icon-only' ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.shareTriggerButtonText) : null,
|
|
374
388
|
"aria-label": formatMessage(_i18n.messages.shareTriggerButtonText),
|
|
375
389
|
onClick: _this.onTriggerClick,
|
|
376
|
-
iconBefore: triggerButtonStyle !== 'text-only' ?
|
|
390
|
+
iconBefore: triggerButtonStyle !== 'text-only' ? (0, _react2.jsx)(ShareButtonIcon, {
|
|
377
391
|
label: ""
|
|
378
392
|
}) : undefined,
|
|
379
393
|
isSelected: isDialogOpen,
|
|
@@ -383,7 +397,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
383
397
|
|
|
384
398
|
|
|
385
399
|
if (triggerButtonStyle === 'icon-only') {
|
|
386
|
-
button =
|
|
400
|
+
button = (0, _react2.jsx)(_tooltip.default, {
|
|
387
401
|
content: !isUsingSplitButton ? triggerButtonTooltipText || formatMessage(_i18n.messages.shareTriggerButtonTooltipText) : null,
|
|
388
402
|
position: triggerButtonTooltipPosition,
|
|
389
403
|
hideTooltipOnClick: true
|
|
@@ -392,7 +406,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
392
406
|
|
|
393
407
|
|
|
394
408
|
if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
|
|
395
|
-
button =
|
|
409
|
+
button = (0, _react2.jsx)(_SplitButton.default, {
|
|
396
410
|
shareButton: button,
|
|
397
411
|
handleOpenSplitButton: _this.handleOpenSplitButton,
|
|
398
412
|
handleCloseSplitButton: _this.handleCloseSplitButton,
|
|
@@ -444,13 +458,13 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
444
458
|
value: function render() {
|
|
445
459
|
var _this2 = this;
|
|
446
460
|
|
|
447
|
-
var _this$
|
|
448
|
-
isDialogOpen = _this$
|
|
449
|
-
isSharing = _this$
|
|
450
|
-
shareError = _this$
|
|
451
|
-
defaultValue = _this$
|
|
452
|
-
showIntegrationForm = _this$
|
|
453
|
-
selectedIntegration = _this$
|
|
461
|
+
var _this$state3 = this.state,
|
|
462
|
+
isDialogOpen = _this$state3.isDialogOpen,
|
|
463
|
+
isSharing = _this$state3.isSharing,
|
|
464
|
+
shareError = _this$state3.shareError,
|
|
465
|
+
defaultValue = _this$state3.defaultValue,
|
|
466
|
+
showIntegrationForm = _this$state3.showIntegrationForm,
|
|
467
|
+
selectedIntegration = _this$state3.selectedIntegration;
|
|
454
468
|
var _this$props7 = this.props,
|
|
455
469
|
copyLink = _this$props7.copyLink,
|
|
456
470
|
dialogPlacement = _this$props7.dialogPlacement,
|
|
@@ -480,15 +494,16 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
480
494
|
} : undefined;
|
|
481
495
|
var footer = (0, _utils.resolveShareFooter)(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
482
496
|
|
|
483
|
-
return
|
|
497
|
+
return (0, _react2.jsx)("div", {
|
|
498
|
+
css: shareButtonWrapperStyles,
|
|
484
499
|
tabIndex: tabIndex,
|
|
485
500
|
onKeyDown: this.handleKeyDown,
|
|
486
501
|
style: style
|
|
487
|
-
},
|
|
502
|
+
}, (0, _react2.jsx)(_popup.default, {
|
|
488
503
|
content: function content() {
|
|
489
|
-
return
|
|
504
|
+
return (0, _react2.jsx)("div", {
|
|
490
505
|
ref: _this2.containerRef
|
|
491
|
-
},
|
|
506
|
+
}, (0, _react2.jsx)(_lazy.default, {
|
|
492
507
|
Content: selectedIntegration && selectedIntegration.Content,
|
|
493
508
|
selectedIntegration: selectedIntegration,
|
|
494
509
|
copyLink: copyLink,
|
|
@@ -504,6 +519,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
504
519
|
defaultValue: defaultValue,
|
|
505
520
|
config: config,
|
|
506
521
|
isFetchingConfig: isFetchingConfig,
|
|
522
|
+
setIsLoading: _this2.setIsLoading,
|
|
507
523
|
submitButtonLabel: submitButtonLabel,
|
|
508
524
|
product: product,
|
|
509
525
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
@@ -531,9 +547,9 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
531
547
|
placement: dialogPlacement,
|
|
532
548
|
trigger: this.renderShareTriggerButton,
|
|
533
549
|
zIndex: dialogZIndex
|
|
534
|
-
}),
|
|
550
|
+
}), (0, _react2.jsx)(_portal.default, {
|
|
535
551
|
zIndex: (0, _utils.generateSelectZIndex)(dialogZIndex)
|
|
536
|
-
},
|
|
552
|
+
}, (0, _react2.jsx)("div", {
|
|
537
553
|
ref: this.selectPortalRef
|
|
538
554
|
})));
|
|
539
555
|
}
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.formWrapperStyles = exports.formFooterStyles = exports.ShareForm = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -29,9 +29,9 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
29
29
|
|
|
30
30
|
var _react = _interopRequireDefault(require("react"));
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _react2 = require("@emotion/react");
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _reactIntlNext = require("react-intl-next");
|
|
35
35
|
|
|
36
36
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
37
37
|
|
|
@@ -81,26 +81,18 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
81
81
|
|
|
82
82
|
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; } }
|
|
83
83
|
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
exports.FormFooter = FormFooter;
|
|
95
|
-
|
|
96
|
-
var FormField = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 12px;\n"])));
|
|
97
|
-
|
|
98
|
-
var IntegrationWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
99
|
-
|
|
100
|
-
var IntegrationIconWrapper = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
84
|
+
var submitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: auto;\n"])));
|
|
85
|
+
var centerAlignedIconWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-self: center;\n padding: 0 10px;\n\n > div {\n line-height: 1;\n }\n"])));
|
|
86
|
+
var formWrapperStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.gridSize)());
|
|
87
|
+
exports.formWrapperStyles = formWrapperStyles;
|
|
88
|
+
var formFooterStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n"])));
|
|
89
|
+
exports.formFooterStyles = formFooterStyles;
|
|
90
|
+
var formFieldStyles = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 12px;\n"])));
|
|
91
|
+
var integrationWrapperStyles = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
92
|
+
var integrationIconWrapperStyles = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
101
93
|
|
|
102
94
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
103
|
-
return
|
|
95
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.shareInIntegrationButtonText, {
|
|
104
96
|
values: {
|
|
105
97
|
integrationName: integrationName
|
|
106
98
|
}
|
|
@@ -151,13 +143,15 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
151
143
|
copyTooltipText = _this$props.copyTooltipText,
|
|
152
144
|
helperMessage = _this$props.helperMessage,
|
|
153
145
|
orgId = _this$props.orgId;
|
|
154
|
-
return
|
|
146
|
+
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
155
147
|
data: {
|
|
156
148
|
source: _analytics.ANALYTICS_SOURCE
|
|
157
149
|
}
|
|
158
|
-
},
|
|
150
|
+
}, (0, _react2.jsx)("form", formProps, showTitle && (0, _react2.jsx)(_ShareHeader.ShareHeader, {
|
|
159
151
|
title: title
|
|
160
|
-
}),
|
|
152
|
+
}), (0, _react2.jsx)("div", {
|
|
153
|
+
css: formFieldStyles
|
|
154
|
+
}, (0, _react2.jsx)(_UserPickerField.UserPickerField, {
|
|
161
155
|
onInputChange: onUserInputChange,
|
|
162
156
|
onChange: onUserSelectionChange,
|
|
163
157
|
loadOptions: loadOptions,
|
|
@@ -172,9 +166,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
172
166
|
isPublicLink: isPublicLink,
|
|
173
167
|
helperMessage: helperMessage,
|
|
174
168
|
orgId: orgId
|
|
175
|
-
})),
|
|
169
|
+
})), (0, _react2.jsx)("div", {
|
|
170
|
+
css: formFieldStyles
|
|
171
|
+
}, (0, _react2.jsx)(_CommentField.CommentField, {
|
|
176
172
|
defaultValue: defaultValue && defaultValue.comment
|
|
177
|
-
})), fieldsFooter,
|
|
173
|
+
})), fieldsFooter, (0, _react2.jsx)("div", {
|
|
174
|
+
css: formFooterStyles,
|
|
175
|
+
"data-testid": "form-footer"
|
|
176
|
+
}, (0, _react2.jsx)(_CopyLinkButton.default, {
|
|
178
177
|
isDisabled: isDisabled,
|
|
179
178
|
onLinkCopy: onLinkCopy,
|
|
180
179
|
link: copyLink,
|
|
@@ -199,18 +198,22 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
199
198
|
var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
200
199
|
var buttonLabel = shareError ? _i18n.messages.formRetry : sendLabel;
|
|
201
200
|
var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : _react.default.Fragment;
|
|
202
|
-
return
|
|
203
|
-
|
|
201
|
+
return (0, _react2.jsx)("div", {
|
|
202
|
+
css: submitButtonWrapperStyles
|
|
203
|
+
}, (0, _react2.jsx)("div", {
|
|
204
|
+
css: centerAlignedIconWrapperStyles
|
|
205
|
+
}, shouldShowWarning && (0, _react2.jsx)(_tooltip.default, {
|
|
206
|
+
content: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.shareFailureMessage),
|
|
204
207
|
position: "top"
|
|
205
|
-
},
|
|
208
|
+
}, (0, _react2.jsx)(_error.default, {
|
|
206
209
|
label: formatMessage(_i18n.messages.shareFailureIconLabel),
|
|
207
210
|
primaryColor: (0, _tokens.token)('color.icon.danger', _colors.R400)
|
|
208
|
-
}))),
|
|
211
|
+
}))), (0, _react2.jsx)(_customThemeButton.default, {
|
|
209
212
|
appearance: buttonAppearance,
|
|
210
213
|
type: "submit",
|
|
211
214
|
isLoading: isSharing,
|
|
212
215
|
isDisabled: isDisabled
|
|
213
|
-
},
|
|
216
|
+
}, (0, _react2.jsx)(ButtonLabelWrapper, null, submitButtonLabel || (0, _react2.jsx)(_reactIntlNext.FormattedMessage, buttonLabel))));
|
|
214
217
|
});
|
|
215
218
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMainTabTitle", function () {
|
|
216
219
|
var _this$props3 = _this.props,
|
|
@@ -222,11 +225,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
222
225
|
}
|
|
223
226
|
|
|
224
227
|
if (!product) {
|
|
225
|
-
return
|
|
228
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.formTitle);
|
|
226
229
|
}
|
|
227
230
|
|
|
228
231
|
var productShareType = product === 'jira' ? _objectSpread({}, _i18n.messages.shareMainTabTextJira) : _objectSpread({}, _i18n.messages.shareMainTabTextConfluence);
|
|
229
|
-
return
|
|
232
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, productShareType);
|
|
230
233
|
});
|
|
231
234
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTab", function (tab) {
|
|
232
235
|
var _this$props$onTabChan, _this$props4;
|
|
@@ -267,23 +270,31 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
267
270
|
var firstIntegration = shareIntegrations[0];
|
|
268
271
|
|
|
269
272
|
if (integrationMode === 'tabs') {
|
|
270
|
-
return
|
|
273
|
+
return (0, _react2.jsx)(_tabs.default, {
|
|
271
274
|
id: "ShareForm-Tabs-Integrations",
|
|
272
275
|
onChange: this.changeTab,
|
|
273
276
|
selected: this.state.selectedTab
|
|
274
|
-
},
|
|
277
|
+
}, (0, _react2.jsx)(_tabs.TabList, null, (0, _react2.jsx)(_tabs.Tab, {
|
|
275
278
|
key: "share-tab-default"
|
|
276
|
-
}, this.renderMainTabTitle()),
|
|
279
|
+
}, this.renderMainTabTitle()), (0, _react2.jsx)(_tabs.Tab, {
|
|
277
280
|
key: "share-tab-".concat(firstIntegration.type)
|
|
278
|
-
},
|
|
281
|
+
}, (0, _react2.jsx)("div", {
|
|
282
|
+
css: integrationWrapperStyles
|
|
283
|
+
}, (0, _react2.jsx)("span", {
|
|
284
|
+
css: integrationIconWrapperStyles
|
|
285
|
+
}, (0, _react2.jsx)(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), (0, _react2.jsx)(_tabs.TabPanel, {
|
|
279
286
|
key: "share-tabPanel-default"
|
|
280
|
-
},
|
|
287
|
+
}, (0, _react2.jsx)("div", {
|
|
288
|
+
css: formWrapperStyles
|
|
289
|
+
}, this.renderShareForm())), (0, _react2.jsx)(_tabs.TabPanel, {
|
|
281
290
|
key: "share-tabPanel-integration"
|
|
282
|
-
},
|
|
291
|
+
}, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
283
292
|
data: {
|
|
284
293
|
source: _analytics.INTEGRATION_MODAL_SOURCE
|
|
285
294
|
}
|
|
286
|
-
},
|
|
295
|
+
}, (0, _react2.jsx)("div", {
|
|
296
|
+
css: formWrapperStyles
|
|
297
|
+
}, (0, _react2.jsx)(_IntegrationForm.IntegrationForm, {
|
|
287
298
|
Content: firstIntegration.Content,
|
|
288
299
|
onIntegrationClose: function onIntegrationClose() {
|
|
289
300
|
return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
|
|
@@ -304,12 +315,12 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
304
315
|
var InternalFormWithIntl = (0, _reactIntlNext.injectIntl)(InternalForm);
|
|
305
316
|
|
|
306
317
|
var ShareForm = function ShareForm(props) {
|
|
307
|
-
return
|
|
318
|
+
return (0, _react2.jsx)(_form.default, {
|
|
308
319
|
onSubmit: props.onSubmit
|
|
309
320
|
}, function (_ref) {
|
|
310
321
|
var formProps = _ref.formProps,
|
|
311
322
|
getValues = _ref.getValues;
|
|
312
|
-
return
|
|
323
|
+
return (0, _react2.jsx)(InternalFormWithIntl, (0, _extends2.default)({}, props, {
|
|
313
324
|
formProps: formProps,
|
|
314
325
|
getValues: getValues
|
|
315
326
|
}));
|