@atlaskit/smart-card 46.5.1 → 46.5.2
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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/components/Frame.js +7 -22
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/components/Frame.js +6 -21
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedCard/components/Frame.js +7 -22
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 46.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6bab83f8b76de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6bab83f8b76de) -
|
|
8
|
+
Remove the unused `jpx-1074-smart-links-iframe` feature gate, preserving the existing
|
|
9
|
+
document-based iframe focus handling.
|
|
10
|
+
|
|
3
11
|
## 46.5.1
|
|
4
12
|
|
|
5
13
|
### 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.5.
|
|
28
|
+
packageVersion: "46.5.1" || ''
|
|
29
29
|
};
|
|
30
30
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
31
31
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,8 +12,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
15
|
-
var _browserApis = require("@atlaskit/browser-apis");
|
|
16
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
15
|
var _getIframeSandboxAttribute = require("../../../utils/get-iframe-sandbox-attribute");
|
|
18
16
|
var _IFrame = require("./IFrame");
|
|
19
17
|
var _IframeDwellTracker = require("./IframeDwellTracker");
|
|
@@ -32,7 +30,6 @@ function mergeRefs(refs) {
|
|
|
32
30
|
}
|
|
33
31
|
var iframeStyles = null;
|
|
34
32
|
var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_ref, iframeRef) {
|
|
35
|
-
var _doc$hasFocus;
|
|
36
33
|
var url = _ref.url,
|
|
37
34
|
_ref$isTrusted = _ref.isTrusted,
|
|
38
35
|
isTrusted = _ref$isTrusted === void 0 ? false : _ref$isTrusted,
|
|
@@ -44,7 +41,6 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
44
41
|
isMouseOverProp = _ref.isMouseOver,
|
|
45
42
|
title = _ref.title,
|
|
46
43
|
extensionKey = _ref.extensionKey;
|
|
47
|
-
var doc = (0, _browserApis.getDocument)();
|
|
48
44
|
var _useState = (0, _react.useState)(false),
|
|
49
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
50
46
|
isIframeLoaded = _useState2[0],
|
|
@@ -59,10 +55,8 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
59
55
|
// _or_
|
|
60
56
|
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
61
57
|
// which already seems to be existing behavior in a useEffect below.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
65
|
-
(0, _fg.fg)('jpx-1074-smart-links-iframe') ? (_doc$hasFocus = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus !== void 0 ? _doc$hasFocus : false : document.hasFocus()),
|
|
58
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
59
|
+
var _useState5 = (0, _react.useState)(document.hasFocus()),
|
|
66
60
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
67
61
|
isWindowFocused = _useState6[0],
|
|
68
62
|
setWindowFocused = _useState6[1];
|
|
@@ -101,23 +95,14 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
101
95
|
};
|
|
102
96
|
}, [threshold, mergedRef]);
|
|
103
97
|
(0, _react.useEffect)(function () {
|
|
104
|
-
var _doc$hasFocus2;
|
|
105
98
|
// Initialize with current focus state
|
|
106
|
-
// The below will be removed as part of FG cleanup
|
|
107
99
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
108
|
-
setWindowFocused(
|
|
100
|
+
setWindowFocused(document.hasFocus());
|
|
109
101
|
var onBlur = function onBlur() {
|
|
110
102
|
setWindowFocused(false);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
// The below will be removed as part of FG cleanup
|
|
117
|
-
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
118
|
-
if (document.activeElement === ref.current) {
|
|
119
|
-
onIframeFocus && onIframeFocus();
|
|
120
|
-
}
|
|
103
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
104
|
+
if (document.activeElement === ref.current) {
|
|
105
|
+
onIframeFocus && onIframeFocus();
|
|
121
106
|
}
|
|
122
107
|
};
|
|
123
108
|
var onFocus = function onFocus() {
|
|
@@ -129,7 +114,7 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
129
114
|
window.removeEventListener('blur', onBlur);
|
|
130
115
|
window.removeEventListener('focus', onFocus);
|
|
131
116
|
};
|
|
132
|
-
}, [ref, onIframeFocus
|
|
117
|
+
}, [ref, onIframeFocus]);
|
|
133
118
|
if (!url) {
|
|
134
119
|
return null;
|
|
135
120
|
}
|
|
@@ -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.5.
|
|
22
|
+
packageVersion: "46.5.1",
|
|
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.5.
|
|
7
|
+
packageVersion: "46.5.1" || ''
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,8 +6,6 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
6
6
|
// eslint-disable-next-line no-unused-vars
|
|
7
7
|
|
|
8
8
|
import { di } from 'react-magnetic-di';
|
|
9
|
-
import { getDocument } from '@atlaskit/browser-apis';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
9
|
import { getIframeSandboxAttribute } from '../../../utils/get-iframe-sandbox-attribute';
|
|
12
10
|
import { IFrame } from './IFrame';
|
|
13
11
|
import { IframeDwellTracker } from './IframeDwellTracker';
|
|
@@ -35,8 +33,6 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
35
33
|
title,
|
|
36
34
|
extensionKey
|
|
37
35
|
}, iframeRef) => {
|
|
38
|
-
var _doc$hasFocus;
|
|
39
|
-
const doc = getDocument();
|
|
40
36
|
const [isIframeLoaded, setIframeLoaded] = useState(false);
|
|
41
37
|
const [isMouseOver, setMouseOver] = useState(false);
|
|
42
38
|
// Accessing the document here for SSR where document.hasFocus may be absent breaks SSR
|
|
@@ -45,10 +41,8 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
45
41
|
// _or_
|
|
46
42
|
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
47
43
|
// which already seems to be existing behavior in a useEffect below.
|
|
48
|
-
const [isWindowFocused, setWindowFocused] = useState(
|
|
49
|
-
// The below will be removed as part of FG cleanup
|
|
50
44
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
51
|
-
|
|
45
|
+
const [isWindowFocused, setWindowFocused] = useState(document.hasFocus());
|
|
52
46
|
|
|
53
47
|
// Use prop if provided (from wrapper), otherwise use local state (for backward compatibility)
|
|
54
48
|
const effectiveMouseOver = isMouseOverProp !== undefined ? isMouseOverProp : isMouseOver;
|
|
@@ -79,23 +73,14 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
79
73
|
};
|
|
80
74
|
}, [threshold, mergedRef]);
|
|
81
75
|
useEffect(() => {
|
|
82
|
-
var _doc$hasFocus2;
|
|
83
76
|
// Initialize with current focus state
|
|
84
|
-
// The below will be removed as part of FG cleanup
|
|
85
77
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
86
|
-
setWindowFocused(
|
|
78
|
+
setWindowFocused(document.hasFocus());
|
|
87
79
|
const onBlur = () => {
|
|
88
80
|
setWindowFocused(false);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
// The below will be removed as part of FG cleanup
|
|
95
|
-
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
96
|
-
if (document.activeElement === ref.current) {
|
|
97
|
-
onIframeFocus && onIframeFocus();
|
|
98
|
-
}
|
|
81
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
82
|
+
if (document.activeElement === ref.current) {
|
|
83
|
+
onIframeFocus && onIframeFocus();
|
|
99
84
|
}
|
|
100
85
|
};
|
|
101
86
|
const onFocus = () => {
|
|
@@ -107,7 +92,7 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
107
92
|
window.removeEventListener('blur', onBlur);
|
|
108
93
|
window.removeEventListener('focus', onFocus);
|
|
109
94
|
};
|
|
110
|
-
}, [ref, onIframeFocus
|
|
95
|
+
}, [ref, onIframeFocus]);
|
|
111
96
|
if (!url) {
|
|
112
97
|
return null;
|
|
113
98
|
}
|
|
@@ -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.5.
|
|
12
|
+
packageVersion: "46.5.1",
|
|
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.5.
|
|
7
|
+
packageVersion: "46.5.1" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -7,8 +7,6 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line no-unused-vars
|
|
8
8
|
|
|
9
9
|
import { di } from 'react-magnetic-di';
|
|
10
|
-
import { getDocument } from '@atlaskit/browser-apis';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
10
|
import { getIframeSandboxAttribute } from '../../../utils/get-iframe-sandbox-attribute';
|
|
13
11
|
import { IFrame } from './IFrame';
|
|
14
12
|
import { IframeDwellTracker } from './IframeDwellTracker';
|
|
@@ -25,7 +23,6 @@ function mergeRefs(refs) {
|
|
|
25
23
|
}
|
|
26
24
|
var iframeStyles = null;
|
|
27
25
|
export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
28
|
-
var _doc$hasFocus;
|
|
29
26
|
var url = _ref.url,
|
|
30
27
|
_ref$isTrusted = _ref.isTrusted,
|
|
31
28
|
isTrusted = _ref$isTrusted === void 0 ? false : _ref$isTrusted,
|
|
@@ -37,7 +34,6 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
37
34
|
isMouseOverProp = _ref.isMouseOver,
|
|
38
35
|
title = _ref.title,
|
|
39
36
|
extensionKey = _ref.extensionKey;
|
|
40
|
-
var doc = getDocument();
|
|
41
37
|
var _useState = useState(false),
|
|
42
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
39
|
isIframeLoaded = _useState2[0],
|
|
@@ -52,10 +48,8 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
52
48
|
// _or_
|
|
53
49
|
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
54
50
|
// which already seems to be existing behavior in a useEffect below.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
58
|
-
fg('jpx-1074-smart-links-iframe') ? (_doc$hasFocus = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus !== void 0 ? _doc$hasFocus : false : document.hasFocus()),
|
|
51
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
52
|
+
var _useState5 = useState(document.hasFocus()),
|
|
59
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
60
54
|
isWindowFocused = _useState6[0],
|
|
61
55
|
setWindowFocused = _useState6[1];
|
|
@@ -94,23 +88,14 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
94
88
|
};
|
|
95
89
|
}, [threshold, mergedRef]);
|
|
96
90
|
useEffect(function () {
|
|
97
|
-
var _doc$hasFocus2;
|
|
98
91
|
// Initialize with current focus state
|
|
99
|
-
// The below will be removed as part of FG cleanup
|
|
100
92
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
101
|
-
setWindowFocused(
|
|
93
|
+
setWindowFocused(document.hasFocus());
|
|
102
94
|
var onBlur = function onBlur() {
|
|
103
95
|
setWindowFocused(false);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
// The below will be removed as part of FG cleanup
|
|
110
|
-
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
111
|
-
if (document.activeElement === ref.current) {
|
|
112
|
-
onIframeFocus && onIframeFocus();
|
|
113
|
-
}
|
|
96
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
97
|
+
if (document.activeElement === ref.current) {
|
|
98
|
+
onIframeFocus && onIframeFocus();
|
|
114
99
|
}
|
|
115
100
|
};
|
|
116
101
|
var onFocus = function onFocus() {
|
|
@@ -122,7 +107,7 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
122
107
|
window.removeEventListener('blur', onBlur);
|
|
123
108
|
window.removeEventListener('focus', onFocus);
|
|
124
109
|
};
|
|
125
|
-
}, [ref, onIframeFocus
|
|
110
|
+
}, [ref, onIframeFocus]);
|
|
126
111
|
if (!url) {
|
|
127
112
|
return null;
|
|
128
113
|
}
|
|
@@ -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.5.
|
|
15
|
+
packageVersion: "46.5.1",
|
|
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.5.
|
|
3
|
+
"version": "46.5.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@atlaskit/popup": "^9.0.0",
|
|
83
83
|
"@atlaskit/primitives": "^22.5.0",
|
|
84
84
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
85
|
-
"@atlaskit/react-ufo": "^8.
|
|
85
|
+
"@atlaskit/react-ufo": "^8.1.0",
|
|
86
86
|
"@atlaskit/rovo-triggers": "^11.10.0",
|
|
87
87
|
"@atlaskit/section-message": "^10.2.0",
|
|
88
88
|
"@atlaskit/select": "^23.1.0",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"@atlaskit/analytics-listeners": "^11.4.0",
|
|
125
125
|
"@atlaskit/code": "^20.0.0",
|
|
126
126
|
"@atlaskit/css-reset": "^8.4.0",
|
|
127
|
-
"@atlaskit/datetime-picker": "^19.
|
|
127
|
+
"@atlaskit/datetime-picker": "^19.1.0",
|
|
128
128
|
"@atlaskit/media-test-helpers": "^43.0.0",
|
|
129
129
|
"@atlaskit/page": "^15.3.0",
|
|
130
130
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration": "^3.4.0",
|
|
@@ -198,9 +198,6 @@
|
|
|
198
198
|
"jfp-magma-platform-lozenge-jump-fix": {
|
|
199
199
|
"type": "boolean"
|
|
200
200
|
},
|
|
201
|
-
"jpx-1074-smart-links-iframe": {
|
|
202
|
-
"type": "boolean"
|
|
203
|
-
},
|
|
204
201
|
"platform_sl_3p_preauth_better_hovercard_killswitch": {
|
|
205
202
|
"type": "boolean"
|
|
206
203
|
},
|