@atlaskit/smart-card 43.7.1 → 43.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a117d28802895`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a117d28802895) -
8
+ [ux] If icon prop is provided it will be used while the card is resolving and hideIcon is false
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 43.7.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`47806d831b118`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/47806d831b118) -
19
+ NAVX-2338 cleaning up navx-1910-fix-hovercard-performance-metrics
20
+
3
21
  ## 43.7.1
4
22
 
5
23
  ### Patch Changes
@@ -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: "0.0.0-development"
14
+ packageVersion: "43.7.2"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -8,11 +8,13 @@ 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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _constants = require("../../../../../../constants");
12
13
  var _loadingSkeleton = require("../../../common/loading-skeleton");
14
+ var _elements = require("../../../elements");
13
15
  var _utils = require("../../../utils");
14
16
  var _block = _interopRequireDefault(require("../../block"));
15
- var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
17
+ var _excluded = ["actionGroup", "icon", "position", "testId", "title", "hideIcon"];
16
18
  /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
17
19
  /**
18
20
  * This represents a TitleBlock for a Smart Link that is currently waiting
@@ -22,6 +24,8 @@ var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
22
24
  */
23
25
  var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
24
26
  var actionGroup = _ref.actionGroup,
27
+ icon = _ref.icon,
28
+ position = _ref.position,
25
29
  testId = _ref.testId,
26
30
  title = _ref.title,
27
31
  hideIcon = _ref.hideIcon,
@@ -31,7 +35,12 @@ var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
31
35
  var iconWidth = (0, _utils.getIconWidth)(size);
32
36
  return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
33
37
  testId: "".concat(testId, "-resolving-view")
34
- }), !hideIcon && /*#__PURE__*/_react.default.createElement("span", {
38
+ }), !hideIcon && icon && (0, _platformFeatureFlags.fg)('platform_initial_icon_for_title_block') && /*#__PURE__*/_react.default.createElement(_elements.LinkIcon, {
39
+ overrideIcon: icon,
40
+ position: position,
41
+ size: size,
42
+ hideLoadingSkeleton: true
43
+ }), !hideIcon && (!icon || !(0, _platformFeatureFlags.fg)('platform_initial_icon_for_title_block')) && /*#__PURE__*/_react.default.createElement("span", {
35
44
  style: {
36
45
  width: iconWidth,
37
46
  height: iconWidth
@@ -9,7 +9,6 @@ exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _extractPreview = require("../../../extractors/flexible/extract-preview");
14
13
  var _blocks = require("../../FlexibleCard/components/blocks");
15
14
  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); }
@@ -34,12 +33,10 @@ var ImagePreview = function ImagePreview(_ref) {
34
33
  if (previewBlockRef.current) {
35
34
  var _previewBlockRef$curr;
36
35
  var previewHeight = (_previewBlockRef$curr = previewBlockRef.current) === null || _previewBlockRef$curr === void 0 ? void 0 : _previewBlockRef$curr.getBoundingClientRect().height;
37
- setDynamicStyles(_objectSpread(_objectSpread({
36
+ setDynamicStyles(_objectSpread({
38
37
  borderTopLeftRadius: "var(--ds-radius-large, 8px)",
39
38
  borderTopRightRadius: "var(--ds-radius-large, 8px)"
40
- }, (0, _platformFeatureFlags.fg)('navx-1910-fix-hovercard-performance-metrics') ? {} : {
41
- marginBottom: "var(--ds-space-100, 8px)"
42
- }), previewHeight ? {
39
+ }, previewHeight ? {
43
40
  height: "".concat(previewHeight, "px")
44
41
  } : {}));
45
42
  }
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "0.0.0-development",
25
+ packageVersion: "43.7.2",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -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: "0.0.0-development"
5
+ packageVersion: "43.7.2"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,8 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
3
3
  import React from 'react';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { SmartLinkSize } from '../../../../../../constants';
5
6
  import { LoadingSkeleton } from '../../../common/loading-skeleton';
7
+ import { LinkIcon } from '../../../elements';
6
8
  import { getIconWidth } from '../../../utils';
7
9
  import Block from '../../block';
8
10
  /**
@@ -13,6 +15,8 @@ import Block from '../../block';
13
15
  */
14
16
  const TitleBlockResolvingView = ({
15
17
  actionGroup,
18
+ icon,
19
+ position,
16
20
  testId,
17
21
  title,
18
22
  hideIcon,
@@ -24,7 +28,12 @@ const TitleBlockResolvingView = ({
24
28
  const iconWidth = getIconWidth(size);
25
29
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
26
30
  testId: `${testId}-resolving-view`
27
- }), !hideIcon && /*#__PURE__*/React.createElement("span", {
31
+ }), !hideIcon && icon && fg('platform_initial_icon_for_title_block') && /*#__PURE__*/React.createElement(LinkIcon, {
32
+ overrideIcon: icon,
33
+ position: position,
34
+ size: size,
35
+ hideLoadingSkeleton: true
36
+ }), !hideIcon && (!icon || !fg('platform_initial_icon_for_title_block')) && /*#__PURE__*/React.createElement("span", {
28
37
  style: {
29
38
  width: iconWidth,
30
39
  height: iconWidth
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback, useRef, useState } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { extractSmartLinkPreviewImage } from '../../../extractors/flexible/extract-preview';
4
3
  import { PreviewBlock } from '../../FlexibleCard/components/blocks';
5
4
  const ImagePreview = ({
@@ -19,9 +18,6 @@ const ImagePreview = ({
19
18
  setDynamicStyles({
20
19
  borderTopLeftRadius: "var(--ds-radius-large, 8px)",
21
20
  borderTopRightRadius: "var(--ds-radius-large, 8px)",
22
- ...(fg('navx-1910-fix-hovercard-performance-metrics') ? {} : {
23
- marginBottom: "var(--ds-space-100, 8px)"
24
- }),
25
21
  ...(previewHeight ? {
26
22
  height: `${previewHeight}px`
27
23
  } : {})
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "0.0.0-development",
15
+ packageVersion: "43.7.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -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: "0.0.0-development"
7
+ packageVersion: "43.7.2"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,10 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
3
+ var _excluded = ["actionGroup", "icon", "position", "testId", "title", "hideIcon"];
4
4
  /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
5
5
  import React from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { SmartLinkSize } from '../../../../../../constants';
7
8
  import { LoadingSkeleton } from '../../../common/loading-skeleton';
9
+ import { LinkIcon } from '../../../elements';
8
10
  import { getIconWidth } from '../../../utils';
9
11
  import Block from '../../block';
10
12
  /**
@@ -15,6 +17,8 @@ import Block from '../../block';
15
17
  */
16
18
  var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
17
19
  var actionGroup = _ref.actionGroup,
20
+ icon = _ref.icon,
21
+ position = _ref.position,
18
22
  testId = _ref.testId,
19
23
  title = _ref.title,
20
24
  hideIcon = _ref.hideIcon,
@@ -24,7 +28,12 @@ var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
24
28
  var iconWidth = getIconWidth(size);
25
29
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
26
30
  testId: "".concat(testId, "-resolving-view")
27
- }), !hideIcon && /*#__PURE__*/React.createElement("span", {
31
+ }), !hideIcon && icon && fg('platform_initial_icon_for_title_block') && /*#__PURE__*/React.createElement(LinkIcon, {
32
+ overrideIcon: icon,
33
+ position: position,
34
+ size: size,
35
+ hideLoadingSkeleton: true
36
+ }), !hideIcon && (!icon || !fg('platform_initial_icon_for_title_block')) && /*#__PURE__*/React.createElement("span", {
28
37
  style: {
29
38
  width: iconWidth,
30
39
  height: iconWidth
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  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; }
4
4
  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) { _defineProperty(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; }
5
5
  import React, { useCallback, useRef, useState } from 'react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { extractSmartLinkPreviewImage } from '../../../extractors/flexible/extract-preview';
8
7
  import { PreviewBlock } from '../../FlexibleCard/components/blocks';
9
8
  var ImagePreview = function ImagePreview(_ref) {
@@ -25,12 +24,10 @@ var ImagePreview = function ImagePreview(_ref) {
25
24
  if (previewBlockRef.current) {
26
25
  var _previewBlockRef$curr;
27
26
  var previewHeight = (_previewBlockRef$curr = previewBlockRef.current) === null || _previewBlockRef$curr === void 0 ? void 0 : _previewBlockRef$curr.getBoundingClientRect().height;
28
- setDynamicStyles(_objectSpread(_objectSpread({
27
+ setDynamicStyles(_objectSpread({
29
28
  borderTopLeftRadius: "var(--ds-radius-large, 8px)",
30
29
  borderTopRightRadius: "var(--ds-radius-large, 8px)"
31
- }, fg('navx-1910-fix-hovercard-performance-metrics') ? {} : {
32
- marginBottom: "var(--ds-space-100, 8px)"
33
- }), previewHeight ? {
30
+ }, previewHeight ? {
34
31
  height: "".concat(previewHeight, "px")
35
32
  } : {}));
36
33
  }
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "0.0.0-development",
18
+ packageVersion: "43.7.2",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -6,5 +6,5 @@ import { type TitleBlockViewProps } from '../types';
6
6
  * This should render when a Smart Link has sent a request.
7
7
  * @see TitleBlock
8
8
  */
9
- declare const TitleBlockResolvingView: ({ actionGroup, testId, title, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
9
+ declare const TitleBlockResolvingView: ({ actionGroup, icon, position, testId, title, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
10
  export default TitleBlockResolvingView;
@@ -6,5 +6,5 @@ import { type TitleBlockViewProps } from '../types';
6
6
  * This should render when a Smart Link has sent a request.
7
7
  * @see TitleBlock
8
8
  */
9
- declare const TitleBlockResolvingView: ({ actionGroup, testId, title, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
9
+ declare const TitleBlockResolvingView: ({ actionGroup, icon, position, testId, title, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
10
  export default TitleBlockResolvingView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.7.1",
3
+ "version": "43.8.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -70,9 +70,9 @@
70
70
  "@atlaskit/textarea": "^8.1.0",
71
71
  "@atlaskit/textfield": "^8.1.0",
72
72
  "@atlaskit/theme": "^21.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^13.38.0",
73
+ "@atlaskit/tmp-editor-statsig": "^13.39.0",
74
74
  "@atlaskit/tokens": "^8.0.0",
75
- "@atlaskit/tooltip": "^20.9.0",
75
+ "@atlaskit/tooltip": "^20.10.0",
76
76
  "@atlaskit/ufo": "^0.4.0",
77
77
  "@babel/runtime": "^7.0.0",
78
78
  "@compiled/react": "^0.18.6",
@@ -100,11 +100,11 @@
100
100
  "@atlaskit/analytics-listeners": "^9.1.0",
101
101
  "@atlaskit/css-reset": "^7.3.0",
102
102
  "@atlaskit/media-test-helpers": "^39.0.0",
103
- "@atlaskit/react-ufo": "^4.14.0",
103
+ "@atlaskit/react-ufo": "^4.15.0",
104
104
  "@atlaskit/ssr": "workspace:^",
105
105
  "@atlassian/analytics-tooling": "workspace:^",
106
106
  "@atlassian/feature-flags-test-utils": "^1.0.0",
107
- "@atlassian/gemini": "^1.20.0",
107
+ "@atlassian/gemini": "^1.21.0",
108
108
  "@testing-library/dom": "^10.1.0",
109
109
  "@testing-library/jest-dom": "^6.4.5",
110
110
  "@testing-library/react": "^13.4.0",
@@ -220,6 +220,9 @@
220
220
  "platform_initial_data_for_smart_cards": {
221
221
  "type": "boolean"
222
222
  },
223
+ "platform_initial_icon_for_title_block": {
224
+ "type": "boolean"
225
+ },
223
226
  "jfp-magma-platform-lozenge-jump-fix": {
224
227
  "type": "boolean"
225
228
  },
@@ -232,9 +235,6 @@
232
235
  "navx-2479-sl-fix-inilne-card-show-connect-button": {
233
236
  "type": "boolean"
234
237
  },
235
- "navx-1910-fix-hovercard-performance-metrics": {
236
- "type": "boolean"
237
- },
238
238
  "platform-linking-smart-card-layered-link-a11y": {
239
239
  "type": "boolean"
240
240
  },