@atlaskit/smart-card 26.64.0 → 26.65.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,14 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.65.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98998](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98998)
8
+ [`935587894f94`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/935587894f94) -
9
+ Trim snippet content on extractSummary. `extractSummary` will now return undefined if the type
10
+ is incorrect.
11
+
3
12
  ## 26.64.0
4
13
 
5
14
  ### Minor Changes
@@ -4,6 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.extractSummary = void 0;
7
+ /**
8
+ * Return link summary
9
+ */
7
10
  var extractSummary = exports.extractSummary = function extractSummary(jsonLd) {
8
- return jsonLd.summary;
11
+ if (typeof (jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.summary) === 'string') {
12
+ var summary = jsonLd.summary.trim();
13
+ return Boolean(summary) ? summary : undefined;
14
+ }
9
15
  };
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "26.64.0"
25
+ packageVersion: "26.65.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "26.64.0",
20
+ packageVersion: "26.65.0",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Return link summary
3
+ */
1
4
  export const extractSummary = jsonLd => {
2
- return jsonLd.summary;
5
+ if (typeof (jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.summary) === 'string') {
6
+ const summary = jsonLd.summary.trim();
7
+ return Boolean(summary) ? summary : undefined;
8
+ }
3
9
  };
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "26.64.0"
7
+ packageVersion: "26.65.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "26.64.0",
10
+ packageVersion: "26.65.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Return link summary
3
+ */
1
4
  export var extractSummary = function extractSummary(jsonLd) {
2
- return jsonLd.summary;
5
+ if (typeof (jsonLd === null || jsonLd === void 0 ? void 0 : jsonLd.summary) === 'string') {
6
+ var summary = jsonLd.summary.trim();
7
+ return Boolean(summary) ? summary : undefined;
8
+ }
3
9
  };
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "26.64.0"
18
+ packageVersion: "26.65.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
10
10
  import LinkWarningModal from './LinkWarningModal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "26.64.0",
13
+ packageVersion: "26.65.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1,2 +1,5 @@
1
- import { JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from 'json-ld-types';
2
+ /**
3
+ * Return link summary
4
+ */
2
5
  export declare const extractSummary: (jsonLd: JsonLd.Data.BaseData) => string | undefined;
@@ -1,2 +1,5 @@
1
- import { JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from 'json-ld-types';
2
+ /**
3
+ * Return link summary
4
+ */
2
5
  export declare const extractSummary: (jsonLd: JsonLd.Data.BaseData) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.64.0",
3
+ "version": "26.65.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"