@atlaskit/share 3.4.2 → 3.5.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`76c73df383f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/76c73df383f) - Exposed CopyLinkButton from share component and made it generic.
8
+
3
9
  ## 3.4.2
4
10
 
5
11
  ### 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
- isPublicLink = _this$props.isPublicLink;
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": formatMessage(isPublicLink ? _i18n.messages.copyPublicLinkButtonText : _i18n.messages.copyLinkButtonText),
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), (0, _react2.jsx)(_reactIntlNext.FormattedMessage, isPublicLink ? _i18n.messages.copyPublicLinkButtonText : _i18n.messages.copyLinkButtonText));
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
- formatMessage = _this$props2.intl.formatMessage,
173
- copyTooltipText = _this$props2.copyTooltipText;
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 && formatMessage(_i18n.messages.copiedToClipboardMessage)), (0, _react2.jsx)(HiddenInput, {
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)("span", {
186
+ }), (0, _react2.jsx)("div", {
190
187
  css: messageTextStyle
191
- }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.copiedToClipboardMessage))));
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;
@@ -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
- isPublicLink: isPublicLink,
181
- copyTooltipText: copyTooltipText
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 () {
@@ -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.4.2"
22
+ packageVersion: "3.5.0"
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");
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.4.2"
3
+ "version": "3.5.0"
4
4
  }
@@ -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
- isPublicLink
88
+ copyLinkButtonText,
89
+ children,
90
+ iconBefore
94
91
  } = this.props;
95
92
  return jsx(Button, _extends({
96
- "aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
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), jsx(FormattedMessage, isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText));
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
- intl: {
118
- formatMessage
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 && formatMessage(messages.copiedToClipboardMessage)), jsx(HiddenInput, {
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("span", {
131
+ }), jsx("div", {
137
132
  css: messageTextStyle
138
- }, jsx(FormattedMessage, messages.copiedToClipboardMessage)))),
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 injectIntl(CopyLinkButton);
145
+ export default CopyLinkButton;
@@ -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
- isPublicLink: isPublicLink,
138
- copyTooltipText: copyTooltipText
140
+ copyTooltipText: copyTooltipText,
141
+ copyLinkButtonText: formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
142
+ copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
139
143
  }), this.renderSubmitButton())));
140
144
  });
141
145
 
@@ -2,7 +2,7 @@ import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
2
2
 
3
3
  const buildAttributes = (attributes = {}) => ({
4
4
  packageName: "@atlaskit/share",
5
- packageVersion: "3.4.2",
5
+ packageVersion: "3.5.0",
6
6
  ...attributes
7
7
  });
8
8
 
@@ -1,3 +1,4 @@
1
1
  export { ShareDialogContainer } from './components/ShareDialogContainer';
2
+ export { CopyLinkButton } from './components/CopyLinkButton';
2
3
  export { // Constants
3
4
  ADMIN_NOTIFIED, OBJECT_SHARED } from './types';
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.4.2"
3
+ "version": "3.5.0"
4
4
  }
@@ -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
- isPublicLink = _this$props.isPublicLink;
112
+ copyLinkButtonText = _this$props.copyLinkButtonText,
113
+ children = _this$props.children,
114
+ iconBefore = _this$props.iconBefore;
116
115
  return jsx(Button, _extends({
117
- "aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
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), jsx(FormattedMessage, isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText));
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
- formatMessage = _this$props2.intl.formatMessage,
144
- copyTooltipText = _this$props2.copyTooltipText;
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 && formatMessage(messages.copiedToClipboardMessage)), jsx(HiddenInput, {
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("span", {
159
+ }), jsx("div", {
161
160
  css: messageTextStyle
162
- }, jsx(FormattedMessage, messages.copiedToClipboardMessage))));
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 injectIntl(CopyLinkButton);
178
+ export default CopyLinkButton;
@@ -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
- isPublicLink: isPublicLink,
139
- copyTooltipText: copyTooltipText
139
+ copyTooltipText: copyTooltipText,
140
+ copyLinkButtonText: formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
141
+ copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
140
142
  }), _this.renderSubmitButton())));
141
143
  });
142
144
 
@@ -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.4.2"
13
+ packageVersion: "3.5.0"
14
14
  }, attributes);
15
15
  };
16
16
 
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { ShareDialogContainer } from './components/ShareDialogContainer';
2
+ export { CopyLinkButton } from './components/CopyLinkButton';
2
3
  export { // Constants
3
4
  ADMIN_NOTIFIED, OBJECT_SHARED } from './types';
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.4.2"
3
+ "version": "3.5.0"
4
4
  }
@@ -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 & WrappedComponentProps, State> {
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
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
36
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
37
- };
38
- export default _default;
37
+ export default CopyLinkButton;
@@ -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.4.2",
3
+ "version": "3.5.0",
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.3.0",
35
+ "@atlaskit/dropdown-menu": "^11.4.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.2.3",
42
+ "@atlaskit/tabs": "^13.3.0",
43
43
  "@atlaskit/textarea": "^4.3.0",
44
- "@atlaskit/theme": "^12.1.0",
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",
@@ -62,10 +62,10 @@
62
62
  "devDependencies": {
63
63
  "@atlaskit/docs": "^9.0.0",
64
64
  "@atlaskit/editor-test-helpers": "^17.1.0",
65
- "@atlaskit/flag": "^14.6.0",
66
- "@atlaskit/section-message": "^6.0.0",
67
- "@atlaskit/select": "^15.6.0",
68
- "@atlaskit/toggle": "^12.4.0",
65
+ "@atlaskit/flag": "^14.7.0",
66
+ "@atlaskit/section-message": "^6.2.0",
67
+ "@atlaskit/select": "^15.7.0",
68
+ "@atlaskit/toggle": "^12.5.0",
69
69
  "@atlaskit/util-data-test": "^17.5.0",
70
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
71
71
  "enzyme": "^3.10.0",
@@ -104,7 +104,8 @@
104
104
  },
105
105
  "af:exports": {
106
106
  ".": "./src/index.ts",
107
- "./clients": "./src/clients/index.ts"
107
+ "./clients": "./src/clients/index.ts",
108
+ "./copy-link-button": "./src/components/CopyLinkButton.tsx"
108
109
  },
109
110
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
110
111
  }
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 type { TriggerProps } from '@atlaskit/popup';
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,