@atlaskit/smart-card 39.4.0 → 40.0.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/index.js +6 -0
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +0 -12
  5. package/dist/cjs/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
  6. package/dist/cjs/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +79 -0
  7. package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
  8. package/dist/cjs/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +2 -1
  9. package/dist/cjs/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
  10. package/dist/cjs/view/FlexibleCard/external.js +6 -0
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/es2019/index.js +1 -1
  13. package/dist/es2019/utils/analytics/analytics.js +1 -1
  14. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +0 -12
  15. package/dist/es2019/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
  16. package/dist/es2019/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +73 -0
  17. package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
  18. package/dist/es2019/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +2 -1
  19. package/dist/es2019/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
  20. package/dist/es2019/view/FlexibleCard/external.js +1 -0
  21. package/dist/es2019/view/LinkUrl/index.js +1 -1
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/utils/analytics/analytics.js +1 -1
  24. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +0 -12
  25. package/dist/esm/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
  26. package/dist/esm/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +72 -0
  27. package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
  28. package/dist/esm/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +2 -1
  29. package/dist/esm/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
  30. package/dist/esm/view/FlexibleCard/external.js +1 -0
  31. package/dist/esm/view/LinkUrl/index.js +1 -1
  32. package/dist/types/index.d.ts +1 -1
  33. package/dist/types/view/FlexibleCard/components/actions/custom-unresolved-action/index.d.ts +16 -0
  34. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
  35. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +2 -0
  36. package/dist/types/view/FlexibleCard/components/elements/custom-by-access-type-element/index.d.ts +2 -1
  37. package/dist/types/view/FlexibleCard/external.d.ts +2 -1
  38. package/dist/types-ts4.5/index.d.ts +1 -1
  39. package/dist/types-ts4.5/view/FlexibleCard/components/actions/custom-unresolved-action/index.d.ts +16 -0
  40. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
  41. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +2 -0
  42. package/dist/types-ts4.5/view/FlexibleCard/components/elements/custom-by-access-type-element/index.d.ts +2 -1
  43. package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +2 -1
  44. package/package.json +5 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 40.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#182438](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182438)
