@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`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.
|
|
8
|
+
|
|
9
|
+
## 3.3.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`575b4888124`](https://bitbucket.org/atlassian/atlassian-frontend/commits/575b4888124) - Removed internal test/demo usages of setSmartUserPickerEnv
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 3.3.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [`3f35716fe41`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f35716fe41) - [ux] changed share dialogue button to 'share' from 'send'
|
|
21
|
+
|
|
3
22
|
## 3.2.6
|
|
4
23
|
|
|
5
24
|
### 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
|
}));
|
|
@@ -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: {
|
|
@@ -368,12 +367,12 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
368
367
|
onClick: _this.onTriggerClick
|
|
369
368
|
}, triggerProps);
|
|
370
369
|
} else {
|
|
371
|
-
button =
|
|
370
|
+
button = (0, _react2.jsx)(_ShareButton.default, (0, _extends2.default)({
|
|
372
371
|
appearance: triggerButtonAppearance,
|
|
373
|
-
text: triggerButtonStyle !== 'icon-only' ?
|
|
372
|
+
text: triggerButtonStyle !== 'icon-only' ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.shareTriggerButtonText) : null,
|
|
374
373
|
"aria-label": formatMessage(_i18n.messages.shareTriggerButtonText),
|
|
375
374
|
onClick: _this.onTriggerClick,
|
|
376
|
-
iconBefore: triggerButtonStyle !== 'text-only' ?
|
|
375
|
+
iconBefore: triggerButtonStyle !== 'text-only' ? (0, _react2.jsx)(ShareButtonIcon, {
|
|
377
376
|
label: ""
|
|
378
377
|
}) : undefined,
|
|
379
378
|
isSelected: isDialogOpen,
|
|
@@ -383,7 +382,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
383
382
|
|
|
384
383
|
|
|
385
384
|
if (triggerButtonStyle === 'icon-only') {
|
|
386
|
-
button =
|
|
385
|
+
button = (0, _react2.jsx)(_tooltip.default, {
|
|
387
386
|
content: !isUsingSplitButton ? triggerButtonTooltipText || formatMessage(_i18n.messages.shareTriggerButtonTooltipText) : null,
|
|
388
387
|
position: triggerButtonTooltipPosition,
|
|
389
388
|
hideTooltipOnClick: true
|
|
@@ -392,7 +391,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
392
391
|
|
|
393
392
|
|
|
394
393
|
if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
|
|
395
|
-
button =
|
|
394
|
+
button = (0, _react2.jsx)(_SplitButton.default, {
|
|
396
395
|
shareButton: button,
|
|
397
396
|
handleOpenSplitButton: _this.handleOpenSplitButton,
|
|
398
397
|
handleCloseSplitButton: _this.handleCloseSplitButton,
|
|
@@ -480,15 +479,16 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
480
479
|
} : undefined;
|
|
481
480
|
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
481
|
|
|
483
|
-
return
|
|
482
|
+
return (0, _react2.jsx)("div", {
|
|
483
|
+
css: shareButtonWrapperStyles,
|
|
484
484
|
tabIndex: tabIndex,
|
|
485
485
|
onKeyDown: this.handleKeyDown,
|
|
486
486
|
style: style
|
|
487
|
-
},
|
|
487
|
+
}, (0, _react2.jsx)(_popup.default, {
|
|
488
488
|
content: function content() {
|
|
489
|
-
return
|
|
489
|
+
return (0, _react2.jsx)("div", {
|
|
490
490
|
ref: _this2.containerRef
|
|
491
|
-
},
|
|
491
|
+
}, (0, _react2.jsx)(_lazy.default, {
|
|
492
492
|
Content: selectedIntegration && selectedIntegration.Content,
|
|
493
493
|
selectedIntegration: selectedIntegration,
|
|
494
494
|
copyLink: copyLink,
|
|
@@ -531,9 +531,9 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
531
531
|
placement: dialogPlacement,
|
|
532
532
|
trigger: this.renderShareTriggerButton,
|
|
533
533
|
zIndex: dialogZIndex
|
|
534
|
-
}),
|
|
534
|
+
}), (0, _react2.jsx)(_portal.default, {
|
|
535
535
|
zIndex: (0, _utils.generateSelectZIndex)(dialogZIndex)
|
|
536
|
-
},
|
|
536
|
+
}, (0, _react2.jsx)("div", {
|
|
537
537
|
ref: this.selectPortalRef
|
|
538
538
|
})));
|
|
539
539
|
}
|
|
@@ -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,
|
|
@@ -195,22 +194,26 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
195
194
|
var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
196
195
|
var tabMode = integrationMode === 'tabs';
|
|
197
196
|
var formPublicLabel = tabMode ? _i18n.messages.formSharePublic : _i18n.messages.formSendPublic;
|
|
198
|
-
var formSendLabel =
|
|
197
|
+
var formSendLabel = _i18n.messages.formShare;
|
|
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
|
}));
|
|
@@ -5,15 +5,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getFormHeaderTitleStyles = exports.ShareHeader = 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
|
-
var
|
|
16
|
+
var _reactIntlNext = require("react-intl-next");
|
|
17
17
|
|
|
18
18
|
var _constants = require("@atlaskit/theme/constants");
|
|
19
19
|
|
|
@@ -23,15 +23,22 @@ var _i18n = require("../i18n");
|
|
|
23
23
|
|
|
24
24
|
var _templateObject, _templateObject2;
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var headerWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var getFormHeaderTitleStyles = function getFormHeaderTitleStyles(theme) {
|
|
29
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _typography.h500)(theme), (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() * 4);
|
|
30
|
+
};
|
|
29
31
|
|
|
30
|
-
exports.
|
|
32
|
+
exports.getFormHeaderTitleStyles = getFormHeaderTitleStyles;
|
|
31
33
|
|
|
32
34
|
var ShareHeader = function ShareHeader(_ref) {
|
|
33
35
|
var title = _ref.title;
|
|
34
|
-
|
|
36
|
+
var theme = (0, _react2.useTheme)();
|
|
37
|
+
return (0, _react2.jsx)("div", {
|
|
38
|
+
css: headerWrapperStyles
|
|
39
|
+
}, (0, _react2.jsx)("h1", {
|
|
40
|
+
css: getFormHeaderTitleStyles(theme)
|
|
41
|
+
}, title || (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.formTitle)));
|
|
35
42
|
};
|
|
36
43
|
|
|
37
44
|
exports.ShareHeader = ShareHeader;
|
|
@@ -17,9 +17,9 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _reactIntlNext = require("react-intl-next");
|
|
23
23
|
|
|
24
24
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
25
25
|
|
|
@@ -47,14 +47,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
47
47
|
|
|
48
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
49
|
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var DropdownMenuWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)());
|
|
50
|
+
var splitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)());
|
|
51
|
+
var dropdownMenuWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)()); // span
|
|
53
52
|
|
|
54
|
-
var
|
|
53
|
+
var dropDownIntegrationButtonWrapperStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n button:hover {\n background: transparent;\n }\n"])));
|
|
55
54
|
|
|
56
55
|
var integrationButtonText = function integrationButtonText(integrationName) {
|
|
57
|
-
return
|
|
56
|
+
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.shareToIntegrationButtonText, {
|
|
58
57
|
values: {
|
|
59
58
|
integrationName: integrationName
|
|
60
59
|
}
|
|
@@ -82,14 +81,16 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
82
81
|
onIntegrationClick(integration);
|
|
83
82
|
createAndFireEvent((0, _analytics.shareIntegrationButtonEvent)(integration.type));
|
|
84
83
|
}, [createAndFireEvent, onIntegrationClick]);
|
|
85
|
-
return
|
|
84
|
+
return (0, _react2.jsx)("div", {
|
|
85
|
+
css: dropdownMenuWrapperStyles
|
|
86
|
+
}, (0, _react2.jsx)(_dropdownMenu.default, {
|
|
86
87
|
testId: "split-button-dropdown",
|
|
87
88
|
trigger: function trigger(_ref2) {
|
|
88
89
|
var triggerRef = _ref2.triggerRef,
|
|
89
90
|
providedProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
90
|
-
return
|
|
91
|
+
return (0, _react2.jsx)(_standardButton.default, (0, _extends2.default)({}, providedProps, {
|
|
91
92
|
ref: triggerRef,
|
|
92
|
-
iconBefore:
|
|
93
|
+
iconBefore: (0, _react2.jsx)(_chevronDown.default, {
|
|
93
94
|
label: ""
|
|
94
95
|
}),
|
|
95
96
|
appearance: triggerButtonAppearance
|
|
@@ -98,11 +99,13 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
98
99
|
placement: "bottom-end",
|
|
99
100
|
isOpen: isUsingSplitButton,
|
|
100
101
|
onOpenChange: onOpenChange
|
|
101
|
-
},
|
|
102
|
-
return
|
|
102
|
+
}, (0, _react2.jsx)(_dropdownMenu.DropdownItemGroup, null, shareIntegrations.map(function (integration) {
|
|
103
|
+
return (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
|
|
103
104
|
key: integration.type,
|
|
104
105
|
testId: "split-button-dropdownitem-".concat(integration.type)
|
|
105
|
-
},
|
|
106
|
+
}, (0, _react2.jsx)("span", {
|
|
107
|
+
css: dropDownIntegrationButtonWrapperStyles
|
|
108
|
+
}, (0, _react2.jsx)(_IntegrationButton.default, {
|
|
106
109
|
textColor: (0, _tokens.token)('color.text', _colors.N800),
|
|
107
110
|
appearance: "subtle",
|
|
108
111
|
onClick: function onClick() {
|
|
@@ -128,9 +131,10 @@ function SplitButton(_ref3) {
|
|
|
128
131
|
dialogZIndex = _ref3.dialogZIndex,
|
|
129
132
|
dialogPlacement = _ref3.dialogPlacement,
|
|
130
133
|
createAndFireEvent = _ref3.createAndFireEvent;
|
|
131
|
-
return
|
|
134
|
+
return (0, _react2.jsx)("div", {
|
|
135
|
+
css: splitButtonWrapperStyles,
|
|
132
136
|
"data-testid": "split-button"
|
|
133
|
-
}, shareButton,
|
|
137
|
+
}, shareButton, (0, _react2.jsx)(SplitButtonDropdown, {
|
|
134
138
|
shareIntegrations: shareIntegrations,
|
|
135
139
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
136
140
|
isUsingSplitButton: isUsingSplitButton,
|