@atlaskit/smart-card 27.6.4 → 27.7.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 +18 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +67 -17
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +0 -3
- package/dist/cjs/extractors/common/icon/prioritiseIcon.js +1 -16
- package/dist/cjs/extractors/embed/index.js +0 -1
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -43
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/components/ActionList.js +12 -8
- package/dist/cjs/view/BlockCard/components/Content.js +10 -6
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +15 -9
- package/dist/cjs/view/BlockCard/components/Frame.js +15 -9
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/Byline.js +25 -25
- package/dist/es2019/extractors/common/icon/extractIcon.js +67 -19
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +0 -5
- package/dist/es2019/extractors/common/icon/prioritiseIcon.js +0 -9
- package/dist/es2019/extractors/embed/index.js +0 -1
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -42
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/components/ActionList.js +13 -8
- package/dist/es2019/view/BlockCard/components/Content.js +11 -7
- package/dist/es2019/view/BlockCard/components/ContentFooter.js +16 -10
- package/dist/es2019/view/BlockCard/components/Frame.js +13 -9
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/Byline.js +26 -26
- package/dist/esm/extractors/common/icon/extractIcon.js +67 -17
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +0 -3
- package/dist/esm/extractors/common/icon/prioritiseIcon.js +1 -16
- package/dist/esm/extractors/embed/index.js +0 -1
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -44
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/components/ActionList.js +13 -8
- package/dist/esm/view/BlockCard/components/Content.js +11 -7
- package/dist/esm/view/BlockCard/components/ContentFooter.js +16 -10
- package/dist/esm/view/BlockCard/components/Frame.js +13 -10
- package/dist/esm/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/Byline.js +26 -26
- package/dist/types/extractors/common/icon/prioritiseIcon.d.ts +1 -5
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +8 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/prioritiseIcon.d.ts +1 -5
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +8 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { N300 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { gs, mq } from './utils';
|
|
6
|
+
var baseStyles = css({
|
|
7
|
+
// Spec: only allow two lines MAX to be shown.
|
|
8
|
+
display: '-webkit-box',
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
WebkitLineClamp: 2,
|
|
12
|
+
WebkitBoxOrient: 'vertical',
|
|
13
|
+
wordBreak: 'break-word',
|
|
14
|
+
whiteSpace: 'pre-line',
|
|
15
|
+
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
16
|
+
// due to HTML its unwrapping behaviour on paste.
|
|
17
|
+
MozUserSelect: 'none'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
21
|
+
var styles = mq({
|
|
22
|
+
fontSize: gs(1.5),
|
|
23
|
+
lineHeight: gs(2.5),
|
|
24
|
+
color: "".concat("var(--ds-text-subtlest, ".concat(N300, ")")),
|
|
25
|
+
fontWeight: 'normal',
|
|
26
|
+
marginTop: gs(0.5),
|
|
27
|
+
// Fallback options.
|
|
28
|
+
maxHeight: gs(5)
|
|
29
|
+
});
|
|
6
30
|
export var Byline = function Byline(_ref) {
|
|
7
31
|
var text = _ref.text,
|
|
8
32
|
children = _ref.children,
|
|
9
33
|
testId = _ref.testId,
|
|
10
34
|
className = _ref.className;
|
|
11
35
|
return jsx("span", {
|
|
12
|
-
|
|
13
|
-
css: mq({
|
|
14
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
15
|
-
fontSize: gs(1.5),
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
17
|
-
lineHeight: gs(2.5),
|
|
18
|
-
color: "".concat("var(--ds-text-subtlest, ".concat(N300, ")")),
|
|
19
|
-
fontWeight: 'normal',
|
|
20
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
|
-
marginTop: gs(0.5),
|
|
22
|
-
// Spec: only allow two lines MAX to be shown.
|
|
23
|
-
display: '-webkit-box',
|
|
24
|
-
overflow: 'hidden',
|
|
25
|
-
textOverflow: 'ellipsis',
|
|
26
|
-
WebkitLineClamp: 2,
|
|
27
|
-
WebkitBoxOrient: 'vertical',
|
|
28
|
-
wordBreak: 'break-word',
|
|
29
|
-
// Fallback options.
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
31
|
-
maxHeight: gs(5),
|
|
32
|
-
whiteSpace: 'pre-line',
|
|
33
|
-
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
34
|
-
// due to HTML its unwrapping behaviour on paste.
|
|
35
|
-
MozUserSelect: 'none'
|
|
36
|
-
}),
|
|
36
|
+
css: [baseStyles, styles],
|
|
37
37
|
"data-testid": testId
|
|
38
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
39
39
|
,
|
|
@@ -11,10 +11,6 @@ export type IconDescriptor = {
|
|
|
11
11
|
* Options required to prioritise which icon to show
|
|
12
12
|
*/
|
|
13
13
|
export type IconPriorityOpts<T> = {
|
|
14
|
-
/**
|
|
15
|
-
* The '@id' field of the JSON-LD generator object
|
|
16
|
-
*/
|
|
17
|
-
providerId: string | undefined;
|
|
18
14
|
/**
|
|
19
15
|
* Icon choice corresponding to the file format (based on MIME type) for the object.
|
|
20
16
|
*/
|
|
@@ -37,4 +33,4 @@ export type IconPriorityOpts<T> = {
|
|
|
37
33
|
* Reusable priority function for choosing which icon to show.
|
|
38
34
|
* Generic so it can be used to prioritise strings, or React components depending on the usage.
|
|
39
35
|
*/
|
|
40
|
-
export declare function prioritiseIcon<T>({
|
|
36
|
+
export declare function prioritiseIcon<T>({ fileFormatIcon, documentTypeIcon, urlIcon, providerIcon, }: IconPriorityOpts<T>): T | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="filesystem" />
|
|
2
1
|
import type { ProductType, EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
3
2
|
export interface AISummaryServiceInt {
|
|
4
3
|
summariseUrl: () => Promise<AISummaryState>;
|
|
@@ -116,6 +115,14 @@ export type Durations = {
|
|
|
116
115
|
};
|
|
117
116
|
total: number;
|
|
118
117
|
};
|
|
118
|
+
export type Metadata = {
|
|
119
|
+
bm25Variant?: string;
|
|
120
|
+
confidenceScore?: number;
|
|
121
|
+
isFallbackMessage?: boolean;
|
|
122
|
+
originalQuery?: string;
|
|
123
|
+
semanticSearchLocationVariant?: string;
|
|
124
|
+
semanticSearchVariant?: string;
|
|
125
|
+
};
|
|
119
126
|
export type Message = {
|
|
120
127
|
appendices?: Appendices;
|
|
121
128
|
author?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CardProps } from '../view/Card';
|
|
3
3
|
import { type FrameStyle } from '../view/EmbedCard/types';
|
|
4
|
-
import { type ActiveThemeState } from '@atlaskit/tokens
|
|
4
|
+
import { type ActiveThemeState } from '@atlaskit/tokens';
|
|
5
5
|
export declare const isCardWithData: (props: CardProps) => boolean;
|
|
6
6
|
export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
|
|
7
7
|
export declare const isIframe: () => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
1
|
+
import { type TrackQuickActionFailureReason, type TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
2
2
|
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
3
|
smartLinkActionType: TrackQuickActionType;
|
|
4
4
|
reason: TrackQuickActionFailureReason;
|
|
@@ -11,10 +11,6 @@ export type IconDescriptor = {
|
|
|
11
11
|
* Options required to prioritise which icon to show
|
|
12
12
|
*/
|
|
13
13
|
export type IconPriorityOpts<T> = {
|
|
14
|
-
/**
|
|
15
|
-
* The '@id' field of the JSON-LD generator object
|
|
16
|
-
*/
|
|
17
|
-
providerId: string | undefined;
|
|
18
14
|
/**
|
|
19
15
|
* Icon choice corresponding to the file format (based on MIME type) for the object.
|
|
20
16
|
*/
|
|
@@ -37,4 +33,4 @@ export type IconPriorityOpts<T> = {
|
|
|
37
33
|
* Reusable priority function for choosing which icon to show.
|
|
38
34
|
* Generic so it can be used to prioritise strings, or React components depending on the usage.
|
|
39
35
|
*/
|
|
40
|
-
export declare function prioritiseIcon<T>({
|
|
36
|
+
export declare function prioritiseIcon<T>({ fileFormatIcon, documentTypeIcon, urlIcon, providerIcon, }: IconPriorityOpts<T>): T | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="filesystem" />
|
|
2
1
|
import type { ProductType, EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
3
2
|
export interface AISummaryServiceInt {
|
|
4
3
|
summariseUrl: () => Promise<AISummaryState>;
|
|
@@ -128,6 +127,14 @@ export type Durations = {
|
|
|
128
127
|
};
|
|
129
128
|
total: number;
|
|
130
129
|
};
|
|
130
|
+
export type Metadata = {
|
|
131
|
+
bm25Variant?: string;
|
|
132
|
+
confidenceScore?: number;
|
|
133
|
+
isFallbackMessage?: boolean;
|
|
134
|
+
originalQuery?: string;
|
|
135
|
+
semanticSearchLocationVariant?: string;
|
|
136
|
+
semanticSearchVariant?: string;
|
|
137
|
+
};
|
|
131
138
|
export type Message = {
|
|
132
139
|
appendices?: Appendices;
|
|
133
140
|
author?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CardProps } from '../view/Card';
|
|
3
3
|
import { type FrameStyle } from '../view/EmbedCard/types';
|
|
4
|
-
import { type ActiveThemeState } from '@atlaskit/tokens
|
|
4
|
+
import { type ActiveThemeState } from '@atlaskit/tokens';
|
|
5
5
|
export declare const isCardWithData: (props: CardProps) => boolean;
|
|
6
6
|
export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
|
|
7
7
|
export declare const isIframe: () => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
1
|
+
import { type TrackQuickActionFailureReason, type TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
2
2
|
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
3
|
smartLinkActionType: TrackQuickActionType;
|
|
4
4
|
reason: TrackQuickActionFailureReason;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.7.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/avatar": "^21.10.0",
|
|
34
34
|
"@atlaskit/avatar-group": "^9.8.0",
|
|
35
35
|
"@atlaskit/badge": "^16.2.0",
|
|
36
|
-
"@atlaskit/button": "^
|
|
36
|
+
"@atlaskit/button": "^18.0.0",
|
|
37
37
|
"@atlaskit/checkbox": "^13.5.0",
|
|
38
38
|
"@atlaskit/dropdown-menu": "^12.13.0",
|
|
39
39
|
"@atlaskit/form": "^10.4.0",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
57
57
|
"@atlaskit/popup": "^1.19.0",
|
|
58
|
-
"@atlaskit/primitives": "^8.
|
|
58
|
+
"@atlaskit/primitives": "^8.2.0",
|
|
59
59
|
"@atlaskit/section-message": "^6.5.0",
|
|
60
60
|
"@atlaskit/select": "^17.11.0",
|
|
61
61
|
"@atlaskit/spinner": "^16.2.0",
|
|
62
62
|
"@atlaskit/textarea": "^5.5.0",
|
|
63
63
|
"@atlaskit/textfield": "^6.4.0",
|
|
64
64
|
"@atlaskit/theme": "^12.11.0",
|
|
65
|
-
"@atlaskit/tokens": "^1.
|
|
65
|
+
"@atlaskit/tokens": "^1.53.0",
|
|
66
66
|
"@atlaskit/tooltip": "^18.5.0",
|
|
67
67
|
"@atlaskit/ufo": "^0.2.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|