8
+ [`0dc9384260f43`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0dc9384260f43) -
9
+ [ux] Modified key of AccessType values in CustomElementByAccessTypeProps to be a MessageDescriptor
10
+ instead of a string for language translation safety.
11
+
12
+ For migration, modify the previous string type to use a MessageDescriptor from `react-intl-next`
13
+
14
+ ### Minor Changes
15
+
16
+ - [#182438](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182438)
17
+ [`38b28eac64441`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38b28eac64441) -
18
+ Add fontSize prop export to CustomElementByType element and, exported action
19
+ CustomUnresolvedAction, modified subset of ElementItem types to accept props when dynamically
20
+ creating elements within blocks such as MetadataBlock
21
+
22
+ ### Patch Changes
23
+
24
+ - [#183756](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183756)
25
+ [`935936bc5eb64`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/935936bc5eb64) -
26
+ [ux] EDM-12566 Removing avatar group css overrides for smart-card
27
+
3
28
  ## 39.4.0
4
29
 
5
30
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -105,6 +105,12 @@ Object.defineProperty(exports, "CustomByStatusElement", {
105
105
  return _external.CustomByStatusElement;
106
106
  }
107
107
  });
108
+ Object.defineProperty(exports, "CustomUnresolvedAction", {
109
+ enumerable: true,
110
+ get: function get() {
111
+ return _external.CustomUnresolvedAction;
112
+ }
113
+ });
108
114
  Object.defineProperty(exports, "DownloadAction", {
109
115
  enumerable: true,
110
116
  get: function get() {
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "39.3.0"
14
+ packageVersion: "39.4.0"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -19,16 +19,9 @@ var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
19
19
  var _withOverrideCss = require("../../../common/with-override-css");
20
20
  var _utils = require("../../../utils");
21
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
23
22
  var IconOnlyLarge = null;
24
-
25
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
26
23
  var SizeSmall = null;
27
-
28
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
29
24
  var SizeSmallIconOnly = null;
30
-
31
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
32
25
  var SizeSmallNotIconOnly = null;
33
26
  var IconButtonAppearanceMap = {
34
27
  default: 'default',
@@ -151,12 +144,7 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
151
144
  ref: ref
152
145
  }, button);
153
146
  });
154
-
155
- // On cleanup of platform-linking-visual-refresh-v1, this should become
156
- // export default withOverrideCss(ActionButton);
157
147
  var ActionButtonRefreshWithOverrideCss = (0, _withOverrideCss.withOverrideCss)(ActionButtonRefresh);
158
-
159
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
160
148
  var ActionButtonNew = function ActionButtonNew(_ref2) {
161
149
  var _ref2$appearance = _ref2.appearance,
162
150
  appearance = _ref2$appearance === void 0 ? 'default' : _ref2$appearance,
@@ -0,0 +1,3 @@
1
+ ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
+ ._1e0c1bgi{display:contents}
@@ -0,0 +1,79 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ require("./index.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+ var _react = _interopRequireDefault(require("react"));
14
+ var _reactIntlNext = require("react-intl-next");
15
+ var _compiled = require("@atlaskit/primitives/compiled");
16
+ var _constants = require("../../../../../constants");
17
+ var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
18
+ var _excluded = ["testId", "onlyShowIfAction", "Container"];
19
+ var styles = {
20
+ button: "_1e0c1bgi",
21
+ message: "_1rjcze3t _18zrze3t"
22
+ };
23
+ var validErrorStatuses = [_constants.SmartLinkStatus.Forbidden, _constants.SmartLinkStatus.Unauthorized];
24
+ var validateErrorStatus = function validateErrorStatus(status) {
25
+ return status !== undefined && validErrorStatuses.includes(status);
26
+ };
27
+ var getMessageDescriptor = function getMessageDescriptor(status, accessType, props) {
28
+ var _props$status;
29
+ if (!validateErrorStatus(status)) {
30
+ return undefined;
31
+ }
32
+ var message = props === null || props === void 0 || (_props$status = props[status]) === null || _props$status === void 0 ? void 0 : _props$status[accessType !== null && accessType !== void 0 ? accessType : 'FALLBACK'];
33
+ return message;
34
+ };
35
+ var CustomUnresolvedAction = function CustomUnresolvedAction(_ref) {
36
+ var _context$data, _context$data2, _getMessageDescriptor;
37
+ var _ref$testId = _ref.testId,
38
+ testId = _ref$testId === void 0 ? 'custom-unresolved-action' : _ref$testId,
39
+ _ref$onlyShowIfAction = _ref.onlyShowIfAction,
40
+ onlyShowIfAction = _ref$onlyShowIfAction === void 0 ? false : _ref$onlyShowIfAction,
41
+ Container = _ref.Container,
42
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
+ var context = (0, _flexibleUiContext.useFlexibleCardContext)();
44
+ var data = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 || (_context$data = _context$data.actions) === null || _context$data === void 0 ? void 0 : _context$data[_constants.InternalActionName.UnresolvedAction];
45
+ if (!data) {
46
+ return null;
47
+ }
48
+ var descriptor = data.descriptor,
49
+ onClick = data.onClick,
50
+ values = data.values;
51
+ var status = context.status;
52
+ var accessType = context === null || context === void 0 || (_context$data2 = context.data) === null || _context$data2 === void 0 || (_context$data2 = _context$data2.meta) === null || _context$data2 === void 0 ? void 0 : _context$data2.accessType;
53
+ var hasAction = onClick !== undefined;
54
+ if (onlyShowIfAction && !hasAction) {
55
+ return null;
56
+ }
57
+ var messageDescriptor = (_getMessageDescriptor = getMessageDescriptor(status, accessType, props)) !== null && _getMessageDescriptor !== void 0 ? _getMessageDescriptor : descriptor;
58
+ if (!messageDescriptor) {
59
+ return null;
60
+ }
61
+ var message = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
62
+ testId: "".concat(testId, "-errored-view-message"),
63
+ tabIndex: hasAction ? 0 : undefined,
64
+ xcss: styles.message
65
+ }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, messageDescriptor, {
66
+ values: values
67
+ })));
68
+ var component = hasAction ? /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
69
+ onClick: data.onClick,
70
+ style: {
71
+ color: "inherit",
72
+ font: "inherit",
73
+ textAlign: "inherit"
74
+ },
75
+ xcss: styles.button
76
+ }, message) : message;
77
+ return Container ? /*#__PURE__*/_react.default.createElement(Container, null, component) : component;
78
+ };
79
+ var _default = exports.default = CustomUnresolvedAction;
@@ -28,6 +28,12 @@ Object.defineProperty(exports, "CustomAction", {
28
28
  return _action.default;
29
29
  }
30
30
  });
