@atlaskit/smart-card 26.45.3 → 26.46.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 +10 -0
- package/dist/cjs/utils/actions/combine-action-options.js +15 -15
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/actions/combine-action-options.js +15 -15
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/actions/combine-action-options.js +15 -15
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/actions/combine-action-options.d.ts +2 -2
- package/dist/types-ts4.5/utils/actions/combine-action-options.d.ts +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.46.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#68535](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68535) [`9d9c89e4ff0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d9c89e4ff0c) - Implement smart-card actionOptions prop within editor and expose prop to editor and renderer
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 26.45.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -7,29 +7,29 @@ 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(actionOptions, showServerActions, showActions) {
|
|
10
|
+
var combineActionOptions = exports.combineActionOptions = function combineActionOptions(actionOptions, showServerActions, showActions, platform) {
|
|
11
11
|
if (typeof actionOptions !== 'undefined') {
|
|
12
12
|
return actionOptions;
|
|
13
13
|
}
|
|
14
|
-
if (showServerActions === false && showActions === false) {
|
|
14
|
+
if (platform === 'mobile' || showServerActions === false && showActions === false) {
|
|
15
15
|
return {
|
|
16
16
|
hide: true
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
|
+
if (showServerActions && showActions) {
|
|
19
20
|
return {
|
|
20
21
|
hide: false
|
|
21
22
|
};
|
|
22
|
-
} else {
|
|
23
|
-
var exclude = [];
|
|
24
|
-
if (showServerActions === false) {
|
|
25
|
-
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.FollowAction, _types.CardAction.ChangeStatusAction]);
|
|
26
|
-
}
|
|
27
|
-
if (showActions === false) {
|
|
28
|
-
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.DownloadAction, _types.CardAction.PreviewAction, _types.CardAction.ViewAction]);
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
hide: false,
|
|
32
|
-
exclude: exclude
|
|
33
|
-
};
|
|
34
23
|
}
|
|
24
|
+
var exclude = [];
|
|
25
|
+
if (showServerActions === false) {
|
|
26
|
+
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.FollowAction, _types.CardAction.ChangeStatusAction]);
|
|
27
|
+
}
|
|
28
|
+
if (showActions === false) {
|
|
29
|
+
exclude = [].concat((0, _toConsumableArray2.default)(exclude), [_types.CardAction.DownloadAction, _types.CardAction.PreviewAction, _types.CardAction.ViewAction]);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
hide: false,
|
|
33
|
+
exclude: exclude
|
|
34
|
+
};
|
|
35
35
|
};
|
|
@@ -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: "26.
|
|
25
|
+
packageVersion: "26.46.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -39,7 +39,7 @@ function Component(_ref) {
|
|
|
39
39
|
onError = _ref.onError,
|
|
40
40
|
testId = _ref.testId,
|
|
41
41
|
showActions = _ref.showActions,
|
|
42
|
-
|
|
42
|
+
showServerActions = _ref.showServerActions,
|
|
43
43
|
actionOptionsProp = _ref.actionOptions,
|
|
44
44
|
inheritDimensions = _ref.inheritDimensions,
|
|
45
45
|
embedIframeRef = _ref.embedIframeRef,
|
|
@@ -73,8 +73,7 @@ function Component(_ref) {
|
|
|
73
73
|
return (0, _flexible.isFlexibleUiCard)(children);
|
|
74
74
|
}, [children]);
|
|
75
75
|
var enableFlexibleBlockCardFlag = Boolean((0, _linkProvider.useFeatureFlag)('enableFlexibleBlockCard'));
|
|
76
|
-
var
|
|
77
|
-
var actionOptions = (0, _combineActionOptions.combineActionOptions)(actionOptionsProp, !hideServerActions, showActions);
|
|
76
|
+
var actionOptions = (0, _combineActionOptions.combineActionOptions)(actionOptionsProp, showServerActions, showActions, platform);
|
|
78
77
|
|
|
79
78
|
// Setup UI handlers.
|
|
80
79
|
var handleClickWrapper = (0, _react.useCallback)(function (event) {
|
|
@@ -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: "26.
|
|
20
|
+
packageVersion: "26.46.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { CardAction } from '../../view/Card/types';
|
|
2
|
-
export const combineActionOptions = (actionOptions, showServerActions, showActions) => {
|
|
2
|
+
export const combineActionOptions = (actionOptions, showServerActions, showActions, platform) => {
|
|
3
3
|
if (typeof actionOptions !== 'undefined') {
|
|
4
4
|
return actionOptions;
|
|
5
5
|
}
|
|
6
|
-
if (showServerActions === false && showActions === false) {
|
|
6
|
+
if (platform === 'mobile' || showServerActions === false && showActions === false) {
|
|
7
7
|
return {
|
|
8
8
|
hide: true
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
if (showServerActions && showActions) {
|
|
11
12
|
return {
|
|
12
13
|
hide: false
|
|
13
14
|
};
|
|
14
|
-
} else {
|
|
15
|
-
let exclude = [];
|
|
16
|
-
if (showServerActions === false) {
|
|
17
|
-
exclude = [...exclude, CardAction.FollowAction, CardAction.ChangeStatusAction];
|
|
18
|
-
}
|
|
19
|
-
if (showActions === false) {
|
|
20
|
-
exclude = [...exclude, CardAction.DownloadAction, CardAction.PreviewAction, CardAction.ViewAction];
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
hide: false,
|
|
24
|
-
exclude
|
|
25
|
-
};
|
|
26
15
|
}
|
|
16
|
+
let exclude = [];
|
|
17
|
+
if (showServerActions === false) {
|
|
18
|
+
exclude = [...exclude, CardAction.FollowAction, CardAction.ChangeStatusAction];
|
|
19
|
+
}
|
|
20
|
+
if (showActions === false) {
|
|
21
|
+
exclude = [...exclude, CardAction.DownloadAction, CardAction.PreviewAction, CardAction.ViewAction];
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
hide: false,
|
|
25
|
+
exclude
|
|
26
|
+
};
|
|
27
27
|
};
|
|
@@ -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: "26.
|
|
7
|
+
packageVersion: "26.46.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -29,7 +29,7 @@ function Component({
|
|
|
29
29
|
onError,
|
|
30
30
|
testId,
|
|
31
31
|
showActions,
|
|
32
|
-
showServerActions
|
|
32
|
+
showServerActions,
|
|
33
33
|
actionOptions: actionOptionsProp,
|
|
34
34
|
inheritDimensions,
|
|
35
35
|
embedIframeRef,
|
|
@@ -64,8 +64,7 @@ function Component({
|
|
|
64
64
|
const canBeDatasource = getCanBeDatasource(state.details);
|
|
65
65
|
let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
|
|
66
66
|
const enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
|
|
67
|
-
const
|
|
68
|
-
const actionOptions = combineActionOptions(actionOptionsProp, !hideServerActions, showActions);
|
|
67
|
+
const actionOptions = combineActionOptions(actionOptionsProp, showServerActions, showActions, platform);
|
|
69
68
|
|
|
70
69
|
// Setup UI handlers.
|
|
71
70
|
const handleClickWrapper = useCallback(event => {
|
|
@@ -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: "26.
|
|
10
|
+
packageVersion: "26.46.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { CardAction } from '../../view/Card/types';
|
|
3
|
-
export var combineActionOptions = function combineActionOptions(actionOptions, showServerActions, showActions) {
|
|
3
|
+
export var combineActionOptions = function combineActionOptions(actionOptions, showServerActions, showActions, platform) {
|
|
4
4
|
if (typeof actionOptions !== 'undefined') {
|
|
5
5
|
return actionOptions;
|
|
6
6
|
}
|
|
7
|
-
if (showServerActions === false && showActions === false) {
|
|
7
|
+
if (platform === 'mobile' || showServerActions === false && showActions === false) {
|
|
8
8
|
return {
|
|
9
9
|
hide: true
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
if (showServerActions && showActions) {
|
|
12
13
|
return {
|
|
13
14
|
hide: false
|
|
14
15
|
};
|
|
15
|
-
} else {
|
|
16
|
-
var exclude = [];
|
|
17
|
-
if (showServerActions === false) {
|
|
18
|
-
exclude = [].concat(_toConsumableArray(exclude), [CardAction.FollowAction, CardAction.ChangeStatusAction]);
|
|
19
|
-
}
|
|
20
|
-
if (showActions === false) {
|
|
21
|
-
exclude = [].concat(_toConsumableArray(exclude), [CardAction.DownloadAction, CardAction.PreviewAction, CardAction.ViewAction]);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
hide: false,
|
|
25
|
-
exclude: exclude
|
|
26
|
-
};
|
|
27
16
|
}
|
|
17
|
+
var exclude = [];
|
|
18
|
+
if (showServerActions === false) {
|
|
19
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.FollowAction, CardAction.ChangeStatusAction]);
|
|
20
|
+
}
|
|
21
|
+
if (showActions === false) {
|
|
22
|
+
exclude = [].concat(_toConsumableArray(exclude), [CardAction.DownloadAction, CardAction.PreviewAction, CardAction.ViewAction]);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
hide: false,
|
|
26
|
+
exclude: exclude
|
|
27
|
+
};
|
|
28
28
|
};
|
|
@@ -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: "26.
|
|
18
|
+
packageVersion: "26.46.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -29,7 +29,7 @@ function Component(_ref) {
|
|
|
29
29
|
onError = _ref.onError,
|
|
30
30
|
testId = _ref.testId,
|
|
31
31
|
showActions = _ref.showActions,
|
|
32
|
-
|
|
32
|
+
showServerActions = _ref.showServerActions,
|
|
33
33
|
actionOptionsProp = _ref.actionOptions,
|
|
34
34
|
inheritDimensions = _ref.inheritDimensions,
|
|
35
35
|
embedIframeRef = _ref.embedIframeRef,
|
|
@@ -63,8 +63,7 @@ function Component(_ref) {
|
|
|
63
63
|
return isFlexibleUiCard(children);
|
|
64
64
|
}, [children]);
|
|
65
65
|
var enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
|
|
66
|
-
var
|
|
67
|
-
var actionOptions = combineActionOptions(actionOptionsProp, !hideServerActions, showActions);
|
|
66
|
+
var actionOptions = combineActionOptions(actionOptionsProp, showServerActions, showActions, platform);
|
|
68
67
|
|
|
69
68
|
// Setup UI handlers.
|
|
70
69
|
var handleClickWrapper = useCallback(function (event) {
|
|
@@ -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.
|
|
13
|
+
packageVersion: "26.46.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CardActionOptions } from '../../view/Card/types';
|
|
2
|
-
export declare const combineActionOptions: (actionOptions?: CardActionOptions, showServerActions?: boolean, showActions?: boolean) => CardActionOptions;
|
|
1
|
+
import { CardPlatform, type CardActionOptions } from '../../view/Card/types';
|
|
2
|
+
export declare const combineActionOptions: (actionOptions?: CardActionOptions, showServerActions?: boolean, showActions?: boolean, platform?: CardPlatform) => CardActionOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type CardActionOptions } from '../../view/Card/types';
|
|
2
|
-
export declare const combineActionOptions: (actionOptions?: CardActionOptions, showServerActions?: boolean, showActions?: boolean) => CardActionOptions;
|
|
1
|
+
import { CardPlatform, type CardActionOptions } from '../../view/Card/types';
|
|
2
|
+
export declare const combineActionOptions: (actionOptions?: CardActionOptions, showServerActions?: boolean, showActions?: boolean, platform?: CardPlatform) => CardActionOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.46.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
50
50
|
"@atlaskit/popup": "^1.11.0",
|
|
51
|
-
"@atlaskit/primitives": "^1.
|
|
51
|
+
"@atlaskit/primitives": "^1.20.0",
|
|
52
52
|
"@atlaskit/spinner": "^16.0.0",
|
|
53
53
|
"@atlaskit/theme": "^12.6.0",
|
|
54
|
-
"@atlaskit/tokens": "^1.
|
|
54
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
55
55
|
"@atlaskit/tooltip": "^18.1.0",
|
|
56
56
|
"@atlaskit/ufo": "^0.2.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|