@atlaskit/smart-card 29.0.2 → 29.1.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 (28) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/extractors/common/detail/extractSubscriberCount.js +4 -7
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +14 -8
  5. package/dist/cjs/view/BlockCard/views/ResolvingView.js +6 -5
  6. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  7. package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +1 -0
  8. package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -0
  9. package/dist/cjs/view/LinkUrl/index.js +1 -1
  10. package/dist/es2019/extractors/common/detail/extractSubscriberCount.js +4 -7
  11. package/dist/es2019/utils/analytics/analytics.js +1 -1
  12. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +14 -8
  13. package/dist/es2019/view/BlockCard/views/ResolvingView.js +5 -4
  14. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  15. package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +1 -0
  16. package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -0
  17. package/dist/es2019/view/LinkUrl/index.js +1 -1
  18. package/dist/esm/extractors/common/detail/extractSubscriberCount.js +4 -7
  19. package/dist/esm/utils/analytics/analytics.js +1 -1
  20. package/dist/esm/view/BlockCard/views/ForbiddenView.js +14 -8
  21. package/dist/esm/view/BlockCard/views/ResolvingView.js +5 -4
  22. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  23. package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +1 -0
  24. package/dist/esm/view/FlexibleCard/components/container/index.js +1 -0
  25. package/dist/esm/view/LinkUrl/index.js +1 -1
  26. package/dist/types/view/Card/types.d.ts +84 -10
  27. package/dist/types-ts4.5/view/Card/types.d.ts +84 -10
  28. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 29.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#149644](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149644)
