@atlaskit/share 1.0.2 → 3.0.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 +25 -0
- package/clients/package.json +7 -0
- package/dist/cjs/clients/ShareServiceClient.js +1 -7
- package/dist/cjs/clients/index.js +13 -0
- package/dist/cjs/components/CopyLinkButton.js +15 -11
- package/dist/cjs/components/IntegrationForm.js +5 -2
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +105 -0
- package/dist/cjs/components/LazyShareForm/index.js +15 -0
- package/dist/cjs/components/LazyShareForm/lazy.js +53 -0
- package/dist/cjs/components/LazyShareForm/styled.js +28 -0
- package/dist/cjs/components/ShareDialogContainer.js +1 -1
- package/dist/cjs/components/ShareDialogWithTrigger.js +26 -38
- package/dist/cjs/components/ShareForm.js +33 -14
- package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +29 -0
- package/dist/cjs/components/ShareFormWrapper/index.js +15 -0
- package/dist/cjs/components/ShareFormWrapper/styled.js +31 -0
- package/dist/cjs/components/styles.js +1 -20
- package/dist/cjs/i18n.js +10 -10
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/types/ShareDialogContainer.js +5 -0
- package/dist/cjs/types/ShareForm.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/ShareServiceClient.js +1 -7
- package/dist/es2019/clients/index.js +1 -0
- package/dist/es2019/components/CopyLinkButton.js +12 -4
- package/dist/es2019/components/IntegrationForm.js +2 -2
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +92 -0
- package/dist/es2019/components/LazyShareForm/index.js +1 -0
- package/dist/es2019/components/LazyShareForm/lazy.js +26 -0
- package/dist/es2019/components/LazyShareForm/styled.js +16 -0
- package/dist/es2019/components/ShareDialogContainer.js +1 -1
- package/dist/es2019/components/ShareDialogWithTrigger.js +27 -39
- package/dist/es2019/components/ShareForm.js +23 -4
- package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +14 -0
- package/dist/es2019/components/ShareFormWrapper/index.js +1 -0
- package/dist/es2019/components/ShareFormWrapper/styled.js +15 -0
- package/dist/es2019/components/styles.js +1 -15
- package/dist/es2019/i18n.js +10 -10
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/types/ShareDialogContainer.js +1 -0
- package/dist/es2019/types/ShareForm.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +1 -7
- package/dist/esm/clients/index.js +1 -0
- package/dist/esm/components/CopyLinkButton.js +12 -4
- package/dist/esm/components/IntegrationForm.js +5 -2
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +87 -0
- package/dist/esm/components/LazyShareForm/index.js +1 -0
- package/dist/esm/components/LazyShareForm/lazy.js +31 -0
- package/dist/esm/components/LazyShareForm/styled.js +9 -0
- package/dist/esm/components/ShareDialogContainer.js +1 -1
- package/dist/esm/components/ShareDialogWithTrigger.js +28 -35
- package/dist/esm/components/ShareForm.js +33 -13
- package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +17 -0
- package/dist/esm/components/ShareFormWrapper/index.js +1 -0
- package/dist/esm/components/ShareFormWrapper/styled.js +15 -0
- package/dist/esm/components/styles.js +1 -16
- package/dist/esm/i18n.js +10 -10
- package/dist/esm/index.js +0 -1
- package/dist/esm/types/ShareDialogContainer.js +1 -0
- package/dist/esm/types/ShareForm.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/ShareServiceClient.d.ts +2 -2
- package/dist/types/clients/index.d.ts +2 -0
- package/dist/types/components/IntegrationForm.d.ts +4 -5
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +19 -0
- package/dist/types/components/LazyShareForm/index.d.ts +1 -0
- package/dist/types/components/LazyShareForm/lazy.d.ts +4 -0
- package/dist/types/components/LazyShareForm/styled.d.ts +4 -0
- package/dist/types/components/ShareDialogContainer.d.ts +10 -148
- package/dist/types/components/ShareDialogWithTrigger.d.ts +10 -71
- package/dist/types/components/ShareForm.d.ts +3 -44
- package/dist/types/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
- package/dist/types/components/ShareFormWrapper/index.d.ts +1 -0
- package/dist/types/components/ShareFormWrapper/styled.d.ts +9 -0
- package/dist/types/components/styles.d.ts +0 -7
- package/dist/types/i18n.d.ts +10 -10
- package/dist/types/index.d.ts +1 -4
- package/dist/types/types/ShareContentState.d.ts +2 -2
- package/dist/types/types/ShareDialogContainer.d.ts +142 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +30 -3
- package/dist/types/types/ShareForm.d.ts +31 -0
- package/dist/types/types/index.d.ts +4 -2
- package/package.json +6 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.InlineDialogFormWrapper = exports.InlineDialogContentWrapper = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
var InlineDialogFormWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n"])), (0, _constants.gridSize)() * 44);
|
|
19
|
+
/**
|
|
20
|
+
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
21
|
+
* compared to the @atlaskit/popup we are now using.
|
|
22
|
+
*
|
|
23
|
+
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.InlineDialogFormWrapper = InlineDialogFormWrapper;
|
|
28
|
+
|
|
29
|
+
var InlineDialogContentWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px;\n"])), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 3);
|
|
30
|
+
|
|
31
|
+
exports.InlineDialogContentWrapper = InlineDialogContentWrapper;
|
|
@@ -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.default = exports.MAX_PICKER_HEIGHT =
|
|
8
|
+
exports.default = exports.MAX_PICKER_HEIGHT = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -13,36 +13,17 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
16
|
var _react = _interopRequireDefault(require("react"));
|
|
19
17
|
|
|
20
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
21
|
-
|
|
22
18
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
23
19
|
|
|
24
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _templateObject;
|
|
27
|
-
|
|
28
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
29
21
|
|
|
30
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
23
|
|
|
32
24
|
var MAX_PICKER_HEIGHT = 102;
|
|
33
|
-
/**
|
|
34
|
-
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
35
|
-
* compared to the @atlaskit/popup we are now using.
|
|
36
|
-
*
|
|
37
|
-
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
25
|
exports.MAX_PICKER_HEIGHT = MAX_PICKER_HEIGHT;
|
|
41
26
|
|
|
42
|
-
var InlineDialogContentWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px;\n"])), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 3);
|
|
43
|
-
|
|
44
|
-
exports.InlineDialogContentWrapper = InlineDialogContentWrapper;
|
|
45
|
-
|
|
46
27
|
var StyledButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
47
28
|
return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
|
|
48
29
|
ref: ref
|
package/dist/cjs/i18n.js
CHANGED
|
@@ -108,11 +108,6 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
108
108
|
defaultMessage: 'Invite',
|
|
109
109
|
description: 'Button label for when the sharee action is set to "edit".'
|
|
110
110
|
},
|
|
111
|
-
copyLinkButtonIconLabel: {
|
|
112
|
-
id: 'fabric.elements.share.copylink.button.icon.label',
|
|
113
|
-
defaultMessage: 'Copy link icon',
|
|
114
|
-
description: 'Default text for the aria-label of the copy Link icon'
|
|
115
|
-
},
|
|
116
111
|
copyLinkButtonText: {
|
|
117
112
|
id: 'fabric.elements.share.copylink.button.text',
|
|
118
113
|
defaultMessage: 'Copy link',
|
|
@@ -123,11 +118,6 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
123
118
|
defaultMessage: 'Copy public link',
|
|
124
119
|
description: 'Default text for the Copy Link button when the link is public'
|
|
125
120
|
},
|
|
126
|
-
copiedToClipboardIconLabel: {
|
|
127
|
-
id: 'fabric.elements.share.copied.to.clipboard.icon.label',
|
|
128
|
-
defaultMessage: 'Copy link success icon',
|
|
129
|
-
description: 'Default text for the aria-label of the copied link icon'
|
|
130
|
-
},
|
|
131
121
|
copiedToClipboardMessage: {
|
|
132
122
|
id: 'fabric.elements.share.copied.to.clipboard.message',
|
|
133
123
|
defaultMessage: 'Link copied to clipboard',
|
|
@@ -168,6 +158,16 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
168
158
|
id: 'fabric.elements.share.in.integration.button',
|
|
169
159
|
defaultMessage: 'Share in {integrationName}',
|
|
170
160
|
description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
|
|
161
|
+
},
|
|
162
|
+
shareMainTabTextJira: {
|
|
163
|
+
id: 'fabric.elements.share.main.tab.text.jira',
|
|
164
|
+
defaultMessage: 'Share issue',
|
|
165
|
+
description: 'Text for the main share tab for jira'
|
|
166
|
+
},
|
|
167
|
+
shareMainTabTextConfluence: {
|
|
168
|
+
id: 'fabric.elements.share.main.tab.text.confluence',
|
|
169
|
+
defaultMessage: 'Share page',
|
|
170
|
+
description: 'Text for the main share tab for confluence'
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
exports.messages = messages;
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,14 +21,6 @@ Object.defineProperty(exports, "ShareDialogContainer", {
|
|
|
21
21
|
return _ShareDialogContainer.ShareDialogContainer;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "ShareServiceClient", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _ShareServiceClient.ShareServiceClient;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
var _ShareServiceClient = require("./clients/ShareServiceClient");
|
|
32
24
|
|
|
33
25
|
var _ShareDialogContainer = require("./components/ShareDialogContainer");
|
|
34
26
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -10,13 +10,7 @@ export class ShareServiceClient {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
getConfig(cloudId
|
|
14
|
-
if (!enableEmailPermissionCheck) {
|
|
15
|
-
return Promise.resolve({
|
|
16
|
-
disableSharingToEmails: false
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
13
|
+
getConfig(cloudId) {
|
|
20
14
|
const options = {
|
|
21
15
|
path: SHARE_CONFIG_PATH,
|
|
22
16
|
queryParams: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ShareServiceClient } from './ShareServiceClient';
|
|
@@ -8,9 +8,11 @@ import { layers } from '@atlaskit/theme/constants';
|
|
|
8
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
11
|
+
import { isSafari } from 'react-device-detect';
|
|
11
12
|
import styled from 'styled-components';
|
|
12
|
-
import Button
|
|
13
|
+
import Button from './styles';
|
|
13
14
|
import { messages } from '../i18n';
|
|
15
|
+
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
14
16
|
const Z_INDEX = layers.modal();
|
|
15
17
|
const AUTO_DISMISS_SECONDS = 8;
|
|
16
18
|
export const AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
@@ -28,6 +30,8 @@ export const HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden in
|
|
|
28
30
|
position: 'absolute',
|
|
29
31
|
left: '-9999px'
|
|
30
32
|
},
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
"aria-hidden": true,
|
|
31
35
|
ref: ref,
|
|
32
36
|
value: props.text,
|
|
33
37
|
readOnly: true
|
|
@@ -85,10 +89,11 @@ export class CopyLinkButton extends React.Component {
|
|
|
85
89
|
isPublicLink
|
|
86
90
|
} = this.props;
|
|
87
91
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
92
|
+
"aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
88
93
|
isDisabled: isDisabled,
|
|
89
94
|
appearance: "subtle-link",
|
|
90
95
|
iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
91
|
-
label:
|
|
96
|
+
label: "",
|
|
92
97
|
size: "medium"
|
|
93
98
|
}),
|
|
94
99
|
onClick: this.handleClick
|
|
@@ -110,13 +115,16 @@ export class CopyLinkButton extends React.Component {
|
|
|
110
115
|
},
|
|
111
116
|
copyTooltipText
|
|
112
117
|
} = this.props;
|
|
113
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari && /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: "assistive",
|
|
120
|
+
"aria-live": "assertive"
|
|
121
|
+
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), /*#__PURE__*/React.createElement(HiddenInput, {
|
|
114
122
|
ref: this.inputRef,
|
|
115
123
|
text: this.props.link
|
|
116
124
|
}), /*#__PURE__*/React.createElement(Popup, {
|
|
117
125
|
zIndex: Z_INDEX,
|
|
118
126
|
content: () => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
119
|
-
label:
|
|
127
|
+
label: "",
|
|
120
128
|
primaryColor: G300
|
|
121
129
|
}), /*#__PURE__*/React.createElement(MessageSpan, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.copiedToClipboardMessage)))),
|
|
122
130
|
isOpen: shouldShowCopiedMessage,
|
|
@@ -31,7 +31,7 @@ export const FormWrapper = styled.div`
|
|
|
31
31
|
`;
|
|
32
32
|
export const IntegrationForm = ({
|
|
33
33
|
Content,
|
|
34
|
-
onIntegrationClose
|
|
35
|
-
}) => /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(Content, {
|
|
34
|
+
onIntegrationClose = () => undefined
|
|
35
|
+
}) => /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
|
|
36
36
|
onClose: onIntegrationClose
|
|
37
37
|
}));
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ShareForm } from '../ShareForm';
|
|
4
|
+
import { ANALYTICS_SOURCE } from '../analytics';
|
|
5
|
+
import { IntegrationForm } from '../IntegrationForm';
|
|
6
|
+
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
7
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A Share form content which is lazy-loaded.
|
|
11
|
+
* Make sure this component is not exported inside main entry points `src/index.ts`
|
|
12
|
+
*/
|
|
13
|
+
function LazyShareForm(props) {
|
|
14
|
+
const {
|
|
15
|
+
copyLink,
|
|
16
|
+
config,
|
|
17
|
+
isFetchingConfig,
|
|
18
|
+
loadOptions,
|
|
19
|
+
shareFormTitle,
|
|
20
|
+
shareFormHelperMessage,
|
|
21
|
+
bottomMessage,
|
|
22
|
+
submitButtonLabel,
|
|
23
|
+
product,
|
|
24
|
+
customFooter,
|
|
25
|
+
enableSmartUserPicker,
|
|
26
|
+
loggedInAccountId,
|
|
27
|
+
cloudId,
|
|
28
|
+
shareFieldsFooter,
|
|
29
|
+
onUserSelectionChange,
|
|
30
|
+
isPublicLink,
|
|
31
|
+
copyTooltipText,
|
|
32
|
+
shareIntegrations,
|
|
33
|
+
integrationMode,
|
|
34
|
+
// actions
|
|
35
|
+
onLinkCopy,
|
|
36
|
+
onDismiss,
|
|
37
|
+
onSubmit,
|
|
38
|
+
onDialogClose,
|
|
39
|
+
// ref
|
|
40
|
+
selectPortalRef,
|
|
41
|
+
// props from states of parent:
|
|
42
|
+
showIntegrationForm,
|
|
43
|
+
selectedIntegration,
|
|
44
|
+
isSharing,
|
|
45
|
+
shareError,
|
|
46
|
+
defaultValue,
|
|
47
|
+
showTitle
|
|
48
|
+
} = props;
|
|
49
|
+
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
50
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
51
|
+
data: {
|
|
52
|
+
source: ANALYTICS_SOURCE
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
55
|
+
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
56
|
+
// so we don't need to show title via ShareFormWrapper
|
|
57
|
+
,
|
|
58
|
+
shouldShowTitle: false
|
|
59
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
60
|
+
Content: selectedIntegration.Content,
|
|
61
|
+
onIntegrationClose: onDialogClose
|
|
62
|
+
}) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
63
|
+
copyLink: copyLink,
|
|
64
|
+
loadOptions: loadOptions,
|
|
65
|
+
title: shareFormTitle,
|
|
66
|
+
showTitle: showTitle,
|
|
67
|
+
helperMessage: shareFormHelperMessage,
|
|
68
|
+
shareError: shareError,
|
|
69
|
+
defaultValue: defaultValue,
|
|
70
|
+
config: config,
|
|
71
|
+
submitButtonLabel: submitButtonLabel,
|
|
72
|
+
product: product,
|
|
73
|
+
enableSmartUserPicker: enableSmartUserPicker,
|
|
74
|
+
loggedInAccountId: loggedInAccountId,
|
|
75
|
+
cloudId: cloudId,
|
|
76
|
+
fieldsFooter: shareFieldsFooter,
|
|
77
|
+
selectPortalRef: selectPortalRef,
|
|
78
|
+
copyTooltipText: copyTooltipText,
|
|
79
|
+
integrationMode: integrationMode,
|
|
80
|
+
shareIntegrations: shareIntegrations,
|
|
81
|
+
isSharing: isSharing,
|
|
82
|
+
isFetchingConfig: isFetchingConfig,
|
|
83
|
+
isPublicLink: isPublicLink,
|
|
84
|
+
onSubmit: onSubmit,
|
|
85
|
+
onDismiss: onDismiss,
|
|
86
|
+
onLinkCopy: onLinkCopy,
|
|
87
|
+
onUserSelectionChange: onUserSelectionChange,
|
|
88
|
+
handleCloseDialog: onDialogClose
|
|
89
|
+
})));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default LazyShareForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LazyShareForm';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
|
|
3
|
+
import Spinner from '@atlaskit/spinner';
|
|
4
|
+
import { SpinnerWrapper } from './styled';
|
|
5
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
6
|
+
const LazyShareFormLazy = lazyForPaint(() => import(
|
|
7
|
+
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
8
|
+
'./LazyShareForm'), {
|
|
9
|
+
ssr: false
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const LoadingDialog = ({
|
|
13
|
+
shareFormTitle,
|
|
14
|
+
showTitle
|
|
15
|
+
}) => /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
16
|
+
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
17
|
+
,
|
|
18
|
+
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
19
|
+
}, /*#__PURE__*/React.createElement(SpinnerWrapper, null, /*#__PURE__*/React.createElement(Spinner, null)));
|
|
20
|
+
|
|
21
|
+
export default (props => /*#__PURE__*/React.createElement(LazySuspense, {
|
|
22
|
+
fallback: /*#__PURE__*/React.createElement(LoadingDialog, {
|
|
23
|
+
shareFormTitle: props.shareFormTitle,
|
|
24
|
+
showTitle: props.showTitle
|
|
25
|
+
})
|
|
26
|
+
}, /*#__PURE__*/React.createElement(LazyShareFormLazy, props)));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
export const BottomMessageWrapper = styled.div`
|
|
4
|
+
width: ${gridSize() * 44}px;
|
|
5
|
+
`;
|
|
6
|
+
export const CustomFooterWrapper = styled.div`
|
|
7
|
+
/* Must match inline dialog padding. */
|
|
8
|
+
margin: 0 ${-gridSize() * 3}px ${-gridSize() * 2}px ${-gridSize() * 3}px;
|
|
9
|
+
`;
|
|
10
|
+
export const SpinnerWrapper = styled.div`
|
|
11
|
+
widht: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-content: center;
|
|
16
|
+
`;
|
|
@@ -53,7 +53,7 @@ export class ShareDialogContainerInternal extends React.Component {
|
|
|
53
53
|
isFetchingConfig: true
|
|
54
54
|
}, async () => {
|
|
55
55
|
try {
|
|
56
|
-
const config = await this.shareClient.getConfig(this.props.cloudId
|
|
56
|
+
const config = await this.shareClient.getConfig(this.props.cloudId);
|
|
57
57
|
|
|
58
58
|
if (this._isMounted) {
|
|
59
59
|
this.setState({
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
5
|
import SplitButton from './SplitButton';
|
|
5
6
|
import ShareIcon from '@atlaskit/icon/glyph/share';
|
|
6
7
|
import Popup from '@atlaskit/popup';
|
|
7
8
|
import Portal from '@atlaskit/portal';
|
|
8
9
|
import Aktooltip from '@atlaskit/tooltip';
|
|
9
|
-
import {
|
|
10
|
-
import React from 'react';
|
|
10
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
11
11
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
13
|
import { messages } from '../i18n';
|
|
14
14
|
import { OBJECT_SHARED } from '../types';
|
|
15
|
-
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked,
|
|
15
|
+
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, screenEvent, shareTriggerButtonClicked, shareSplitButtonEvent, shareTabClicked, formShareSubmitted } from './analytics';
|
|
16
16
|
import ShareButton from './ShareButton';
|
|
17
|
-
import { ShareForm } from './ShareForm';
|
|
18
17
|
import { generateSelectZIndex } from './utils';
|
|
19
|
-
import
|
|
20
|
-
import { IntegrationForm } from './IntegrationForm';
|
|
18
|
+
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
21
19
|
const ShareButtonWrapper = styled.div`
|
|
22
20
|
display: inline-flex;
|
|
23
21
|
outline: none;
|
|
24
22
|
`;
|
|
25
|
-
const InlineDialogFormWrapper = styled.div`
|
|
26
|
-
width: 352px;
|
|
27
|
-
`;
|
|
28
|
-
const BottomMessageWrapper = styled.div`
|
|
29
|
-
width: 352px;
|
|
30
|
-
`;
|
|
31
|
-
const CustomFooterWrapper = styled.div`
|
|
32
|
-
/* Must match inline dialog padding. */
|
|
33
|
-
margin: 0 ${-gridSize() * 3}px ${-gridSize() * 2}px ${-gridSize() * 3}px;
|
|
34
|
-
`;
|
|
35
23
|
export const defaultShareContentState = {
|
|
36
24
|
users: [],
|
|
37
25
|
comment: {
|
|
@@ -425,48 +413,48 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
425
413
|
onKeyDown: this.handleKeyDown,
|
|
426
414
|
style: style
|
|
427
415
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
428
|
-
content: () => /*#__PURE__*/React.createElement(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
innerRef: this.containerRef
|
|
434
|
-
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
435
|
-
Content: selectedIntegration.Content,
|
|
436
|
-
onIntegrationClose: this.handleCloseDialog
|
|
437
|
-
})) : /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, /*#__PURE__*/React.createElement(ShareForm, {
|
|
416
|
+
content: () => /*#__PURE__*/React.createElement("div", {
|
|
417
|
+
ref: this.containerRef
|
|
418
|
+
}, /*#__PURE__*/React.createElement(LazyShareFormLazy, {
|
|
419
|
+
Content: selectedIntegration && selectedIntegration.Content,
|
|
420
|
+
selectedIntegration: selectedIntegration,
|
|
438
421
|
copyLink: copyLink,
|
|
422
|
+
showIntegrationForm: showIntegrationForm,
|
|
423
|
+
bottomMessage: bottomMessage,
|
|
424
|
+
customFooter: customFooter,
|
|
439
425
|
loadOptions: loadUserOptions,
|
|
440
426
|
isSharing: isSharing,
|
|
441
|
-
|
|
442
|
-
title: shareFormTitle,
|
|
427
|
+
shareFormTitle: shareFormTitle,
|
|
443
428
|
showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
|
|
444
|
-
|
|
445
|
-
helperMessage: shareFormHelperMessage,
|
|
429
|
+
shareFormHelperMessage: shareFormHelperMessage,
|
|
446
430
|
shareError: shareError,
|
|
447
|
-
onDismiss: this.handleFormDismiss,
|
|
448
431
|
defaultValue: defaultValue,
|
|
449
432
|
config: config,
|
|
450
433
|
isFetchingConfig: isFetchingConfig,
|
|
451
|
-
onLinkCopy: this.handleCopyLink,
|
|
452
434
|
submitButtonLabel: submitButtonLabel,
|
|
453
435
|
product: product,
|
|
454
436
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
455
437
|
loggedInAccountId: loggedInAccountId,
|
|
456
438
|
cloudId: cloudId,
|
|
457
439
|
onUserSelectionChange: onUserSelectionChange,
|
|
458
|
-
|
|
459
|
-
selectPortalRef: this.selectPortalRef,
|
|
440
|
+
shareFieldsFooter: shareFieldsFooter,
|
|
460
441
|
isPublicLink: isPublicLink,
|
|
461
442
|
copyTooltipText: copyTooltipText,
|
|
462
443
|
integrationMode: integrationMode,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
444
|
+
shareIntegrations: shareIntegrations // actions
|
|
445
|
+
,
|
|
446
|
+
onLinkCopy: this.handleCopyLink,
|
|
447
|
+
onSubmit: this.handleShareSubmit,
|
|
448
|
+
onDismiss: this.handleFormDismiss,
|
|
449
|
+
onDialogClose: this.handleCloseDialog,
|
|
450
|
+
onTabChange: this.onTabChange //ref
|
|
451
|
+
,
|
|
452
|
+
selectPortalRef: this.selectPortalRef
|
|
453
|
+
})),
|
|
466
454
|
isOpen: isDialogOpen,
|
|
467
455
|
onClose: this.handleCloseDialog,
|
|
468
456
|
placement: dialogPlacement,
|
|
469
|
-
trigger:
|
|
457
|
+
trigger: this.renderShareTriggerButton,
|
|
470
458
|
zIndex: dialogZIndex
|
|
471
459
|
}), /*#__PURE__*/React.createElement(Portal, {
|
|
472
460
|
zIndex: generateSelectZIndex(dialogZIndex)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
4
5
|
import Form from '@atlaskit/form';
|
|
5
6
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
@@ -7,7 +8,6 @@ import { R400 } from '@atlaskit/theme/colors';
|
|
|
7
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
10
|
import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
|
|
10
|
-
import React from 'react';
|
|
11
11
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
13
|
import { messages } from '../i18n';
|
|
@@ -97,7 +97,7 @@ class InternalForm extends React.PureComponent {
|
|
|
97
97
|
defaultValue: defaultValue && defaultValue.users,
|
|
98
98
|
config: config,
|
|
99
99
|
isLoading: isFetchingConfig,
|
|
100
|
-
product: product,
|
|
100
|
+
product: product || 'confluence',
|
|
101
101
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
102
102
|
loggedInAccountId: loggedInAccountId,
|
|
103
103
|
cloudId: cloudId,
|
|
@@ -144,6 +144,26 @@ class InternalForm extends React.PureComponent {
|
|
|
144
144
|
isDisabled: isDisabled
|
|
145
145
|
}, /*#__PURE__*/React.createElement(ButtonLabelWrapper, null, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, buttonLabel))));
|
|
146
146
|
});
|
|
147
|
+
|
|
148
|
+
_defineProperty(this, "renderMainTabTitle", () => {
|
|
149
|
+
const {
|
|
150
|
+
title,
|
|
151
|
+
product
|
|
152
|
+
} = this.props;
|
|
153
|
+
|
|
154
|
+
if (title) {
|
|
155
|
+
return title;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (!product) {
|
|
159
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, messages.formTitle);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const productShareType = product === 'jira' ? { ...messages.shareMainTabTextJira
|
|
163
|
+
} : { ...messages.shareMainTabTextConfluence
|
|
164
|
+
};
|
|
165
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
|
|
166
|
+
});
|
|
147
167
|
}
|
|
148
168
|
|
|
149
169
|
componentWillUnmount() {
|
|
@@ -159,7 +179,6 @@ class InternalForm extends React.PureComponent {
|
|
|
159
179
|
|
|
160
180
|
render() {
|
|
161
181
|
const {
|
|
162
|
-
title,
|
|
163
182
|
integrationMode = 'off',
|
|
164
183
|
shareIntegrations,
|
|
165
184
|
onTabChange,
|
|
@@ -180,7 +199,7 @@ class InternalForm extends React.PureComponent {
|
|
|
180
199
|
}
|
|
181
200
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
182
201
|
key: `share-tab-default`
|
|
183
|
-
},
|
|
202
|
+
}, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
|
|
184
203
|
key: `share-tab-${firstIntegration.type}`
|
|
185
204
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
186
205
|
key: `share-tabPanel-default`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InlineDialogFormWrapper, InlineDialogContentWrapper } from './styled';
|
|
3
|
+
import { ShareHeader } from '../ShareHeader';
|
|
4
|
+
|
|
5
|
+
const ShareFormWrapper = ({
|
|
6
|
+
shareFormTitle,
|
|
7
|
+
shouldShowTitle,
|
|
8
|
+
children = null,
|
|
9
|
+
footer = null
|
|
10
|
+
}) => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, shouldShowTitle && /*#__PURE__*/React.createElement(ShareHeader, {
|
|
11
|
+
title: shareFormTitle
|
|
12
|
+
}), children), footer);
|
|
13
|
+
|
|
14
|
+
export default ShareFormWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ShareFormWrapper } from './ShareFormWrapper';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
export const InlineDialogFormWrapper = styled.div`
|
|
4
|
+
width: ${gridSize() * 44}px;
|
|
5
|
+
`;
|
|
6
|
+
/**
|
|
7
|
+
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
8
|
+
* compared to the @atlaskit/popup we are now using.
|
|
9
|
+
*
|
|
10
|
+
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const InlineDialogContentWrapper = styled.div`
|
|
14
|
+
padding: ${gridSize() * 2}px ${gridSize() * 3}px;
|
|
15
|
+
`;
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
4
|
-
|
|
5
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
2
|
+
import React from 'react';
|
|
6
3
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
4
|
export const MAX_PICKER_HEIGHT = 102;
|
|
9
|
-
/**
|
|
10
|
-
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
11
|
-
* compared to the @atlaskit/popup we are now using.
|
|
12
|
-
*
|
|
13
|
-
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export const InlineDialogContentWrapper = styled.div`
|
|
17
|
-
padding: ${gridSize() * 2}px ${gridSize() * 3}px;
|
|
18
|
-
`;
|
|
19
5
|
const StyledButton = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(Button, _extends({
|
|
20
6
|
ref: ref
|
|
21
7
|
}, props, {
|