@atlaskit/smart-card 28.1.3 → 28.1.4
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 +7 -0
- package/dist/cjs/utils/actions/combine-action-options.js +16 -4
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +6 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +5 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/actions/combine-action-options.js +17 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +6 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +5 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/actions/combine-action-options.js +16 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +6 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +5 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/actions/combine-action-options.d.ts +10 -2
- package/dist/types/view/FlexibleCard/types.d.ts +3 -1
- package/dist/types/view/HoverCard/types.d.ts +3 -1
- package/dist/types-ts4.5/utils/actions/combine-action-options.d.ts +10 -2
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +3 -1
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 28.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d716377afe79d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d716377afe79d) -
|
|
8
|
+
deprecating hidePreviewButton and hideHoverCardPreviewButton in hover card
|
|
9
|
+
|
|
3
10
|
## 28.1.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -7,7 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.combineActionOptions = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _types = require("../../view/Card/types");
|
|
10
|
-
var combineActionOptions = exports.combineActionOptions = function combineActionOptions(
|
|
10
|
+
var combineActionOptions = exports.combineActionOptions = function combineActionOptions(_ref) {
|
|
11
|
+
var actionOptions = _ref.actionOptions,
|
|
12
|
+
showServerActions = _ref.showServerActions,
|
|
13
|
+
showActions = _ref.showActions,
|
|
14
|
+
platform = _ref.platform,
|
|
15
|
+
hidePreviewButton = _ref.hidePreviewButton;
|
|
11
16
|
if (typeof actionOptions !== 'undefined') {
|
|
12
17
|
return actionOptions;
|
|
13
18
|
}
|
|
@@ -16,17 +21,24 @@ var combineActionOptions = exports.combineActionOptions = function combineAction
|
|
|
16
21
|
hide: true
|
|
17
22
|
};
|
|
18
23
|
}
|
|
24
|
+
var exclude = [];
|
|
25
|
+
if (hidePreviewButton) {
|
|
26
|
+
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.PreviewAction]);
|
|
27
|
+
}
|
|
19
28
|
if (showServerActions && showActions) {
|
|
20
29
|
return {
|
|
21
|
-
hide: false
|
|
30
|
+
hide: false,
|
|
31
|
+
exclude: exclude
|
|
22
32
|
};
|
|
23
33
|
}
|
|
24
|
-
var exclude = [];
|
|
25
34
|
if (showServerActions === false) {
|
|
26
35
|
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.FollowAction, _types.CardAction.ChangeStatusAction]);
|
|
27
36
|
}
|
|
28
37
|
if (showActions === false) {
|
|
29
|
-
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.DownloadAction, _types.CardAction.
|
|
38
|
+
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.DownloadAction, _types.CardAction.ViewAction]);
|
|
39
|
+
if (!exclude.includes(_types.CardAction.PreviewAction)) {
|
|
40
|
+
exclude.push(_types.CardAction.PreviewAction);
|
|
41
|
+
}
|
|
30
42
|
}
|
|
31
43
|
return {
|
|
32
44
|
hide: false,
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "28.1.
|
|
25
|
+
packageVersion: "28.1.4"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -76,7 +76,12 @@ function Component(_ref) {
|
|
|
76
76
|
var isFlexibleUi = (0, _react.useMemo)(function () {
|
|
77
77
|
return (0, _flexible.isFlexibleUiCard)(children);
|
|
78
78
|
}, [children]);
|
|
79
|
-
var actionOptions = (0, _combineActionOptions.combineActionOptions)(
|
|
79
|
+
var actionOptions = (0, _combineActionOptions.combineActionOptions)({
|
|
80
|
+
actionOptions: actionOptionsProp,
|
|
81
|
+
showServerActions: showServerActions,
|
|
82
|
+
showActions: showActions,
|
|
83
|
+
platform: platform
|
|
84
|
+
});
|
|
80
85
|
var frameStyle = (0, _utils.combineFrameStyle)(frameStyleProp, isFrameVisible);
|
|
81
86
|
|
|
82
87
|
// Setup UI handlers.
|
|
@@ -72,7 +72,11 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
72
72
|
var analytics = (0, _analytics.useSmartLinkAnalytics)(url, undefined, id);
|
|
73
73
|
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
74
74
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
75
|
-
var actionOptions = (0, _combineActionOptions.combineActionOptions)(
|
|
75
|
+
var actionOptions = (0, _combineActionOptions.combineActionOptions)({
|
|
76
|
+
actionOptions: actionOptionsProp,
|
|
77
|
+
showServerActions: showServerActions,
|
|
78
|
+
hidePreviewButton: hidePreviewButton
|
|
79
|
+
});
|
|
76
80
|
var setMousePosition = (0, _react2.useCallback)(function (event) {
|
|
77
81
|
if (isOpen && canOpen) {
|
|
78
82
|
return;
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "28.1.
|
|
20
|
+
packageVersion: "28.1.4",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { CardAction } from '../../view/Card/types';
|
|
2
|
-
export const combineActionOptions = (
|
|
2
|
+
export const combineActionOptions = ({
|
|
3
|
+
actionOptions,
|
|
4
|
+
showServerActions,
|
|
5
|
+
showActions,
|
|
6
|
+
platform,
|
|
7
|
+
hidePreviewButton
|
|
8
|
+
}) => {
|
|
3
9
|
if (typeof actionOptions !== 'undefined') {
|
|
4
10
|
return actionOptions;
|
|
5
11
|
}
|
|
@@ -8,17 +14,24 @@ export const combineActionOptions = (actionOptions, showServerActions, showActio
|
|
|
8
14
|
hide: true
|
|
9
15
|
};
|
|
10
16
|
}
|
|
17
|
+
let exclude = [];
|
|
18
|
+
if (hidePreviewButton) {
|
|
19
|
+
exclude = [...exclude, CardAction.PreviewAction];
|
|
20
|
+
}
|
|
11
21
|
if (showServerActions && showActions) {
|
|
12
22
|
return {
|
|
13
|
-
hide: false
|
|
23
|
+
hide: false,
|
|
24
|
+
exclude
|
|
14
25
|
};
|
|
15
26
|
}
|
|
16
|
-
let exclude = [];
|
|
17
27
|
if (showServerActions === false) {
|
|
18
28
|
exclude = [...exclude, CardAction.FollowAction, CardAction.ChangeStatusAction];
|
|
19
29
|
}
|
|
20
30
|
if (showActions === false) {
|
|
21
|
-
exclude = [...exclude, CardAction.DownloadAction, CardAction.
|
|
31
|
+
exclude = [...exclude, CardAction.DownloadAction, CardAction.ViewAction];
|
|
32
|
+
if (!exclude.includes(CardAction.PreviewAction)) {
|
|
33
|
+
exclude.push(CardAction.PreviewAction);
|
|
34
|
+
}
|
|
22
35
|
}
|
|
23
36
|
return {
|
|
24
37
|
hide: false,
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "28.1.
|
|
7
|
+
packageVersion: "28.1.4"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -67,7 +67,12 @@ function Component({
|
|
|
67
67
|
const services = getServices(state.details);
|
|
68
68
|
const canBeDatasource = getCanBeDatasource(state.details);
|
|
69
69
|
let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
|
|
70
|
-
const actionOptions = combineActionOptions(
|
|
70
|
+
const actionOptions = combineActionOptions({
|
|
71
|
+
actionOptions: actionOptionsProp,
|
|
72
|
+
showServerActions,
|
|
73
|
+
showActions,
|
|
74
|
+
platform
|
|
75
|
+
});
|
|
71
76
|
const frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
|
|
72
77
|
|
|
73
78
|
// Setup UI handlers.
|
|
@@ -51,7 +51,11 @@ export const HoverCardComponent = ({
|
|
|
51
51
|
const {
|
|
52
52
|
loadMetadata
|
|
53
53
|
} = useSmartCardActions(id, url, analytics);
|
|
54
|
-
const actionOptions = combineActionOptions(
|
|
54
|
+
const actionOptions = combineActionOptions({
|
|
55
|
+
actionOptions: actionOptionsProp,
|
|
56
|
+
showServerActions,
|
|
57
|
+
hidePreviewButton
|
|
58
|
+
});
|
|
55
59
|
const setMousePosition = useCallback(event => {
|
|
56
60
|
if (isOpen && canOpen) {
|
|
57
61
|
return;
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "28.1.
|
|
10
|
+
packageVersion: "28.1.4",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { CardAction } from '../../view/Card/types';
|
|
3
|
-
export var combineActionOptions = function combineActionOptions(
|
|
3
|
+
export var combineActionOptions = function combineActionOptions(_ref) {
|
|
4
|
+
var actionOptions = _ref.actionOptions,
|
|
5
|
+
showServerActions = _ref.showServerActions,
|
|
6
|
+
showActions = _ref.showActions,
|
|
7
|
+
platform = _ref.platform,
|
|
8
|
+
hidePreviewButton = _ref.hidePreviewButton;
|
|
4
9
|
if (typeof actionOptions !== 'undefined') {
|
|
5
10
|
return actionOptions;
|
|
6
11
|
}
|
|
@@ -9,17 +14,24 @@ export var combineActionOptions = function combineActionOptions(actionOptions, s
|
|
|
9
14
|
hide: true
|
|
10
15
|
};
|
|
11
16
|
}
|
|
17
|
+
var exclude = [];
|
|
18
|
+
if (hidePreviewButton) {
|
|
19
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.PreviewAction]);
|
|
20
|
+
}
|
|
12
21
|
if (showServerActions && showActions) {
|
|
13
22
|
return {
|
|
14
|
-
hide: false
|
|
23
|
+
hide: false,
|
|
24
|
+
exclude: exclude
|
|
15
25
|
};
|
|
16
26
|
}
|
|
17
|
-
var exclude = [];
|
|
18
27
|
if (showServerActions === false) {
|
|
19
28
|
exclude = [].concat(_toConsumableArray(exclude), [CardAction.FollowAction, CardAction.ChangeStatusAction]);
|
|
20
29
|
}
|
|
21
30
|
if (showActions === false) {
|
|
22
|
-
exclude = [].concat(_toConsumableArray(exclude), [CardAction.DownloadAction, CardAction.
|
|
31
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.DownloadAction, CardAction.ViewAction]);
|
|
32
|
+
if (!exclude.includes(CardAction.PreviewAction)) {
|
|
33
|
+
exclude.push(CardAction.PreviewAction);
|
|
34
|
+
}
|
|
23
35
|
}
|
|
24
36
|
return {
|
|
25
37
|
hide: false,
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "28.1.
|
|
18
|
+
packageVersion: "28.1.4"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -66,7 +66,12 @@ function Component(_ref) {
|
|
|
66
66
|
var isFlexibleUi = useMemo(function () {
|
|
67
67
|
return isFlexibleUiCard(children);
|
|
68
68
|
}, [children]);
|
|
69
|
-
var actionOptions = combineActionOptions(
|
|
69
|
+
var actionOptions = combineActionOptions({
|
|
70
|
+
actionOptions: actionOptionsProp,
|
|
71
|
+
showServerActions: showServerActions,
|
|
72
|
+
showActions: showActions,
|
|
73
|
+
platform: platform
|
|
74
|
+
});
|
|
70
75
|
var frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
|
|
71
76
|
|
|
72
77
|
// Setup UI handlers.
|
|
@@ -60,7 +60,11 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
60
60
|
var analytics = useSmartLinkAnalytics(url, undefined, id);
|
|
61
61
|
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
62
62
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
63
|
-
var actionOptions = combineActionOptions(
|
|
63
|
+
var actionOptions = combineActionOptions({
|
|
64
|
+
actionOptions: actionOptionsProp,
|
|
65
|
+
showServerActions: showServerActions,
|
|
66
|
+
hidePreviewButton: hidePreviewButton
|
|
67
|
+
});
|
|
64
68
|
var setMousePosition = useCallback(function (event) {
|
|
65
69
|
if (isOpen && canOpen) {
|
|
66
70
|
return;
|
|
@@ -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: "28.1.
|
|
13
|
+
packageVersion: "28.1.4",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type CardActionOptions, type CardPlatform } from '../../view/Card/types';
|
|
2
|
+
type CombineActionsOptions = {
|
|
3
|
+
actionOptions?: CardActionOptions;
|
|
4
|
+
showServerActions?: boolean;
|
|
5
|
+
showActions?: boolean;
|
|
6
|
+
platform?: CardPlatform;
|
|
7
|
+
hidePreviewButton?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const combineActionOptions: ({ actionOptions, showServerActions, showActions, platform, hidePreviewButton, }: CombineActionsOptions) => CardActionOptions;
|
|
10
|
+
export {};
|
|
@@ -102,7 +102,9 @@ export type FlexibleUiOptions = {
|
|
|
102
102
|
*/
|
|
103
103
|
hideElevation?: boolean;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* @deprecated {@link https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14817 Internal documentation for deprecation (no external access)}
|
|
106
|
+
*
|
|
107
|
+
* Prefer 'actionOptions' prop. Determines whether to hide hover preview's full screen view.
|
|
106
108
|
* Only applies if showHoverPreview from FlexibleCardProps is true
|
|
107
109
|
*/
|
|
108
110
|
hideHoverCardPreviewButton?: boolean;
|
|
@@ -36,7 +36,9 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
36
36
|
*/
|
|
37
37
|
closeOnChildClick?: boolean;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* @deprecated {@link https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14817 Internal documentation for deprecation (no external access)}
|
|
40
|
+
*
|
|
41
|
+
* Prefer 'actionOptions' prop. Determines if the hover card should display the "Open preview" button.
|
|
40
42
|
*/
|
|
41
43
|
hidePreviewButton?: boolean;
|
|
42
44
|
/**
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type CardActionOptions, type CardPlatform } from '../../view/Card/types';
|
|
2
|
+
type CombineActionsOptions = {
|
|
3
|
+
actionOptions?: CardActionOptions;
|
|
4
|
+
showServerActions?: boolean;
|
|
5
|
+
showActions?: boolean;
|
|
6
|
+
platform?: CardPlatform;
|
|
7
|
+
hidePreviewButton?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const combineActionOptions: ({ actionOptions, showServerActions, showActions, platform, hidePreviewButton, }: CombineActionsOptions) => CardActionOptions;
|
|
10
|
+
export {};
|
|
@@ -102,7 +102,9 @@ export type FlexibleUiOptions = {
|
|
|
102
102
|
*/
|
|
103
103
|
hideElevation?: boolean;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* @deprecated {@link https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14817 Internal documentation for deprecation (no external access)}
|
|
106
|
+
*
|
|
107
|
+
* Prefer 'actionOptions' prop. Determines whether to hide hover preview's full screen view.
|
|
106
108
|
* Only applies if showHoverPreview from FlexibleCardProps is true
|
|
107
109
|
*/
|
|
108
110
|
hideHoverCardPreviewButton?: boolean;
|
|
@@ -36,7 +36,9 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
36
36
|
*/
|
|
37
37
|
closeOnChildClick?: boolean;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* @deprecated {@link https://hello.jira.atlassian.cloud/browse/ENGHEALTH-14817 Internal documentation for deprecation (no external access)}
|
|
40
|
+
*
|
|
41
|
+
* Prefer 'actionOptions' prop. Determines if the hover card should display the "Open preview" button.
|
|
40
42
|
*/
|
|
41
43
|
hidePreviewButton?: boolean;
|
|
42
44
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "28.1.
|
|
3
|
+
"version": "28.1.4",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/popup": "^1.25.0",
|
|
55
55
|
"@atlaskit/primitives": "^12.1.0",
|
|
56
56
|
"@atlaskit/section-message": "^6.6.0",
|
|
57
|
-
"@atlaskit/select": "^17.
|
|
57
|
+
"@atlaskit/select": "^17.18.0",
|
|
58
58
|
"@atlaskit/spinner": "^16.3.0",
|
|
59
59
|
"@atlaskit/textarea": "^5.6.0",
|
|
60
60
|
"@atlaskit/textfield": "^6.5.0",
|