@atlaskit/share 3.4.2 → 3.5.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/copy-link-button/package.json +7 -0
- package/dist/cjs/components/CopyLinkButton.js +14 -19
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +11 -3
- package/dist/cjs/components/LazyShareForm/lazy.js +9 -3
- package/dist/cjs/components/ShareForm.js +5 -3
- package/dist/cjs/components/ShareFormWrapper/styled.js +19 -6
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/CopyLinkButton.js +14 -19
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +10 -2
- package/dist/es2019/components/LazyShareForm/lazy.js +9 -2
- package/dist/es2019/components/ShareForm.js +7 -3
- package/dist/es2019/components/ShareFormWrapper/styled.js +17 -7
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/CopyLinkButton.js +14 -15
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +10 -2
- package/dist/esm/components/LazyShareForm/lazy.js +9 -2
- package/dist/esm/components/ShareForm.js +5 -3
- package/dist/esm/components/ShareFormWrapper/styled.js +19 -7
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/CopyLinkButton.d.ts +7 -8
- package/dist/types/components/ShareFormWrapper/styled.d.ts +4 -3
- package/dist/types/index.d.ts +1 -0
- package/package.json +11 -11
- package/report.api.md +32 -1
- package/dist/cjs/components/LazyShareForm/styled.js +0 -28
- package/dist/es2019/components/LazyShareForm/styled.js +0 -16
- package/dist/esm/components/LazyShareForm/styled.js +0 -9
- package/dist/types/components/LazyShareForm/styled.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e9a46954c0f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9a46954c0f) - added examples of copy link button
|
|
8
|
+
|
|
9
|
+
## 3.5.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`99ba33da55f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/99ba33da55f) - Removed styled components from tests and examples
|
|
14
|
+
|
|
15
|
+
## 3.5.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`76c73df383f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/76c73df383f) - Exposed CopyLinkButton from share component and made it generic.
|
|
20
|
+
|
|
3
21
|
## 3.4.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/share/copy-link-button",
|
|
3
|
+
"main": "../dist/cjs/components/CopyLinkButton.js",
|
|
4
|
+
"module": "../dist/esm/components/CopyLinkButton.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/components/CopyLinkButton.js",
|
|
6
|
+
"types": "../dist/types/components/CopyLinkButton.d.ts"
|
|
7
|
+
}
|
|
@@ -29,8 +29,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _reactIntlNext = require("react-intl-next");
|
|
33
|
-
|
|
34
32
|
var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/check-circle"));
|
|
35
33
|
|
|
36
34
|
var _linkFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/link-filled"));
|
|
@@ -45,8 +43,6 @@ var _tokens = require("@atlaskit/tokens");
|
|
|
45
43
|
|
|
46
44
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
47
45
|
|
|
48
|
-
var _i18n = require("../i18n");
|
|
49
|
-
|
|
50
46
|
var _styled = require("./ShareFormWrapper/styled");
|
|
51
47
|
|
|
52
48
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -64,8 +60,8 @@ var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
|
64
60
|
exports.AUTO_DISMISS_MS = AUTO_DISMISS_MS;
|
|
65
61
|
var messageContainerStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n margin: -8px -16px;\n"])));
|
|
66
62
|
exports.messageContainerStyle = messageContainerStyle;
|
|
67
|
-
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
68
63
|
var messageTextStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-indent: 6px;\n"])));
|
|
64
|
+
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
69
65
|
|
|
70
66
|
var HiddenInput = /*#__PURE__*/_react.default.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
|
|
71
67
|
function (props, ref) {
|
|
@@ -140,19 +136,20 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
140
136
|
});
|
|
141
137
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderTriggerButton", function (triggerProps) {
|
|
142
138
|
var _this$props = _this.props,
|
|
143
|
-
formatMessage = _this$props.intl.formatMessage,
|
|
144
139
|
isDisabled = _this$props.isDisabled,
|
|
145
|
-
|
|
140
|
+
copyLinkButtonText = _this$props.copyLinkButtonText,
|
|
141
|
+
children = _this$props.children,
|
|
142
|
+
iconBefore = _this$props.iconBefore;
|
|
146
143
|
return (0, _react2.jsx)(_styles.default, (0, _extends2.default)({
|
|
147
|
-
"aria-label":
|
|
144
|
+
"aria-label": copyLinkButtonText,
|
|
148
145
|
isDisabled: isDisabled,
|
|
149
146
|
appearance: "subtle-link",
|
|
150
|
-
iconBefore: (0, _react2.jsx)(_linkFilled.default, {
|
|
147
|
+
iconBefore: iconBefore || (0, _react2.jsx)(_linkFilled.default, {
|
|
151
148
|
label: "",
|
|
152
149
|
size: "medium"
|
|
153
150
|
}),
|
|
154
151
|
onClick: _this.handleClick
|
|
155
|
-
}, triggerProps),
|
|
152
|
+
}, triggerProps), children || copyLinkButtonText);
|
|
156
153
|
});
|
|
157
154
|
return _this;
|
|
158
155
|
}
|
|
@@ -169,12 +166,12 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
169
166
|
|
|
170
167
|
var shouldShowCopiedMessage = this.state.shouldShowCopiedMessage;
|
|
171
168
|
var _this$props2 = this.props,
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
copyTooltipText = _this$props2.copyTooltipText,
|
|
170
|
+
copiedToClipboardText = _this$props2.copiedToClipboardText;
|
|
174
171
|
return (0, _react2.jsx)(_react.default.Fragment, null, isSafari && (0, _react2.jsx)("div", {
|
|
175
172
|
className: "assistive",
|
|
176
173
|
"aria-live": "assertive"
|
|
177
|
-
}, shouldShowCopiedMessage &&
|
|
174
|
+
}, shouldShowCopiedMessage && copiedToClipboardText), (0, _react2.jsx)(HiddenInput, {
|
|
178
175
|
ref: this.inputRef,
|
|
179
176
|
text: this.props.link
|
|
180
177
|
}), (0, _react2.jsx)(_popup.default, {
|
|
@@ -183,12 +180,12 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
183
180
|
return (0, _react2.jsx)(_styled.InlineDialogContentWrapper, null, (0, _react2.jsx)("div", {
|
|
184
181
|
css: messageContainerStyle,
|
|
185
182
|
"data-testid": "message-container"
|
|
186
|
-
}, (0, _react2.jsx)(_checkCircle.default, {
|
|
183
|
+
}, (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_checkCircle.default, {
|
|
187
184
|
label: "",
|
|
188
185
|
primaryColor: (0, _tokens.token)('color.icon.success', _colors.G300)
|
|
189
|
-
}), (0, _react2.jsx)("
|
|
186
|
+
}), (0, _react2.jsx)("div", {
|
|
190
187
|
css: messageTextStyle
|
|
191
|
-
},
|
|
188
|
+
}, copiedToClipboardText))));
|
|
192
189
|
},
|
|
193
190
|
isOpen: shouldShowCopiedMessage,
|
|
194
191
|
onClose: this.handleDismissCopiedMessage,
|
|
@@ -206,7 +203,5 @@ var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
206
203
|
}(_react.default.Component);
|
|
207
204
|
|
|
208
205
|
exports.CopyLinkButton = CopyLinkButton;
|
|
209
|
-
|
|
210
|
-
var _default = (0, _reactIntlNext.injectIntl)(CopyLinkButton);
|
|
211
|
-
|
|
206
|
+
var _default = CopyLinkButton;
|
|
212
207
|
exports.default = _default;
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
13
|
|
|
14
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
15
|
+
|
|
14
16
|
var _analytics = require("../analytics/analytics");
|
|
15
17
|
|
|
16
18
|
var _IntegrationForm = require("../IntegrationForm");
|
|
@@ -19,8 +21,6 @@ var _ShareForm = require("../ShareForm");
|
|
|
19
21
|
|
|
20
22
|
var _ShareFormWrapper = require("../ShareFormWrapper");
|
|
21
23
|
|
|
22
|
-
var _styled = require("./styled");
|
|
23
|
-
|
|
24
24
|
/**
|
|
25
25
|
* A Share form content which is lazy-loaded.
|
|
26
26
|
* Make sure this component is not exported inside main entry points `src/index.ts`
|
|
@@ -60,7 +60,15 @@ function LazyShareForm(props) {
|
|
|
60
60
|
showTitle = props.showTitle,
|
|
61
61
|
orgId = props.orgId;
|
|
62
62
|
|
|
63
|
-
var footer = /*#__PURE__*/_react.default.createElement("div", null, bottomMessage ? /*#__PURE__*/_react.default.createElement(
|
|
63
|
+
var footer = /*#__PURE__*/_react.default.createElement("div", null, bottomMessage ? /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
css: {
|
|
65
|
+
width: "".concat((0, _constants.gridSize)() * 44, "px")
|
|
66
|
+
}
|
|
67
|
+
}, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
css: {
|
|
69
|
+
margin: "0 ".concat(-(0, _constants.gridSize)() * 3, "px ").concat(-(0, _constants.gridSize)() * 2, "px ").concat(-(0, _constants.gridSize)() * 3, "px")
|
|
70
|
+
}
|
|
71
|
+
}, customFooter));
|
|
64
72
|
|
|
65
73
|
_react.default.useEffect(function () {
|
|
66
74
|
setIsLoading(false);
|
|
@@ -17,8 +17,6 @@ var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
|
17
17
|
|
|
18
18
|
var _ShareFormWrapper = require("../ShareFormWrapper");
|
|
19
19
|
|
|
20
|
-
var _styled = require("./styled");
|
|
21
|
-
|
|
22
20
|
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); }
|
|
23
21
|
|
|
24
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(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; }
|
|
@@ -44,7 +42,15 @@ var LoadingDialog = function LoadingDialog(_ref) {
|
|
|
44
42
|
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
45
43
|
,
|
|
46
44
|
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
css: {
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '100%',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
alignContent: 'center'
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_spinner.default, null)));
|
|
48
54
|
};
|
|
49
55
|
|
|
50
56
|
var _default = function _default(props) {
|
|
@@ -142,7 +142,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
142
142
|
isPublicLink = _this$props.isPublicLink,
|
|
143
143
|
copyTooltipText = _this$props.copyTooltipText,
|
|
144
144
|
helperMessage = _this$props.helperMessage,
|
|
145
|
-
orgId = _this$props.orgId
|
|
145
|
+
orgId = _this$props.orgId,
|
|
146
|
+
formatMessage = _this$props.intl.formatMessage;
|
|
146
147
|
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
147
148
|
data: {
|
|
148
149
|
source: _analytics.ANALYTICS_SOURCE
|
|
@@ -177,8 +178,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
177
178
|
isDisabled: isDisabled,
|
|
178
179
|
onLinkCopy: onLinkCopy,
|
|
179
180
|
link: copyLink,
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
copyTooltipText: copyTooltipText,
|
|
182
|
+
copyLinkButtonText: formatMessage(isPublicLink ? _i18n.messages.copyPublicLinkButtonText : _i18n.messages.copyLinkButtonText),
|
|
183
|
+
copiedToClipboardText: formatMessage(_i18n.messages.copiedToClipboardMessage)
|
|
182
184
|
}), _this.renderSubmitButton())));
|
|
183
185
|
});
|
|
184
186
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSubmitButton", function () {
|
|
@@ -7,15 +7,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.InlineDialogFormWrapper = exports.InlineDialogContentWrapper = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
var InlineDialogFormWrapper = function InlineDialogFormWrapper(_ref) {
|
|
18
|
+
var children = _ref.children;
|
|
19
|
+
return (0, _react2.jsx)("div", {
|
|
20
|
+
css: {
|
|
21
|
+
width: "".concat((0, _constants.gridSize)() * 44, "px")
|
|
22
|
+
}
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
19
25
|
/**
|
|
20
26
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
21
27
|
* compared to the @atlaskit/popup we are now using.
|
|
@@ -26,6 +32,13 @@ var InlineDialogFormWrapper = _styledComponents.default.div(_templateObject || (
|
|
|
26
32
|
|
|
27
33
|
exports.InlineDialogFormWrapper = InlineDialogFormWrapper;
|
|
28
34
|
|
|
29
|
-
var InlineDialogContentWrapper =
|
|
35
|
+
var InlineDialogContentWrapper = function InlineDialogContentWrapper(_ref2) {
|
|
36
|
+
var children = _ref2.children;
|
|
37
|
+
return (0, _react2.jsx)("div", {
|
|
38
|
+
css: {
|
|
39
|
+
padding: "".concat((0, _constants.gridSize)() * 2, "px ").concat((0, _constants.gridSize)() * 3, "px")
|
|
40
|
+
}
|
|
41
|
+
}, children);
|
|
42
|
+
};
|
|
30
43
|
|
|
31
44
|
exports.InlineDialogContentWrapper = InlineDialogContentWrapper;
|
|
@@ -19,7 +19,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
19
19
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
20
|
return _objectSpread({
|
|
21
21
|
packageName: "@atlaskit/share",
|
|
22
|
-
packageVersion: "3.
|
|
22
|
+
packageVersion: "3.5.2"
|
|
23
23
|
}, attributes);
|
|
24
24
|
};
|
|
25
25
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "ADMIN_NOTIFIED", {
|
|
|
9
9
|
return _types.ADMIN_NOTIFIED;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "CopyLinkButton", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _CopyLinkButton.CopyLinkButton;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "OBJECT_SHARED", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
@@ -24,4 +30,6 @@ Object.defineProperty(exports, "ShareDialogContainer", {
|
|
|
24
30
|
|
|
25
31
|
var _ShareDialogContainer = require("./components/ShareDialogContainer");
|
|
26
32
|
|
|
33
|
+
var _CopyLinkButton = require("./components/CopyLinkButton");
|
|
34
|
+
|
|
27
35
|
var _types = require("./types");
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,7 +4,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
8
7
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
9
8
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
10
9
|
import Popup from '@atlaskit/popup';
|
|
@@ -12,7 +11,6 @@ import { G300 } from '@atlaskit/theme/colors';
|
|
|
12
11
|
import { layers } from '@atlaskit/theme/constants';
|
|
13
12
|
import { token } from '@atlaskit/tokens';
|
|
14
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
|
-
import { messages } from '../i18n';
|
|
16
14
|
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
17
15
|
import Button from './styles';
|
|
18
16
|
const Z_INDEX = layers.modal();
|
|
@@ -23,10 +21,10 @@ export const messageContainerStyle = css`
|
|
|
23
21
|
align-items: center;
|
|
24
22
|
margin: -8px -16px;
|
|
25
23
|
`;
|
|
26
|
-
const isSafari = navigator.userAgent.indexOf('Safari');
|
|
27
24
|
const messageTextStyle = css`
|
|
28
25
|
text-indent: 6px;
|
|
29
26
|
`;
|
|
27
|
+
const isSafari = navigator.userAgent.indexOf('Safari');
|
|
30
28
|
export const HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
|
|
31
29
|
(props, ref) => jsx("input", {
|
|
32
30
|
style: {
|
|
@@ -86,22 +84,21 @@ export class CopyLinkButton extends React.Component {
|
|
|
86
84
|
|
|
87
85
|
_defineProperty(this, "renderTriggerButton", triggerProps => {
|
|
88
86
|
const {
|
|
89
|
-
intl: {
|
|
90
|
-
formatMessage
|
|
91
|
-
},
|
|
92
87
|
isDisabled,
|
|
93
|
-
|
|
88
|
+
copyLinkButtonText,
|
|
89
|
+
children,
|
|
90
|
+
iconBefore
|
|
94
91
|
} = this.props;
|
|
95
92
|
return jsx(Button, _extends({
|
|
96
|
-
"aria-label":
|
|
93
|
+
"aria-label": copyLinkButtonText,
|
|
97
94
|
isDisabled: isDisabled,
|
|
98
95
|
appearance: "subtle-link",
|
|
99
|
-
iconBefore: jsx(LinkFilledIcon, {
|
|
96
|
+
iconBefore: iconBefore || jsx(LinkFilledIcon, {
|
|
100
97
|
label: "",
|
|
101
98
|
size: "medium"
|
|
102
99
|
}),
|
|
103
100
|
onClick: this.handleClick
|
|
104
|
-
}, triggerProps),
|
|
101
|
+
}, triggerProps), children || copyLinkButtonText);
|
|
105
102
|
});
|
|
106
103
|
}
|
|
107
104
|
|
|
@@ -114,15 +111,13 @@ export class CopyLinkButton extends React.Component {
|
|
|
114
111
|
shouldShowCopiedMessage
|
|
115
112
|
} = this.state;
|
|
116
113
|
const {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
copyTooltipText
|
|
114
|
+
copyTooltipText,
|
|
115
|
+
copiedToClipboardText
|
|
121
116
|
} = this.props;
|
|
122
117
|
return jsx(React.Fragment, null, isSafari && jsx("div", {
|
|
123
118
|
className: "assistive",
|
|
124
119
|
"aria-live": "assertive"
|
|
125
|
-
}, shouldShowCopiedMessage &&
|
|
120
|
+
}, shouldShowCopiedMessage && copiedToClipboardText), jsx(HiddenInput, {
|
|
126
121
|
ref: this.inputRef,
|
|
127
122
|
text: this.props.link
|
|
128
123
|
}), jsx(Popup, {
|
|
@@ -130,12 +125,12 @@ export class CopyLinkButton extends React.Component {
|
|
|
130
125
|
content: () => jsx(InlineDialogContentWrapper, null, jsx("div", {
|
|
131
126
|
css: messageContainerStyle,
|
|
132
127
|
"data-testid": "message-container"
|
|
133
|
-
}, jsx(CheckCircleIcon, {
|
|
128
|
+
}, jsx(React.Fragment, null, jsx(CheckCircleIcon, {
|
|
134
129
|
label: "",
|
|
135
130
|
primaryColor: token('color.icon.success', G300)
|
|
136
|
-
}), jsx("
|
|
131
|
+
}), jsx("div", {
|
|
137
132
|
css: messageTextStyle
|
|
138
|
-
},
|
|
133
|
+
}, copiedToClipboardText)))),
|
|
139
134
|
isOpen: shouldShowCopiedMessage,
|
|
140
135
|
onClose: this.handleDismissCopiedMessage,
|
|
141
136
|
placement: "top-start",
|
|
@@ -147,4 +142,4 @@ export class CopyLinkButton extends React.Component {
|
|
|
147
142
|
}
|
|
148
143
|
|
|
149
144
|
}
|
|
150
|
-
export default
|
|
145
|
+
export default CopyLinkButton;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
4
|
import { INTEGRATION_MODAL_SOURCE } from '../analytics/analytics';
|
|
4
5
|
import { IntegrationForm } from '../IntegrationForm';
|
|
5
6
|
import { ShareForm } from '../ShareForm';
|
|
6
7
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
7
|
-
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A Share form content which is lazy-loaded.
|
|
@@ -49,7 +49,15 @@ function LazyShareForm(props) {
|
|
|
49
49
|
showTitle,
|
|
50
50
|
orgId
|
|
51
51
|
} = props;
|
|
52
|
-
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(
|
|
52
|
+
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
css: {
|
|
54
|
+
width: `${gridSize() * 44}px`
|
|
55
|
+
}
|
|
56
|
+
}, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
css: {
|
|
58
|
+
margin: `0 ${-gridSize() * 3}px ${-gridSize() * 2}px ${-gridSize() * 3}px`
|
|
59
|
+
}
|
|
60
|
+
}, customFooter));
|
|
53
61
|
React.useEffect(() => {
|
|
54
62
|
setIsLoading(false);
|
|
55
63
|
});
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
4
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
5
|
-
import { SpinnerWrapper } from './styled';
|
|
6
5
|
const LazyShareFormLazy = lazyForPaint(() => import(
|
|
7
6
|
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
8
7
|
'./LazyShareForm'), {
|
|
@@ -21,7 +20,15 @@ const LoadingDialog = ({
|
|
|
21
20
|
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
22
21
|
,
|
|
23
22
|
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
24
|
-
}, /*#__PURE__*/React.createElement(
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
css: {
|
|
25
|
+
width: '100%',
|
|
26
|
+
height: '100%',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
alignContent: 'center'
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)));
|
|
25
32
|
};
|
|
26
33
|
|
|
27
34
|
export default (props => /*#__PURE__*/React.createElement(LazySuspense, {
|
|
@@ -98,7 +98,10 @@ class InternalForm extends React.PureComponent {
|
|
|
98
98
|
isPublicLink,
|
|
99
99
|
copyTooltipText,
|
|
100
100
|
helperMessage,
|
|
101
|
-
orgId
|
|
101
|
+
orgId,
|
|
102
|
+
intl: {
|
|
103
|
+
formatMessage
|
|
104
|
+
}
|
|
102
105
|
} = this.props;
|
|
103
106
|
return jsx(AnalyticsContext, {
|
|
104
107
|
data: {
|
|
@@ -134,8 +137,9 @@ class InternalForm extends React.PureComponent {
|
|
|
134
137
|
isDisabled: isDisabled,
|
|
135
138
|
onLinkCopy: onLinkCopy,
|
|
136
139
|
link: copyLink,
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
copyTooltipText: copyTooltipText,
|
|
141
|
+
copyLinkButtonText: formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
142
|
+
copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
|
|
139
143
|
}), this.renderSubmitButton())));
|
|
140
144
|
});
|
|
141
145
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
export const InlineDialogFormWrapper =
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
export const InlineDialogFormWrapper = ({
|
|
6
|
+
children
|
|
7
|
+
}) => jsx("div", {
|
|
8
|
+
css: {
|
|
9
|
+
width: `${gridSize() * 44}px`
|
|
10
|
+
}
|
|
11
|
+
}, children);
|
|
6
12
|
/**
|
|
7
13
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
8
14
|
* compared to the @atlaskit/popup we are now using.
|
|
@@ -10,6 +16,10 @@ export const InlineDialogFormWrapper = styled.div`
|
|
|
10
16
|
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
11
17
|
*/
|
|
12
18
|
|
|
13
|
-
export const InlineDialogContentWrapper =
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
export const InlineDialogContentWrapper = ({
|
|
20
|
+
children
|
|
21
|
+
}) => jsx("div", {
|
|
22
|
+
css: {
|
|
23
|
+
padding: `${gridSize() * 2}px ${gridSize() * 3}px`
|
|
24
|
+
}
|
|
25
|
+
}, children);
|
package/dist/es2019/index.js
CHANGED
package/dist/es2019/version.json
CHANGED
|
@@ -17,7 +17,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
17
|
/** @jsx jsx */
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { css, jsx } from '@emotion/react';
|
|
20
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
21
20
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
22
21
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
23
22
|
import Popup from '@atlaskit/popup';
|
|
@@ -25,15 +24,14 @@ import { G300 } from '@atlaskit/theme/colors';
|
|
|
25
24
|
import { layers } from '@atlaskit/theme/constants';
|
|
26
25
|
import { token } from '@atlaskit/tokens';
|
|
27
26
|
import Tooltip from '@atlaskit/tooltip';
|
|
28
|
-
import { messages } from '../i18n';
|
|
29
27
|
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
30
28
|
import Button from './styles';
|
|
31
29
|
var Z_INDEX = layers.modal();
|
|
32
30
|
var AUTO_DISMISS_SECONDS = 8;
|
|
33
31
|
export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
34
32
|
export var messageContainerStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: -8px -16px;\n"])));
|
|
35
|
-
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
36
33
|
var messageTextStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-indent: 6px;\n"])));
|
|
34
|
+
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
37
35
|
export var HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
|
|
38
36
|
function (props, ref) {
|
|
39
37
|
return jsx("input", {
|
|
@@ -110,19 +108,20 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
110
108
|
|
|
111
109
|
_defineProperty(_assertThisInitialized(_this), "renderTriggerButton", function (triggerProps) {
|
|
112
110
|
var _this$props = _this.props,
|
|
113
|
-
formatMessage = _this$props.intl.formatMessage,
|
|
114
111
|
isDisabled = _this$props.isDisabled,
|
|
115
|
-
|
|
112
|
+
copyLinkButtonText = _this$props.copyLinkButtonText,
|
|
113
|
+
children = _this$props.children,
|
|
114
|
+
iconBefore = _this$props.iconBefore;
|
|
116
115
|
return jsx(Button, _extends({
|
|
117
|
-
"aria-label":
|
|
116
|
+
"aria-label": copyLinkButtonText,
|
|
118
117
|
isDisabled: isDisabled,
|
|
119
118
|
appearance: "subtle-link",
|
|
120
|
-
iconBefore: jsx(LinkFilledIcon, {
|
|
119
|
+
iconBefore: iconBefore || jsx(LinkFilledIcon, {
|
|
121
120
|
label: "",
|
|
122
121
|
size: "medium"
|
|
123
122
|
}),
|
|
124
123
|
onClick: _this.handleClick
|
|
125
|
-
}, triggerProps),
|
|
124
|
+
}, triggerProps), children || copyLinkButtonText);
|
|
126
125
|
});
|
|
127
126
|
|
|
128
127
|
return _this;
|
|
@@ -140,12 +139,12 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
140
139
|
|
|
141
140
|
var shouldShowCopiedMessage = this.state.shouldShowCopiedMessage;
|
|
142
141
|
var _this$props2 = this.props,
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
copyTooltipText = _this$props2.copyTooltipText,
|
|
143
|
+
copiedToClipboardText = _this$props2.copiedToClipboardText;
|
|
145
144
|
return jsx(React.Fragment, null, isSafari && jsx("div", {
|
|
146
145
|
className: "assistive",
|
|
147
146
|
"aria-live": "assertive"
|
|
148
|
-
}, shouldShowCopiedMessage &&
|
|
147
|
+
}, shouldShowCopiedMessage && copiedToClipboardText), jsx(HiddenInput, {
|
|
149
148
|
ref: this.inputRef,
|
|
150
149
|
text: this.props.link
|
|
151
150
|
}), jsx(Popup, {
|
|
@@ -154,12 +153,12 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
154
153
|
return jsx(InlineDialogContentWrapper, null, jsx("div", {
|
|
155
154
|
css: messageContainerStyle,
|
|
156
155
|
"data-testid": "message-container"
|
|
157
|
-
}, jsx(CheckCircleIcon, {
|
|
156
|
+
}, jsx(React.Fragment, null, jsx(CheckCircleIcon, {
|
|
158
157
|
label: "",
|
|
159
158
|
primaryColor: token('color.icon.success', G300)
|
|
160
|
-
}), jsx("
|
|
159
|
+
}), jsx("div", {
|
|
161
160
|
css: messageTextStyle
|
|
162
|
-
},
|
|
161
|
+
}, copiedToClipboardText))));
|
|
163
162
|
},
|
|
164
163
|
isOpen: shouldShowCopiedMessage,
|
|
165
164
|
onClose: this.handleDismissCopiedMessage,
|
|
@@ -176,4 +175,4 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
176
175
|
|
|
177
176
|
return CopyLinkButton;
|
|
178
177
|
}(React.Component);
|
|
179
|
-
export default
|
|
178
|
+
export default CopyLinkButton;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
4
|
import { INTEGRATION_MODAL_SOURCE } from '../analytics/analytics';
|
|
4
5
|
import { IntegrationForm } from '../IntegrationForm';
|
|
5
6
|
import { ShareForm } from '../ShareForm';
|
|
6
7
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
7
|
-
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A Share form content which is lazy-loaded.
|
|
@@ -44,7 +44,15 @@ function LazyShareForm(props) {
|
|
|
44
44
|
defaultValue = props.defaultValue,
|
|
45
45
|
showTitle = props.showTitle,
|
|
46
46
|
orgId = props.orgId;
|
|
47
|
-
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(
|
|
47
|
+
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
css: {
|
|
49
|
+
width: "".concat(gridSize() * 44, "px")
|
|
50
|
+
}
|
|
51
|
+
}, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
css: {
|
|
53
|
+
margin: "0 ".concat(-gridSize() * 3, "px ").concat(-gridSize() * 2, "px ").concat(-gridSize() * 3, "px")
|
|
54
|
+
}
|
|
55
|
+
}, customFooter));
|
|
48
56
|
React.useEffect(function () {
|
|
49
57
|
setIsLoading(false);
|
|
50
58
|
});
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
4
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
5
|
-
import { SpinnerWrapper } from './styled';
|
|
6
5
|
var LazyShareFormLazy = lazyForPaint(function () {
|
|
7
6
|
return import(
|
|
8
7
|
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
@@ -22,7 +21,15 @@ var LoadingDialog = function LoadingDialog(_ref) {
|
|
|
22
21
|
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
23
22
|
,
|
|
24
23
|
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
25
|
-
}, /*#__PURE__*/React.createElement(
|
|
24
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
css: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
alignContent: 'center'
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)));
|
|
26
33
|
};
|
|
27
34
|
|
|
28
35
|
export default (function (props) {
|
|
@@ -100,7 +100,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
100
100
|
isPublicLink = _this$props.isPublicLink,
|
|
101
101
|
copyTooltipText = _this$props.copyTooltipText,
|
|
102
102
|
helperMessage = _this$props.helperMessage,
|
|
103
|
-
orgId = _this$props.orgId
|
|
103
|
+
orgId = _this$props.orgId,
|
|
104
|
+
formatMessage = _this$props.intl.formatMessage;
|
|
104
105
|
return jsx(AnalyticsContext, {
|
|
105
106
|
data: {
|
|
106
107
|
source: ANALYTICS_SOURCE
|
|
@@ -135,8 +136,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
135
136
|
isDisabled: isDisabled,
|
|
136
137
|
onLinkCopy: onLinkCopy,
|
|
137
138
|
link: copyLink,
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
copyTooltipText: copyTooltipText,
|
|
140
|
+
copyLinkButtonText: formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
141
|
+
copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
|
|
140
142
|
}), _this.renderSubmitButton())));
|
|
141
143
|
});
|
|
142
144
|
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import styled from 'styled-components';
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
6
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
|
-
export var InlineDialogFormWrapper =
|
|
5
|
+
export var InlineDialogFormWrapper = function InlineDialogFormWrapper(_ref) {
|
|
6
|
+
var children = _ref.children;
|
|
7
|
+
return jsx("div", {
|
|
8
|
+
css: {
|
|
9
|
+
width: "".concat(gridSize() * 44, "px")
|
|
10
|
+
}
|
|
11
|
+
}, children);
|
|
12
|
+
};
|
|
8
13
|
/**
|
|
9
14
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
10
15
|
* compared to the @atlaskit/popup we are now using.
|
|
@@ -12,4 +17,11 @@ export var InlineDialogFormWrapper = styled.div(_templateObject || (_templateObj
|
|
|
12
17
|
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
13
18
|
*/
|
|
14
19
|
|
|
15
|
-
export var InlineDialogContentWrapper =
|
|
20
|
+
export var InlineDialogContentWrapper = function InlineDialogContentWrapper(_ref2) {
|
|
21
|
+
var children = _ref2.children;
|
|
22
|
+
return jsx("div", {
|
|
23
|
+
css: {
|
|
24
|
+
padding: "".concat(gridSize() * 2, "px ").concat(gridSize() * 3, "px")
|
|
25
|
+
}
|
|
26
|
+
}, children);
|
|
27
|
+
};
|
|
@@ -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.5.2"
|
|
14
14
|
}, attributes);
|
|
15
15
|
};
|
|
16
16
|
|
package/dist/esm/index.js
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
4
|
import { TriggerProps } from '@atlaskit/popup';
|
|
6
5
|
export declare const AUTO_DISMISS_MS: number;
|
|
7
6
|
export declare const messageContainerStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -13,13 +12,16 @@ export declare type Props = {
|
|
|
13
12
|
onLinkCopy?: (link: string) => void;
|
|
14
13
|
link: string;
|
|
15
14
|
isDisabled?: boolean;
|
|
16
|
-
isPublicLink?: boolean;
|
|
17
15
|
copyTooltipText?: string;
|
|
16
|
+
children?: string | ReactElement;
|
|
17
|
+
copyLinkButtonText: string;
|
|
18
|
+
copiedToClipboardText: string;
|
|
19
|
+
iconBefore?: ReactElement;
|
|
18
20
|
};
|
|
19
21
|
export declare type State = {
|
|
20
22
|
shouldShowCopiedMessage: boolean;
|
|
21
23
|
};
|
|
22
|
-
export declare class CopyLinkButton extends React.Component<Props
|
|
24
|
+
export declare class CopyLinkButton extends React.Component<Props, State> {
|
|
23
25
|
private autoDismiss;
|
|
24
26
|
private inputRef;
|
|
25
27
|
state: {
|
|
@@ -32,7 +34,4 @@ export declare class CopyLinkButton extends React.Component<Props & WrappedCompo
|
|
|
32
34
|
renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
|
|
33
35
|
render(): jsx.JSX.Element;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
37
|
-
};
|
|
38
|
-
export default _default;
|
|
37
|
+
export default CopyLinkButton;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const InlineDialogFormWrapper: React.FC;
|
|
3
4
|
/**
|
|
4
5
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
5
6
|
* compared to the @atlaskit/popup we are now using.
|
|
6
7
|
*
|
|
7
8
|
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
8
9
|
*/
|
|
9
|
-
export declare const InlineDialogContentWrapper:
|
|
10
|
+
export declare const InlineDialogContentWrapper: React.FC;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ShareDialogContainer } from './components/ShareDialogContainer';
|
|
2
|
+
export { CopyLinkButton } from './components/CopyLinkButton';
|
|
2
3
|
export { ADMIN_NOTIFIED, OBJECT_SHARED, } from './types';
|
|
3
4
|
export type { Comment, Content, DialogContentState, DialogPlacement, Flag, FlagType, FormChildrenArgs, KeysOfType, MessageDescriptor, MetaData, OriginAnalyticAttributes, OriginTracing, OriginTracingFactory, OriginTracingForSubSequentEvents, OriginTracingWithIdGenerated, ProductId, ProductName, RenderCustomTriggerButton, ShareButtonStyle, ShareContentState, ShareError, ShareRequest, ShareResponse, ConfigResponse, TooltipPosition, User, UserWithEmail, UserWithId, ShareDialogContainerProps, } from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/share",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "Fabric Share Element",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
34
34
|
"@atlaskit/button": "^16.3.0",
|
|
35
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
35
|
+
"@atlaskit/dropdown-menu": "^11.5.0",
|
|
36
36
|
"@atlaskit/form": "^8.5.0",
|
|
37
37
|
"@atlaskit/icon": "^21.10.0",
|
|
38
38
|
"@atlaskit/popup": "^1.4.0",
|
|
39
39
|
"@atlaskit/portal": "^4.0.0",
|
|
40
40
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
41
41
|
"@atlaskit/spinner": "^15.1.4",
|
|
42
|
-
"@atlaskit/tabs": "^13.
|
|
42
|
+
"@atlaskit/tabs": "^13.3.0",
|
|
43
43
|
"@atlaskit/textarea": "^4.3.0",
|
|
44
|
-
"@atlaskit/theme": "^12.
|
|
44
|
+
"@atlaskit/theme": "^12.2.0",
|
|
45
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
46
46
|
"@atlaskit/tooltip": "^17.5.0",
|
|
47
47
|
"@atlaskit/ufo": "^0.1.0",
|
|
@@ -56,16 +56,15 @@
|
|
|
56
56
|
"tiny-invariant": "^1.2.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"react": "^16.8.0"
|
|
60
|
-
"styled-components": "^3.2.6"
|
|
59
|
+
"react": "^16.8.0"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@atlaskit/docs": "^9.0.0",
|
|
64
63
|
"@atlaskit/editor-test-helpers": "^17.1.0",
|
|
65
|
-
"@atlaskit/flag": "^14.
|
|
66
|
-
"@atlaskit/section-message": "^6.
|
|
67
|
-
"@atlaskit/select": "^15.
|
|
68
|
-
"@atlaskit/toggle": "^12.
|
|
64
|
+
"@atlaskit/flag": "^14.7.0",
|
|
65
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
66
|
+
"@atlaskit/select": "^15.7.0",
|
|
67
|
+
"@atlaskit/toggle": "^12.5.0",
|
|
69
68
|
"@atlaskit/util-data-test": "^17.5.0",
|
|
70
69
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
71
70
|
"enzyme": "^3.10.0",
|
|
@@ -104,7 +103,8 @@
|
|
|
104
103
|
},
|
|
105
104
|
"af:exports": {
|
|
106
105
|
".": "./src/index.ts",
|
|
107
|
-
"./clients": "./src/clients/index.ts"
|
|
106
|
+
"./clients": "./src/clients/index.ts",
|
|
107
|
+
"./copy-link-button": "./src/components/CopyLinkButton.tsx"
|
|
108
108
|
},
|
|
109
109
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
110
110
|
}
|
package/report.api.md
CHANGED
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
import type { Appearance } from '@atlaskit/button/types';
|
|
11
11
|
import type { IconProps } from '@atlaskit/icon';
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
12
13
|
import type { LoadOptions } from '@atlaskit/smart-user-picker';
|
|
13
14
|
import { OptionData } from '@atlaskit/smart-user-picker';
|
|
14
15
|
import type { Placement } from '@atlaskit/popper';
|
|
15
16
|
import { default as React_2 } from 'react';
|
|
16
|
-
import
|
|
17
|
+
import { ReactElement } from 'react';
|
|
18
|
+
import { TriggerProps } from '@atlaskit/popup';
|
|
17
19
|
import type { Value } from '@atlaskit/smart-user-picker';
|
|
18
20
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
19
21
|
|
|
@@ -36,6 +38,20 @@ export declare type Content = {
|
|
|
36
38
|
type: string;
|
|
37
39
|
};
|
|
38
40
|
|
|
41
|
+
export declare class CopyLinkButton extends React_2.Component<Props, State> {
|
|
42
|
+
private autoDismiss;
|
|
43
|
+
private inputRef;
|
|
44
|
+
state: {
|
|
45
|
+
shouldShowCopiedMessage: boolean;
|
|
46
|
+
};
|
|
47
|
+
componentWillUnmount(): void;
|
|
48
|
+
private clearAutoDismiss;
|
|
49
|
+
private handleClick;
|
|
50
|
+
private handleDismissCopiedMessage;
|
|
51
|
+
renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
|
|
52
|
+
render(): jsx.JSX.Element;
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
export declare type DialogContentState = {
|
|
40
56
|
users: OptionData[];
|
|
41
57
|
comment: Comment_2;
|
|
@@ -130,6 +146,17 @@ export declare type ProductId =
|
|
|
130
146
|
|
|
131
147
|
export declare type ProductName = 'jira' | 'confluence';
|
|
132
148
|
|
|
149
|
+
declare type Props = {
|
|
150
|
+
onLinkCopy?: (link: string) => void;
|
|
151
|
+
link: string;
|
|
152
|
+
isDisabled?: boolean;
|
|
153
|
+
copyTooltipText?: string;
|
|
154
|
+
children?: string | ReactElement;
|
|
155
|
+
copyLinkButtonText: string;
|
|
156
|
+
copiedToClipboardText: string;
|
|
157
|
+
iconBefore?: ReactElement;
|
|
158
|
+
};
|
|
159
|
+
|
|
133
160
|
export declare type RenderCustomTriggerButton = (
|
|
134
161
|
args: {
|
|
135
162
|
error?: ShareError;
|
|
@@ -390,6 +417,10 @@ declare interface ShortenResponse {
|
|
|
390
417
|
shortUrl: string;
|
|
391
418
|
}
|
|
392
419
|
|
|
420
|
+
declare type State = {
|
|
421
|
+
shouldShowCopiedMessage: boolean;
|
|
422
|
+
};
|
|
423
|
+
|
|
393
424
|
declare enum TabType {
|
|
394
425
|
default = 0,
|
|
395
426
|
Slack = 1,
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.SpinnerWrapper = exports.CustomFooterWrapper = exports.BottomMessageWrapper = 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, _templateObject3;
|
|
17
|
-
|
|
18
|
-
var BottomMessageWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n"])), (0, _constants.gridSize)() * 44);
|
|
19
|
-
|
|
20
|
-
exports.BottomMessageWrapper = BottomMessageWrapper;
|
|
21
|
-
|
|
22
|
-
var CustomFooterWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* Must match inline dialog padding. */\n margin: 0 ", "px ", "px ", "px;\n"])), -(0, _constants.gridSize)() * 3, -(0, _constants.gridSize)() * 2, -(0, _constants.gridSize)() * 3);
|
|
23
|
-
|
|
24
|
-
exports.CustomFooterWrapper = CustomFooterWrapper;
|
|
25
|
-
|
|
26
|
-
var SpinnerWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-content: center;\n"])));
|
|
27
|
-
|
|
28
|
-
exports.SpinnerWrapper = SpinnerWrapper;
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
align-content: center;
|
|
16
|
-
`;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
-
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
|
-
export var BottomMessageWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n"])), gridSize() * 44);
|
|
8
|
-
export var CustomFooterWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* Must match inline dialog padding. */\n margin: 0 ", "px ", "px ", "px;\n"])), -gridSize() * 3, -gridSize() * 2, -gridSize() * 3);
|
|
9
|
-
export var SpinnerWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-content: center;\n"])));
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const BottomMessageWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
3
|
-
export declare const CustomFooterWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
4
|
-
export declare const SpinnerWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|