@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
|
@@ -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: {
|
|
@@ -77,7 +78,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
77
78
|
isUsingSplitButton: false,
|
|
78
79
|
showIntegrationForm: false,
|
|
79
80
|
selectedIntegration: null,
|
|
80
|
-
tabIndex: 0
|
|
81
|
+
tabIndex: 0,
|
|
82
|
+
isLoading: false
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
_defineProperty(_assertThisInitialized(_this), "closeAndResetDialog", function () {
|
|
@@ -149,10 +151,30 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
149
151
|
}];
|
|
150
152
|
});
|
|
151
153
|
|
|
154
|
+
_defineProperty(_assertThisInitialized(_this), "setIsLoading", function (isLoading) {
|
|
155
|
+
_this.setState({
|
|
156
|
+
isLoading: isLoading
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
_defineProperty(_assertThisInitialized(_this), "focus", function () {
|
|
161
|
+
if (_this.containerRef.current) {
|
|
162
|
+
_this.containerRef.current.focus();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
152
166
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
153
|
-
var
|
|
167
|
+
var _this$state = _this.state,
|
|
168
|
+
isLoading = _this$state.isLoading,
|
|
169
|
+
isDialogOpen = _this$state.isDialogOpen;
|
|
154
170
|
var shouldCloseOnEscapePress = _this.props.shouldCloseOnEscapePress;
|
|
155
171
|
|
|
172
|
+
if (isLoading) {
|
|
173
|
+
event.stopPropagation();
|
|
174
|
+
|
|
175
|
+
_this.focus();
|
|
176
|
+
}
|
|
177
|
+
|
|
156
178
|
if (isDialogOpen) {
|
|
157
179
|
switch (event.key) {
|
|
158
180
|
case 'Esc':
|
|
@@ -164,9 +186,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
164
186
|
event.stopPropagation(); // put the focus back onto the share dialog so that
|
|
165
187
|
// the user can press the escape key again to close the dialog
|
|
166
188
|
|
|
167
|
-
|
|
168
|
-
_this.containerRef.current.focus();
|
|
169
|
-
}
|
|
189
|
+
_this.focus();
|
|
170
190
|
|
|
171
191
|
return;
|
|
172
192
|
} // The dialog will auto-close in @atlaskit/popup, we just need to fire
|
|
@@ -213,9 +233,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
213
233
|
onDialogOpen();
|
|
214
234
|
}
|
|
215
235
|
|
|
216
|
-
|
|
217
|
-
_this.containerRef.current.focus();
|
|
218
|
-
}
|
|
236
|
+
_this.focus();
|
|
219
237
|
}
|
|
220
238
|
});
|
|
221
239
|
});
|
|
@@ -320,9 +338,9 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
320
338
|
});
|
|
321
339
|
|
|
322
340
|
_defineProperty(_assertThisInitialized(_this), "renderShareTriggerButton", function (triggerProps) {
|
|
323
|
-
var _this$
|
|
324
|
-
isDialogOpen = _this$
|
|
325
|
-
isUsingSplitButton = _this$
|
|
341
|
+
var _this$state2 = _this.state,
|
|
342
|
+
isDialogOpen = _this$state2.isDialogOpen,
|
|
343
|
+
isUsingSplitButton = _this$state2.isUsingSplitButton;
|
|
326
344
|
var _this$props6 = _this.props,
|
|
327
345
|
formatMessage = _this$props6.intl.formatMessage,
|
|
328
346
|
isDisabled = _this$props6.isDisabled,
|
|
@@ -348,12 +366,12 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
348
366
|
onClick: _this.onTriggerClick
|
|
349
367
|
}, triggerProps);
|
|
350
368
|
} else {
|
|
351
|
-
button =
|
|
369
|
+
button = jsx(ShareButton, _extends({
|
|
352
370
|
appearance: triggerButtonAppearance,
|
|
353
|
-
text: triggerButtonStyle !== 'icon-only' ?
|
|
371
|
+
text: triggerButtonStyle !== 'icon-only' ? jsx(FormattedMessage, messages.shareTriggerButtonText) : null,
|
|
354
372
|
"aria-label": formatMessage(messages.shareTriggerButtonText),
|
|
355
373
|
onClick: _this.onTriggerClick,
|
|
356
|
-
iconBefore: triggerButtonStyle !== 'text-only' ?
|
|
374
|
+
iconBefore: triggerButtonStyle !== 'text-only' ? jsx(ShareButtonIcon, {
|
|
357
375
|
label: ""
|
|
358
376
|
}) : undefined,
|
|
359
377
|
isSelected: isDialogOpen,
|
|
@@ -363,7 +381,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
363
381
|
|
|
364
382
|
|
|
365
383
|
if (triggerButtonStyle === 'icon-only') {
|
|
366
|
-
button =
|
|
384
|
+
button = jsx(Aktooltip, {
|
|
367
385
|
content: !isUsingSplitButton ? triggerButtonTooltipText || formatMessage(messages.shareTriggerButtonTooltipText) : null,
|
|
368
386
|
position: triggerButtonTooltipPosition,
|
|
369
387
|
hideTooltipOnClick: true
|
|
@@ -372,7 +390,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
372
390
|
|
|
373
391
|
|
|
374
392
|
if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
|
|
375
|
-
button =
|
|
393
|
+
button = jsx(SplitButton, {
|
|
376
394
|
shareButton: button,
|
|
377
395
|
handleOpenSplitButton: _this.handleOpenSplitButton,
|
|
378
396
|
handleCloseSplitButton: _this.handleCloseSplitButton,
|
|
@@ -427,13 +445,13 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
427
445
|
value: function render() {
|
|
428
446
|
var _this2 = this;
|
|
429
447
|
|
|
430
|
-
var _this$
|
|
431
|
-
isDialogOpen = _this$
|
|
432
|
-
isSharing = _this$
|
|
433
|
-
shareError = _this$
|
|
434
|
-
defaultValue = _this$
|
|
435
|
-
showIntegrationForm = _this$
|
|
436
|
-
selectedIntegration = _this$
|
|
448
|
+
var _this$state3 = this.state,
|
|
449
|
+
isDialogOpen = _this$state3.isDialogOpen,
|
|
450
|
+
isSharing = _this$state3.isSharing,
|
|
451
|
+
shareError = _this$state3.shareError,
|
|
452
|
+
defaultValue = _this$state3.defaultValue,
|
|
453
|
+
showIntegrationForm = _this$state3.showIntegrationForm,
|
|
454
|
+
selectedIntegration = _this$state3.selectedIntegration;
|
|
437
455
|
var _this$props7 = this.props,
|
|
438
456
|
copyLink = _this$props7.copyLink,
|
|
439
457
|
dialogPlacement = _this$props7.dialogPlacement,
|
|
@@ -463,15 +481,16 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
463
481
|
} : undefined;
|
|
464
482
|
var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
465
483
|
|
|
466
|
-
return
|
|
484
|
+
return jsx("div", {
|
|
485
|
+
css: shareButtonWrapperStyles,
|
|
467
486
|
tabIndex: tabIndex,
|
|
468
487
|
onKeyDown: this.handleKeyDown,
|
|
469
488
|
style: style
|
|
470
|
-
},
|
|
489
|
+
}, jsx(Popup, {
|
|
471
490
|
content: function content() {
|
|
472
|
-
return
|
|
491
|
+
return jsx("div", {
|
|
473
492
|
ref: _this2.containerRef
|
|
474
|
-
},
|
|
493
|
+
}, jsx(LazyShareFormLazy, {
|
|
475
494
|
Content: selectedIntegration && selectedIntegration.Content,
|
|
476
495
|
selectedIntegration: selectedIntegration,
|
|
477
496
|
copyLink: copyLink,
|
|
@@ -487,6 +506,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
487
506
|
defaultValue: defaultValue,
|
|
488
507
|
config: config,
|
|
489
508
|
isFetchingConfig: isFetchingConfig,
|
|
509
|
+
setIsLoading: _this2.setIsLoading,
|
|
490
510
|
submitButtonLabel: submitButtonLabel,
|
|
491
511
|
product: product,
|
|
492
512
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
@@ -514,9 +534,9 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
514
534
|
placement: dialogPlacement,
|
|
515
535
|
trigger: this.renderShareTriggerButton,
|
|
516
536
|
zIndex: dialogZIndex
|
|
517
|
-
}),
|
|
537
|
+
}), jsx(Portal, {
|
|
518
538
|
zIndex: generateSelectZIndex(dialogZIndex)
|
|
519
|
-
},
|
|
539
|
+
}, jsx("div", {
|
|
520
540
|
ref: this.selectPortalRef
|
|
521
541
|
})));
|
|
522
542
|
}
|
|
@@ -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,
|
|
@@ -149,18 +157,22 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
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.2"
|
|
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;
|
|
@@ -10,6 +10,7 @@ export declare type LazyShareFormProps = Pick<ShareDialogWithTriggerProps, 'copy
|
|
|
10
10
|
loadOptions?: LoadOptions;
|
|
11
11
|
selectPortalRef: any;
|
|
12
12
|
showTitle: boolean;
|
|
13
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
16
|
* A Share form content which is lazy-loaded.
|
|
@@ -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';
|
|
@@ -22,6 +24,8 @@ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<
|
|
|
22
24
|
private createAndFireEvent;
|
|
23
25
|
private onTabChange;
|
|
24
26
|
private getFlags;
|
|
27
|
+
private setIsLoading;
|
|
28
|
+
private focus;
|
|
25
29
|
private handleKeyDown;
|
|
26
30
|
private handleDialogOpen;
|
|
27
31
|
private onTriggerClick;
|
|
@@ -33,7 +37,7 @@ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<
|
|
|
33
37
|
renderShareTriggerButton: (triggerProps: TriggerProps) => React.ReactNode;
|
|
34
38
|
handleOpenSplitButton: () => void;
|
|
35
39
|
handleCloseSplitButton: () => void;
|
|
36
|
-
render(): JSX.Element;
|
|
40
|
+
render(): jsx.JSX.Element;
|
|
37
41
|
}
|
|
38
42
|
export declare const ShareDialogWithTrigger: React.ComponentType<ShareDialogWithTriggerProps>;
|
|
39
43
|
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>;
|
|
@@ -32,6 +32,7 @@ export declare type ShareDialogWithTriggerProps = Pick<ShareDialogContainerProps
|
|
|
32
32
|
submitButtonLabel?: React.ReactNode;
|
|
33
33
|
};
|
|
34
34
|
export declare type ShareDialogWithTriggerStates = {
|
|
35
|
+
isLoading: boolean;
|
|
35
36
|
isDialogOpen: boolean;
|
|
36
37
|
isSharing: boolean;
|
|
37
38
|
shareError?: ShareError;
|