@atlaskit/smart-card 26.56.2 → 26.56.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.56.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#92048](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92048) [`2780e081d2c9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2780e081d2c9) - ActionBlock: Sort actions
8
+ - [#92399](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92399) [`e0c0acd16c19`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e0c0acd16c19) - Fix for the AI Summary custom errors handling
9
+
10
+ ## 26.56.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [#91582](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91582) [`a43b331b2043`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a43b331b2043) - Hide copy link button on hover card when redesign ff is on
15
+
3
16
  ## 26.56.2
4
17
 
5
18
  ### Patch Changes
@@ -17,109 +17,99 @@ function readStream(_x) {
17
17
  }
18
18
  function _readStream() {
19
19
  _readStream = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
20
- var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
20
+ var reader, doneStreaming, chunkBuffer, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
21
21
  return _regenerator.default.wrap(function _callee$(_context) {
22
22
  while (1) switch (_context.prev = _context.next) {
23
23
  case 0:
24
24
  reader = (0, _utils.getBufferReader)(response);
25
25
  doneStreaming = false;
26
26
  chunkBuffer = '';
27
- chunkTypeErrorMessage = 'jsonChunkType error';
28
- case 4:
29
- _context.prev = 4;
30
- _context.next = 7;
27
+ case 3:
28
+ _context.prev = 3;
29
+ _context.next = 6;
31
30
  return (0, _awaitAsyncGenerator2.default)(reader.read());
32
- case 7:
31
+ case 6:
33
32
  _yield$_awaitAsyncGen = _context.sent;
34
33
  value = _yield$_awaitAsyncGen.value;
35
34
  done = _yield$_awaitAsyncGen.done;
36
35
  doneStreaming = done;
37
36
  if (!value) {
38
- _context.next = 42;
37
+ _context.next = 38;
39
38
  break;
40
39
  }
41
40
  processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
42
41
  chunkBuffer = '';
43
42
  _iterator = _createForOfIteratorHelper(processedChunks);
44
- _context.prev = 15;
43
+ _context.prev = 14;
45
44
  _iterator.s();
46
- case 17:
45
+ case 16:
47
46
  if ((_step = _iterator.n()).done) {
48
- _context.next = 34;
47
+ _context.next = 30;
49
48
  break;
50
49
  }
51
50
  chunk = _step.value;
52
- _context.prev = 19;
51
+ _context.prev = 18;
53
52
  jsonChunk = JSON.parse(chunk);
54
- if (!(jsonChunk.type === 'ERROR')) {
55
- _context.next = 23;
56
- break;
53
+ if (jsonChunk.type === 'ERROR') {
54
+ reader.cancel();
57
55
  }
58
- throw new Error(chunkTypeErrorMessage);
59
- case 23:
60
- _context.next = 25;
56
+ _context.next = 23;
61
57
  return jsonChunk;
62
- case 25:
63
- _context.next = 32;
58
+ case 23:
59
+ _context.next = 28;
64
60
  break;
65
- case 27:
66
- _context.prev = 27;
67
- _context.t0 = _context["catch"](19);
68
- if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
69
- _context.next = 31;
70
- break;
71
- }
72
- throw _context.t0;
73
- case 31:
61
+ case 25:
62
+ _context.prev = 25;
63
+ _context.t0 = _context["catch"](18);
74
64
  // the chunk may be incomplete, so we'll save it for the next iteration.
75
65
  chunkBuffer = chunk;
76
- case 32:
77
- _context.next = 17;
66
+ case 28:
67
+ _context.next = 16;
78
68
  break;
79
- case 34:
80
- _context.next = 39;
69
+ case 30:
70
+ _context.next = 35;
81
71
  break;
82
- case 36:
83
- _context.prev = 36;
84
- _context.t1 = _context["catch"](15);
72
+ case 32:
73
+ _context.prev = 32;
74
+ _context.t1 = _context["catch"](14);
85
75
  _iterator.e(_context.t1);
86
- case 39:
87
- _context.prev = 39;
76
+ case 35:
77
+ _context.prev = 35;
88
78
  _iterator.f();
89
- return _context.finish(39);
90
- case 42:
91
- _context.next = 52;
79
+ return _context.finish(35);
80
+ case 38:
81
+ _context.next = 48;
92
82
  break;
93
- case 44:
94
- _context.prev = 44;
95
- _context.t2 = _context["catch"](4);
83
+ case 40:
84
+ _context.prev = 40;
85
+ _context.t2 = _context["catch"](3);
96
86
  if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
97
- _context.next = 50;
87
+ _context.next = 46;
98
88
  break;
99
89
  }
100
90
  doneStreaming = true;
101
- _context.next = 52;
91
+ _context.next = 48;
102
92
  break;
103
- case 50:
93
+ case 46:
104
94
  reader.cancel();
105
95
  throw _context.t2;
106
- case 52:
96
+ case 48:
107
97
  if (!doneStreaming) {
108
- _context.next = 4;
98
+ _context.next = 3;
109
99
  break;
110
100
  }
111
- case 53:
101
+ case 49:
112
102
  if (!chunkBuffer) {
113
- _context.next = 56;
103
+ _context.next = 52;
114
104
  break;
115
105
  }
116
106
  error = new Error("Not all the data was processed: ".concat(chunkBuffer));
117
107
  throw error;
118
- case 56:
108
+ case 52:
119
109
  case "end":
120
110
  return _context.stop();
121
111
  }
122
- }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
112
+ }, _callee, null, [[3, 40], [14, 32, 35, 38], [18, 25]]);
123
113
  }));
