@atlaskit/smart-card 27.4.4 → 27.5.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,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 27.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#106790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106790)
8
+ [`fe0b21796ab6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fe0b21796ab6) -
9
+ EDM-9715: remove platform.linking-platform.smart-card.enable-theme-state-url FF
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 27.4.4
4
16
 
5
17
  ### 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: "27.4.4"
25
+ packageVersion: "27.5.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -477,20 +477,12 @@ var getPreviewUrlWithTheme = exports.getPreviewUrlWithTheme = function getPrevie
477
477
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
478
478
  try {
479
479
  var url = new URL(previewUrl);
480
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
481
- url.searchParams.append('themeState', (0, _tokens.themeObjectToString)(themeState));
482
- } else {
483
- var _themeState$colorMode;
484
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
485
- }
480
+ url.searchParams.append('themeState', (0, _tokens.themeObjectToString)(themeState));
486
481
  return url.href;
487
482
  } catch (_unused) {
488
483
  return previewUrl;
489
484
  }
490
485
  }
491
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-theme-state-url')) {
492
- var themeStateQueryString = encodeURIComponent((0, _tokens.themeObjectToString)(themeState));
493
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
494
- }
495
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeMode=").concat(themeState.colorMode);
486
+ var themeStateQueryString = encodeURIComponent((0, _tokens.themeObjectToString)(themeState));
487
+ return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
496
488
  };
@@ -50,9 +50,8 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react2
50
50
  });
51
51
  }, [src, linkGlyph, iconFromContext]);
52
52
  var themeState = (0, _tokens.useThemeObserver)();
53
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
54
53
  var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
55
- if (previewUrl && isSupportTheming && colorMode) {
54
+ if (previewUrl && isSupportTheming) {
56
55
  previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
57
56
  }
58
57
  return (0, _react.jsx)(_ExpandedFrame.ExpandedFrame, {
@@ -93,7 +93,6 @@ var EmbedModal = function EmbedModal(_ref) {
93
93
  }
94
94
  }, [onResize, width]);
95
95
  var themeState = (0, _tokens.useThemeObserver)();
96
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
97
96
  var previewUrl = src;
98
97
  var handleOnViewActionClick = (0, _react.useCallback)(function () {
99
98
  invoke({
@@ -143,7 +142,7 @@ var EmbedModal = function EmbedModal(_ref) {
143
142
  extensionKey: extensionKey
144
143
  });
145
144
  }, [download, extensionKey, invoke]);
146
- if (previewUrl && isSupportTheming && colorMode) {
145
+ if (previewUrl && isSupportTheming) {
147
146
  previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
148
147
  }
149
148
  return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
@@ -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: "27.4.4",
20
+ packageVersion: "27.5.0",
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: "27.4.4"
7
+ packageVersion: "27.5.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -180,20 +180,12 @@ export const getPreviewUrlWithTheme = (previewUrl, themeState) => {
180
180
  if (getBooleanFF('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
181
181
  try {
182
182
  const url = new URL(previewUrl);
183
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
184
- url.searchParams.append('themeState', themeObjectToString(themeState));
185
- } else {
186
- var _themeState$colorMode;
187
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
188
- }
183
+ url.searchParams.append('themeState', themeObjectToString(themeState));
189
184
  return url.href;
190
185
  } catch {
191
186
  return previewUrl;
192
187
  }
193
188
  }
194
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
195
- const themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
196
- return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeState=${themeStateQueryString}`;
197
- }
198
- return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeMode=${themeState.colorMode}`;
189
+ const themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
190
+ return `${previewUrl}${previewUrl.includes('?') ? '&' : '?'}themeState=${themeStateQueryString}`;
199
191
  };
@@ -40,9 +40,8 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
40
40
  });
41
41
  }, [src, linkGlyph, iconFromContext]);
42
42
  const themeState = useThemeObserver();
43
- const colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
44
43
  let previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
45
- if (previewUrl && isSupportTheming && colorMode) {
44
+ if (previewUrl && isSupportTheming) {
46
45
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
47
46
  }
48
47
  return jsx(ExpandedFrame, {
@@ -66,7 +66,6 @@ const EmbedModal = ({
66
66
  }
67
67
  }, [onResize, width]);
68
68
  const themeState = useThemeObserver();
69
- const colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
70
69
  let previewUrl = src;
71
70
  const handleOnViewActionClick = useCallback(() => {
72
71
  invoke({
@@ -84,7 +83,7 @@ const EmbedModal = ({
84
83
  extensionKey
85
84
  });
86
85
  }, [download, extensionKey, invoke]);
87
- if (previewUrl && isSupportTheming && colorMode) {
86
+ if (previewUrl && isSupportTheming) {
88
87
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
89
88
  }
90
89
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
@@ -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: "27.4.4",
10
+ packageVersion: "27.5.0",
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: "27.4.4"
18
+ packageVersion: "27.5.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -367,20 +367,12 @@ export var getPreviewUrlWithTheme = function getPreviewUrlWithTheme(previewUrl,
367
367
  if (getBooleanFF('platform.linking-platform.smart-card.fix-embed-preview-url-query-params')) {
368
368
  try {
369
369
  var url = new URL(previewUrl);
370
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
371
- url.searchParams.append('themeState', themeObjectToString(themeState));
372
- } else {
373
- var _themeState$colorMode;
374
- url.searchParams.append('themeMode', (_themeState$colorMode = themeState.colorMode) !== null && _themeState$colorMode !== void 0 ? _themeState$colorMode : '');
375
- }
370
+ url.searchParams.append('themeState', themeObjectToString(themeState));
376
371
  return url.href;
377
372
  } catch (_unused) {
378
373
  return previewUrl;
379
374
  }
380
375
  }
381
- if (getBooleanFF('platform.linking-platform.smart-card.enable-theme-state-url')) {
382
- var themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
383
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
384
- }
385
- return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeMode=").concat(themeState.colorMode);
376
+ var themeStateQueryString = encodeURIComponent(themeObjectToString(themeState));
377
+ return "".concat(previewUrl).concat(previewUrl.includes('?') ? '&' : '?', "themeState=").concat(themeStateQueryString);
386
378
  };
@@ -42,9 +42,8 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
42
42
  });
43
43
  }, [src, linkGlyph, iconFromContext]);
44
44
  var themeState = useThemeObserver();
45
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
46
45
  var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
47
- if (previewUrl && isSupportTheming && colorMode) {
46
+ if (previewUrl && isSupportTheming) {
48
47
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
49
48
  }
50
49
  return jsx(ExpandedFrame, {
@@ -83,7 +83,6 @@ var EmbedModal = function EmbedModal(_ref) {
83
83
  }
84
84
  }, [onResize, width]);
85
85
  var themeState = useThemeObserver();
86
- var colorMode = themeState === null || themeState === void 0 ? void 0 : themeState.colorMode;
87
86
  var previewUrl = src;
88
87
  var handleOnViewActionClick = useCallback(function () {
89
88
  invoke({
@@ -133,7 +132,7 @@ var EmbedModal = function EmbedModal(_ref) {
133
132
  extensionKey: extensionKey
134
133
  });
135
134
  }, [download, extensionKey, invoke]);
136
- if (previewUrl && isSupportTheming && colorMode) {
135
+ if (previewUrl && isSupportTheming) {
137
136
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
138
137
  }
139
138
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
@@ -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: "27.4.4",
13
+ packageVersion: "27.5.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "27.4.4",
3
+ "version": "27.5.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
56
56
  "@atlaskit/platform-feature-flags": "^0.2.1",
57
57
  "@atlaskit/popup": "^1.17.0",
58
- "@atlaskit/primitives": "^6.4.0",
58
+ "@atlaskit/primitives": "^6.5.0",
59
59
  "@atlaskit/section-message": "^6.5.0",
60
60
  "@atlaskit/select": "^17.10.0",
61
61
  "@atlaskit/spinner": "^16.1.0",
@@ -170,9 +170,6 @@
170
170
  "platform.linking-platform.smart-card.hover-card-action-redesign": {
171
171
  "type": "boolean"
172
172
  },
173
- "platform.linking-platform.smart-card.enable-theme-state-url": {
174
- "type": "boolean"
175
- },
176
173
  "platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour": {
177
174
  "type": "boolean"
178
175
  },