@atlaskit/smart-card 46.7.7 → 46.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,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 46.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`366c86f823ba6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/366c86f823ba6) -
8
+ Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 46.7.8
15
+
16
+ ### Patch Changes
17
+
18
+ - [`28ac5d6dcda14`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28ac5d6dcda14) -
19
+ Behind platform_sl_embed_modal_escape_isolation: pressing Escape in the Smart Link embed preview
20
+ modal now closes only the modal, instead of also closing the drawer or modal it was opened from.
21
+ - Updated dependencies
22
+
3
23
  ## 46.7.7
4
24
 
5
25
  ### Patch Changes
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
25
25
  var context = exports.context = {
26
26
  componentName: 'smart-cards',
27
27
  packageName: "@atlaskit/smart-card" || '',
28
- packageVersion: "46.7.6" || ''
28
+ packageVersion: "46.7.8" || ''
29
29
  };
30
30
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
31
31
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _modalBody = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-body"));
13
13
  var _modalDialog = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-dialog"));
14
14
  var _modalTransition = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-transition"));
15
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
15
16
  var _useThemeObserver = require("@atlaskit/tokens/use-theme-observer");
16
17
  var _constants = require("../../constants");
17
18
  var _useInvokeClientAction = _interopRequireDefault(require("../../state/hooks/use-invoke-client-action"));
@@ -151,6 +152,32 @@ var EmbedModal = function EmbedModal(_ref) {
151
152
  window.removeEventListener('blur', handleWindowBlur);
152
153
  };
153
154
  }, [isOpen]);
155
+
156
+ // `openEmbedModal` renders this modal into its own React root, outside the layering context of
157
+ // whatever opened it (e.g. a drawer or another modal). Layered components close on Escape via
158
+ // `window` keydown listeners, so without this they would all close on a single Escape press.
159
+ // Handle Escape during the capture phase on `window`, close only this modal, and stop the event
160
+ // before it reaches the layers underneath.
161
+ (0, _react.useEffect)(function () {
162
+ if (!isOpen || !(0, _fg.fg)('platform_sl_embed_modal_escape_isolation')) {
163
+ return;
164
+ }
165
+ var handleEscapeKeyDown = function handleEscapeKeyDown(event) {
166
+ if (event.key !== 'Escape' || event.defaultPrevented || event.isComposing) {
167
+ return;
168
+ }
169
+ event.stopPropagation();
170
+ handleOnClose();
171
+ };
172
+ window.addEventListener('keydown', handleEscapeKeyDown, {
173
+ capture: true
174
+ });
175
+ return function () {
176
+ window.removeEventListener('keydown', handleEscapeKeyDown, {
177
+ capture: true
178
+ });
179
+ };
180
+ }, [isOpen, handleOnClose]);
154
181
  return /*#__PURE__*/_react.default.createElement(_modalTransition.default, null, isOpen &&
155
182
  /*#__PURE__*/
156
183
  // eslint-disable-next-line @atlaskit/design-system/no-modal-label
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "46.7.6",
22
+ packageVersion: "46.7.8",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -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: "46.7.6" || ''
7
+ packageVersion: "46.7.8" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
3
3
  import ModalBody from '@atlaskit/modal-dialog/modal-body';
4
4
  import ModalDialog from '@atlaskit/modal-dialog/modal-dialog';
5
5
  import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
7
8
  import { SmartLinkSize } from '../../constants';
8
9
  import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
@@ -127,6 +128,32 @@ const EmbedModal = ({
127
128
  window.removeEventListener('blur', handleWindowBlur);
128
129
  };
129
130
  }, [isOpen]);
131
+
132
+ // `openEmbedModal` renders this modal into its own React root, outside the layering context of
133
+ // whatever opened it (e.g. a drawer or another modal). Layered components close on Escape via
134
+ // `window` keydown listeners, so without this they would all close on a single Escape press.
135
+ // Handle Escape during the capture phase on `window`, close only this modal, and stop the event
136
+ // before it reaches the layers underneath.
137
+ useEffect(() => {
138
+ if (!isOpen || !fg('platform_sl_embed_modal_escape_isolation')) {
139
+ return;
140
+ }
141
+ const handleEscapeKeyDown = event => {
142
+ if (event.key !== 'Escape' || event.defaultPrevented || event.isComposing) {
143
+ return;
144
+ }
145
+ event.stopPropagation();
146
+ handleOnClose();
147
+ };
148
+ window.addEventListener('keydown', handleEscapeKeyDown, {
149
+ capture: true
150
+ });
151
+ return () => {
152
+ window.removeEventListener('keydown', handleEscapeKeyDown, {
153
+ capture: true
154
+ });
155
+ };
156
+ }, [isOpen, handleOnClose]);
130
157
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen &&
131
158
  /*#__PURE__*/
132
159
  // eslint-disable-next-line @atlaskit/design-system/no-modal-label
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.7.6",
12
+ packageVersion: "46.7.8",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -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: "46.7.6" || ''
7
+ packageVersion: "46.7.8" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
4
4
  import ModalBody from '@atlaskit/modal-dialog/modal-body';
5
5
  import ModalDialog from '@atlaskit/modal-dialog/modal-dialog';
6
6
  import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
7
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
8
  import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
8
9
  import { SmartLinkSize } from '../../constants';
9
10
  import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
@@ -142,6 +143,32 @@ var EmbedModal = function EmbedModal(_ref) {
142
143
  window.removeEventListener('blur', handleWindowBlur);
143
144
  };
144
145
  }, [isOpen]);
146
+
147
+ // `openEmbedModal` renders this modal into its own React root, outside the layering context of
148
+ // whatever opened it (e.g. a drawer or another modal). Layered components close on Escape via
149
+ // `window` keydown listeners, so without this they would all close on a single Escape press.
150
+ // Handle Escape during the capture phase on `window`, close only this modal, and stop the event
151
+ // before it reaches the layers underneath.
152
+ useEffect(function () {
153
+ if (!isOpen || !fg('platform_sl_embed_modal_escape_isolation')) {
154
+ return;
155
+ }
156
+ var handleEscapeKeyDown = function handleEscapeKeyDown(event) {
157
+ if (event.key !== 'Escape' || event.defaultPrevented || event.isComposing) {
158
+ return;
159
+ }
160
+ event.stopPropagation();
161
+ handleOnClose();
162
+ };
163
+ window.addEventListener('keydown', handleEscapeKeyDown, {
164
+ capture: true
165
+ });
166
+ return function () {
167
+ window.removeEventListener('keydown', handleEscapeKeyDown, {
168
+ capture: true
169
+ });
170
+ };
171
+ }, [isOpen, handleOnClose]);
145
172
  return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen &&
146
173
  /*#__PURE__*/
147
174
  // eslint-disable-next-line @atlaskit/design-system/no-modal-label
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "46.7.6",
15
+ packageVersion: "46.7.8",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.7.7",
3
+ "version": "46.8.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@atlaskit/adf-utils": "^20.9.0",
42
- "@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.280.0",
42
+ "@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.288.0",
43
43
  "@atlaskit/analytics-cross-product": "^2.3.0",
44
44
  "@atlaskit/analytics-gas-types": "^6.2.0",
45
45
  "@atlaskit/analytics-next": "^12.6.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/feature-gate-js-client": "^7.0.0",
57
57
  "@atlaskit/flag": "^19.0.0",
58
58
  "@atlaskit/form": "^18.2.0",
59
- "@atlaskit/frontend-utilities": "^5.0.0",
59
+ "@atlaskit/frontend-utilities": "^5.1.0",
60
60
  "@atlaskit/heading": "^8.0.0",
61
61
  "@atlaskit/icon": "^38.0.0",
62
62
  "@atlaskit/icon-file-type": "^8.3.0",
@@ -83,8 +83,8 @@
83
83
  "@atlaskit/popup": "^10.0.0",
84
84
  "@atlaskit/primitives": "^22.6.0",
85
85
  "@atlaskit/react-compiler-gating": "^0.2.0",
86
- "@atlaskit/react-ufo": "^8.1.0",
87
- "@atlaskit/rovo-triggers": "^12.6.0",
86
+ "@atlaskit/react-ufo": "^8.2.0",
87
+ "@atlaskit/rovo-triggers": "^12.8.0",
88
88
  "@atlaskit/section-message": "^10.2.0",
89
89
  "@atlaskit/select": "^23.1.0",
90
90
  "@atlaskit/spinner": "^20.4.0",
@@ -94,10 +94,10 @@
94
94
  "@atlaskit/textfield": "^10.2.0",
95
95
  "@atlaskit/theme": "^28.2.0",
96
96
  "@atlaskit/tile": "^5.0.0",
97
- "@atlaskit/tmp-editor-statsig": "^245.0.0",
97
+ "@atlaskit/tmp-editor-statsig": "^246.0.0",
98
98
  "@atlaskit/tokens": "^20.7.0",
99
99
  "@atlaskit/tooltip": "^24.4.0",
100
- "@atlaskit/top-layer": "^6.6.0",
100
+ "@atlaskit/top-layer": "^6.7.0",
101
101
  "@atlaskit/ufo": "^2.0.0",
102
102
  "@atlaskit/width-detector": "^7.2.0",
103
103
  "@babel/runtime": "^7.0.0",
@@ -127,7 +127,7 @@
127
127
  "@atlaskit/banner": "^15.3.0",
128
128
  "@atlaskit/code": "^20.0.0",
129
129
  "@atlaskit/css-reset": "^8.4.0",
130
- "@atlaskit/datetime-picker": "^19.3.0",
130
+ "@atlaskit/datetime-picker": "^19.4.0",
131
131
  "@atlaskit/inline-message": "^16.4.0",
132
132
  "@atlaskit/link-provider": "^6.0.0",
133
133
  "@atlaskit/media-test-helpers": "^43.0.0",