31
+ Object.defineProperty(exports, "CustomUnresolvedAction", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _customUnresolvedAction.default;
35
+ }
36
+ });
31
37
  Object.defineProperty(exports, "DeleteAction", {
32
38
  enumerable: true,
33
39
  get: function get() {
@@ -80,4 +86,5 @@ var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
80
86
  var _unresolvedAction = _interopRequireDefault(require("./unresolved-action"));
81
87
  var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
82
88
  var _automationAction = _interopRequireDefault(require("./automation-action"));
83
- var _viewRelatedLinksAction = _interopRequireDefault(require("./view-related-links-action"));
89
+ var _viewRelatedLinksAction = _interopRequireDefault(require("./view-related-links-action"));
90
+ var _customUnresolvedAction = _interopRequireDefault(require("./custom-unresolved-action"));
@@ -22,6 +22,7 @@ var _utils = require("../../../utils");
22
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
23
  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; }
24
24
  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; }
25
+ var stylesOld = null;
25
26
  var styles = null;
26
27
  var stylesMap = {
27
28
  xlarge: "_1e0c116y _1kvxu2gc _102oidpf",
@@ -95,7 +96,7 @@ var BaseAvatarGroup = function BaseAvatarGroup(_ref) {
95
96
  "data-testid": testId
96
97
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
97
98
  ,
98
- className: (0, _runtime.ax)([stylesMap[size], "_1ul91ns9", className])
99
+ className: (0, _runtime.ax)([!(0, _platformFeatureFlags.fg)('platform-linking-fix-smart-card-avatar-overrides') && stylesMap[size], (0, _platformFeatureFlags.fg)('platform-linking-fix-smart-card-avatar-overrides') ? "_1ul91ns9 _1e0c116y _1kvxu2gc _102oidpf" : "_1ul91ns9", className])
99
100
  }), /*#__PURE__*/React.createElement(_avatarGroup.default, {
100
101
  maxCount: maxCount,
101
102
  appearance: "stack",
@@ -8,30 +8,33 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
+ var _constants = require("../../../../../constants");
11
12
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
12
13
  var _common = require("../common");
13
14
  var _excluded = ["className", "testId"];
14
15
  var CustomElementByAccessType = function CustomElementByAccessType(_ref) {
15
- var _context$data, _props;
16
+ var _context$data, _props, _context$data2;
16
17
  var className = _ref.className,
17
18
  _ref$testId = _ref.testId,
18
19
  testId = _ref$testId === void 0 ? 'custom-by-access-type-element' : _ref$testId,
19
20
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
21
  var context = (0, _flexibleUiContext.useFlexibleCardContext)();
21
22
  var accessType = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 || (_context$data = _context$data.meta) === null || _context$data === void 0 ? void 0 : _context$data.accessType;
22
- var text = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
23
- if (!text) {
23
+ var descriptor = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
24
+ if (!descriptor) {
24
25
  return null;
25
26
  }
26
- return (
27
- /*#__PURE__*/
27
+ var values = context === null || context === void 0 || (_context$data2 = context.data) === null || _context$data2 === void 0 || (_context$data2 = _context$data2.actions) === null || _context$data2 === void 0 || (_context$data2 = _context$data2[_constants.InternalActionName.UnresolvedAction]) === null || _context$data2 === void 0 ? void 0 : _context$data2.values;
28
+ return /*#__PURE__*/_react.default.createElement(_common.BaseTextElement, (0, _extends2.default)({}, props, {
29
+ message: {
30
+ descriptor: descriptor,
31
+ values: values
32
+ }
28
33
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
29
- _react.default.createElement(_common.BaseTextElement, (0, _extends2.default)({}, props, {
30
- content: text,
31
- className: className,
32
- testId: testId,
33
- hideFormat: true
34
- }))
35
- );
34
+ ,
35
+ className: className,
36
+ testId: testId,
37
+ hideFormat: true
38
+ }));
36
39
  };
37
40
  var _default = exports.default = CustomElementByAccessType;
@@ -17,6 +17,12 @@ Object.defineProperty(exports, "CustomByStatusElement", {
17
17
  return _elements.CustomByStatusElement;
18
18
  }
19
19
  });
20
+ Object.defineProperty(exports, "CustomUnresolvedAction", {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _actions.CustomUnresolvedAction;
24
+ }
25
+ });
20
26
  exports.toActionProps = exports.VoteCountElement = exports.ViewCountElement = exports.UnresolvedAction = exports.TitleElement = exports.TargetBranchElement = exports.SubscriberCountElement = exports.SubTasksProgressElement = exports.StoryPointsElement = exports.StateElement = exports.SourceBranchElement = exports.SnippetElement = exports.SentOnElement = exports.ReadTimeElement = exports.ReactCountElement = exports.ProviderElement = exports.ProgrammingLanguageElement = exports.PriorityElement = exports.PreviewElement = exports.PreviewAction = exports.OwnedByGroupElement = exports.OwnedByElement = exports.ModifiedOnElement = exports.ModifiedByElement = exports.LocationElement = exports.LinkIconElement = exports.LatestCommitElement = exports.FollowAction = exports.DueOnElement = exports.DownloadAction = void 0;
21
27
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
22
28
  var _react = _interopRequireDefault(require("react"));
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "39.3.0",
23
+ packageVersion: "39.4.0",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
15
15
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
16
16
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
17
17
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, CustomByAccessTypeElement, CustomByStatusElement } from './view/FlexibleCard/external';
18
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
18
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, CustomUnresolvedAction } from './view/FlexibleCard/external';
19
19
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
20
20
  export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "39.3.0"
5
+ packageVersion: "39.4.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,16 +10,9 @@ import { SmartLinkSize } from '../../../../../../constants';
10
10
  import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
11
11
  import { withOverrideCss } from '../../../common/with-override-css';
12
12
  import { sizeToButtonSpacing } from '../../../utils';
13
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
14
13
  const IconOnlyLarge = null;
15
-
16
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
17
14
  const SizeSmall = null;
18
-
19
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
20
15
  const SizeSmallIconOnly = null;
21
-
22
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
23
16
  const SizeSmallNotIconOnly = null;
24
17
  const IconButtonAppearanceMap = {
25
18
  default: 'default',
@@ -134,12 +127,7 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
134
127
  ref: ref
135
128
  }, button);
136
129
  });
137
-
138
- // On cleanup of platform-linking-visual-refresh-v1, this should become
139
- // export default withOverrideCss(ActionButton);
140
130
  const ActionButtonRefreshWithOverrideCss = withOverrideCss(ActionButtonRefresh);
