@atlaskit/smart-card 26.46.3 → 26.46.5
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 +13 -0
- package/dist/cjs/extractors/common/context/extractAccessContext.js +34 -31
- package/dist/cjs/messages.js +29 -76
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +1 -1
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- package/dist/cjs/view/FlexibleCard/utils.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.js +38 -0
- package/dist/es2019/extractors/common/context/extractAccessContext.js +35 -31
- package/dist/es2019/messages.js +29 -76
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +1 -1
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +5 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- package/dist/es2019/view/FlexibleCard/utils.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +35 -0
- package/dist/esm/extractors/common/context/extractAccessContext.js +34 -31
- package/dist/esm/messages.js +29 -76
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/index.js +1 -1
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- package/dist/esm/view/FlexibleCard/utils.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +31 -0
- package/dist/types/extractors/common/context/extractAccessContext.d.ts +2 -2
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/common/ai-summary/index.d.ts +20 -0
- package/dist/types-ts4.5/extractors/common/context/extractAccessContext.d.ts +2 -2
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/view/common/ai-summary/index.d.ts +20 -0
- package/package.json +3 -2
|
@@ -158,7 +158,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
158
158
|
var requestAccessContext = extractRequestAccessContext({
|
|
159
159
|
jsonLd: cardMetadata,
|
|
160
160
|
url: url,
|
|
161
|
-
|
|
161
|
+
product: (_forbiddenViewProps$c = forbiddenViewProps.context) === null || _forbiddenViewProps$c === void 0 ? void 0 : _forbiddenViewProps$c.text
|
|
162
162
|
});
|
|
163
163
|
return jsx(BlockCardForbiddenView, _extends({}, forbiddenViewProps, {
|
|
164
164
|
isSelected: isSelected,
|
|
@@ -41,7 +41,9 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
41
41
|
};
|
|
42
42
|
var action = requestAccessContext.action,
|
|
43
43
|
_requestAccessContext = requestAccessContext.descriptiveMessageKey,
|
|
44
|
-
descriptiveMessageKey = _requestAccessContext === void 0 ? 'invalid_permissions_description' : _requestAccessContext
|
|
44
|
+
descriptiveMessageKey = _requestAccessContext === void 0 ? 'invalid_permissions_description' : _requestAccessContext,
|
|
45
|
+
_requestAccessContext2 = requestAccessContext.hostname,
|
|
46
|
+
hostname = _requestAccessContext2 === void 0 ? '' : _requestAccessContext2;
|
|
45
47
|
var items = action ? [].concat(_toConsumableArray(actions), [action]) : actions;
|
|
46
48
|
return jsx(Frame, {
|
|
47
49
|
isSelected: isSelected,
|
|
@@ -66,7 +68,9 @@ export var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
66
68
|
}),
|
|
67
69
|
text: jsx(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
|
|
68
70
|
values: {
|
|
69
|
-
|
|
71
|
+
product: context.text,
|
|
72
|
+
context: context.text,
|
|
73
|
+
hostname: hostname
|
|
70
74
|
}
|
|
71
75
|
}))
|
|
72
76
|
}))), jsx(ContentFooter, null, jsx(Provider, {
|
|
@@ -30,13 +30,13 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
|
|
|
30
30
|
return (_provider$text = provider === null || provider === void 0 ? void 0 : provider.text) !== null && _provider$text !== void 0 ? _provider$text : '';
|
|
31
31
|
}, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data]);
|
|
32
32
|
var title = useMemo(function () {
|
|
33
|
-
return intl.formatMessage(messages.
|
|
33
|
+
return intl.formatMessage(messages.not_found_title, {
|
|
34
34
|
product: product
|
|
35
35
|
});
|
|
36
36
|
}, [intl, product]);
|
|
37
37
|
var description = useMemo(function () {
|
|
38
38
|
return {
|
|
39
|
-
descriptor: messages.
|
|
39
|
+
descriptor: messages.not_found_description
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
42
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, props, {
|
|
@@ -72,7 +72,7 @@ export var getRetryOptions = function getRetryOptions(url, status, response, onA
|
|
|
72
72
|
var access = extractRequestAccessContext({
|
|
73
73
|
jsonLd: meta,
|
|
74
74
|
url: url,
|
|
75
|
-
|
|
75
|
+
product: context
|
|
76
76
|
});
|
|
77
77
|
var messageKey = getForbiddenMessageKey(meta);
|
|
78
78
|
var descriptor = messages[messageKey];
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.46.
|
|
13
|
+
packageVersion: "26.46.5",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Markdown from 'markdown-to-jsx';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
var AISummaryCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-y: auto;\n font-size: 0.75rem;\n line-height: 1rem;\n word-wrap: break-word;\n white-space: normal;\n"])));
|
|
8
|
+
/**
|
|
9
|
+
* A component to render a response from AI in markdown text.
|
|
10
|
+
* @internal
|
|
11
|
+
* @param {AISummaryProps} AISummaryProps
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var AISummary = function AISummary(_ref) {
|
|
15
|
+
var content = _ref.content,
|
|
16
|
+
overrideCss = _ref.overrideCss,
|
|
17
|
+
_ref$testId = _ref.testId,
|
|
18
|
+
testId = _ref$testId === void 0 ? 'ai-summary' : _ref$testId;
|
|
19
|
+
if (!content) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return jsx(Markdown, {
|
|
23
|
+
"data-testid": testId,
|
|
24
|
+
css: [AISummaryCSS, overrideCss],
|
|
25
|
+
children: content,
|
|
26
|
+
options: {
|
|
27
|
+
forceWrapper: true
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export default AISummary;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
export declare const extractRequestAccessContext: ({ jsonLd, url,
|
|
4
|
+
export declare const extractRequestAccessContext: ({ jsonLd, url, product, }: {
|
|
5
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
product?: string | undefined;
|
|
8
8
|
}) => RequestAccessContextProps;
|
|
9
9
|
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
10
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
-
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | '
|
|
2
|
+
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
3
|
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_info' | 'ai_summarizing' | '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' | 'follow' | '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' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | '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' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SerializedStyles } from '@emotion/react';
|
|
4
|
+
type AISummaryProps = {
|
|
5
|
+
content?: string;
|
|
6
|
+
showAIIcon?: boolean;
|
|
7
|
+
overrideCss?: SerializedStyles;
|
|
8
|
+
/**
|
|
9
|
+
* appears as a data attribute `data-testid` in the rendered code,
|
|
10
|
+
* serving as a hook for automated tests
|
|
11
|
+
*/
|
|
12
|
+
testId?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A component to render a response from AI in markdown text.
|
|
16
|
+
* @internal
|
|
17
|
+
* @param {AISummaryProps} AISummaryProps
|
|
18
|
+
*/
|
|
19
|
+
declare const AISummary: React.FC<AISummaryProps>;
|
|
20
|
+
export default AISummary;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
export declare const extractRequestAccessContext: ({ jsonLd, url,
|
|
4
|
+
export declare const extractRequestAccessContext: ({ jsonLd, url, product, }: {
|
|
5
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
product?: string | undefined;
|
|
8
8
|
}) => RequestAccessContextProps;
|
|
9
9
|
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
10
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
-
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | '
|
|
2
|
+
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
3
|
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_info' | 'ai_summarizing' | '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' | 'follow' | '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' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | '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' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SerializedStyles } from '@emotion/react';
|
|
4
|
+
type AISummaryProps = {
|
|
5
|
+
content?: string;
|
|
6
|
+
showAIIcon?: boolean;
|
|
7
|
+
overrideCss?: SerializedStyles;
|
|
8
|
+
/**
|
|
9
|
+
* appears as a data attribute `data-testid` in the rendered code,
|
|
10
|
+
* serving as a hook for automated tests
|
|
11
|
+
*/
|
|
12
|
+
testId?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A component to render a response from AI in markdown text.
|
|
16
|
+
* @internal
|
|
17
|
+
* @param {AISummaryProps} AISummaryProps
|
|
18
|
+
*/
|
|
19
|
+
declare const AISummary: React.FC<AISummaryProps>;
|
|
20
|
+
export default AISummary;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.46.
|
|
3
|
+
"version": "26.46.5",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
32
32
|
"@atlaskit/badge": "^15.2.0",
|
|
33
33
|
"@atlaskit/button": "^17.3.0",
|
|
34
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
34
|
+
"@atlaskit/dropdown-menu": "^12.5.0",
|
|
35
35
|
"@atlaskit/icon": "^22.0.0",
|
|
36
36
|
"@atlaskit/icon-file-type": "^6.4.0",
|
|
37
37
|
"@atlaskit/icon-object": "^6.3.0",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@formatjs/intl-utils": "^3.8.4",
|
|
61
61
|
"facepaint": "^1.2.1",
|
|
62
62
|
"json-ld-types": "^3.11.0",
|
|
63
|
+
"markdown-to-jsx": "^7.1.7",
|
|
63
64
|
"react-error-boundary": "^3.1.3",
|
|
64
65
|
"react-lazily-render": "^1.2.0",
|
|
65
66
|
"react-loadable": "^5.1.0",
|