8
+ [`5a157fb05e298`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5a157fb05e298) -
9
+ [ux] Enable new icons behind a feature flag.
10
+ - [#148475](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/148475)
11
+ [`09e912b75c96d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/09e912b75c96d) -
12
+ [ux] Enable new icons behind a feature flag.
13
+ - [#148475](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/148475)
14
+ [`8a89b1fabdecc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8a89b1fabdecc) -
15
+ [ux] Enable new icons behind a feature flag.
16
+
17
+ ## 29.0.3
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 29.0.2
4
24
 
5
25
  ### Patch Changes
@@ -7,19 +7,16 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.extractSubscriberCount = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _colors = require("@atlaskit/theme/colors");
10
- var _people = _interopRequireDefault(require("@atlaskit/icon/glyph/people"));
10
+ var _peopleGroupPeople = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group--people"));
11
11
  var extractSubscriberCount = exports.extractSubscriberCount = function extractSubscriberCount(jsonLd) {
12
12
  var subscriberCount = jsonLd['atlassian:subscriberCount'];
13
13
  if (subscriberCount) {
14
14
  return {
15
15
  text: subscriberCount.toString(),
16
- icon:
17
- /*#__PURE__*/
18
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19499
19
- _react.default.createElement(_people.default, {
20
- size: "small",
16
+ icon: /*#__PURE__*/_react.default.createElement(_peopleGroupPeople.default, {
17
+ LEGACY_size: "small",
21
18
  label: "subscribers",
22
- primaryColor: "var(--ds-icon-subtle, ".concat(_colors.N600, ")")
19
+ color: "var(--ds-icon-subtle, ".concat(_colors.N600, ")")
23
20
  })
24
21
  };
25
22
  }
@@ -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: "29.0.2"
25
+ packageVersion: "29.1.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
10
10
  var _react = require("@emotion/react");
11
11
  var _reactIntlNext = require("react-intl-next");
12
12
  var _colors = require("@atlaskit/theme/colors");
13
- var _lockFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/lock-filled"));
13
+ var _lockLockedLockFilled = _interopRequireDefault(require("@atlaskit/icon/utility/migration/lock-locked--lock-filled"));
14
14
  var _Frame = require("../components/Frame");
15
15
  var _Provider = require("../components/Provider");
16
16
  var _Byline = require("../../common/Byline");
@@ -22,12 +22,16 @@ var _ContentHeader = require("../components/ContentHeader");
22
22
  var _handlers = require("../utils/handlers");
23
23
  var _Link = require("../components/Link");
24
24
  var _UnresolvedText = require("../components/UnresolvedText");
25
+ var _primitives = require("@atlaskit/primitives");
25
26
  /**
26
27
  * @jsxRuntime classic
27
28
  * @jsx jsx
28
29
  */
29
30
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
30
31
 
32
+ var iconWrapperStyles = (0, _primitives.xcss)({
33
+ marginRight: 'space.050'
34
+ });
31
35
  /**
32
36
  * Class name for selecting non-flexible forbidden block card
33
37
  *
@@ -90,14 +94,16 @@ var ForbiddenView = exports.ForbiddenView = function ForbiddenView(_ref) {
90
94
  ,
91
95
  className: blockCardForbiddenViewLinkClassName
92
96
  })), (0, _react.jsx)(_Byline.Byline, null, (0, _react.jsx)(_UnresolvedText.UnresolvedText, {
93
- icon:
94
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
95
- (0, _react.jsx)(_lockFilled.default, {
97
+ icon: (0, _react.jsx)(_primitives.Flex, {
98
+ alignItems: "center",
99
+ xcss: iconWrapperStyles
100
+ }, (0, _react.jsx)(_lockLockedLockFilled.default, {
96
101
  label: "forbidden-lock-icon",
97
- size: "small",
98
- primaryColor: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
99
- testId: "".concat(testId, "-lock-icon")
100
- }),
102
+ LEGACY_size: "small",
103
+ color: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
104
+ testId: "".concat(testId, "-lock-icon"),
105
+ LEGACY_margin: "0 ".concat("var(--ds-space-negative-050, -4px)", " 0 0")
106
+ })),
101
107
  text: (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages[descriptiveMessageKey], {
102
108
  values: {
103
109
  product: context.text,
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.blockCardResolvingViewClassName = exports.ResolvingView = void 0;
8
8
  var _react = require("@emotion/react");
9
- var _documentFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/document-filled"));
9
+ var _fileEditorFile = _interopRequireDefault(require("@atlaskit/icon/core/migration/file--editor-file"));
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
  var _constants = require("@atlaskit/theme/constants");
12
12
  var _Frame = require("../components/Frame");
@@ -46,10 +46,11 @@ var ResolvingView = exports.ResolvingView = function ResolvingView(_ref) {
46
46
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
47
47
  ,
48
48
  className: blockCardResolvingViewClassName
49
- }, (0, _react.jsx)(_documentFilled.default, {
50
- size: "small",
51
- primaryColor: "var(--ds-icon-subtle, ".concat(_colors.N50, ")"),
52
- label: "document-icon"
49
+ }, (0, _react.jsx)(_fileEditorFile.default, {
50
+ LEGACY_size: "medium",
51
+ color: "var(--ds-icon-subtle, ".concat(_colors.N50, ")"),
52
+ label: "document-icon",
53
+ LEGACY_margin: "0 -4.3px 0 -4px"
53
54
  }), (0, _react.jsx)("span", {
54
55
  css: messageStyles
55
56
  }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.loading)));
@@ -22,6 +22,7 @@ var _messages = require("../../../../../messages");
22
22
  var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
23
23
  var _actionGroupItem = _interopRequireDefault(require("./action-group-item"));
24
24
  var _utils2 = require("../utils");
25
+ var _reactMagneticDi = require("react-magnetic-di");
25
26
  var _excluded = ["triggerRef"];
26
27
  /**
27
28
  * @jsxRuntime classic
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.AIFooterMetadata = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
10
+ var _reactMagneticDi = require("react-magnetic-di");
10
11
  var _reactIntlNext = require("react-intl-next");
11
12
  var _primitives = require("@atlaskit/primitives");
12
13
  var _aiIcon = _interopRequireDefault(require("../../../../../common/ai-icon"));
@@ -16,6 +16,7 @@ var _layeredLink = _interopRequireDefault(require("./layered-link"));
16
16
  var _hoverCardControl = _interopRequireDefault(require("./hover-card-control"));
17
17
  var _utils = require("../../../../state/flexible-ui-context/utils");
18
18
  var _colors = require("@atlaskit/theme/colors");
19
+ var _reactMagneticDi = require("react-magnetic-di");
19
20
  var _templateObject;
20
21
  /**
21
22
  * @jsxRuntime classic
@@ -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: "29.0.2",
20
+ packageVersion: "29.1.0",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -1,18 +1,15 @@
1
1
  import React from 'react';
2
2
  import { N600 } from '@atlaskit/theme/colors';
3
- import PeopleIcon from '@atlaskit/icon/glyph/people';
3
+ import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
4
4
  export const extractSubscriberCount = jsonLd => {
5
5
  const subscriberCount = jsonLd['atlassian:subscriberCount'];
6
6
  if (subscriberCount) {
7
7
  return {
8
8
  text: subscriberCount.toString(),
9
- icon:
10
- /*#__PURE__*/
11
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19499
12
- React.createElement(PeopleIcon, {
13
- size: "small",
9
+ icon: /*#__PURE__*/React.createElement(PeopleIcon, {
10
+ LEGACY_size: "small",
14
11
  label: "subscribers",
15
- primaryColor: `var(--ds-icon-subtle, ${N600})`
12
+ color: `var(--ds-icon-subtle, ${N600})`
16
13
  })
17
14
  };
18
15
  }
@@ -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: "29.0.2"
7
+ packageVersion: "29.1.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,7 +7,7 @@ import _extends from "@babel/runtime/helpers/extends";
7
7
  import { jsx } from '@emotion/react';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
9
  import { R300 } from '@atlaskit/theme/colors';
10
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
10
+ import LockIcon from '@atlaskit/icon/utility/migration/lock-locked--lock-filled';
11
11
  import { Frame } from '../components/Frame';
12
12
  import { Provider } from '../components/Provider';
13
13
  import { Byline } from '../../common/Byline';
@@ -19,6 +19,10 @@ import { ContentHeader } from '../components/ContentHeader';
19
19
  import { handleClickCommon } from '../utils/handlers';
20
20
  import { Link } from '../components/Link';
21
21
  import { UnresolvedText } from '../components/UnresolvedText';
22
+ import { Flex, xcss } from '@atlaskit/primitives';
23
+ const iconWrapperStyles = xcss({
24
+ marginRight: 'space.050'
25
+ });
22
26
  /**
23
27
  * Class name for selecting non-flexible forbidden block card
24
28
  *
@@ -73,14 +77,16 @@ export const ForbiddenView = ({
73
77
  ,
74
78
  className: blockCardForbiddenViewLinkClassName
75
79
  })), jsx(Byline, null, jsx(UnresolvedText, {
76
- icon:
77
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
78
- jsx(LockIcon, {
80
+ icon: jsx(Flex, {
81
+ alignItems: "center",
82
+ xcss: iconWrapperStyles
83
+ }, jsx(LockIcon, {
79
84
  label: "forbidden-lock-icon",
80
- size: "small",
81
- primaryColor: `var(--ds-icon-danger, ${R300})`,
82
- testId: `${testId}-lock-icon`
83
- }),
85
+ LEGACY_size: "small",
86
+ color: `var(--ds-icon-danger, ${R300})`,
87
+ testId: `${testId}-lock-icon`,
88
+ LEGACY_margin: `0 ${"var(--ds-space-negative-050, -4px)"} 0 0`
89
+ })),
84
90
  text: jsx(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
85
91
  values: {
86
92
  product: context.text,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, jsx } from '@emotion/react';
7
- import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
7
+ import DocumentFilledIcon from '@atlaskit/icon/core/migration/file--editor-file';
8
8
  import { N50, N90 } from '@atlaskit/theme/colors';
9
9
  import { fontSize } from '@atlaskit/theme/constants';
10
10
  import { Frame } from '../components/Frame';
@@ -37,9 +37,10 @@ export const ResolvingView = ({
37
37
  ,
38
38
  className: blockCardResolvingViewClassName
39
39
  }, jsx(DocumentFilledIcon, {
40
- size: "small",
41
- primaryColor: `var(--ds-icon-subtle, ${N50})`,
42
- label: "document-icon"
40
+ LEGACY_size: "medium",
41
+ color: `var(--ds-icon-subtle, ${N50})`,
42
+ label: "document-icon",
43
+ LEGACY_margin: "0 -4.3px 0 -4px"
43
44
  }), jsx("span", {
44
45
  css: messageStyles
45
46
  }, jsx(FormattedMessage, messages.loading)));
@@ -19,6 +19,7 @@ import { messages } from '../../../../../messages';
19
19
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
20
20
  import ActionGroupItem from './action-group-item';
21
21
  import { filterActionItems } from '../utils';
22
+ import { di } from 'react-magnetic-di';
22
23
  const styles = css({
23
24
  display: 'inline-flex',
24
25
  lineHeight: '1rem',
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import Tooltip from '@atlaskit/tooltip';
3
+ import { di } from 'react-magnetic-di';
3
4
  import { FormattedMessage } from 'react-intl-next';
4
5
  import { Box, Inline } from '@atlaskit/primitives';
5
6
  import AIIcon from '../../../../../common/ai-icon';
@@ -12,6 +12,7 @@ import LayeredLink from './layered-link';
12
12
  import HoverCardControl from './hover-card-control';
13
13
  import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
14
14
  import { N40 } from '@atlaskit/theme/colors';
15
+ import { di } from 'react-magnetic-di';
15
16
  const elevationStyles = css({
16
17
  border: `1px solid ${`var(--ds-border, ${N40})`}`,
17
18
  borderRadius: "var(--ds-border-radius-200, 8px)",
@@ -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: "29.0.2",
10
+ packageVersion: "29.1.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,18 +1,15 @@
1
1
  import React from 'react';
2
2
  import { N600 } from '@atlaskit/theme/colors';
3
- import PeopleIcon from '@atlaskit/icon/glyph/people';
3
+ import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
4
4
  export var extractSubscriberCount = function extractSubscriberCount(jsonLd) {
5
5
  var subscriberCount = jsonLd['atlassian:subscriberCount'];
6
6
  if (subscriberCount) {
7
7
  return {
8
8
  text: subscriberCount.toString(),
9
- icon:
10
- /*#__PURE__*/
11
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19499
12
- React.createElement(PeopleIcon, {
13
- size: "small",
9
+ icon: /*#__PURE__*/React.createElement(PeopleIcon, {
10
+ LEGACY_size: "small",
14
11
  label: "subscribers",
15
- primaryColor: "var(--ds-icon-subtle, ".concat(N600, ")")
12
+ color: "var(--ds-icon-subtle, ".concat(N600, ")")
16
13
  })
17
14
  };
18
15
  }
@@ -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: "29.0.2"
18
+ packageVersion: "29.1.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -8,7 +8,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
8
8
  import { jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { R300 } from '@atlaskit/theme/colors';
11
- import LockIcon from '@atlaskit/icon/glyph/lock-filled';
11
+ import LockIcon from '@atlaskit/icon/utility/migration/lock-locked--lock-filled';
12
12
  import { Frame } from '../components/Frame';
13
13
  import { Provider } from '../components/Provider';
14
14
  import { Byline } from '../../common/Byline';
@@ -20,6 +20,10 @@ import { ContentHeader } from '../components/ContentHeader';
20
20
  import { handleClickCommon } from '../utils/handlers';
21
21
  import { Link } from '../components/Link';
22
22
  import { UnresolvedText } from '../components/UnresolvedText';
23
+ import { Flex, xcss } from '@atlaskit/primitives';
24
+ var iconWrapperStyles = xcss({
25
+ marginRight: 'space.050'
26
+ });
23
27
  /**
24
28
  * Class name for selecting non-flexible forbidden block card
25
29
  *
@@ -82,14 +86,16 @@ export var ForbiddenView = function ForbiddenView(_ref) {
82
86
  ,
83
87
  className: blockCardForbiddenViewLinkClassName
84
88
  })), jsx(Byline, null, jsx(UnresolvedText, {
85
- icon:
86
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19497
87
- jsx(LockIcon, {
89
+ icon: jsx(Flex, {
90
+ alignItems: "center",
91
+ xcss: iconWrapperStyles
92
+ }, jsx(LockIcon, {
88
93
  label: "forbidden-lock-icon",
89
- size: "small",
90
- primaryColor: "var(--ds-icon-danger, ".concat(R300, ")"),
91
- testId: "".concat(testId, "-lock-icon")
92
- }),
94
+ LEGACY_size: "small",
95
+ color: "var(--ds-icon-danger, ".concat(R300, ")"),
96
+ testId: "".concat(testId, "-lock-icon"),
97
+ LEGACY_margin: "0 ".concat("var(--ds-space-negative-050, -4px)", " 0 0")
98
+ })),
93
99
  text: jsx(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
94
100
  values: {
95
101
  product: context.text,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, jsx } from '@emotion/react';
7
- import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
7
+ import DocumentFilledIcon from '@atlaskit/icon/core/migration/file--editor-file';
8
8
  import { N50, N90 } from '@atlaskit/theme/colors';
9
9
  import { fontSize } from '@atlaskit/theme/constants';
10
10
  import { Frame } from '../components/Frame';
@@ -39,9 +39,10 @@ export var ResolvingView = function ResolvingView(_ref) {
39
39
  ,
40
40
  className: blockCardResolvingViewClassName
41
41
  }, jsx(DocumentFilledIcon, {
42
- size: "small",
43
- primaryColor: "var(--ds-icon-subtle, ".concat(N50, ")"),
44
- label: "document-icon"
42
+ LEGACY_size: "medium",
43
+ color: "var(--ds-icon-subtle, ".concat(N50, ")"),
44
+ label: "document-icon",
45
+ LEGACY_margin: "0 -4.3px 0 -4px"
45
46
  }), jsx("span", {
46
47
  css: messageStyles
47
48
  }, jsx(FormattedMessage, messages.loading)));
@@ -22,6 +22,7 @@ import { messages } from '../../../../../messages';
22
22
  import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
23
23
  import ActionGroupItem from './action-group-item';
24
24
  import { filterActionItems } from '../utils';
25
+ import { di } from 'react-magnetic-di';
25
26
  var styles = css({
26
27
  display: 'inline-flex',
27
28
  lineHeight: '1rem',
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import Tooltip from '@atlaskit/tooltip';
3
+ import { di } from 'react-magnetic-di';
3
4
  import { FormattedMessage } from 'react-intl-next';
4
5
  import { Box, Inline } from '@atlaskit/primitives';
5
6
  import AIIcon from '../../../../../common/ai-icon';
@@ -14,6 +14,7 @@ import LayeredLink from './layered-link';
14
14
  import HoverCardControl from './hover-card-control';
15
15
  import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
16
16
  import { N40 } from '@atlaskit/theme/colors';
17
+ import { di } from 'react-magnetic-di';
17
18
  var elevationStyles = css({
18
19
  border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")")),
19
20
  borderRadius: "var(--ds-border-radius-200, 8px)",
@@ -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: "29.0.2",
13
+ packageVersion: "29.1.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -31,26 +31,57 @@ export type CardActionOptions = {
31
31
  exclude?: Array<CardAction>;
32
32
  };
33
33
  interface ActionProps {
34
+ /**
35
+ * Configure visibility of actions available.
36
+ * By default, smart links show all actions available on the views.
37
+ * Set `hide` to true to disable all actions.
38
+ * Set `hide` to false and set `exclude` to enable only specific actions.
39
+ */
34
40
  actionOptions?: CardActionOptions;
35
41
  }
36
42
  interface HoverPreviewProps extends ActionProps {
43
+ /**
44
+ * Flag to display hover preview on hover.
45
+ */
37
46
  showHoverPreview?: boolean;
47
+ /**
48
+ * Configuration for hover card.
49
+ */
38
50
  hoverPreviewOptions?: HoverPreviewOptions;
51
+ /**
52
+ * Flag to display unresolved views on hover preview.
53
+ */
39
54
  showAuthTooltip?: boolean;
40
55
  }
41
56
  export interface BaseCardProps {
57
+ /**
58
+ * Define smart card default appearance.
59
+ */
42
60
  appearance: CardAppearance;
61
+ /**
62
+ * The container which `react-lazily-render` listens to for scroll events.
63
+ * This property can be used in a scenario where you want to specify your own scroll container
64
+ * while the Card component is (lazy)loading.
65
+ */
43
66
  container?: HTMLElement;
44
67
  /**
45
- * A component that will be rendered when smart card fails to render
46
- * because of uncaught errors
68
+ * A React component responsible for returning a fallback UI when smart link fails to render because of uncaught errors.
47
69
  */
48
70
  fallbackComponent?: React.ComponentType;
71
+ /**
72
+ * Unique id for smart link used in analytics.
73
+ */
49
74
  id?: string;
75
+ /**
76
+ * Show selected state of smart link.
77
+ */
50
78
  isSelected?: boolean;
79
+ /**
80
+ * A callback function after a link is clicked.
81
+ */
51
82
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
52
83
  /**
53
- * A callback function currently invoked in two cases
84
+ * A callback function currently invoked in two cases:
54
85
  * 1. When the {@link CardState.status} is one of {@link ErrorCardType}. "err" property in argument will be undefined in this case
55
86
  * This does not mean that smart card failed to render.
56
87
  * 2. When there is any unhandled error inside smart card while rendering, resulting in failure to render smart card succesfully.
@@ -60,19 +91,40 @@ export interface BaseCardProps {
60
91
  * If fallbackComponent is not provided, smart card will render null
61
92
  */
62
93
  onError?: OnErrorCallback;
94
+ /**
95
+ * A callback function after the url is resolved into smart card.
96
+ */
63
97
  onResolve?: OnResolveCallback;
98
+ /**
99
+ * String to be displayed while the Card component is (lazy)loading.
100
+ */
64
101
  placeholder?: string;
102
+ /**
103
+ * A `testId` prop is provided for specified elements, which is a unique
104
+ * string that appears as a data attribute `data-testid` in the rendered code,
105
+ * serving as a hook for automated tests.
106
+ */
65
107
  testId?: string;
108
+ /**
109
+ * The url link of the resource to be resolved and shown as Smart Link.
110
+ */
66
111
  url?: string;
67
112
  }
68
113
  export interface InlineProps extends HoverPreviewProps {
114
+ /**
115
+ * By default, inline resolving states show a frame with a spinner on the left.
116
+ * An alternative is to remove the frame and place the spinner on the right by setting this value to `on-right-without-skeleton`.
117
+ * This property is specific to inline links in the editor.
118
+ */
69
119
  inlinePreloaderStyle?: InlinePreloaderStyle;
70
- /** A flag that determines whether a card is in a hover state in edit mode. Currently used for inline links only */
120
+ /**
121
+ * A flag that determines whether a card is in a hover state. Currently used for inline links in editor only.
122
+ */
71
123
  isHovered?: boolean;
72
124
  /**
73
125
  * When set to true, the text fragment will be removed from the title.
74
126
  * This will have no impact on the url and text highlighting will still persist in the url,
75
- * however the the text fragment will be stripped from the title of the smart card.
127
+ * however the text fragment will be stripped from the title of the smart card.
76
128
  * For example, when set to true: "my name | :~:text=highlight this" will be displayed as "my name"
77
129
  */
78
130
  removeTextHighlightingFromTitle?: boolean;
@@ -80,27 +132,49 @@ export interface InlineProps extends HoverPreviewProps {
80
132
  * When defined, this placeholder will be displayed while the smart card is resolving. This is only useful for inline cards.
81
133
  */
82
134
  resolvingPlaceholder?: string;
83
- /** When set to true, inline cards will be truncated to one line. */
135
+ /**
136
+ * When set to true, inline cards will be truncated to one line
137
+ */
84
138
  truncateInline?: boolean;
85
139
  }
86
140
  export interface BlockProps extends ActionProps {
87
141
  /**
88
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
89
142
  * When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
90
143
  * Usage is strongly discouraged. This should only be used if there is a specific reason you're
91
144
  * unable to use the new flexible block cards.
145
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
92
146
  */
93
147
  useLegacyBlockCard?: boolean;
94
148
  }
95
149
  export interface EmbedProps {
150
+ /**
151
+ * React referenced value on embed iframe.
152
+ */
96
153
  embedIframeRef?: React.Ref<HTMLIFrameElement>;
154
+ /**
155
+ * Type of URL used with embed iframe. By default, the embed use `data.preview.href` from link response.
156
+ * `interactiveHref` is suitable for displaying iframe content that contains "more editable" version of
157
+ * the link, e.g. includes toolbar.
158
+ * It is only available on supported link response with `data.preview.interactiveHref`.
159
+ */
97
160
  embedIframeUrlType?: EmbedIframeUrlType;
98
- /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
161
+ /**
162
+ * A prop that determines the style of a frame:
163
+ * whether to show it, hide it or only show it when a user hovers over embed.
164
+ */
99
165
  frameStyle?: FrameStyle;
100
- /** This props determines if dimensions of an embed card are to be inherited from the parent.
101
- * The parent container needs to override a style '.loader-wrapper' and set the desirable height there. (for instance, 'height: 100%')
166
+ /**
167
+ * Determines whether width and height of an embed card are to be inherited from the parent.
168
+ * If `true`, embed iframe will remove restrictions on iframe aspect ratio, height and width.
169
+ * The parent container needs to override a style `.loader-wrapper` and set the desirable height there.
170
+ * (For instance, 'height: 100%')
102
171
  */
103
172
  inheritDimensions?: boolean;
173
+ /**
174
+ * Informs Smart Link of the device it is rendered in. Available values are `web` and `mobile`.
175
+ * It is used together with link response `data.preview["atlassian:supportedPlatforms"]`.
176
+ * To make embed content available on all supported urls, use `web`.
177
+ */
104
178
  platform?: CardPlatform;
105
179
  }
106
180
  export interface FlexibleProps extends ActionProps, HoverPreviewProps {
@@ -31,26 +31,57 @@ export type CardActionOptions = {
31
31
  exclude?: Array<CardAction>;
32
32
  };
33
33
  interface ActionProps {
34
+ /**
35
+ * Configure visibility of actions available.
36
+ * By default, smart links show all actions available on the views.
37
+ * Set `hide` to true to disable all actions.
38
+ * Set `hide` to false and set `exclude` to enable only specific actions.
39
+ */
34
40
  actionOptions?: CardActionOptions;
35
41
  }
36
42
  interface HoverPreviewProps extends ActionProps {
43
+ /**
44
+ * Flag to display hover preview on hover.
45
+ */
37
46
  showHoverPreview?: boolean;
47
+ /**
48
+ * Configuration for hover card.
49
+ */
38
50
  hoverPreviewOptions?: HoverPreviewOptions;
51
+ /**
52
+ * Flag to display unresolved views on hover preview.
53
+ */
39
54
  showAuthTooltip?: boolean;
40
55
  }
41
56
  export interface BaseCardProps {
57
+ /**
58
+ * Define smart card default appearance.
59
+ */
42
60
  appearance: CardAppearance;
61
+ /**
62
+ * The container which `react-lazily-render` listens to for scroll events.
63
+ * This property can be used in a scenario where you want to specify your own scroll container
64
+ * while the Card component is (lazy)loading.
65
+ */
43
66
  container?: HTMLElement;
44
67
  /**
45
- * A component that will be rendered when smart card fails to render
46
- * because of uncaught errors
68
+ * A React component responsible for returning a fallback UI when smart link fails to render because of uncaught errors.
47
69
  */
48
70
  fallbackComponent?: React.ComponentType;
71
+ /**
72
+ * Unique id for smart link used in analytics.
73
+ */
49
74
  id?: string;
75
+ /**
76
+ * Show selected state of smart link.
77
+ */
50
78
  isSelected?: boolean;
79
+ /**
80
+ * A callback function after a link is clicked.
81
+ */
51
82
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
52
83
  /**
53
- * A callback function currently invoked in two cases
84
+ * A callback function currently invoked in two cases:
54
85
  * 1. When the {@link CardState.status} is one of {@link ErrorCardType}. "err" property in argument will be undefined in this case
55
86
  * This does not mean that smart card failed to render.
56
87
  * 2. When there is any unhandled error inside smart card while rendering, resulting in failure to render smart card succesfully.
@@ -60,19 +91,40 @@ export interface BaseCardProps {
60
91
  * If fallbackComponent is not provided, smart card will render null
61
92
  */
62
93
  onError?: OnErrorCallback;
94
+ /**
95
+ * A callback function after the url is resolved into smart card.
96
+ */
63
97
  onResolve?: OnResolveCallback;
98
+ /**
99
+ * String to be displayed while the Card component is (lazy)loading.
100
+ */
64
101
  placeholder?: string;
102
+ /**
103
+ * A `testId` prop is provided for specified elements, which is a unique
104
+ * string that appears as a data attribute `data-testid` in the rendered code,
105
+ * serving as a hook for automated tests.
106
+ */
65
107
  testId?: string;
108
+ /**
109
+ * The url link of the resource to be resolved and shown as Smart Link.
110
+ */
66
111
  url?: string;
67
112
  }
68
113
  export interface InlineProps extends HoverPreviewProps {
114
+ /**
115
+ * By default, inline resolving states show a frame with a spinner on the left.
116
+ * An alternative is to remove the frame and place the spinner on the right by setting this value to `on-right-without-skeleton`.
117
+ * This property is specific to inline links in the editor.
118
+ */
69
119
  inlinePreloaderStyle?: InlinePreloaderStyle;
70
- /** A flag that determines whether a card is in a hover state in edit mode. Currently used for inline links only */
120
+ /**
121
+ * A flag that determines whether a card is in a hover state. Currently used for inline links in editor only.
122
+ */
71
123
  isHovered?: boolean;
72
124
  /**
73
125
  * When set to true, the text fragment will be removed from the title.
74
126
  * This will have no impact on the url and text highlighting will still persist in the url,
75
- * however the the text fragment will be stripped from the title of the smart card.
127
+ * however the text fragment will be stripped from the title of the smart card.
76
128
  * For example, when set to true: "my name | :~:text=highlight this" will be displayed as "my name"
77
129
  */
78
130
  removeTextHighlightingFromTitle?: boolean;
@@ -80,27 +132,49 @@ export interface InlineProps extends HoverPreviewProps {
80
132
  * When defined, this placeholder will be displayed while the smart card is resolving. This is only useful for inline cards.
81
133
  */
82
134
  resolvingPlaceholder?: string;
83
- /** When set to true, inline cards will be truncated to one line. */
135
+ /**
136
+ * When set to true, inline cards will be truncated to one line
137
+ */
84
138
  truncateInline?: boolean;
85
139
  }
86
140
  export interface BlockProps extends ActionProps {
87
141
  /**
88
- * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
89
142
  * When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
90
143
  * Usage is strongly discouraged. This should only be used if there is a specific reason you're
91
144
  * unable to use the new flexible block cards.
145
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
92
146
  */
93
147
  useLegacyBlockCard?: boolean;
94
148
  }
95
149
  export interface EmbedProps {
150
+ /**
151
+ * React referenced value on embed iframe.
152
+ */
96
153
  embedIframeRef?: React.Ref<HTMLIFrameElement>;
154
+ /**
155
+ * Type of URL used with embed iframe. By default, the embed use `data.preview.href` from link response.
156
+ * `interactiveHref` is suitable for displaying iframe content that contains "more editable" version of
157
+ * the link, e.g. includes toolbar.
158
+ * It is only available on supported link response with `data.preview.interactiveHref`.
159
+ */
97
160
  embedIframeUrlType?: EmbedIframeUrlType;
98
- /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
161
+ /**
162
+ * A prop that determines the style of a frame:
163
+ * whether to show it, hide it or only show it when a user hovers over embed.
164
+ */
99
165
  frameStyle?: FrameStyle;
100
- /** This props determines if dimensions of an embed card are to be inherited from the parent.
101
- * The parent container needs to override a style '.loader-wrapper' and set the desirable height there. (for instance, 'height: 100%')
166
+ /**
167
+ * Determines whether width and height of an embed card are to be inherited from the parent.
168
+ * If `true`, embed iframe will remove restrictions on iframe aspect ratio, height and width.
169
+ * The parent container needs to override a style `.loader-wrapper` and set the desirable height there.
170
+ * (For instance, 'height: 100%')
102
171
  */
103
172
  inheritDimensions?: boolean;
173
+ /**
174
+ * Informs Smart Link of the device it is rendered in. Available values are `web` and `mobile`.
175
+ * It is used together with link response `data.preview["atlassian:supportedPlatforms"]`.
176
+ * To make embed content available on all supported urls, use `web`.
177
+ */
104
178
  platform?: CardPlatform;
105
179
  }
106
180
  export interface FlexibleProps extends ActionProps, HoverPreviewProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "29.0.2",
3
+ "version": "29.1.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,11 +32,11 @@
32
32
  "@atlaskit/badge": "^16.4.0",
33
33
  "@atlaskit/button": "^20.2.0",
34
34
  "@atlaskit/checkbox": "^14.0.0",
35
- "@atlaskit/dropdown-menu": "^12.18.0",
35
+ "@atlaskit/dropdown-menu": "^12.19.0",
36
36
  "@atlaskit/form": "^10.5.0",
37
37
  "@atlaskit/frontend-utilities": "^2.7.0",
38
38
  "@atlaskit/heading": "^2.4.0",
39
- "@atlaskit/icon": "^22.20.0",
39
+ "@atlaskit/icon": "^22.22.0",
40
40
  "@atlaskit/icon-file-type": "^6.5.0",
41
41
  "@atlaskit/icon-object": "^6.5.0",
42
42
  "@atlaskit/icon-priority": "^6.3.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/popup": "^1.28.0",
55
55
  "@atlaskit/primitives": "^12.2.0",
56
56
  "@atlaskit/section-message": "^6.6.0",
57
- "@atlaskit/select": "^17.19.0",
57
+ "@atlaskit/select": "^18.0.0",
58
58
  "@atlaskit/spinner": "^16.3.0",
59
59
  "@atlaskit/textarea": "^5.6.0",
60
60
  "@atlaskit/textfield": "^6.5.0",
@@ -89,6 +89,7 @@
89
89
  "@af/visual-regression": "*",
90
90
  "@atlaskit/analytics-listeners": "^8.11.0",
91
91
  "@atlaskit/css-reset": "^6.11.0",
92
+ "@atlaskit/link": "^1.2.1",
92
93
  "@atlaskit/link-test-helpers": "^7.5.0",
93
94
  "@atlaskit/media-test-helpers": "^34.4.0",
94
95
  "@atlaskit/ssr": "*",