141
-
142
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
143
131
  const ActionButtonNew = ({
144
132
  appearance = 'default',
145
133
  content,
@@ -0,0 +1,3 @@
1
+ ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
+ ._1e0c1bgi{display:contents}
@@ -0,0 +1,73 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React from 'react';
6
+ import { FormattedMessage } from 'react-intl-next';
7
+ import { Box, Pressable } from '@atlaskit/primitives/compiled';
8
+ import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
9
+ import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
10
+ const styles = {
11
+ button: "_1e0c1bgi",
12
+ message: "_1rjcze3t _18zrze3t"
13
+ };
14
+ const validErrorStatuses = [SmartLinkStatus.Forbidden, SmartLinkStatus.Unauthorized];
15
+ const validateErrorStatus = status => {
16
+ return status !== undefined && validErrorStatuses.includes(status);
17
+ };
18
+ const getMessageDescriptor = (status, accessType, props) => {
19
+ var _props$status;
20
+ if (!validateErrorStatus(status)) {
21
+ return undefined;
22
+ }
23
+ const message = props === null || props === void 0 ? void 0 : (_props$status = props[status]) === null || _props$status === void 0 ? void 0 : _props$status[accessType !== null && accessType !== void 0 ? accessType : 'FALLBACK'];
24
+ return message;
25
+ };
26
+ const CustomUnresolvedAction = ({
27
+ testId = 'custom-unresolved-action',
28
+ onlyShowIfAction = false,
29
+ Container,
30
+ ...props
31
+ }) => {
32
+ var _context$data, _context$data$actions, _context$data2, _context$data2$meta, _getMessageDescriptor;
33
+ const context = useFlexibleCardContext();
34
+ const data = context === null || context === void 0 ? void 0 : (_context$data = context.data) === null || _context$data === void 0 ? void 0 : (_context$data$actions = _context$data.actions) === null || _context$data$actions === void 0 ? void 0 : _context$data$actions[InternalActionName.UnresolvedAction];
35
+ if (!data) {
36
+ return null;
37
+ }
38
+ const {
39
+ descriptor,
40
+ onClick,
41
+ values
42
+ } = data;
43
+ const {
44
+ status
45
+ } = context;
46
+ const accessType = context === null || context === void 0 ? void 0 : (_context$data2 = context.data) === null || _context$data2 === void 0 ? void 0 : (_context$data2$meta = _context$data2.meta) === null || _context$data2$meta === void 0 ? void 0 : _context$data2$meta.accessType;
47
+ const hasAction = onClick !== undefined;
48
+ if (onlyShowIfAction && !hasAction) {
49
+ return null;
50
+ }
51
+ const messageDescriptor = (_getMessageDescriptor = getMessageDescriptor(status, accessType, props)) !== null && _getMessageDescriptor !== void 0 ? _getMessageDescriptor : descriptor;
52
+ if (!messageDescriptor) {
53
+ return null;
54
+ }
55
+ const message = /*#__PURE__*/React.createElement(Box, {
56
+ testId: `${testId}-errored-view-message`,
57
+ tabIndex: hasAction ? 0 : undefined,
58
+ xcss: styles.message
59
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messageDescriptor, {
60
+ values: values
61
+ })));
62
+ const component = hasAction ? /*#__PURE__*/React.createElement(Pressable, {
63
+ onClick: data.onClick,
64
+ style: {
65
+ color: `inherit`,
66
+ font: `inherit`,
67
+ textAlign: `inherit`
68
+ },
69
+ xcss: styles.button
70
+ }, message) : message;
71
+ return Container ? /*#__PURE__*/React.createElement(Container, null, component) : component;
72
+ };
73
+ export default CustomUnresolvedAction;
@@ -8,4 +8,5 @@ export { default as CopyLinkAction } from './copy-link-action';
8
8
  export { default as UnresolvedAction } from './unresolved-action';
9
9
  export { default as AISummaryAction } from './ai-summary-action';
10
10
  export { default as AutomationAction } from './automation-action';
11
- export { default as ViewRelatedLinksAction } from './view-related-links-action';
11
+ export { default as ViewRelatedLinksAction } from './view-related-links-action';
12
+ export { default as CustomUnresolvedAction } from './custom-unresolved-action';
@@ -10,6 +10,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { ElementName, SmartLinkSize } from '../../../../../../constants';
11
11
  import { messages } from '../../../../../../messages';
12
12
  import { getFormattedMessageAsString } from '../../../utils';
13
+ const stylesOld = null;
13
14
  const styles = null;
14
15
  const stylesMap = {
15
16
  xlarge: "_1e0c116y _1kvxu2gc _102oidpf",
@@ -81,7 +82,7 @@ const BaseAvatarGroup = ({
81
82
  "data-testid": testId
82
83
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
83
84
  ,
84
- className: ax([stylesMap[size], "_1ul91ns9", className])
85
+ className: ax([!fg('platform-linking-fix-smart-card-avatar-overrides') && stylesMap[size], fg('platform-linking-fix-smart-card-avatar-overrides') ? "_1ul91ns9 _1e0c116y _1kvxu2gc _102oidpf" : "_1ul91ns9", className])
85
86
  }), /*#__PURE__*/React.createElement(AtlaskitAvatarGroup, {
86
87
  maxCount: maxCount,
87
88
  appearance: "stack",
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { InternalActionName } from '../../../../../constants';
3
4
  import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
4
5
  import { BaseTextElement } from '../common';
5
6
  const CustomElementByAccessType = ({
@@ -7,22 +8,24 @@ const CustomElementByAccessType = ({
7
8
  testId = 'custom-by-access-type-element',
8
9
  ...props
9
10
  }) => {
10
- var _context$data, _context$data$meta, _props;
11
+ var _context$data, _context$data$meta, _props, _context$data2, _context$data2$action, _context$data2$action2;
11
12
  const context = useFlexibleCardContext();
12
13
  const accessType = context === null || context === void 0 ? void 0 : (_context$data = context.data) === null || _context$data === void 0 ? void 0 : (_context$data$meta = _context$data.meta) === null || _context$data$meta === void 0 ? void 0 : _context$data$meta.accessType;
13
- const text = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
14
- if (!text) {
14
+ const descriptor = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
15
+ if (!descriptor) {
15
16
  return null;
16
17
  }
17
- return (
18
- /*#__PURE__*/
18
+ const values = context === null || context === void 0 ? void 0 : (_context$data2 = context.data) === null || _context$data2 === void 0 ? void 0 : (_context$data2$action = _context$data2.actions) === null || _context$data2$action === void 0 ? void 0 : (_context$data2$action2 = _context$data2$action[InternalActionName.UnresolvedAction]) === null || _context$data2$action2 === void 0 ? void 0 : _context$data2$action2.values;
19
+ return /*#__PURE__*/React.createElement(BaseTextElement, _extends({}, props, {
20
+ message: {
21
+ descriptor,
22
+ values
23
+ }
19
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
20
- React.createElement(BaseTextElement, _extends({}, props, {
21
- content: text,
22
- className: className,
23
- testId: testId,
24
- hideFormat: true
25
- }))
26
- );
25
+ ,
26
+ className: className,
27
+ testId: testId,
28
+ hideFormat: true
29
+ }));
27
30
  };
28
31
  export default CustomElementByAccessType;
@@ -140,4 +140,5 @@ export const DownloadAction = props => /*#__PURE__*/React.createElement(Download
140
140
  export const FollowAction = props => /*#__PURE__*/React.createElement(FollowActionComponent, toActionProps(props));
141
141
  export const PreviewAction = props => /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
142
142
  export const UnresolvedAction = () => /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
143
+ export { CustomUnresolvedAction } from './components/actions';
143
144
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "39.3.0",
13
+ packageVersion: "39.4.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
package/dist/esm/index.js CHANGED
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
15
15
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
16
16
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
17
17
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, CustomByAccessTypeElement, CustomByStatusElement } from './view/FlexibleCard/external';
18
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
18
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, CustomUnresolvedAction } from './view/FlexibleCard/external';
19
19
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
20
20
  export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "39.3.0"
7
+ packageVersion: "39.4.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,16 +10,9 @@ import { SmartLinkSize } from '../../../../../../constants';
10
10
  import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
11
11
  import { withOverrideCss } from '../../../common/with-override-css';
12
12
  import { sizeToButtonSpacing } from '../../../utils';
13
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
14
13
  var IconOnlyLarge = null;
15
-
16
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
17
14
  var SizeSmall = null;
18
-
19
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
20
15
  var SizeSmallIconOnly = null;
21
-
22
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
23
16
  var SizeSmallNotIconOnly = null;
24
17
  var IconButtonAppearanceMap = {
25
18
  default: 'default',
@@ -142,12 +135,7 @@ var ActionButtonRefresh = /*#__PURE__*/forwardRef(function (_ref, ref) {
142
135
  ref: ref
143
136
  }, button);
144
137
  });
145
-
146
- // On cleanup of platform-linking-visual-refresh-v1, this should become
147
- // export default withOverrideCss(ActionButton);
148
138
  var ActionButtonRefreshWithOverrideCss = withOverrideCss(ActionButtonRefresh);
149
-
150
- // TODO: Remove on fg cleanup: platform-linking-visual-refresh-v1
151
139
  var ActionButtonNew = function ActionButtonNew(_ref2) {
152
140
  var _ref2$appearance = _ref2.appearance,
153
141
  appearance = _ref2$appearance === void 0 ? 'default' : _ref2$appearance,
@@ -0,0 +1,3 @@
1
+ ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
+ ._1e0c1bgi{display:contents}
@@ -0,0 +1,72 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["testId", "onlyShowIfAction", "Container"];
5
+ import "./index.compiled.css";
6
+ import { ax, ix } from "@compiled/react/runtime";
7
+ import React from 'react';
8
+ import { FormattedMessage } from 'react-intl-next';
9
+ import { Box, Pressable } from '@atlaskit/primitives/compiled';
10
+ import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
11
+ import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
12
+ var styles = {
13
+ button: "_1e0c1bgi",
14
+ message: "_1rjcze3t _18zrze3t"
15
+ };
16
+ var validErrorStatuses = [SmartLinkStatus.Forbidden, SmartLinkStatus.Unauthorized];
17
+ var validateErrorStatus = function validateErrorStatus(status) {
18
+ return status !== undefined && validErrorStatuses.includes(status);
19
+ };
20
+ var getMessageDescriptor = function getMessageDescriptor(status, accessType, props) {
21
+ var _props$status;
22
+ if (!validateErrorStatus(status)) {
23
+ return undefined;
24
+ }
25
+ var message = props === null || props === void 0 || (_props$status = props[status]) === null || _props$status === void 0 ? void 0 : _props$status[accessType !== null && accessType !== void 0 ? accessType : 'FALLBACK'];
26
+ return message;
27
+ };
28
+ var CustomUnresolvedAction = function CustomUnresolvedAction(_ref) {
29
+ var _context$data, _context$data2, _getMessageDescriptor;
30
+ var _ref$testId = _ref.testId,
31
+ testId = _ref$testId === void 0 ? 'custom-unresolved-action' : _ref$testId,
32
+ _ref$onlyShowIfAction = _ref.onlyShowIfAction,
33
+ onlyShowIfAction = _ref$onlyShowIfAction === void 0 ? false : _ref$onlyShowIfAction,
34
+ Container = _ref.Container,
35
+ props = _objectWithoutProperties(_ref, _excluded);
36
+ var context = useFlexibleCardContext();
37
+ var data = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 || (_context$data = _context$data.actions) === null || _context$data === void 0 ? void 0 : _context$data[InternalActionName.UnresolvedAction];
38
+ if (!data) {
39
+ return null;
40
+ }
41
+ var descriptor = data.descriptor,
42
+ onClick = data.onClick,
43
+ values = data.values;
44
+ var status = context.status;
45
+ var accessType = context === null || context === void 0 || (_context$data2 = context.data) === null || _context$data2 === void 0 || (_context$data2 = _context$data2.meta) === null || _context$data2 === void 0 ? void 0 : _context$data2.accessType;
46
+ var hasAction = onClick !== undefined;
47
+ if (onlyShowIfAction && !hasAction) {
48
+ return null;
49
+ }
50
+ var messageDescriptor = (_getMessageDescriptor = getMessageDescriptor(status, accessType, props)) !== null && _getMessageDescriptor !== void 0 ? _getMessageDescriptor : descriptor;
51
+ if (!messageDescriptor) {
52
+ return null;
53
+ }
54
+ var message = /*#__PURE__*/React.createElement(Box, {
55
+ testId: "".concat(testId, "-errored-view-message"),
56
+ tabIndex: hasAction ? 0 : undefined,
57
+ xcss: styles.message
58
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messageDescriptor, {
59
+ values: values
60
+ })));
61
+ var component = hasAction ? /*#__PURE__*/React.createElement(Pressable, {
62
+ onClick: data.onClick,
63
+ style: {
64
+ color: "inherit",
65
+ font: "inherit",
66
+ textAlign: "inherit"
67
+ },
68
+ xcss: styles.button
69
+ }, message) : message;
70
+ return Container ? /*#__PURE__*/React.createElement(Container, null, component) : component;
71
+ };
72
+ export default CustomUnresolvedAction;
@@ -8,4 +8,5 @@ export { default as CopyLinkAction } from './copy-link-action';
8
8
  export { default as UnresolvedAction } from './unresolved-action';
9
9
  export { default as AISummaryAction } from './ai-summary-action';
10
10
  export { default as AutomationAction } from './automation-action';
11
- export { default as ViewRelatedLinksAction } from './view-related-links-action';
11
+ export { default as ViewRelatedLinksAction } from './view-related-links-action';
12
+ export { default as CustomUnresolvedAction } from './custom-unresolved-action';
@@ -13,6 +13,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { ElementName, SmartLinkSize } from '../../../../../../constants';
14
14
  import { messages } from '../../../../../../messages';
15
15
  import { getFormattedMessageAsString } from '../../../utils';
16
+ var stylesOld = null;
16
17
  var styles = null;
17
18
  var stylesMap = {
18
19
  xlarge: "_1e0c116y _1kvxu2gc _102oidpf",
@@ -86,7 +87,7 @@ var BaseAvatarGroup = function BaseAvatarGroup(_ref) {
86
87
  "data-testid": testId
87
88
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
88
89
  ,
89
- className: ax([stylesMap[size], "_1ul91ns9", className])
90
+ className: ax([!fg('platform-linking-fix-smart-card-avatar-overrides') && stylesMap[size], fg('platform-linking-fix-smart-card-avatar-overrides') ? "_1ul91ns9 _1e0c116y _1kvxu2gc _102oidpf" : "_1ul91ns9", className])
90
91
  }), /*#__PURE__*/React.createElement(AtlaskitAvatarGroup, {
91
92
  maxCount: maxCount,
92
93
  appearance: "stack",
@@ -2,29 +2,32 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["className", "testId"];
4
4
  import React from 'react';
5
+ import { InternalActionName } from '../../../../../constants';
5
6
  import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
6
7
  import { BaseTextElement } from '../common';
7
8
  var CustomElementByAccessType = function CustomElementByAccessType(_ref) {
8
- var _context$data, _props;
9
+ var _context$data, _props, _context$data2;
9
10
  var className = _ref.className,
10
11
  _ref$testId = _ref.testId,
11
12
  testId = _ref$testId === void 0 ? 'custom-by-access-type-element' : _ref$testId,
12
13
  props = _objectWithoutProperties(_ref, _excluded);
13
14
  var context = useFlexibleCardContext();
14
15
  var accessType = context === null || context === void 0 || (_context$data = context.data) === null || _context$data === void 0 || (_context$data = _context$data.meta) === null || _context$data === void 0 ? void 0 : _context$data.accessType;
15
- var text = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
16
- if (!text) {
16
+ var descriptor = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
17
+ if (!descriptor) {
17
18
  return null;
18
19
  }
19
- return (
20
- /*#__PURE__*/
20
+ var values = context === null || context === void 0 || (_context$data2 = context.data) === null || _context$data2 === void 0 || (_context$data2 = _context$data2.actions) === null || _context$data2 === void 0 || (_context$data2 = _context$data2[InternalActionName.UnresolvedAction]) === null || _context$data2 === void 0 ? void 0 : _context$data2.values;
21
+ return /*#__PURE__*/React.createElement(BaseTextElement, _extends({}, props, {
22
+ message: {
23
+ descriptor: descriptor,
24
+ values: values
25
+ }
21
26
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
22
- React.createElement(BaseTextElement, _extends({}, props, {
23
- content: text,
24
- className: className,
25
- testId: testId,
26
- hideFormat: true
27
- }))
28
- );
27
+ ,
28
+ className: className,
29
+ testId: testId,
30
+ hideFormat: true
31
+ }));
29
32
  };
30
33
  export default CustomElementByAccessType;
@@ -206,4 +206,5 @@ export var PreviewAction = function PreviewAction(props) {
206
206
  export var UnresolvedAction = function UnresolvedAction() {
207
207
  return /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
208
208
  };
209
+ export { CustomUnresolvedAction } from './components/actions';
209
210
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "39.3.0",
16
+ packageVersion: "39.4.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
11
11
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
12
12
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
13
13
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, CustomByAccessTypeElement, CustomByStatusElement, } from './view/FlexibleCard/external';
14
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
14
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, CustomUnresolvedAction, } from './view/FlexibleCard/external';
15
15
  export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
16
16
  export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
17
17
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type MessageDescriptor } from 'react-intl-next';
3
+ import { type Prettify } from '@atlaskit/linking-common';
4
+ import { SmartLinkStatus } from '../../../../../constants';
5
+ export type AccessType = 'DIRECT_ACCESS' | 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DENIED_REQUEST_EXISTS' | 'ACCESS_EXISTS' | undefined;
6
+ export type CustomStatusComponents = Partial<Record<NonNullable<AccessType> | 'FALLBACK', MessageDescriptor>>;
7
+ type ErrorStatus = Extract<SmartLinkStatus, SmartLinkStatus.Forbidden | SmartLinkStatus.Unauthorized>;
8
+ type CustomUnresolvedActionProps = Prettify<{
9
+ testId?: string;
10
+ onlyShowIfAction?: boolean;
11
+ Container?: React.ComponentType<{
12
+ children: React.ReactNode;
13
+ }>;
14
+ } & Partial<Record<ErrorStatus, CustomStatusComponents>>>;
15
+ declare const CustomUnresolvedAction: ({ testId, onlyShowIfAction, Container, ...props }: CustomUnresolvedActionProps) => JSX.Element | null;
16
+ export default CustomUnresolvedAction;
@@ -9,3 +9,4 @@ export { default as UnresolvedAction } from './unresolved-action';
9
9
  export { default as AISummaryAction } from './ai-summary-action';
10
10
  export { default as AutomationAction } from './automation-action';
11
11
  export { default as ViewRelatedLinksAction } from './view-related-links-action';
12
+ export { default as CustomUnresolvedAction } from './custom-unresolved-action';
@@ -282,6 +282,7 @@ export type OwnedBy = {
282
282
  name: ElementName.OwnedBy;
283
283
  textPrefix?: 'owned_by' | 'owned_by_override';
284
284
  hideFormat?: boolean;
285
+ fontSize?: 'font.body' | 'font.body.large' | 'font.body.small' | 'font.body.UNSAFE_small';
285
286
  };
286
287
  /**
287
288
  * Represents the props available for an CreatedOn element.
@@ -338,6 +339,7 @@ export type ModifiedOn = {
338
339
  * A string which will be displayed before the specified element.
339
340
  */
340
341
  text?: string;
342
+ fontSize?: 'font.body' | 'font.body.large' | 'font.body.small' | 'font.body.UNSAFE_small';
341
343
  };
342
344
  /**
343
345
  * Represents the props available for an Preview element.
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { type MessageDescriptor } from 'react-intl-next';
2
3
  import type { Prettify } from '@atlaskit/linking-common';
3
4
  import { type BaseTextElementProps } from '../common';
4
5
  type AccessType = 'DIRECT_ACCESS' | 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DENIED_REQUEST_EXISTS';
5
- export type CustomElementByAccessTypeProps = Prettify<Pick<BaseTextElementProps, 'className' | 'testId' | 'color'> & Partial<Record<AccessType | 'fallback', string>>>;
6
+ export type CustomElementByAccessTypeProps = Prettify<Pick<BaseTextElementProps, 'className' | 'testId' | 'color' | 'fontSize'> & Partial<Record<AccessType | 'fallback', MessageDescriptor>>>;
6
7
  declare const CustomElementByAccessType: ({ className, testId, ...props }: CustomElementByAccessTypeProps) => JSX.Element | null;
7
8
  export default CustomElementByAccessType;
@@ -27,7 +27,7 @@ type LinkIconElementProps = Prettify<Pick<React.ComponentProps<typeof LinkIcon>,
27
27
  export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
28
28
  export declare const LocationElement: () => React.JSX.Element;
29
29
  export declare const ModifiedByElement: () => React.JSX.Element;
30
- type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color' | 'onRender' | 'fontSize'>;
30
+ export type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color' | 'onRender' | 'fontSize'>;
31
31
  export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
32
32
  export type OwnedByElementProps = Pick<React.ComponentProps<typeof OwnedBy>, 'hideFormat' | 'color' | 'onRender' | 'textPrefix' | 'fontSize'>;
33
33
  export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
@@ -79,4 +79,5 @@ export declare const FollowAction: (props: FollowActionProps) => React.JSX.Eleme
79
79
  export type PreviewActionProps = BaseActionProps;
80
80
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
81
81
  export declare const UnresolvedAction: () => React.JSX.Element;
82
+ export { CustomUnresolvedAction } from './components/actions';
82
83
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
11
11
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
12
12
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
13
13
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, CustomByAccessTypeElement, CustomByStatusElement, } from './view/FlexibleCard/external';
14
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
14
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, CustomUnresolvedAction, } from './view/FlexibleCard/external';
15
15
  export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
16
16
  export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
17
17
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type MessageDescriptor } from 'react-intl-next';
3
+ import { type Prettify } from '@atlaskit/linking-common';
4
+ import { SmartLinkStatus } from '../../../../../constants';
5
+ export type AccessType = 'DIRECT_ACCESS' | 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DENIED_REQUEST_EXISTS' | 'ACCESS_EXISTS' | undefined;
6
+ export type CustomStatusComponents = Partial<Record<NonNullable<AccessType> | 'FALLBACK', MessageDescriptor>>;
7
+ type ErrorStatus = Extract<SmartLinkStatus, SmartLinkStatus.Forbidden | SmartLinkStatus.Unauthorized>;
8
+ type CustomUnresolvedActionProps = Prettify<{
9
+ testId?: string;
10
+ onlyShowIfAction?: boolean;
11
+ Container?: React.ComponentType<{
12
+ children: React.ReactNode;
13
+ }>;
14
+ } & Partial<Record<ErrorStatus, CustomStatusComponents>>>;
15
+ declare const CustomUnresolvedAction: ({ testId, onlyShowIfAction, Container, ...props }: CustomUnresolvedActionProps) => JSX.Element | null;
16
+ export default CustomUnresolvedAction;
@@ -9,3 +9,4 @@ export { default as UnresolvedAction } from './unresolved-action';
9
9
  export { default as AISummaryAction } from './ai-summary-action';
10
10
  export { default as AutomationAction } from './automation-action';
11
11
  export { default as ViewRelatedLinksAction } from './view-related-links-action';
12
+ export { default as CustomUnresolvedAction } from './custom-unresolved-action';
@@ -282,6 +282,7 @@ export type OwnedBy = {
282
282
  name: ElementName.OwnedBy;
283
283
  textPrefix?: 'owned_by' | 'owned_by_override';
284
284
  hideFormat?: boolean;
285
+ fontSize?: 'font.body' | 'font.body.large' | 'font.body.small' | 'font.body.UNSAFE_small';
285
286
  };
286
287
  /**
287
288
  * Represents the props available for an CreatedOn element.
@@ -338,6 +339,7 @@ export type ModifiedOn = {
338
339
  * A string which will be displayed before the specified element.
339
340
  */
340
341
  text?: string;
342
+ fontSize?: 'font.body' | 'font.body.large' | 'font.body.small' | 'font.body.UNSAFE_small';
341
343
  };
342
344
  /**
343
345
  * Represents the props available for an Preview element.
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { type MessageDescriptor } from 'react-intl-next';
2
3
  import type { Prettify } from '@atlaskit/linking-common';
3
4
  import { type BaseTextElementProps } from '../common';
4
5
  type AccessType = 'DIRECT_ACCESS' | 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DENIED_REQUEST_EXISTS';
5
- export type CustomElementByAccessTypeProps = Prettify<Pick<BaseTextElementProps, 'className' | 'testId' | 'color'> & Partial<Record<AccessType | 'fallback', string>>>;
6
+ export type CustomElementByAccessTypeProps = Prettify<Pick<BaseTextElementProps, 'className' | 'testId' | 'color' | 'fontSize'> & Partial<Record<AccessType | 'fallback', MessageDescriptor>>>;
6
7
  declare const CustomElementByAccessType: ({ className, testId, ...props }: CustomElementByAccessTypeProps) => JSX.Element | null;
7
8
  export default CustomElementByAccessType;
@@ -27,7 +27,7 @@ type LinkIconElementProps = Prettify<Pick<React.ComponentProps<typeof LinkIcon>,
27
27
  export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
28
28
  export declare const LocationElement: () => React.JSX.Element;
29
29
  export declare const ModifiedByElement: () => React.JSX.Element;
30
- type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color' | 'onRender' | 'fontSize'>;
30
+ export type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color' | 'onRender' | 'fontSize'>;
31
31
  export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
32
32
  export type OwnedByElementProps = Pick<React.ComponentProps<typeof OwnedBy>, 'hideFormat' | 'color' | 'onRender' | 'textPrefix' | 'fontSize'>;
33
33
  export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
@@ -79,4 +79,5 @@ export declare const FollowAction: (props: FollowActionProps) => React.JSX.Eleme
79
79
  export type PreviewActionProps = BaseActionProps;
80
80
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
81
81
  export declare const UnresolvedAction: () => React.JSX.Element;
82
+ export { CustomUnresolvedAction } from './components/actions';
82
83
  export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "39.4.0",
3
+ "version": "40.0.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/textarea": "^8.0.0",
68
68
  "@atlaskit/textfield": "^8.0.0",
69
69
  "@atlaskit/theme": "^19.0.0",
70
- "@atlaskit/tokens": "^5.4.0",
70
+ "@atlaskit/tokens": "^5.5.0",
71
71
  "@atlaskit/tooltip": "^20.3.0",
72
72
  "@atlaskit/ufo": "^0.4.0",
73
73
  "@babel/runtime": "^7.0.0",
@@ -249,6 +249,9 @@
249
249
  },
250
250
  "platform-linking-enable-avatar-data-separator": {
251
251
  "type": "boolean"
252
+ },
253
+ "platform-linking-fix-smart-card-avatar-overrides": {
254
+ "type": "boolean"
252
255
  }
253
256
  },
254
257
  "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"