124
114
  return _readStream.apply(this, arguments);
125
115
  }
@@ -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.56.2"
25
+ packageVersion: "26.56.4"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -19,11 +19,22 @@ var ignoreContainerPaddingStyles = (0, _primitives.xcss)({
19
19
  marginLeft: 'calc(var(--container-gap-left) * -1)',
20
20
  marginRight: 'calc(var(--container-gap-right) * -1)'
21
21
  });
22
+ var DEFAULT_SORT_ORDER = [_constants.ActionName.PreviewAction, _constants.ActionName.CopyLinkAction];
23
+ var sort = function sort(a, b) {
24
+ var idxA = DEFAULT_SORT_ORDER.indexOf(a);
25
+ var idxB = DEFAULT_SORT_ORDER.indexOf(b);
26
+ if (idxA === -1) {
27
+ idxA = DEFAULT_SORT_ORDER.length;
28
+ }
29
+ if (idxB === -1) {
30
+ idxB = DEFAULT_SORT_ORDER.length;
31
+ }
32
+ return idxA - idxB;
33
+ };
22
34
  var ActionBlock = function ActionBlock(_ref) {
23
35
  var blockRef = _ref.blockRef,
24
36
  onClickCallback = _ref.onClick,
25
37
  size = _ref.size,
26
- sort = _ref.sort,
27
38
  spaceInline = _ref.spaceInline,
28
39
  _ref$testId = _ref.testId,
29
40
  testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
@@ -35,9 +46,7 @@ var ActionBlock = function ActionBlock(_ref) {
35
46
  return;
36
47
  }
37
48
  var arr = Object.keys(context.actions);
38
- if (sort) {
39
- arr.sort(sort);
40
- }
49
+ arr.sort(sort);
41
50
  return arr.map(function (name) {
42
51
  var Action = name in Actions ? Actions[name] : undefined;
43
52
  return Action ? /*#__PURE__*/_react.default.createElement(Action, {
@@ -53,7 +62,7 @@ var ActionBlock = function ActionBlock(_ref) {
53
62
  })
54
63
  }) : null;
55
64
  });
56
- }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, sort, spaceInline]);
65
+ }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
57
66
  return actions ? /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
58
67
  grow: "fill",
59
68
  xcss: ignoreContainerPaddingStyles,
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.hoverCardClassName = exports.getCopyAction = exports.default = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _react = require("@emotion/react");
12
13
  var _analyticsNext = require("@atlaskit/analytics-next");
13
14
  var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
@@ -146,7 +147,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
146
147
  subtitle = _extractMetadata.subtitle;
147
148
  var titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
