@atlaskit/smart-card 26.45.2 → 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 +16 -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/BlockCard/views/flexible/utils/index.js +15 -0
- package/dist/cjs/view/CardWithUrl/component.js +2 -3
- package/dist/cjs/view/HoverCard/utils.js +10 -0
- 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/BlockCard/views/flexible/utils/index.js +15 -0
- package/dist/es2019/view/CardWithUrl/component.js +2 -3
- package/dist/es2019/view/HoverCard/utils.js +11 -0
- 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/BlockCard/views/flexible/utils/index.js +15 -0
- package/dist/esm/view/CardWithUrl/component.js +2 -3
- package/dist/esm/view/HoverCard/utils.js +10 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/flexible/latest-commit/index.d.ts +2 -1
- package/dist/types/utils/actions/combine-action-options.d.ts +2 -2
- package/dist/types-ts4.5/extractors/flexible/latest-commit/index.d.ts +2 -1
- package/dist/types-ts4.5/utils/actions/combine-action-options.d.ts +2 -2
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
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
|
+
|
|
13
|
+
## 26.45.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#67731](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67731) [`6c4de5b272be`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6c4de5b272be) - [ux] add latest commit information to block and hover cards for BB files
|
|
18
|
+
|
|
3
19
|
## 26.45.2
|
|
4
20
|
|
|
5
21
|
### 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";
|
|
@@ -8,6 +8,7 @@ var _constants = require("../../../../../constants");
|
|
|
8
8
|
var _utils = require("../../../../../extractors/flexible/utils");
|
|
9
9
|
var _helpers = require("../../../../../state/helpers");
|
|
10
10
|
var _styled = require("../styled");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var baseTopMetadata = [{
|
|
12
13
|
name: _constants.ElementName.ModifiedOn
|
|
13
14
|
}, {
|
|
@@ -48,6 +49,20 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
48
49
|
}].concat(baseTopMetadata);
|
|
49
50
|
var defaultBottomMetadata = baseBottomMetaData;
|
|
50
51
|
switch (extensionKey) {
|
|
52
|
+
case 'bitbucket-object-provider':
|
|
53
|
+
case 'native-bitbucket-object-provider':
|
|
54
|
+
var isFile = data['@type'].includes('schema:DigitalDocument');
|
|
55
|
+
return {
|
|
56
|
+
titleMetadata: defaultTitleMetadata,
|
|
57
|
+
topMetadata: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.extractor.improve-bitbucket-file-links') && isFile ? [{
|
|
58
|
+
name: _constants.ElementName.LatestCommit
|
|
59
|
+
}, {
|
|
60
|
+
name: _constants.ElementName.CollaboratorGroup
|
|
61
|
+
}, {
|
|
62
|
+
name: _constants.ElementName.ModifiedOn
|
|
63
|
+
}] : defaultTopMetadata,
|
|
64
|
+
bottomMetadata: defaultBottomMetadata
|
|
65
|
+
};
|
|
51
66
|
case 'confluence-object-provider':
|
|
52
67
|
return {
|
|
53
68
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -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) {
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _constants = require("../../constants");
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
11
|
var _utils = require("../../extractors/flexible/utils");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
15
|
var getSimulatedMetadata = exports.getSimulatedMetadata = function getSimulatedMetadata() {
|
|
@@ -115,6 +116,15 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
}
|
|
119
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.extractor.improve-bitbucket-file-links') && types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
120
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
121
|
+
topMetadataBlock: {
|
|
122
|
+
primary: [_constants.ElementName.LatestCommit, _constants.ElementName.CollaboratorGroup, _constants.ElementName.ModifiedOn],
|
|
123
|
+
secondary: [],
|
|
124
|
+
subtitle: []
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
118
128
|
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
119
129
|
topMetadataBlock: {
|
|
120
130
|
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn],
|
|
@@ -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";
|
|
@@ -2,6 +2,7 @@ import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '.
|
|
|
2
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
const baseTopMetadata = [{
|
|
6
7
|
name: ElementName.ModifiedOn
|
|
7
8
|
}, {
|
|
@@ -42,6 +43,20 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
42
43
|
}, ...baseTopMetadata];
|
|
43
44
|
const defaultBottomMetadata = baseBottomMetaData;
|
|
44
45
|
switch (extensionKey) {
|
|
46
|
+
case 'bitbucket-object-provider':
|
|
47
|
+
case 'native-bitbucket-object-provider':
|
|
48
|
+
const isFile = data['@type'].includes('schema:DigitalDocument');
|
|
49
|
+
return {
|
|
50
|
+
titleMetadata: defaultTitleMetadata,
|
|
51
|
+
topMetadata: getBooleanFF('platform.linking-platform.extractor.improve-bitbucket-file-links') && isFile ? [{
|
|
52
|
+
name: ElementName.LatestCommit
|
|
53
|
+
}, {
|
|
54
|
+
name: ElementName.CollaboratorGroup
|
|
55
|
+
}, {
|
|
56
|
+
name: ElementName.ModifiedOn
|
|
57
|
+
}] : defaultTopMetadata,
|
|
58
|
+
bottomMetadata: defaultBottomMetadata
|
|
59
|
+
};
|
|
45
60
|
case 'confluence-object-provider':
|
|
46
61
|
return {
|
|
47
62
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -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 => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElementName } from '../../constants';
|
|
2
2
|
import { extractType } from '@atlaskit/link-extractors';
|
|
3
3
|
import { extractOwnedBy } from '../../extractors/flexible/utils';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
export const getSimulatedMetadata = (extensionKey = '', data) => {
|
|
5
6
|
const types = data ? extractType(data) : undefined;
|
|
6
7
|
switch (extensionKey) {
|
|
@@ -102,6 +103,16 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
|
|
|
102
103
|
}
|
|
103
104
|
};
|
|
104
105
|
}
|
|
106
|
+
if (getBooleanFF('platform.linking-platform.extractor.improve-bitbucket-file-links') && types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
107
|
+
return {
|
|
108
|
+
...defaultMetadata,
|
|
109
|
+
topMetadataBlock: {
|
|
110
|
+
primary: [ElementName.LatestCommit, ElementName.CollaboratorGroup, ElementName.ModifiedOn],
|
|
111
|
+
secondary: [],
|
|
112
|
+
subtitle: []
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
105
116
|
return {
|
|
106
117
|
...defaultMetadata,
|
|
107
118
|
topMetadataBlock: {
|
|
@@ -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";
|
|
@@ -2,6 +2,7 @@ import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '.
|
|
|
2
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
var baseTopMetadata = [{
|
|
6
7
|
name: ElementName.ModifiedOn
|
|
7
8
|
}, {
|
|
@@ -42,6 +43,20 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
42
43
|
}].concat(baseTopMetadata);
|
|
43
44
|
var defaultBottomMetadata = baseBottomMetaData;
|
|
44
45
|
switch (extensionKey) {
|
|
46
|
+
case 'bitbucket-object-provider':
|
|
47
|
+
case 'native-bitbucket-object-provider':
|
|
48
|
+
var isFile = data['@type'].includes('schema:DigitalDocument');
|
|
49
|
+
return {
|
|
50
|
+
titleMetadata: defaultTitleMetadata,
|
|
51
|
+
topMetadata: getBooleanFF('platform.linking-platform.extractor.improve-bitbucket-file-links') && isFile ? [{
|
|
52
|
+
name: ElementName.LatestCommit
|
|
53
|
+
}, {
|
|
54
|
+
name: ElementName.CollaboratorGroup
|
|
55
|
+
}, {
|
|
56
|
+
name: ElementName.ModifiedOn
|
|
57
|
+
}] : defaultTopMetadata,
|
|
58
|
+
bottomMetadata: defaultBottomMetadata
|
|
59
|
+
};
|
|
45
60
|
case 'confluence-object-provider':
|
|
46
61
|
return {
|
|
47
62
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -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) {
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { ElementName } from '../../constants';
|
|
5
5
|
import { extractType } from '@atlaskit/link-extractors';
|
|
6
6
|
import { extractOwnedBy } from '../../extractors/flexible/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
8
9
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9
10
|
var data = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -108,6 +109,15 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
}
|
|
112
|
+
if (getBooleanFF('platform.linking-platform.extractor.improve-bitbucket-file-links') && types !== null && types !== void 0 && types.includes('schema:DigitalDocument')) {
|
|
113
|
+
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
114
|
+
topMetadataBlock: {
|
|
115
|
+
primary: [ElementName.LatestCommit, ElementName.CollaboratorGroup, ElementName.ModifiedOn],
|
|
116
|
+
secondary: [],
|
|
117
|
+
subtitle: []
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
111
121
|
return _objectSpread(_objectSpread({}, defaultMetadata), {}, {
|
|
112
122
|
topMetadataBlock: {
|
|
113
123
|
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn],
|
|
@@ -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,3 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
export
|
|
2
|
+
export type LinkTypeLatestCommit = JsonLd.Data.SourceCodeDocument | JsonLd.Data.SourceCodeRepository;
|
|
3
|
+
export declare const extractLatestCommit: (jsonLd: LinkTypeLatestCommit) => string | undefined;
|
|
@@ -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,3 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
export
|
|
2
|
+
export type LinkTypeLatestCommit = JsonLd.Data.SourceCodeDocument | JsonLd.Data.SourceCodeRepository;
|
|
3
|
+
export declare const extractLatestCommit: (jsonLd: LinkTypeLatestCommit) => string | undefined;
|
|
@@ -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/"
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
42
42
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
43
43
|
"@atlaskit/linking-common": "^5.3.0",
|
|
44
|
-
"@atlaskit/linking-types": "^8.
|
|
44
|
+
"@atlaskit/linking-types": "^8.6.0",
|
|
45
45
|
"@atlaskit/logo": "^13.15.0",
|
|
46
46
|
"@atlaskit/lozenge": "^11.6.0",
|
|
47
47
|
"@atlaskit/modal-dialog": "^12.10.0",
|
|
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",
|
|
@@ -149,6 +149,9 @@
|
|
|
149
149
|
"platform.editor.show-embed-card-frame-renderer": {
|
|
150
150
|
"type": "boolean"
|
|
151
151
|
},
|
|
152
|
+
"platform.linking-platform.extractor.improve-bitbucket-file-links": {
|
|
153
|
+
"type": "boolean"
|
|
154
|
+
},
|
|
152
155
|
"platform.linking-platform.smart-card.disable-jira-status-action": {
|
|
153
156
|
"type": "boolean"
|
|
154
157
|
}
|