@atlaskit/smart-card 23.12.3 → 23.13.1
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 +12 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +12 -6
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +14 -7
- package/dist/cjs/extractors/common/icon/extractIconFromTask.js +25 -15
- package/dist/cjs/linkUrl.js +15 -0
- package/dist/cjs/messages.js +21 -1
- package/dist/cjs/utils/index.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +3 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +6 -3
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +2 -1
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +1 -0
- package/dist/cjs/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +76 -0
- package/dist/cjs/view/LinkUrl/LinkWarningModal/index.js +70 -0
- package/dist/cjs/view/LinkUrl/index.js +48 -0
- package/dist/cjs/view/LinkUrl/types.js +5 -0
- package/dist/es2019/extractors/common/icon/extractIcon.js +12 -6
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +14 -7
- package/dist/es2019/extractors/common/icon/extractIconFromTask.js +24 -15
- package/dist/es2019/linkUrl.js +1 -0
- package/dist/es2019/messages.js +21 -1
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +3 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/es2019/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +6 -3
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +2 -1
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +1 -0
- package/dist/es2019/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +49 -0
- package/dist/es2019/view/LinkUrl/LinkWarningModal/index.js +46 -0
- package/dist/es2019/view/LinkUrl/index.js +28 -0
- package/dist/es2019/view/LinkUrl/types.js +1 -0
- package/dist/esm/extractors/common/icon/extractIcon.js +12 -6
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +14 -7
- package/dist/esm/extractors/common/icon/extractIconFromTask.js +24 -15
- package/dist/esm/linkUrl.js +1 -0
- package/dist/esm/messages.js +21 -1
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/esm/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +6 -3
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +2 -1
- package/dist/esm/view/InlineCard/ResolvedView/index.js +1 -0
- package/dist/esm/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +62 -0
- package/dist/esm/view/LinkUrl/LinkWarningModal/index.js +46 -0
- package/dist/esm/view/LinkUrl/index.js +33 -0
- package/dist/esm/view/LinkUrl/types.js +1 -0
- package/dist/types/extractors/common/__mocks__/withIntl.d.ts +2 -0
- package/dist/types/linkUrl.d.ts +2 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.d.ts +9 -0
- package/dist/types/view/LinkUrl/LinkWarningModal/index.d.ts +13 -0
- package/dist/types/view/LinkUrl/index.d.ts +4 -0
- package/dist/types/view/LinkUrl/types.d.ts +8 -0
- package/link-url/package.json +15 -0
- package/package.json +3 -4
- package/dist/types/extractors/common/__mocks__/render.d.ts +0 -2
package/dist/esm/messages.js
CHANGED
|
@@ -40,6 +40,11 @@ export var messages = defineMessages({
|
|
|
40
40
|
defaultMessage: 'Close',
|
|
41
41
|
description: ''
|
|
42
42
|
},
|
|
43
|
+
check_this_link: {
|
|
44
|
+
id: 'fabric.linking.check_this_link',
|
|
45
|
+
defaultMessage: 'Check this link',
|
|
46
|
+
description: 'Link safety warning modal header'
|
|
47
|
+
},
|
|
43
48
|
connect_to: {
|
|
44
49
|
id: 'fabric.linking.connect_to',
|
|
45
50
|
defaultMessage: 'Connect to {name}',
|
|
@@ -85,8 +90,13 @@ export var messages = defineMessages({
|
|
|
85
90
|
defaultMessage: 'Connect to Atlassian to view more details of your work and collaborate from one place.',
|
|
86
91
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
87
92
|
},
|
|
93
|
+
continue: {
|
|
94
|
+
id: 'fabric.linking.continue',
|
|
95
|
+
defaultMessage: 'Continue',
|
|
96
|
+
description: 'continue'
|
|
97
|
+
},
|
|
88
98
|
copy_url_to_clipboard: {
|
|
89
|
-
id: 'fabric.linking.
|
|
99
|
+
id: 'fabric.linking.copy_url_to_clipboard',
|
|
90
100
|
defaultMessage: 'Copy link',
|
|
91
101
|
description: ''
|
|
92
102
|
},
|
|
@@ -130,6 +140,11 @@ export var messages = defineMessages({
|
|
|
130
140
|
defaultMessage: 'You don’t have access to this preview. Contact the site admin if you need access.',
|
|
131
141
|
description: 'Informs the user that they cannot view this content.'
|
|
132
142
|
},
|
|
143
|
+
go_back: {
|
|
144
|
+
id: 'fabric.linking.go_back',
|
|
145
|
+
defaultMessage: 'Go back',
|
|
146
|
+
description: 'go back'
|
|
147
|
+
},
|
|
133
148
|
invalid_permissions: {
|
|
134
149
|
id: 'fabric.linking.invalid_permissions',
|
|
135
150
|
defaultMessage: 'Restricted content',
|
|
@@ -335,6 +350,11 @@ export var messages = defineMessages({
|
|
|
335
350
|
defaultMessage: 'Try another account',
|
|
336
351
|
description: 'Allows the user to try an action again with a different account'
|
|
337
352
|
},
|
|
353
|
+
link_safety_warning_message: {
|
|
354
|
+
id: 'fabric.linking.link_safety_warning_message',
|
|
355
|
+
defaultMessage: 'The link {unsafeLinkText} is taking you to a different site, <a>actual link here</a>',
|
|
356
|
+
description: 'Link safety check warning message'
|
|
357
|
+
},
|
|
338
358
|
unlink_account: {
|
|
339
359
|
id: 'fabric.linking.unlink_account',
|
|
340
360
|
defaultMessage: 'Unlink Account',
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -49,7 +49,8 @@ export var getIconForFileType = function getIconForFileType(fileMimeType) {
|
|
|
49
49
|
}); // because we're using dynamic loading here, TS will not be able to infer the type
|
|
50
50
|
|
|
51
51
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
-
label: label
|
|
52
|
+
label: label,
|
|
53
|
+
testId: "document-file-format-icon"
|
|
53
54
|
});
|
|
54
55
|
};
|
|
55
56
|
export var getLabelForFileType = function getLabelForFileType(fileMimeType) {
|
package/dist/esm/version.json
CHANGED
|
@@ -77,7 +77,9 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
77
77
|
"data-testid": testId,
|
|
78
78
|
"data-trello-do-not-use-override": testId,
|
|
79
79
|
"data-is-selected": isSelected,
|
|
80
|
-
"data-is-visible": isVisible
|
|
80
|
+
"data-is-visible": isVisible,
|
|
81
|
+
"data-wrapper-type": "default",
|
|
82
|
+
"data-is-interactive": isInteractive()
|
|
81
83
|
}, renderHeader(), renderContent());
|
|
82
84
|
}
|
|
83
85
|
};
|
|
@@ -148,7 +148,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
148
148
|
onMouseEnter: initShowCard,
|
|
149
149
|
onMouseLeave: initHideCard,
|
|
150
150
|
onMouseMove: setMousePosition,
|
|
151
|
-
onClick: onChildClick
|
|
151
|
+
onClick: onChildClick,
|
|
152
|
+
"data-testid": "hover-card-trigger-wrapper"
|
|
152
153
|
}), children));
|
|
153
154
|
},
|
|
154
155
|
zIndex: 511 // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
@@ -54,7 +54,8 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
|
54
54
|
spacing: "none",
|
|
55
55
|
appearance: "subtle-link",
|
|
56
56
|
component: IconStyledButton,
|
|
57
|
-
onClick: _this.handleRetry
|
|
57
|
+
onClick: _this.handleRetry,
|
|
58
|
+
role: "button"
|
|
58
59
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again, function (formattedMessage) {
|
|
59
60
|
return /*#__PURE__*/React.createElement(LowercaseAppearance, null, formattedMessage);
|
|
60
61
|
})));
|
|
@@ -80,7 +81,8 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
|
80
81
|
icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
81
82
|
label: "error",
|
|
82
83
|
size: "small",
|
|
83
|
-
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")")
|
|
84
|
+
primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
85
|
+
testId: "errored-view-default-icon"
|
|
84
86
|
})),
|
|
85
87
|
link: url,
|
|
86
88
|
title: url,
|
|
@@ -26,7 +26,8 @@ import { LozengeWrapper, LozengeBlockWrapper } from '../IconAndTitleLayout/style
|
|
|
26
26
|
var FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
|
|
27
27
|
label: "error",
|
|
28
28
|
size: "small",
|
|
29
|
-
primaryColor: "var(--ds-icon-danger, ".concat(R400, ")")
|
|
29
|
+
primaryColor: "var(--ds-icon-danger, ".concat(R400, ")"),
|
|
30
|
+
testId: "forbidden-view-fallback-icon"
|
|
30
31
|
}));
|
|
31
32
|
export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
32
33
|
_inherits(InlineCardForbiddenView, _React$Component);
|
|
@@ -90,7 +91,8 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
90
91
|
appearance: "subtle-link",
|
|
91
92
|
onClick: _this.handleRetry,
|
|
92
93
|
component: IconStyledButton,
|
|
93
|
-
testId: "button-connect-other-account"
|
|
94
|
+
testId: "button-connect-other-account",
|
|
95
|
+
role: "button"
|
|
94
96
|
}, _this.renderForbiddenAccessMessage());
|
|
95
97
|
}
|
|
96
98
|
|
|
@@ -100,7 +102,8 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
100
102
|
appearance: "subtle-link",
|
|
101
103
|
onClick: _this.handleRetry,
|
|
102
104
|
component: IconStyledButton,
|
|
103
|
-
testId: "button-connect-other-account"
|
|
105
|
+
testId: "button-connect-other-account",
|
|
106
|
+
role: "button"
|
|
104
107
|
}, /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
|
|
105
108
|
appearance: 'moved'
|
|
106
109
|
}, _this.renderForbiddenAccessMessage()))));
|
|
@@ -151,7 +151,8 @@ export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
151
151
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconTitleWrapper, {
|
|
152
152
|
style: {
|
|
153
153
|
color: titleColor
|
|
154
|
-
}
|
|
154
|
+
},
|
|
155
|
+
"data-testid": testId
|
|
155
156
|
}, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
|
|
156
157
|
href: link,
|
|
157
158
|
onClick: this.handleClick,
|
|
@@ -35,6 +35,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return /*#__PURE__*/React.createElement(LozengeBlockWrapper, null, /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
|
|
38
|
+
testId: "inline-card-resolved-view-lozenge",
|
|
38
39
|
appearance: lozenge.appearance || 'default',
|
|
39
40
|
isBold: lozenge.isBold
|
|
40
41
|
}, lozenge.text)));
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { normalizeUrl } from '@atlaskit/linking-common/url';
|
|
4
|
+
export var useLinkWarningModal = function useLinkWarningModal() {
|
|
5
|
+
var _useState = useState(null),
|
|
6
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7
|
+
unsafeLinkText = _useState2[0],
|
|
8
|
+
setUnsafeLinkText = _useState2[1];
|
|
9
|
+
|
|
10
|
+
var _useState3 = useState(null),
|
|
11
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
12
|
+
url = _useState4[0],
|
|
13
|
+
setUrl = _useState4[1];
|
|
14
|
+
|
|
15
|
+
var _useState5 = useState(false),
|
|
16
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
17
|
+
isOpen = _useState6[0],
|
|
18
|
+
setIsOpen = _useState6[1];
|
|
19
|
+
/**
|
|
20
|
+
* It checks and warns if a link text is a URL and different from an actual link destination
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var checkLinkSafety = function checkLinkSafety(event, href) {
|
|
25
|
+
var linkText = event.currentTarget.innerText;
|
|
26
|
+
var anchorLinkRegex = new RegExp(/^#/im);
|
|
27
|
+
var isAnchorLink = anchorLinkRegex.test(linkText);
|
|
28
|
+
|
|
29
|
+
if (isAnchorLink) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var normalisedUrlFromLinkText = normalizeUrl(linkText);
|
|
34
|
+
|
|
35
|
+
if (!!normalisedUrlFromLinkText && normalisedUrlFromLinkText !== href) {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
setUnsafeLinkText(linkText);
|
|
38
|
+
href && setUrl(href);
|
|
39
|
+
setIsOpen(true);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var onClose = function onClose() {
|
|
44
|
+
setIsOpen(false);
|
|
45
|
+
setUnsafeLinkText(null);
|
|
46
|
+
setUrl(null);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var onContinue = function onContinue() {
|
|
50
|
+
onClose();
|
|
51
|
+
url && window.location.assign(url);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
checkLinkSafety: checkLinkSafety,
|
|
56
|
+
unsafeLinkText: unsafeLinkText,
|
|
57
|
+
onClose: onClose,
|
|
58
|
+
onContinue: onContinue,
|
|
59
|
+
isOpen: isOpen,
|
|
60
|
+
url: url
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Button from '@atlaskit/button/standard-button';
|
|
4
|
+
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl-next';
|
|
6
|
+
import { messages } from '../../../messages';
|
|
7
|
+
|
|
8
|
+
var WarningModal = function WarningModal(props) {
|
|
9
|
+
var isOpen = props.isOpen,
|
|
10
|
+
unsafeLinkText = props.unsafeLinkText,
|
|
11
|
+
url = props.url,
|
|
12
|
+
onClose = props.onClose,
|
|
13
|
+
onContinue = props.onContinue,
|
|
14
|
+
intl = props.intl;
|
|
15
|
+
var content = /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(Modal, {
|
|
16
|
+
onClose: onClose,
|
|
17
|
+
testId: "link-with-safety-warning"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
19
|
+
appearance: "warning"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.check_this_link))), /*#__PURE__*/React.createElement(ModalBody, null, url && unsafeLinkText && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.link_safety_warning_message, {
|
|
21
|
+
values: {
|
|
22
|
+
unsafeLinkText: unsafeLinkText,
|
|
23
|
+
a: function a() {
|
|
24
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
25
|
+
href: url,
|
|
26
|
+
target: "_blank",
|
|
27
|
+
rel: "noopener noreferrer"
|
|
28
|
+
}, url);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
32
|
+
appearance: "subtle",
|
|
33
|
+
onClick: onClose
|
|
34
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.go_back)), /*#__PURE__*/React.createElement(Button, {
|
|
35
|
+
appearance: "warning",
|
|
36
|
+
onClick: onContinue,
|
|
37
|
+
autoFocus: true
|
|
38
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.continue)))));
|
|
39
|
+
return intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
40
|
+
locale: "en"
|
|
41
|
+
}, content);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default injectIntl(WarningModal, {
|
|
45
|
+
enforceContext: false
|
|
46
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
4
|
+
_excluded2 = ["checkLinkSafety"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
7
|
+
import LinkWarningModal from './LinkWarningModal';
|
|
8
|
+
|
|
9
|
+
var LinkUrl = function LinkUrl(_ref) {
|
|
10
|
+
var href = _ref.href,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
_ref$checkSafety = _ref.checkSafety,
|
|
13
|
+
checkSafety = _ref$checkSafety === void 0 ? true : _ref$checkSafety,
|
|
14
|
+
_onClick = _ref.onClick,
|
|
15
|
+
_ref$testId = _ref.testId,
|
|
16
|
+
testId = _ref$testId === void 0 ? 'link-with-safety' : _ref$testId,
|
|
17
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
19
|
+
var _useLinkWarningModal = useLinkWarningModal(),
|
|
20
|
+
checkLinkSafety = _useLinkWarningModal.checkLinkSafety,
|
|
21
|
+
linkWarningModalProps = _objectWithoutProperties(_useLinkWarningModal, _excluded2);
|
|
22
|
+
|
|
23
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", _extends({
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
href: href,
|
|
26
|
+
onClick: function onClick(e) {
|
|
27
|
+
checkSafety && checkLinkSafety(e, href);
|
|
28
|
+
_onClick && _onClick(e);
|
|
29
|
+
}
|
|
30
|
+
}, props), children), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default LinkUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export declare type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_link_in_a_new_tab' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export declare type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_link_in_a_new_tab' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
declare type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
export declare const useLinkWarningModal: () => {
|
|
3
|
+
checkLinkSafety: (event: MouseEvent, href: string | undefined) => void;
|
|
4
|
+
unsafeLinkText: string | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onContinue: () => void;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
url: string | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
interface LinkWarningModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onContinue: () => void;
|
|
7
|
+
unsafeLinkText: string | null;
|
|
8
|
+
url: string | null;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<LinkWarningModalProps & WrappedComponentProps<"intl">>> & {
|
|
11
|
+
WrappedComponent: React.ComponentType<LinkWarningModalProps & WrappedComponentProps<"intl">>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/smart-card/link-url",
|
|
3
|
+
"main": "../dist/cjs/linkUrl.js",
|
|
4
|
+
"module": "../dist/esm/linkUrl.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/linkUrl.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/linkUrl.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/linkUrl.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.13.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/icon-object": "^6.2.0",
|
|
34
34
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
35
35
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
36
|
-
"@atlaskit/linking-common": "^1.
|
|
36
|
+
"@atlaskit/linking-common": "^1.20.0",
|
|
37
37
|
"@atlaskit/logo": "^13.10.0",
|
|
38
38
|
"@atlaskit/lozenge": "^11.3.0",
|
|
39
39
|
"@atlaskit/media-common": "^2.18.0",
|
|
@@ -91,13 +91,11 @@
|
|
|
91
91
|
"@testing-library/react": "^12.1.5",
|
|
92
92
|
"@testing-library/react-hooks": "^8.0.1",
|
|
93
93
|
"@testing-library/user-event": "^14.4.3",
|
|
94
|
-
"@types/enzyme": "^3.1.15",
|
|
95
94
|
"@types/lorem-ipsum": "^1.0.2",
|
|
96
95
|
"@types/react": "^16.8.0",
|
|
97
96
|
"@types/react-loadable": "^5.4.1",
|
|
98
97
|
"abortcontroller-polyfill": "^1.1.9",
|
|
99
98
|
"brace": "^0.11.1",
|
|
100
|
-
"enzyme": "^3.10.0",
|
|
101
99
|
"jest-emotion": "^10.0.32",
|
|
102
100
|
"jest-extended": "^0.11.2",
|
|
103
101
|
"jsdom": "^16.2.2",
|
|
@@ -120,6 +118,7 @@
|
|
|
120
118
|
"./types": "./src/types.ts",
|
|
121
119
|
"./hooks": "./src/hooks.ts",
|
|
122
120
|
"./hover-card": "./src/hoverCard.ts",
|
|
121
|
+
"./link-url": "./src/linkUrl.ts",
|
|
123
122
|
".": "./src/index.ts"
|
|
124
123
|
},
|
|
125
124
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|