148
149
  var titleBlockProps = {
149
- actions: titleActions,
150
+ actions: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : titleActions,
150
151
  maxLines: titleMaxLines,
151
152
  overrideCss: _styled.titleBlockCss,
152
153
  size: _constants.SmartLinkSize.Large,
@@ -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.56.2",
20
+ packageVersion: "26.56.4",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -3,7 +3,6 @@ export async function* readStream(response) {
3
3
  const reader = getBufferReader(response);
4
4
  let doneStreaming = false;
5
5
  let chunkBuffer = '';
6
- const chunkTypeErrorMessage = 'jsonChunkType error';
7
6
  do {
8
7
  try {
9
8
  const {
@@ -19,13 +18,10 @@ export async function* readStream(response) {
19
18
  try {
20
19
  const jsonChunk = JSON.parse(chunk);
21
20
  if (jsonChunk.type === 'ERROR') {
22
- throw new Error(chunkTypeErrorMessage);
21
+ reader.cancel();
23
22
  }
24
23
  yield jsonChunk;
25
24
  } catch (e) {
26
- if (e instanceof Error && e.message === chunkTypeErrorMessage) {
27
- throw e;
28
- }
29
25
  // the chunk may be incomplete, so we'll save it for the next iteration.
30
26
  chunkBuffer = chunk;
31
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.56.2"
7
+ packageVersion: "26.56.4"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,6 @@
1
1
  import { Stack, xcss } from '@atlaskit/primitives';
2
2
  import React, { useMemo } from 'react';
3
- import { SmartLinkSize } from '../../../../../constants';
3
+ import { ActionName, SmartLinkSize } from '../../../../../constants';
4
4
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
5
5
  import * as Actions from '../../actions';
6
6
  import { getPrimitivesPaddingSpaceBySize } from '../../utils';
@@ -10,11 +10,22 @@ const ignoreContainerPaddingStyles = xcss({
10
10
  marginLeft: 'calc(var(--container-gap-left) * -1)',
11
11
  marginRight: 'calc(var(--container-gap-right) * -1)'
12
12
  });
13
+ const DEFAULT_SORT_ORDER = [ActionName.PreviewAction, ActionName.CopyLinkAction];
14
+ const sort = (a, b) => {
15
+ let idxA = DEFAULT_SORT_ORDER.indexOf(a);
16
+ let idxB = DEFAULT_SORT_ORDER.indexOf(b);
17
+ if (idxA === -1) {
18
+ idxA = DEFAULT_SORT_ORDER.length;
19
+ }
20
+ if (idxB === -1) {
21
+ idxB = DEFAULT_SORT_ORDER.length;
22
+ }
23
+ return idxA - idxB;
24
+ };
13
25
  const ActionBlock = ({
14
26
  blockRef,
15
27
  onClick: onClickCallback,
16
28
  size,
17
- sort,
18
29
  spaceInline,
19
30
  testId = 'smart-block-action'
20
31
  }) => {
@@ -26,9 +37,7 @@ const ActionBlock = ({
26
37
  return;
27
38
  }
28
39
  const arr = Object.keys(context.actions);
29
- if (sort) {
30
- arr.sort(sort);
31
- }
40
+ arr.sort(sort);
32
41
  return arr.map(name => {
33
42
  const Action = name in Actions ? Actions[name] : undefined;
34
43
  return Action ? /*#__PURE__*/React.createElement(Action, {
@@ -42,7 +51,7 @@ const ActionBlock = ({
42
51
  })
43
52
  }) : null;
44
53
  });
45
- }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, sort, spaceInline]);
54
+ }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
46
55
  return actions ? /*#__PURE__*/React.createElement(Stack, {
47
56
  grow: "fill",
48
57
  xcss: ignoreContainerPaddingStyles,
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
3
  import { jsx } from '@emotion/react';
3
4
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
4
5
  import CopyIcon from '@atlaskit/icon/glyph/copy';
@@ -110,7 +111,7 @@ const HoverCardContent = ({
110
111
  } = extractMetadata(getSimulatedMetadata(extensionKey, data));
111
112
  const titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
112
113
  const titleBlockProps = {
113
- actions: titleActions,
114
+ actions: getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : titleActions,
114
115
  maxLines: titleMaxLines,
115
116
  overrideCss: titleBlockCss,
116
117
  size: SmartLinkSize.Large,
@@ -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.56.2",
10
+ packageVersion: "26.56.4",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -10,109 +10,99 @@ export function readStream(_x) {
10
10
  }
11
11
  function _readStream() {
12
12
  _readStream = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
13
- var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
13
+ var reader, doneStreaming, chunkBuffer, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
14
14
  return _regeneratorRuntime.wrap(function _callee$(_context) {
15
15
  while (1) switch (_context.prev = _context.next) {
16
16
  case 0:
17
17
  reader = getBufferReader(response);
18
18
  doneStreaming = false;
19
19
  chunkBuffer = '';
20
- chunkTypeErrorMessage = 'jsonChunkType error';
21
- case 4:
22
- _context.prev = 4;
23
- _context.next = 7;
20
+ case 3:
21
+ _context.prev = 3;
22
+ _context.next = 6;
24
23
  return _awaitAsyncGenerator(reader.read());
25
- case 7:
24
+ case 6:
26
25
  _yield$_awaitAsyncGen = _context.sent;
27
26
  value = _yield$_awaitAsyncGen.value;
28
27
  done = _yield$_awaitAsyncGen.done;
29
28
  doneStreaming = done;
30
29
  if (!value) {
31
- _context.next = 42;
30
+ _context.next = 38;
32
31
  break;
33
32
  }
34
33
  processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
35
34
  chunkBuffer = '';
36
35
  _iterator = _createForOfIteratorHelper(processedChunks);
37
- _context.prev = 15;
36
+ _context.prev = 14;
38
37
  _iterator.s();
39
- case 17:
38
+ case 16:
40
39
  if ((_step = _iterator.n()).done) {
41
- _context.next = 34;
40
+ _context.next = 30;
42
41
  break;
43
42
  }
44
43
  chunk = _step.value;
45
- _context.prev = 19;
44
+ _context.prev = 18;
46
45
  jsonChunk = JSON.parse(chunk);
47
- if (!(jsonChunk.type === 'ERROR')) {
48
- _context.next = 23;
49
- break;
46
+ if (jsonChunk.type === 'ERROR') {
47
+ reader.cancel();
50
48
  }
51
- throw new Error(chunkTypeErrorMessage);
52
- case 23:
53
- _context.next = 25;
49
+ _context.next = 23;
54
50
  return jsonChunk;
55
- case 25:
56
- _context.next = 32;
51
+ case 23:
52
+ _context.next = 28;
57
53
  break;
58
- case 27:
59
- _context.prev = 27;
60
- _context.t0 = _context["catch"](19);
61
- if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
62
- _context.next = 31;
63
- break;
64
- }
65
- throw _context.t0;
66
- case 31:
54
+ case 25:
55
+ _context.prev = 25;
56
+ _context.t0 = _context["catch"](18);
67
57
  // the chunk may be incomplete, so we'll save it for the next iteration.
68
58
  chunkBuffer = chunk;
69
- case 32:
70
- _context.next = 17;
59
+ case 28:
60
+ _context.next = 16;
71
61
  break;
72
- case 34:
73
- _context.next = 39;
62
+ case 30:
63
+ _context.next = 35;
74
64
  break;
75
- case 36:
76
- _context.prev = 36;
77
- _context.t1 = _context["catch"](15);
65
+ case 32:
66
+ _context.prev = 32;
67
+ _context.t1 = _context["catch"](14);
78
68
  _iterator.e(_context.t1);
79
- case 39:
80
- _context.prev = 39;
69
+ case 35:
70
+ _context.prev = 35;
81
71
  _iterator.f();
82
- return _context.finish(39);
83
- case 42:
84
- _context.next = 52;
72
+ return _context.finish(35);
73
+ case 38:
74
+ _context.next = 48;
85
75
  break;
86
- case 44:
87
- _context.prev = 44;
88
- _context.t2 = _context["catch"](4);
76
+ case 40:
77
+ _context.prev = 40;
78
+ _context.t2 = _context["catch"](3);
89
79
  if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
90
- _context.next = 50;
80
+ _context.next = 46;
91
81
  break;
92
82
  }
93
83
  doneStreaming = true;
94
- _context.next = 52;
84
+ _context.next = 48;
95
85
  break;
96
- case 50:
86
+ case 46:
97
87
  reader.cancel();
98
88
  throw _context.t2;
99
- case 52:
89
+ case 48:
100
90
  if (!doneStreaming) {
101
- _context.next = 4;
91
+ _context.next = 3;
102
92
  break;
103
93
  }
104
- case 53:
94
+ case 49:
105
95
  if (!chunkBuffer) {
106
- _context.next = 56;
96
+ _context.next = 52;
107
97
  break;
108
98
  }
109
99
  error = new Error("Not all the data was processed: ".concat(chunkBuffer));
110
100
  throw error;
111
- case 56:
101
+ case 52:
112
102
  case "end":
113
103
  return _context.stop();
114
104
  }
115
- }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
105
+ }, _callee, null, [[3, 40], [14, 32, 35, 38], [18, 25]]);
116
106
  }));
117
107
  return _readStream.apply(this, arguments);
118
108
  }
@@ -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.56.2"
18
+ packageVersion: "26.56.4"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,6 @@
1
1
  import { Stack, xcss } from '@atlaskit/primitives';
2
2
  import React, { useMemo } from 'react';
3
- import { SmartLinkSize } from '../../../../../constants';
3
+ import { ActionName, SmartLinkSize } from '../../../../../constants';
4
4
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
5
5
  import * as Actions from '../../actions';
6
6
  import { getPrimitivesPaddingSpaceBySize } from '../../utils';
@@ -10,11 +10,22 @@ var ignoreContainerPaddingStyles = xcss({
10
10
  marginLeft: 'calc(var(--container-gap-left) * -1)',
11
11
  marginRight: 'calc(var(--container-gap-right) * -1)'
12
12
  });
13
+ var DEFAULT_SORT_ORDER = [ActionName.PreviewAction, ActionName.CopyLinkAction];
14
+ var sort = function sort(a, b) {
15
+ var idxA = DEFAULT_SORT_ORDER.indexOf(a);
16
+ var idxB = DEFAULT_SORT_ORDER.indexOf(b);
17
+ if (idxA === -1) {
18
+ idxA = DEFAULT_SORT_ORDER.length;
19
+ }
20
+ if (idxB === -1) {
21
+ idxB = DEFAULT_SORT_ORDER.length;
22
+ }
23
+ return idxA - idxB;
24
+ };
13
25
  var ActionBlock = function ActionBlock(_ref) {
14
26
  var blockRef = _ref.blockRef,
15
27
  onClickCallback = _ref.onClick,
16
28
  size = _ref.size,
17
- sort = _ref.sort,
18
29
  spaceInline = _ref.spaceInline,
19
30
  _ref$testId = _ref.testId,
20
31
  testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
@@ -26,9 +37,7 @@ var ActionBlock = function ActionBlock(_ref) {
26
37
  return;
27
38
  }
28
39
  var arr = Object.keys(context.actions);
29
- if (sort) {
30
- arr.sort(sort);
31
- }
40
+ arr.sort(sort);
32
41
  return arr.map(function (name) {
33
42
  var Action = name in Actions ? Actions[name] : undefined;
34
43
  return Action ? /*#__PURE__*/React.createElement(Action, {
@@ -44,7 +53,7 @@ var ActionBlock = function ActionBlock(_ref) {
44
53
  })
45
54
  }) : null;
46
55
  });
47
- }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, sort, spaceInline]);
56
+ }, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
48
57
  return actions ? /*#__PURE__*/React.createElement(Stack, {
49
58
  grow: "fill",
50
59
  xcss: ignoreContainerPaddingStyles,
@@ -1,6 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  /** @jsx jsx */
4
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
5
  import { jsx } from '@emotion/react';
5
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
7
  import CopyIcon from '@atlaskit/icon/glyph/copy';
@@ -135,7 +136,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
135
136
  subtitle = _extractMetadata.subtitle;
136
137
  var titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
137
138
  var titleBlockProps = {
138
- actions: titleActions,
139
+ actions: getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') ? undefined : titleActions,
139
140
  maxLines: titleMaxLines,
140
141
  overrideCss: titleBlockCss,
141
142
  size: SmartLinkSize.Large,
@@ -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.56.2",
13
+ packageVersion: "26.56.4",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -6,10 +6,6 @@ export type ActionBlockProps = {
6
6
  * Callback once action is executed.
7
7
  */
8
8
  onClick?: (name: ActionName) => void;
9
- /**
10
- * Array.Sort function to order the actions
11
- */
12
- sort?: (a: ActionName, b: ActionName) => number;
13
9
  /**
14
10
  * Used to add space along the inline axis (typically horizontal).
15
11
  */
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
3
2
  import { ActionItem } from '../../FlexibleCard/components/blocks/types';
4
3
  import { HoverCardContentProps } from '../types';
@@ -6,10 +6,6 @@ export type ActionBlockProps = {
6
6
  * Callback once action is executed.
7
7
  */
8
8
  onClick?: (name: ActionName) => void;
9
- /**
10
- * Array.Sort function to order the actions
11
- */
12
- sort?: (a: ActionName, b: ActionName) => number;
13
9
  /**
14
10
  * Used to add space along the inline axis (typically horizontal).
15
11
  */
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
3
2
  import { ActionItem } from '../../FlexibleCard/components/blocks/types';
4
3
  import { HoverCardContentProps } from '../types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.56.2",
3
+ "version": "26.56.4",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"