@atlaskit/share 3.0.4 → 3.0.8
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 +24 -0
- package/dist/cjs/clients/ShareServiceClient.js +2 -2
- package/dist/cjs/components/IntegrationButton.js +3 -1
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +9 -9
- package/dist/cjs/components/MessagesIntlProvider.js +2 -2
- package/dist/cjs/components/ShareButton.js +3 -1
- package/dist/cjs/components/ShareDialogContainer.js +2 -2
- package/dist/cjs/components/ShareDialogWithTrigger.js +13 -6
- package/dist/cjs/components/ShareForm.js +41 -36
- package/dist/cjs/components/SplitButton.js +3 -1
- package/dist/cjs/components/analytics.js +3 -3
- package/dist/cjs/components/styles.js +5 -3
- package/dist/cjs/components/utils.js +10 -2
- package/dist/cjs/i18n.js +10 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +10 -10
- package/dist/es2019/components/ShareDialogWithTrigger.js +11 -5
- package/dist/es2019/components/ShareForm.js +28 -21
- package/dist/es2019/components/analytics.js +1 -1
- package/dist/es2019/components/utils.js +6 -1
- package/dist/es2019/i18n.js +10 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +2 -2
- package/dist/esm/components/IntegrationButton.js +2 -1
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +10 -10
- package/dist/esm/components/MessagesIntlProvider.js +2 -2
- package/dist/esm/components/ShareButton.js +2 -1
- package/dist/esm/components/ShareDialogContainer.js +2 -2
- package/dist/esm/components/ShareDialogWithTrigger.js +14 -7
- package/dist/esm/components/ShareForm.js +39 -36
- package/dist/esm/components/SplitButton.js +2 -1
- package/dist/esm/components/analytics.js +3 -3
- package/dist/esm/components/styles.js +4 -3
- package/dist/esm/components/utils.js +5 -0
- package/dist/esm/i18n.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ShareForm.d.ts +1 -5
- package/dist/types/components/analytics.d.ts +1 -1
- package/dist/types/components/utils.d.ts +2 -0
- package/dist/types/i18n.d.ts +10 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9f7c98cf94f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9f7c98cf94f) - Fixes issues with share dialog closing and resetting tabIndex
|
|
8
|
+
|
|
9
|
+
## 3.0.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4e97b934e85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e97b934e85) - Adds condition to only render customFooter for default share form
|
|
14
|
+
|
|
15
|
+
## 3.0.6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`3bada8f14f6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3bada8f14f6) - Rendering of share form submit button depends on the integration type. A type of 'tabs' will change the label to 'share'
|
|
20
|
+
|
|
21
|
+
## 3.0.5
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`7fe36d0765b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7fe36d0765b) - Analytics context changes for share to integrations
|
|
26
|
+
|
|
3
27
|
## 3.0.4
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -15,9 +15,9 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
|
|
16
16
|
var _utilServiceSupport = require("@atlaskit/util-service-support");
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
19
|
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
21
|
|
|
22
22
|
var DEFAULT_SHARE_PATH = 'share';
|
|
23
23
|
exports.DEFAULT_SHARE_PATH = DEFAULT_SHARE_PATH;
|
|
@@ -19,6 +19,8 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
|
|
|
19
19
|
|
|
20
20
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
21
|
|
|
22
|
+
var _excluded = ["text", "textColor", "IntegrationIcon"];
|
|
23
|
+
|
|
22
24
|
var _templateObject, _templateObject2;
|
|
23
25
|
|
|
24
26
|
var IntegrationButtonCopyWrapper = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n display: flex;\n justify-content: left;\n"])), function (props) {
|
|
@@ -31,7 +33,7 @@ var IntegrationButton = function IntegrationButton(props) {
|
|
|
31
33
|
var text = props.text,
|
|
32
34
|
textColor = props.textColor,
|
|
33
35
|
IntegrationIcon = props.IntegrationIcon,
|
|
34
|
-
restProps = (0, _objectWithoutProperties2.default)(props,
|
|
36
|
+
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
35
37
|
return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, restProps, /*#__PURE__*/_react.default.createElement(IntegrationButtonCopyWrapper, {
|
|
36
38
|
theme: {
|
|
37
39
|
textColor: textColor
|
|
@@ -58,21 +58,21 @@ function LazyShareForm(props) {
|
|
|
58
58
|
defaultValue = props.defaultValue,
|
|
59
59
|
showTitle = props.showTitle;
|
|
60
60
|
|
|
61
|
-
var footer = /*#__PURE__*/_react.default.createElement("div", null, bottomMessage ? /*#__PURE__*/_react.default.createElement(_styled.BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/_react.default.createElement(_styled.CustomFooterWrapper, null, customFooter));
|
|
61
|
+
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));
|
|
62
62
|
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
64
|
-
data: {
|
|
65
|
-
source: _analytics.ANALYTICS_SOURCE
|
|
66
|
-
}
|
|
67
|
-
}, /*#__PURE__*/_react.default.createElement(_ShareFormWrapper.ShareFormWrapper, {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_ShareFormWrapper.ShareFormWrapper, {
|
|
68
64
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
69
65
|
// so we don't need to show title via ShareFormWrapper
|
|
70
66
|
,
|
|
71
67
|
shouldShowTitle: false
|
|
72
|
-
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/_react.default.createElement(
|
|
68
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
69
|
+
data: {
|
|
70
|
+
source: _analytics.INTEGRATION_MODAL_SOURCE
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
|
|
73
73
|
Content: selectedIntegration.Content,
|
|
74
74
|
onIntegrationClose: onDialogClose
|
|
75
|
-
}) : /*#__PURE__*/_react.default.createElement(_ShareForm.ShareForm, {
|
|
75
|
+
})) : /*#__PURE__*/_react.default.createElement(_ShareForm.ShareForm, {
|
|
76
76
|
copyLink: copyLink,
|
|
77
77
|
loadOptions: loadOptions,
|
|
78
78
|
title: shareFormTitle,
|
|
@@ -100,7 +100,7 @@ function LazyShareForm(props) {
|
|
|
100
100
|
onUserSelectionChange: onUserSelectionChange,
|
|
101
101
|
handleCloseDialog: onDialogClose,
|
|
102
102
|
onTabChange: onTabChange
|
|
103
|
-
}))
|
|
103
|
+
}));
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
var _default = LazyShareForm;
|
|
@@ -21,9 +21,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
25
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
27
|
|
|
28
28
|
var MessagesIntlProvider = function MessagesIntlProvider(_ref) {
|
|
29
29
|
var intl = _ref.intl,
|
|
@@ -15,9 +15,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
17
17
|
|
|
18
|
+
var _excluded = ["text"];
|
|
19
|
+
|
|
18
20
|
var ShareButton = /*#__PURE__*/_react.default.forwardRef(function ShareButton(_ref, ref) {
|
|
19
21
|
var text = _ref.text,
|
|
20
|
-
props = (0, _objectWithoutProperties2.default)(_ref,
|
|
22
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
21
23
|
return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
|
|
22
24
|
ref: ref,
|
|
23
25
|
"aria-expanded": props.isSelected
|
|
@@ -53,9 +53,9 @@ var _ShareDialogWithTrigger = require("./ShareDialogWithTrigger");
|
|
|
53
53
|
|
|
54
54
|
var _utils = require("./utils");
|
|
55
55
|
|
|
56
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
56
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
57
|
|
|
58
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
58
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
59
|
|
|
60
60
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
61
61
|
|
|
@@ -59,9 +59,9 @@ var _utils = require("./utils");
|
|
|
59
59
|
|
|
60
60
|
var _templateObject;
|
|
61
61
|
|
|
62
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
63
63
|
|
|
64
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
65
65
|
|
|
66
66
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
67
67
|
|
|
@@ -104,7 +104,8 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
104
104
|
defaultValue: defaultShareContentState,
|
|
105
105
|
isUsingSplitButton: false,
|
|
106
106
|
showIntegrationForm: false,
|
|
107
|
-
selectedIntegration: null
|
|
107
|
+
selectedIntegration: null,
|
|
108
|
+
tabIndex: 0
|
|
108
109
|
});
|
|
109
110
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closeAndResetDialog", function () {
|
|
110
111
|
_this.setState({
|
|
@@ -149,6 +150,10 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
_this.createAndFireEvent((0, _analytics.shareTabClicked)(subjectId));
|
|
153
|
+
|
|
154
|
+
_this.setState({
|
|
155
|
+
tabIndex: index
|
|
156
|
+
});
|
|
152
157
|
});
|
|
153
158
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFlags", function () {
|
|
154
159
|
var formatMessage = _this.props.intl.formatMessage; // The reason for providing message property is that in jira,
|
|
@@ -250,7 +255,8 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
250
255
|
_this.setState({
|
|
251
256
|
isDialogOpen: false,
|
|
252
257
|
showIntegrationForm: false,
|
|
253
|
-
selectedIntegration: null
|
|
258
|
+
selectedIntegration: null,
|
|
259
|
+
tabIndex: 0
|
|
254
260
|
});
|
|
255
261
|
});
|
|
256
262
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleShareSubmit", function (data) {
|
|
@@ -450,7 +456,8 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
450
456
|
shareIntegrations = _this$props7.shareIntegrations;
|
|
451
457
|
var style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
452
458
|
outline: 'none'
|
|
453
|
-
} : undefined;
|
|
459
|
+
} : undefined;
|
|
460
|
+
var footer = (0, _utils.resolveShareFooter)(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
454
461
|
|
|
455
462
|
return /*#__PURE__*/_react.default.createElement(ShareButtonWrapper, {
|
|
456
463
|
tabIndex: tabIndex,
|
|
@@ -466,7 +473,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
466
473
|
copyLink: copyLink,
|
|
467
474
|
showIntegrationForm: showIntegrationForm,
|
|
468
475
|
bottomMessage: bottomMessage,
|
|
469
|
-
customFooter:
|
|
476
|
+
customFooter: footer,
|
|
470
477
|
loadOptions: loadUserOptions,
|
|
471
478
|
isSharing: isSharing,
|
|
472
479
|
shareFormTitle: shareFormTitle,
|
|
@@ -33,6 +33,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
33
33
|
|
|
34
34
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
35
35
|
|
|
36
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
37
|
+
|
|
36
38
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
37
39
|
|
|
38
40
|
var _form = _interopRequireDefault(require("@atlaskit/form"));
|
|
@@ -51,6 +53,8 @@ var _i18n = require("../i18n");
|
|
|
51
53
|
|
|
52
54
|
var _types = require("../types");
|
|
53
55
|
|
|
56
|
+
var _analytics = require("./analytics");
|
|
57
|
+
|
|
54
58
|
var _CommentField = require("./CommentField");
|
|
55
59
|
|
|
56
60
|
var _CopyLinkButton = _interopRequireDefault(require("./CopyLinkButton"));
|
|
@@ -67,9 +71,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
67
71
|
|
|
68
72
|
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; }
|
|
69
73
|
|
|
70
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
74
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
71
75
|
|
|
72
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
76
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
73
77
|
|
|
74
78
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
75
79
|
|
|
@@ -79,9 +83,7 @@ var SubmitButtonWrapper = _styledComponents.default.div(_templateObject || (_tem
|
|
|
79
83
|
|
|
80
84
|
var CenterAlignedIconWrapper = _styledComponents.default.div(_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"])));
|
|
81
85
|
|
|
82
|
-
var FormWrapper = _styledComponents.default.div(_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"])),
|
|
83
|
-
return props.isMainShare ? (0, _constants.gridSize)() : (0, _constants.gridSize)() * 2;
|
|
84
|
-
});
|
|
86
|
+
var FormWrapper = _styledComponents.default.div(_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)());
|
|
85
87
|
|
|
86
88
|
exports.FormWrapper = FormWrapper;
|
|
87
89
|
|
|
@@ -93,7 +95,7 @@ var FormField = _styledComponents.default.div(_templateObject5 || (_templateObje
|
|
|
93
95
|
|
|
94
96
|
var IntegrationWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
95
97
|
|
|
96
|
-
var IntegrationIconWrapper = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -
|
|
98
|
+
var IntegrationIconWrapper = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
97
99
|
|
|
98
100
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
99
101
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.shareInIntegrationButtonText, {
|
|
@@ -146,7 +148,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
146
148
|
isPublicLink = _this$props.isPublicLink,
|
|
147
149
|
copyTooltipText = _this$props.copyTooltipText,
|
|
148
150
|
helperMessage = _this$props.helperMessage;
|
|
149
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
152
|
+
data: {
|
|
153
|
+
source: _analytics.ANALYTICS_SOURCE
|
|
154
|
+
}
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement("form", formProps, showTitle && /*#__PURE__*/_react.default.createElement(_ShareHeader.ShareHeader, {
|
|
150
156
|
title: title
|
|
151
157
|
}), /*#__PURE__*/_react.default.createElement(FormField, null, /*#__PURE__*/_react.default.createElement(_UserPickerField.UserPickerField, {
|
|
152
158
|
onInputChange: onUserInputChange,
|
|
@@ -170,7 +176,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
170
176
|
link: copyLink,
|
|
171
177
|
isPublicLink: isPublicLink,
|
|
172
178
|
copyTooltipText: copyTooltipText
|
|
173
|
-
}), _this.renderSubmitButton()));
|
|
179
|
+
}), _this.renderSubmitButton())));
|
|
174
180
|
});
|
|
175
181
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSubmitButton", function () {
|
|
176
182
|
var _this$props2 = _this.props,
|
|
@@ -179,10 +185,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
179
185
|
shareError = _this$props2.shareError,
|
|
180
186
|
submitButtonLabel = _this$props2.submitButtonLabel,
|
|
181
187
|
isDisabled = _this$props2.isDisabled,
|
|
182
|
-
isPublicLink = _this$props2.isPublicLink
|
|
188
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
189
|
+
integrationMode = _this$props2.integrationMode;
|
|
183
190
|
var shouldShowWarning = shareError && !isSharing;
|
|
184
191
|
var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
185
|
-
var
|
|
192
|
+
var tabMode = integrationMode === 'tabs';
|
|
193
|
+
var formPublicLabel = tabMode ? _i18n.messages.formSharePublic : _i18n.messages.formSendPublic;
|
|
194
|
+
var formSendLabel = tabMode ? _i18n.messages.formShare : _i18n.messages.formSend;
|
|
195
|
+
var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
|
|
186
196
|
var buttonLabel = shareError ? _i18n.messages.formRetry : sendLabel;
|
|
187
197
|
var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : _react.default.Fragment;
|
|
188
198
|
return /*#__PURE__*/_react.default.createElement(SubmitButtonWrapper, null, /*#__PURE__*/_react.default.createElement(CenterAlignedIconWrapper, null, shouldShowWarning && /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
@@ -215,9 +225,13 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
215
225
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, productShareType);
|
|
216
226
|
});
|
|
217
227
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTab", function (tab) {
|
|
228
|
+
var _this$props$onTabChan, _this$props4;
|
|
229
|
+
|
|
218
230
|
_this.setState({
|
|
219
231
|
selectedTab: tab
|
|
220
232
|
});
|
|
233
|
+
|
|
234
|
+
(_this$props$onTabChan = (_this$props4 = _this.props).onTabChange) === null || _this$props$onTabChan === void 0 ? void 0 : _this$props$onTabChan.call(_this$props4, tab);
|
|
221
235
|
});
|
|
222
236
|
return _this;
|
|
223
237
|
}
|
|
@@ -225,9 +239,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
225
239
|
(0, _createClass2.default)(InternalForm, [{
|
|
226
240
|
key: "componentWillUnmount",
|
|
227
241
|
value: function componentWillUnmount() {
|
|
228
|
-
var _this$
|
|
229
|
-
onDismiss = _this$
|
|
230
|
-
getValues = _this$
|
|
242
|
+
var _this$props5 = this.props,
|
|
243
|
+
onDismiss = _this$props5.onDismiss,
|
|
244
|
+
getValues = _this$props5.getValues;
|
|
231
245
|
|
|
232
246
|
if (onDismiss) {
|
|
233
247
|
onDismiss(getValues());
|
|
@@ -236,14 +250,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
236
250
|
}, {
|
|
237
251
|
key: "render",
|
|
238
252
|
value: function render() {
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
shareIntegrations = _this$props5.shareIntegrations,
|
|
245
|
-
onTabChange = _this$props5.onTabChange,
|
|
246
|
-
handleCloseDialog = _this$props5.handleCloseDialog;
|
|
253
|
+
var _this$props6 = this.props,
|
|
254
|
+
_this$props6$integrat = _this$props6.integrationMode,
|
|
255
|
+
integrationMode = _this$props6$integrat === void 0 ? 'off' : _this$props6$integrat,
|
|
256
|
+
shareIntegrations = _this$props6.shareIntegrations,
|
|
257
|
+
handleCloseDialog = _this$props6.handleCloseDialog;
|
|
247
258
|
|
|
248
259
|
if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
|
|
249
260
|
return this.renderShareForm();
|
|
@@ -254,11 +265,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
254
265
|
if (integrationMode === 'tabs') {
|
|
255
266
|
return /*#__PURE__*/_react.default.createElement(_tabs.default, {
|
|
256
267
|
id: "ShareForm-Tabs-Integrations",
|
|
257
|
-
onChange:
|
|
258
|
-
_this2.changeTab(index);
|
|
259
|
-
|
|
260
|
-
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
261
|
-
},
|
|
268
|
+
onChange: this.changeTab,
|
|
262
269
|
selected: this.state.selectedTab
|
|
263
270
|
}, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
|
|
264
271
|
key: "share-tab-default"
|
|
@@ -266,21 +273,19 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
266
273
|
key: "share-tab-".concat(firstIntegration.type)
|
|
267
274
|
}, /*#__PURE__*/_react.default.createElement(IntegrationWrapper, null, /*#__PURE__*/_react.default.createElement(IntegrationIconWrapper, null, /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
|
|
268
275
|
key: "share-tabPanel-default"
|
|
269
|
-
}, /*#__PURE__*/_react.default.createElement(FormWrapper, {
|
|
270
|
-
isMainShare: true
|
|
271
|
-
}, this.renderShareForm())), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
|
|
276
|
+
}, /*#__PURE__*/_react.default.createElement(FormWrapper, null, this.renderShareForm())), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
|
|
272
277
|
key: "share-tabPanel-integration"
|
|
273
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
274
|
-
|
|
275
|
-
|
|
278
|
+
}, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
279
|
+
data: {
|
|
280
|
+
source: _analytics.INTEGRATION_MODAL_SOURCE
|
|
281
|
+
}
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(FormWrapper, null, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
|
|
276
283
|
Content: firstIntegration.Content,
|
|
277
284
|
onIntegrationClose: function onIntegrationClose() {
|
|
278
285
|
return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
|
|
279
286
|
},
|
|
280
|
-
changeTab:
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
}))));
|
|
287
|
+
changeTab: this.changeTab
|
|
288
|
+
})))));
|
|
284
289
|
}
|
|
285
290
|
|
|
286
291
|
return this.renderShareForm();
|
|
@@ -37,6 +37,8 @@ var _analytics = require("./analytics");
|
|
|
37
37
|
|
|
38
38
|
var _IntegrationButton = _interopRequireDefault(require("./IntegrationButton"));
|
|
39
39
|
|
|
40
|
+
var _excluded = ["triggerRef"];
|
|
41
|
+
|
|
40
42
|
var _templateObject, _templateObject2, _templateObject3;
|
|
41
43
|
|
|
42
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -82,7 +84,7 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
82
84
|
testId: "split-button-dropdown",
|
|
83
85
|
trigger: function trigger(_ref2) {
|
|
84
86
|
var triggerRef = _ref2.triggerRef,
|
|
85
|
-
providedProps = (0, _objectWithoutProperties2.default)(_ref2,
|
|
87
|
+
providedProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
86
88
|
return /*#__PURE__*/_react.default.createElement(_standardButton.default, (0, _extends2.default)({}, providedProps, {
|
|
87
89
|
ref: triggerRef,
|
|
88
90
|
iconBefore: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
@@ -13,9 +13,9 @@ var _userPicker = require("@atlaskit/user-picker");
|
|
|
13
13
|
|
|
14
14
|
var _version = require("../version.json");
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
19
|
|
|
20
20
|
var buildAttributes = function buildAttributes() {
|
|
21
21
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -50,7 +50,7 @@ var CHANNEL_ID = 'fabric-elements';
|
|
|
50
50
|
exports.CHANNEL_ID = CHANNEL_ID;
|
|
51
51
|
var ANALYTICS_SOURCE = 'shareModal';
|
|
52
52
|
exports.ANALYTICS_SOURCE = ANALYTICS_SOURCE;
|
|
53
|
-
var INTEGRATION_MODAL_SOURCE = '
|
|
53
|
+
var INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
|
|
54
54
|
exports.INTEGRATION_MODAL_SOURCE = INTEGRATION_MODAL_SOURCE;
|
|
55
55
|
|
|
56
56
|
var screenEvent = function screenEvent(_ref) {
|
|
@@ -17,9 +17,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _excluded = ["buttonStyles"];
|
|
21
21
|
|
|
22
|
-
function
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
25
|
|
|
24
26
|
var MAX_PICKER_HEIGHT = 102;
|
|
25
27
|
exports.MAX_PICKER_HEIGHT = MAX_PICKER_HEIGHT;
|
|
@@ -31,7 +33,7 @@ var StyledButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
31
33
|
theme: function theme(currentTheme, themeProps) {
|
|
32
34
|
var _currentTheme = currentTheme(themeProps),
|
|
33
35
|
buttonStyles = _currentTheme.buttonStyles,
|
|
34
|
-
rest = (0, _objectWithoutProperties2.default)(_currentTheme,
|
|
36
|
+
rest = (0, _objectWithoutProperties2.default)(_currentTheme, _excluded);
|
|
35
37
|
|
|
36
38
|
return _objectSpread({
|
|
37
39
|
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), {}, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.zIndexAddition = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.allowEmails = void 0;
|
|
6
|
+
exports.zIndexAddition = exports.resolveShareFooter = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.allowEmails = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("@atlaskit/theme/constants");
|
|
9
9
|
|
|
@@ -73,4 +73,12 @@ var allowEmails = function allowEmails(config) {
|
|
|
73
73
|
return !(config && config.disableSharingToEmails);
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
exports.allowEmails = allowEmails;
|
|
76
|
+
exports.allowEmails = allowEmails;
|
|
77
|
+
|
|
78
|
+
var resolveShareFooter = function resolveShareFooter(integrationMode, tabIndex, customFooter) {
|
|
79
|
+
if (integrationMode === 'tabs' && tabIndex === 0 && customFooter) {
|
|
80
|
+
return customFooter;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.resolveShareFooter = resolveShareFooter;
|
package/dist/cjs/i18n.js
CHANGED
|
@@ -18,11 +18,21 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
18
18
|
defaultMessage: 'Send',
|
|
19
19
|
description: 'Label for Share form submit button.'
|
|
20
20
|
},
|
|
21
|
+
formShare: {
|
|
22
|
+
id: 'fabric.elements.share.form.share',
|
|
23
|
+
defaultMessage: 'Share',
|
|
24
|
+
description: 'Label for Share form submit button.'
|
|
25
|
+
},
|
|
21
26
|
formSendPublic: {
|
|
22
27
|
id: 'fabric.elements.share.form.public.send',
|
|
23
28
|
defaultMessage: 'Send public link',
|
|
24
29
|
description: 'Label for Share form submit button when link is public.'
|
|
25
30
|
},
|
|
31
|
+
formSharePublic: {
|
|
32
|
+
id: 'fabric.elements.share.form.public.share',
|
|
33
|
+
defaultMessage: 'Share public link',
|
|
34
|
+
description: 'Label for Share form submit button when link is public.'
|
|
35
|
+
},
|
|
26
36
|
formRetry: {
|
|
27
37
|
id: 'fabric.elements.share.form.retry',
|
|
28
38
|
defaultMessage: 'Retry',
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import {
|
|
3
|
+
import { INTEGRATION_MODAL_SOURCE } from '../analytics';
|
|
4
4
|
import { IntegrationForm } from '../IntegrationForm';
|
|
5
5
|
import { ShareForm } from '../ShareForm';
|
|
6
6
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
@@ -47,20 +47,20 @@ function LazyShareForm(props) {
|
|
|
47
47
|
defaultValue,
|
|
48
48
|
showTitle
|
|
49
49
|
} = props;
|
|
50
|
-
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
51
|
-
return /*#__PURE__*/React.createElement(
|
|
52
|
-
data: {
|
|
53
|
-
source: ANALYTICS_SOURCE
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
50
|
+
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
51
|
+
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
56
52
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
57
53
|
// so we don't need to show title via ShareFormWrapper
|
|
58
54
|
,
|
|
59
55
|
shouldShowTitle: false
|
|
60
|
-
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(
|
|
56
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
57
|
+
data: {
|
|
58
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
61
61
|
Content: selectedIntegration.Content,
|
|
62
62
|
onIntegrationClose: onDialogClose
|
|
63
|
-
}) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
63
|
+
})) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
64
64
|
copyLink: copyLink,
|
|
65
65
|
loadOptions: loadOptions,
|
|
66
66
|
title: shareFormTitle,
|
|
@@ -88,7 +88,7 @@ function LazyShareForm(props) {
|
|
|
88
88
|
onUserSelectionChange: onUserSelectionChange,
|
|
89
89
|
handleCloseDialog: onDialogClose,
|
|
90
90
|
onTabChange: onTabChange
|
|
91
|
-
}))
|
|
91
|
+
}));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export default LazyShareForm;
|
|
@@ -17,7 +17,7 @@ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, scr
|
|
|
17
17
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
18
18
|
import ShareButton from './ShareButton';
|
|
19
19
|
import SplitButton from './SplitButton';
|
|
20
|
-
import { generateSelectZIndex } from './utils';
|
|
20
|
+
import { generateSelectZIndex, resolveShareFooter } from './utils';
|
|
21
21
|
const ShareButtonWrapper = styled.div`
|
|
22
22
|
display: inline-flex;
|
|
23
23
|
outline: none;
|
|
@@ -47,7 +47,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
47
47
|
defaultValue: defaultShareContentState,
|
|
48
48
|
isUsingSplitButton: false,
|
|
49
49
|
showIntegrationForm: false,
|
|
50
|
-
selectedIntegration: null
|
|
50
|
+
selectedIntegration: null,
|
|
51
|
+
tabIndex: 0
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
_defineProperty(this, "closeAndResetDialog", () => {
|
|
@@ -96,6 +97,9 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
this.createAndFireEvent(shareTabClicked(subjectId));
|
|
100
|
+
this.setState({
|
|
101
|
+
tabIndex: index
|
|
102
|
+
});
|
|
99
103
|
});
|
|
100
104
|
|
|
101
105
|
_defineProperty(this, "getFlags", () => {
|
|
@@ -209,7 +213,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
209
213
|
this.setState({
|
|
210
214
|
isDialogOpen: false,
|
|
211
215
|
showIntegrationForm: false,
|
|
212
|
-
selectedIntegration: null
|
|
216
|
+
selectedIntegration: null,
|
|
217
|
+
tabIndex: 0
|
|
213
218
|
});
|
|
214
219
|
});
|
|
215
220
|
|
|
@@ -410,7 +415,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
410
415
|
} = this.props;
|
|
411
416
|
const style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
412
417
|
outline: 'none'
|
|
413
|
-
} : undefined;
|
|
418
|
+
} : undefined;
|
|
419
|
+
const footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
414
420
|
|
|
415
421
|
return /*#__PURE__*/React.createElement(ShareButtonWrapper, {
|
|
416
422
|
tabIndex: tabIndex,
|
|
@@ -425,7 +431,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
425
431
|
copyLink: copyLink,
|
|
426
432
|
showIntegrationForm: showIntegrationForm,
|
|
427
433
|
bottomMessage: bottomMessage,
|
|
428
|
-
customFooter:
|
|
434
|
+
customFooter: footer,
|
|
429
435
|
loadOptions: loadUserOptions,
|
|
430
436
|
isSharing: isSharing,
|
|
431
437
|
shareFormTitle: shareFormTitle,
|