@atlaskit/smart-card 30.2.1 → 30.2.3

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,21 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 30.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#163278](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163278)
8
+ [`fbaa7de32c0b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fbaa7de32c0b2) -
9
+ Update FlexibleCard block prop children types
10
+
11
+ ## 30.2.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#162750](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/162750)
16
+ [`37259b34967fa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37259b34967fa) -
17
+ Updated metadata structure for Jira plans smart links block view
18
+
3
19
  ## 30.2.1
4
20
 
5
21
  ### Patch Changes
@@ -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: "30.2.1"
25
+ packageVersion: "30.2.3"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.titleBlockOptions = exports.getSimulatedBetterMetadata = exports.PreviewBlockOptions = exports.FooterBlockOptions = exports.FlexibleCardUiOptions = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
8
  var _constants = require("../../../../../constants");
8
9
  var _utils = require("../../../../../extractors/flexible/utils");
9
10
  var _helpers = require("../../../../../state/helpers");
@@ -35,7 +36,7 @@ var baseBottomMetaData = [{
35
36
  name: _constants.ElementName.ChecklistProgress
36
37
  }];
37
38
  var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails) {
38
- var _getExtensionKey, _data$Type$includes, _data$Type;
39
+ var _getExtensionKey, _data$Type$includes, _data$Type, _data$atlassianOwned;
39
40
  var extensionKey = (_getExtensionKey = (0, _helpers.getExtensionKey)(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
40
41
  var data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
41
42
  var defaultTitleMetadata = [{
@@ -74,21 +75,32 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
74
75
  };
75
76
  case 'jira-object-provider':
76
77
  var isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
77
- return {
78
- titleMetadata: defaultTitleMetadata,
79
- topMetadata: isJiraTask ? [{
78
+ var isJiraPlan = (_data$atlassianOwned = !!data['atlassian:ownedBy']) !== null && _data$atlassianOwned !== void 0 ? _data$atlassianOwned : false;
79
+ var topMetadata = [{
80
+ name: _constants.ElementName.AuthorGroup
81
+ }, {
82
+ name: _constants.ElementName.CreatedBy
83
+ }, {
84
+ name: _constants.ElementName.ModifiedOn
85
+ }];
86
+ if (isJiraTask) {
87
+ topMetadata = [{
80
88
  name: _constants.ElementName.AssignedToGroup
81
89
  }, {
82
90
  name: _constants.ElementName.AssignedTo
83
91
  }, {
84
92
  name: _constants.ElementName.ModifiedOn
85
- }] : [{
86
- name: _constants.ElementName.AuthorGroup
87
- }, {
88
- name: _constants.ElementName.CreatedBy
93
+ }];
94
+ } else if (isJiraPlan && (0, _platformFeatureFlags.fg)('smart_links_for_plans')) {
95
+ topMetadata = [{
96
+ name: _constants.ElementName.OwnedByGroup
89
97
  }, {
90
- name: _constants.ElementName.ModifiedOn
91
- }],
98
+ name: _constants.ElementName.OwnedBy
99
+ }];
100
+ }
101
+ return {
102
+ titleMetadata: defaultTitleMetadata,
103
+ topMetadata: topMetadata,
92
104
  bottomMetadata: [{
93
105
  name: _constants.ElementName.StoryPoints
94
106
  }, {
@@ -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: "30.2.1",
20
+ packageVersion: "30.2.3",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -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: "30.2.1"
7
+ packageVersion: "30.2.3"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
2
3
  import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
3
4
  import { getExtensionKey } from '../../../../../state/helpers';
@@ -29,7 +30,7 @@ const baseBottomMetaData = [{
29
30
  name: ElementName.ChecklistProgress
30
31
  }];
31
32
  export const getSimulatedBetterMetadata = cardDetails => {
32
- var _getExtensionKey, _data$Type$includes, _data$Type;
33
+ var _getExtensionKey, _data$Type$includes, _data$Type, _data$atlassianOwned;
33
34
  const extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
34
35
  const data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
35
36
  const defaultTitleMetadata = [{
@@ -68,21 +69,32 @@ export const getSimulatedBetterMetadata = cardDetails => {
68
69
  };
69
70
  case 'jira-object-provider':
70
71
  const isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
71
- return {
72
- titleMetadata: defaultTitleMetadata,
73
- topMetadata: isJiraTask ? [{
72
+ const isJiraPlan = (_data$atlassianOwned = !!data['atlassian:ownedBy']) !== null && _data$atlassianOwned !== void 0 ? _data$atlassianOwned : false;
73
+ let topMetadata = [{
74
+ name: ElementName.AuthorGroup
75
+ }, {
76
+ name: ElementName.CreatedBy
77
+ }, {
78
+ name: ElementName.ModifiedOn
79
+ }];
80
+ if (isJiraTask) {
81
+ topMetadata = [{
74
82
  name: ElementName.AssignedToGroup
75
83
  }, {
76
84
  name: ElementName.AssignedTo
77
85
  }, {
78
86
  name: ElementName.ModifiedOn
79
- }] : [{
80
- name: ElementName.AuthorGroup
81
- }, {
82
- name: ElementName.CreatedBy
87
+ }];
88
+ } else if (isJiraPlan && fg('smart_links_for_plans')) {
89
+ topMetadata = [{
90
+ name: ElementName.OwnedByGroup
83
91
  }, {
84
- name: ElementName.ModifiedOn
85
- }],
92
+ name: ElementName.OwnedBy
93
+ }];
94
+ }
95
+ return {
96
+ titleMetadata: defaultTitleMetadata,
97
+ topMetadata,
86
98
  bottomMetadata: [{
87
99
  name: ElementName.StoryPoints
88
100
  }, {
@@ -7,7 +7,7 @@ import LinkWarningModal from './LinkWarningModal';
7
7
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "30.2.1",
10
+ packageVersion: "30.2.3",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -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: "30.2.1"
18
+ packageVersion: "30.2.3"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
2
3
  import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
3
4
  import { getExtensionKey } from '../../../../../state/helpers';
@@ -29,7 +30,7 @@ var baseBottomMetaData = [{
29
30
  name: ElementName.ChecklistProgress
30
31
  }];
31
32
  export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails) {
32
- var _getExtensionKey, _data$Type$includes, _data$Type;
33
+ var _getExtensionKey, _data$Type$includes, _data$Type, _data$atlassianOwned;
33
34
  var extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
34
35
  var data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
35
36
  var defaultTitleMetadata = [{
@@ -68,21 +69,32 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
68
69
  };
69
70
  case 'jira-object-provider':
70
71
  var isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
71
- return {
72
- titleMetadata: defaultTitleMetadata,
73
- topMetadata: isJiraTask ? [{
72
+ var isJiraPlan = (_data$atlassianOwned = !!data['atlassian:ownedBy']) !== null && _data$atlassianOwned !== void 0 ? _data$atlassianOwned : false;
73
+ var topMetadata = [{
74
+ name: ElementName.AuthorGroup
75
+ }, {
76
+ name: ElementName.CreatedBy
77
+ }, {
78
+ name: ElementName.ModifiedOn
79
+ }];
80
+ if (isJiraTask) {
81
+ topMetadata = [{
74
82
  name: ElementName.AssignedToGroup
75
83
  }, {
76
84
  name: ElementName.AssignedTo
77
85
  }, {
78
86
  name: ElementName.ModifiedOn
79
- }] : [{
80
- name: ElementName.AuthorGroup
81
- }, {
82
- name: ElementName.CreatedBy
87
+ }];
88
+ } else if (isJiraPlan && fg('smart_links_for_plans')) {
89
+ topMetadata = [{
90
+ name: ElementName.OwnedByGroup
83
91
  }, {
84
- name: ElementName.ModifiedOn
85
- }],
92
+ name: ElementName.OwnedBy
93
+ }];
94
+ }
95
+ return {
96
+ titleMetadata: defaultTitleMetadata,
97
+ topMetadata: topMetadata,
86
98
  bottomMetadata: [{
87
99
  name: ElementName.StoryPoints
88
100
  }, {
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "30.2.1",
13
+ packageVersion: "30.2.3",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1,16 +1,5 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type BlockProps } from '../../types';
3
- export declare const RelatedUrlsBlockResolvingView: ({ testId, ...blockProps }: {
4
- direction?: import("../../../../../..").SmartLinkDirection | undefined;
5
- overrideCss?: import("@emotion/serialize").SerializedStyles | undefined;
6
- size?: import("../../../../../..").SmartLinkSize | undefined;
7
- status?: import("../../../../../../constants").SmartLinkStatus | undefined;
8
- testId?: string | undefined;
9
- blockRef?: React.Ref<HTMLDivElement> | undefined;
10
- onRender?: (() => void) | undefined;
11
- onTransitionEnd?: (() => void) | undefined;
12
- } & {
13
- children?: React.ReactNode;
14
- } & {
3
+ export declare const RelatedUrlsBlockResolvingView: ({ testId, ...blockProps }: BlockProps & {
15
4
  testId?: string | undefined;
16
5
  }) => JSX.Element;
@@ -1,16 +1,22 @@
1
- import { type PropsWithChildren, type Ref } from 'react';
1
+ import { type ReactNode, type Ref } from 'react';
2
2
  import { type SerializedStyles } from '@emotion/react';
3
3
  import { type ActionName, type ElementName, type SmartLinkDirection, type SmartLinkSize, type SmartLinkStatus } from '../../../../constants';
4
4
  import { type ActionProps } from '../actions/action/types';
5
- export type BlockProps = PropsWithChildren<{
5
+ export type BlockProps = {
6
6
  /**
7
- * The direction that the block should arrange it's elements. Can be vertical
7
+ * React children
8
+ */
9
+ children?: ReactNode | undefined;
10
+ /**
11
+ * The direction that the block should arrange its elements. Can be vertical
8
12
  * or horizontal. Default is horizontal.
9
13
  * @internal
10
14
  */
11
15
  direction?: SmartLinkDirection;
12
16
  /**
13
17
  * Any additional CSS properties to apply to the block.
18
+ * The use of this prop is **strongly** discouraged.
19
+ * `@emotion/react` will be replaced with compiled.
14
20
  */
15
21
  overrideCss?: SerializedStyles;
16
22
  /**
@@ -44,7 +50,7 @@ export type BlockProps = PropsWithChildren<{
44
50
  * @internal
45
51
  */
46
52
  onTransitionEnd?: () => void;
47
- }>;
53
+ };
48
54
  /**
49
55
  * Used to represent a metadata element to be rendered.
50
56
  */
@@ -1,16 +1,5 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type BlockProps } from '../../types';
3
- export declare const RelatedUrlsBlockResolvingView: ({ testId, ...blockProps }: {
4
- direction?: import("../../../../../..").SmartLinkDirection | undefined;
5
- overrideCss?: import("@emotion/serialize").SerializedStyles | undefined;
6
- size?: import("../../../../../..").SmartLinkSize | undefined;
7
- status?: import("../../../../../../constants").SmartLinkStatus | undefined;
8
- testId?: string | undefined;
9
- blockRef?: React.Ref<HTMLDivElement> | undefined;
10
- onRender?: (() => void) | undefined;
11
- onTransitionEnd?: (() => void) | undefined;
12
- } & {
13
- children?: React.ReactNode;
14
- } & {
3
+ export declare const RelatedUrlsBlockResolvingView: ({ testId, ...blockProps }: BlockProps & {
15
4
  testId?: string | undefined;
16
5
  }) => JSX.Element;
@@ -1,16 +1,22 @@
1
- import { type PropsWithChildren, type Ref } from 'react';
1
+ import { type ReactNode, type Ref } from 'react';
2
2
  import { type SerializedStyles } from '@emotion/react';
3
3
  import { type ActionName, type ElementName, type SmartLinkDirection, type SmartLinkSize, type SmartLinkStatus } from '../../../../constants';
4
4
  import { type ActionProps } from '../actions/action/types';
5
- export type BlockProps = PropsWithChildren<{
5
+ export type BlockProps = {
6
6
  /**
7
- * The direction that the block should arrange it's elements. Can be vertical
7
+ * React children
8
+ */
9
+ children?: ReactNode | undefined;
10
+ /**
11
+ * The direction that the block should arrange its elements. Can be vertical
8
12
  * or horizontal. Default is horizontal.
9
13
  * @internal
10
14
  */
11
15
  direction?: SmartLinkDirection;
12
16
  /**
13
17
  * Any additional CSS properties to apply to the block.
18
+ * The use of this prop is **strongly** discouraged.
19
+ * `@emotion/react` will be replaced with compiled.
14
20
  */
15
21
  overrideCss?: SerializedStyles;
16
22
  /**
@@ -44,7 +50,7 @@ export type BlockProps = PropsWithChildren<{
44
50
  * @internal
45
51
  */
46
52
  onTransitionEnd?: () => void;
47
- }>;
53
+ };
48
54
  /**
49
55
  * Used to represent a metadata element to be rendered.
50
56
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "30.2.1",
3
+ "version": "30.2.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/link-client-extension": "^2.4.0",
45
45
  "@atlaskit/link-extractors": "^1.9.0",
46
46
  "@atlaskit/linking-common": "^6.0.0",
47
- "@atlaskit/linking-types": "^9.4.0",
47
+ "@atlaskit/linking-types": "^9.5.0",
48
48
  "@atlaskit/logo": "^14.3.0",
49
49
  "@atlaskit/lozenge": "^11.12.0",
50
50
  "@atlaskit/menu": "^2.13.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
53
53
  "@atlaskit/platform-feature-flags": "^0.3.0",
54
54
  "@atlaskit/popup": "^1.29.0",
55
- "@atlaskit/primitives": "^13.0.0",
55
+ "@atlaskit/primitives": "^13.1.0",
56
56
  "@atlaskit/section-message": "^6.6.0",
57
57
  "@atlaskit/select": "^18.5.0",
58
58
  "@atlaskit/spinner": "^16.3.0",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/textfield": "^6.5.0",
61
61
  "@atlaskit/theme": "^14.0.0",
62
62
  "@atlaskit/tokens": "^2.2.0",
63
- "@atlaskit/tooltip": "^18.8.0",
63
+ "@atlaskit/tooltip": "^18.9.0",
64
64
  "@atlaskit/ufo": "^0.3.0",
65
65
  "@babel/runtime": "^7.0.0",
66
66
  "@emotion/react": "^11.7.1",
@@ -91,7 +91,7 @@
91
91
  "@atlaskit/css-reset": "^6.11.0",
92
92
  "@atlaskit/link": "^1.2.1",
93
93
  "@atlaskit/link-test-helpers": "^7.5.0",
94
- "@atlaskit/media-test-helpers": "^34.5.0",
94
+ "@atlaskit/media-test-helpers": "^34.6.0",
95
95
  "@atlaskit/ssr": "*",
96
96
  "@atlaskit/visual-regression": "*",
97
97
  "@atlassian/analytics-tooling": "*",
@@ -170,6 +170,9 @@
170
170
  },
171
171
  "platform-visual-refresh-icons": {
172
172
  "type": "boolean"
173
+ },
174
+ "smart_links_for_plans": {
175
+ "type": "boolean"
173
176
  }
174
177
  }
175
178
  }