@atlaskit/smart-card 43.25.14 → 43.25.15
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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/components/Frame.js +41 -8
- 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 +41 -8
- 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 +41 -8
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "43.25.
|
|
14
|
+
packageVersion: "43.25.14"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,6 +12,8 @@ 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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _utils = require("../../../utils");
|
|
16
18
|
var _IFrame = require("./IFrame");
|
|
17
19
|
var _IframeDwellTracker = require("./IframeDwellTracker");
|
|
@@ -38,6 +40,7 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
38
40
|
onIframeFocus = _ref.onIframeFocus,
|
|
39
41
|
title = _ref.title,
|
|
40
42
|
extensionKey = _ref.extensionKey;
|
|
43
|
+
var doc = (0, _browserApis.getDocument)();
|
|
41
44
|
var _useState = (0, _react.useState)(false),
|
|
42
45
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
43
46
|
isIframeLoaded = _useState2[0],
|
|
@@ -84,8 +87,16 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
84
87
|
(0, _react.useEffect)(function () {
|
|
85
88
|
var onBlur = function onBlur() {
|
|
86
89
|
setWindowFocused(false);
|
|
87
|
-
if (
|
|
88
|
-
|
|
90
|
+
if ((0, _platformFeatureFlags.fg)('jpx-833-smart-links-graphql-provider')) {
|
|
91
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
92
|
+
onIframeFocus && onIframeFocus();
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
// The below will be removed as part of FG cleanup
|
|
96
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
97
|
+
if (document.activeElement === ref.current) {
|
|
98
|
+
onIframeFocus && onIframeFocus();
|
|
99
|
+
}
|
|
89
100
|
}
|
|
90
101
|
};
|
|
91
102
|
var onFocus = function onFocus() {
|
|
@@ -97,7 +108,7 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
97
108
|
window.removeEventListener('blur', onBlur);
|
|
98
109
|
window.removeEventListener('focus', onFocus);
|
|
99
110
|
};
|
|
100
|
-
}, [ref, onIframeFocus]);
|
|
111
|
+
}, [ref, onIframeFocus, doc]);
|
|
101
112
|
if (!url) {
|
|
102
113
|
return null;
|
|
103
114
|
}
|
|
@@ -131,6 +142,7 @@ var Frame = exports.Frame = /*#__PURE__*/_react.default.forwardRef(function (_re
|
|
|
131
142
|
}));
|
|
132
143
|
});
|
|
133
144
|
var FrameUpdated = exports.FrameUpdated = /*#__PURE__*/_react.default.forwardRef(function (_ref2, iframeRef) {
|
|
145
|
+
var _doc$hasFocus;
|
|
134
146
|
var url = _ref2.url,
|
|
135
147
|
_ref2$isTrusted = _ref2.isTrusted,
|
|
136
148
|
isTrusted = _ref2$isTrusted === void 0 ? false : _ref2$isTrusted,
|
|
@@ -142,6 +154,7 @@ var FrameUpdated = exports.FrameUpdated = /*#__PURE__*/_react.default.forwardRef
|
|
|
142
154
|
isMouseOverProp = _ref2.isMouseOver,
|
|
143
155
|
title = _ref2.title,
|
|
144
156
|
extensionKey = _ref2.extensionKey;
|
|
157
|
+
var doc = (0, _browserApis.getDocument)();
|
|
145
158
|
var _useState1 = (0, _react.useState)(false),
|
|
146
159
|
_useState10 = (0, _slicedToArray2.default)(_useState1, 2),
|
|
147
160
|
isIframeLoaded = _useState10[0],
|
|
@@ -150,7 +163,16 @@ var FrameUpdated = exports.FrameUpdated = /*#__PURE__*/_react.default.forwardRef
|
|
|
150
163
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
151
164
|
isMouseOver = _useState12[0],
|
|
152
165
|
setMouseOver = _useState12[1];
|
|
153
|
-
|
|
166
|
+
// Accessing the document here for SSR where document.hasFocus may be absent breaks SSR
|
|
167
|
+
// when we're trying to load things like Loom frames in SSR
|
|
168
|
+
// We _could_ either throw a guard in here (i.e check for the existence of document)
|
|
169
|
+
// _or_
|
|
170
|
+
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
171
|
+
// which already seems to be existing behavior in a useEffect below.
|
|
172
|
+
var _useState13 = (0, _react.useState)(
|
|
173
|
+
// The below will be removed as part of FG cleanup
|
|
174
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
175
|
+
(0, _platformFeatureFlags.fg)('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus !== void 0 ? _doc$hasFocus : false : document.hasFocus()),
|
|
154
176
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
155
177
|
isWindowFocused = _useState14[0],
|
|
156
178
|
setWindowFocused = _useState14[1];
|
|
@@ -189,12 +211,23 @@ var FrameUpdated = exports.FrameUpdated = /*#__PURE__*/_react.default.forwardRef
|
|
|
189
211
|
};
|
|
190
212
|
}, [threshold, mergedRef]);
|
|
191
213
|
(0, _react.useEffect)(function () {
|
|
214
|
+
var _doc$hasFocus2;
|
|
192
215
|
// Initialize with current focus state
|
|
193
|
-
|
|
216
|
+
// The below will be removed as part of FG cleanup
|
|
217
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
218
|
+
setWindowFocused((0, _platformFeatureFlags.fg)('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus2 = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus2 !== void 0 ? _doc$hasFocus2 : false : document.hasFocus());
|
|
194
219
|
var onBlur = function onBlur() {
|
|
195
220
|
setWindowFocused(false);
|
|
196
|
-
if (
|
|
197
|
-
|
|
221
|
+
if ((0, _platformFeatureFlags.fg)('jpx-833-smart-links-graphql-provider')) {
|
|
222
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
223
|
+
onIframeFocus && onIframeFocus();
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
// The below will be removed as part of FG cleanup
|
|
227
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
228
|
+
if (document.activeElement === ref.current) {
|
|
229
|
+
onIframeFocus && onIframeFocus();
|
|
230
|
+
}
|
|
198
231
|
}
|
|
199
232
|
};
|
|
200
233
|
var onFocus = function onFocus() {
|
|
@@ -206,7 +239,7 @@ var FrameUpdated = exports.FrameUpdated = /*#__PURE__*/_react.default.forwardRef
|
|
|
206
239
|
window.removeEventListener('blur', onBlur);
|
|
207
240
|
window.removeEventListener('focus', onFocus);
|
|
208
241
|
};
|
|
209
|
-
}, [ref, onIframeFocus]);
|
|
242
|
+
}, [ref, onIframeFocus, doc]);
|
|
210
243
|
if (!url) {
|
|
211
244
|
return null;
|
|
212
245
|
}
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "43.25.
|
|
25
|
+
packageVersion: "43.25.14",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "43.25.
|
|
5
|
+
packageVersion: "43.25.14"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,6 +6,8 @@ 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';
|
|
9
11
|
import { getIframeSandboxAttribute } from '../../../utils';
|
|
10
12
|
import { IFrame } from './IFrame';
|
|
11
13
|
import { IframeDwellTracker } from './IframeDwellTracker';
|
|
@@ -30,6 +32,7 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
30
32
|
title,
|
|
31
33
|
extensionKey
|
|
32
34
|
}, iframeRef) => {
|
|
35
|
+
const doc = getDocument();
|
|
33
36
|
const [isIframeLoaded, setIframeLoaded] = useState(false);
|
|
34
37
|
const [isMouseOver, setMouseOver] = useState(false);
|
|
35
38
|
const [isWindowFocused, setWindowFocused] = useState(true);
|
|
@@ -62,8 +65,16 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
62
65
|
useEffect(() => {
|
|
63
66
|
const onBlur = () => {
|
|
64
67
|
setWindowFocused(false);
|
|
65
|
-
if (
|
|
66
|
-
|
|
68
|
+
if (fg('jpx-833-smart-links-graphql-provider')) {
|
|
69
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
70
|
+
onIframeFocus && onIframeFocus();
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
// The below will be removed as part of FG cleanup
|
|
74
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
75
|
+
if (document.activeElement === ref.current) {
|
|
76
|
+
onIframeFocus && onIframeFocus();
|
|
77
|
+
}
|
|
67
78
|
}
|
|
68
79
|
};
|
|
69
80
|
const onFocus = () => {
|
|
@@ -75,7 +86,7 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
|
|
|
75
86
|
window.removeEventListener('blur', onBlur);
|
|
76
87
|
window.removeEventListener('focus', onFocus);
|
|
77
88
|
};
|
|
78
|
-
}, [ref, onIframeFocus]);
|
|
89
|
+
}, [ref, onIframeFocus, doc]);
|
|
79
90
|
if (!url) {
|
|
80
91
|
return null;
|
|
81
92
|
}
|
|
@@ -120,9 +131,20 @@ export const FrameUpdated = /*#__PURE__*/React.forwardRef(({
|
|
|
120
131
|
title,
|
|
121
132
|
extensionKey
|
|
122
133
|
}, iframeRef) => {
|
|
134
|
+
var _doc$hasFocus;
|
|
135
|
+
const doc = getDocument();
|
|
123
136
|
const [isIframeLoaded, setIframeLoaded] = useState(false);
|
|
124
137
|
const [isMouseOver, setMouseOver] = useState(false);
|
|
125
|
-
|
|
138
|
+
// Accessing the document here for SSR where document.hasFocus may be absent breaks SSR
|
|
139
|
+
// when we're trying to load things like Loom frames in SSR
|
|
140
|
+
// We _could_ either throw a guard in here (i.e check for the existence of document)
|
|
141
|
+
// _or_
|
|
142
|
+
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
143
|
+
// which already seems to be existing behavior in a useEffect below.
|
|
144
|
+
const [isWindowFocused, setWindowFocused] = useState(
|
|
145
|
+
// The below will be removed as part of FG cleanup
|
|
146
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
147
|
+
fg('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus !== void 0 ? _doc$hasFocus : false : document.hasFocus());
|
|
126
148
|
|
|
127
149
|
// Use prop if provided (from wrapper), otherwise use local state (for backward compatibility)
|
|
128
150
|
const effectiveMouseOver = isMouseOverProp !== undefined ? isMouseOverProp : isMouseOver;
|
|
@@ -153,12 +175,23 @@ export const FrameUpdated = /*#__PURE__*/React.forwardRef(({
|
|
|
153
175
|
};
|
|
154
176
|
}, [threshold, mergedRef]);
|
|
155
177
|
useEffect(() => {
|
|
178
|
+
var _doc$hasFocus2;
|
|
156
179
|
// Initialize with current focus state
|
|
157
|
-
|
|
180
|
+
// The below will be removed as part of FG cleanup
|
|
181
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
182
|
+
setWindowFocused(fg('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus2 = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus2 !== void 0 ? _doc$hasFocus2 : false : document.hasFocus());
|
|
158
183
|
const onBlur = () => {
|
|
159
184
|
setWindowFocused(false);
|
|
160
|
-
if (
|
|
161
|
-
|
|
185
|
+
if (fg('jpx-833-smart-links-graphql-provider')) {
|
|
186
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
187
|
+
onIframeFocus && onIframeFocus();
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
// The below will be removed as part of FG cleanup
|
|
191
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
192
|
+
if (document.activeElement === ref.current) {
|
|
193
|
+
onIframeFocus && onIframeFocus();
|
|
194
|
+
}
|
|
162
195
|
}
|
|
163
196
|
};
|
|
164
197
|
const onFocus = () => {
|
|
@@ -170,7 +203,7 @@ export const FrameUpdated = /*#__PURE__*/React.forwardRef(({
|
|
|
170
203
|
window.removeEventListener('blur', onBlur);
|
|
171
204
|
window.removeEventListener('focus', onFocus);
|
|
172
205
|
};
|
|
173
|
-
}, [ref, onIframeFocus]);
|
|
206
|
+
}, [ref, onIframeFocus, doc]);
|
|
174
207
|
if (!url) {
|
|
175
208
|
return null;
|
|
176
209
|
}
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "43.25.
|
|
15
|
+
packageVersion: "43.25.14",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -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: "43.25.
|
|
7
|
+
packageVersion: "43.25.14"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -7,6 +7,8 @@ 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';
|
|
10
12
|
import { getIframeSandboxAttribute } from '../../../utils';
|
|
11
13
|
import { IFrame } from './IFrame';
|
|
12
14
|
import { IframeDwellTracker } from './IframeDwellTracker';
|
|
@@ -31,6 +33,7 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
31
33
|
onIframeFocus = _ref.onIframeFocus,
|
|
32
34
|
title = _ref.title,
|
|
33
35
|
extensionKey = _ref.extensionKey;
|
|
36
|
+
var doc = getDocument();
|
|
34
37
|
var _useState = useState(false),
|
|
35
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
39
|
isIframeLoaded = _useState2[0],
|
|
@@ -77,8 +80,16 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
77
80
|
useEffect(function () {
|
|
78
81
|
var onBlur = function onBlur() {
|
|
79
82
|
setWindowFocused(false);
|
|
80
|
-
if (
|
|
81
|
-
|
|
83
|
+
if (fg('jpx-833-smart-links-graphql-provider')) {
|
|
84
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
85
|
+
onIframeFocus && onIframeFocus();
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
// The below will be removed as part of FG cleanup
|
|
89
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
90
|
+
if (document.activeElement === ref.current) {
|
|
91
|
+
onIframeFocus && onIframeFocus();
|
|
92
|
+
}
|
|
82
93
|
}
|
|
83
94
|
};
|
|
84
95
|
var onFocus = function onFocus() {
|
|
@@ -90,7 +101,7 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
90
101
|
window.removeEventListener('blur', onBlur);
|
|
91
102
|
window.removeEventListener('focus', onFocus);
|
|
92
103
|
};
|
|
93
|
-
}, [ref, onIframeFocus]);
|
|
104
|
+
}, [ref, onIframeFocus, doc]);
|
|
94
105
|
if (!url) {
|
|
95
106
|
return null;
|
|
96
107
|
}
|
|
@@ -124,6 +135,7 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
|
|
|
124
135
|
}));
|
|
125
136
|
});
|
|
126
137
|
export var FrameUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef) {
|
|
138
|
+
var _doc$hasFocus;
|
|
127
139
|
var url = _ref2.url,
|
|
128
140
|
_ref2$isTrusted = _ref2.isTrusted,
|
|
129
141
|
isTrusted = _ref2$isTrusted === void 0 ? false : _ref2$isTrusted,
|
|
@@ -135,6 +147,7 @@ export var FrameUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, iframeR
|
|
|
135
147
|
isMouseOverProp = _ref2.isMouseOver,
|
|
136
148
|
title = _ref2.title,
|
|
137
149
|
extensionKey = _ref2.extensionKey;
|
|
150
|
+
var doc = getDocument();
|
|
138
151
|
var _useState1 = useState(false),
|
|
139
152
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
140
153
|
isIframeLoaded = _useState10[0],
|
|
@@ -143,7 +156,16 @@ export var FrameUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, iframeR
|
|
|
143
156
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
144
157
|
isMouseOver = _useState12[0],
|
|
145
158
|
setMouseOver = _useState12[1];
|
|
146
|
-
|
|
159
|
+
// Accessing the document here for SSR where document.hasFocus may be absent breaks SSR
|
|
160
|
+
// when we're trying to load things like Loom frames in SSR
|
|
161
|
+
// We _could_ either throw a guard in here (i.e check for the existence of document)
|
|
162
|
+
// _or_
|
|
163
|
+
// we can default to false, and set this state once the frame ref is available in a useEffect (safer IMO)
|
|
164
|
+
// which already seems to be existing behavior in a useEffect below.
|
|
165
|
+
var _useState13 = useState(
|
|
166
|
+
// The below will be removed as part of FG cleanup
|
|
167
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
168
|
+
fg('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus !== void 0 ? _doc$hasFocus : false : document.hasFocus()),
|
|
147
169
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
148
170
|
isWindowFocused = _useState14[0],
|
|
149
171
|
setWindowFocused = _useState14[1];
|
|
@@ -182,12 +204,23 @@ export var FrameUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, iframeR
|
|
|
182
204
|
};
|
|
183
205
|
}, [threshold, mergedRef]);
|
|
184
206
|
useEffect(function () {
|
|
207
|
+
var _doc$hasFocus2;
|
|
185
208
|
// Initialize with current focus state
|
|
186
|
-
|
|
209
|
+
// The below will be removed as part of FG cleanup
|
|
210
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
211
|
+
setWindowFocused(fg('jpx-833-smart-links-graphql-provider') ? (_doc$hasFocus2 = doc === null || doc === void 0 ? void 0 : doc.hasFocus()) !== null && _doc$hasFocus2 !== void 0 ? _doc$hasFocus2 : false : document.hasFocus());
|
|
187
212
|
var onBlur = function onBlur() {
|
|
188
213
|
setWindowFocused(false);
|
|
189
|
-
if (
|
|
190
|
-
|
|
214
|
+
if (fg('jpx-833-smart-links-graphql-provider')) {
|
|
215
|
+
if ((doc === null || doc === void 0 ? void 0 : doc.activeElement) === ref.current) {
|
|
216
|
+
onIframeFocus && onIframeFocus();
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
// The below will be removed as part of FG cleanup
|
|
220
|
+
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage
|
|
221
|
+
if (document.activeElement === ref.current) {
|
|
222
|
+
onIframeFocus && onIframeFocus();
|
|
223
|
+
}
|
|
191
224
|
}
|
|
192
225
|
};
|
|
193
226
|
var onFocus = function onFocus() {
|
|
@@ -199,7 +232,7 @@ export var FrameUpdated = /*#__PURE__*/React.forwardRef(function (_ref2, iframeR
|
|
|
199
232
|
window.removeEventListener('blur', onBlur);
|
|
200
233
|
window.removeEventListener('focus', onFocus);
|
|
201
234
|
};
|
|
202
|
-
}, [ref, onIframeFocus]);
|
|
235
|
+
}, [ref, onIframeFocus, doc]);
|
|
203
236
|
if (!url) {
|
|
204
237
|
return null;
|
|
205
238
|
}
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "43.25.
|
|
18
|
+
packageVersion: "43.25.14",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.25.
|
|
3
|
+
"version": "43.25.15",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@atlaskit/avatar": "^25.8.0",
|
|
34
34
|
"@atlaskit/avatar-group": "^12.4.0",
|
|
35
35
|
"@atlaskit/badge": "^18.4.0",
|
|
36
|
+
"@atlaskit/browser-apis": "^0.0.1",
|
|
36
37
|
"@atlaskit/button": "^23.10.0",
|
|
37
38
|
"@atlaskit/checkbox": "^17.3.0",
|
|
38
39
|
"@atlaskit/css": "^0.19.0",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"@atlaskit/textfield": "^8.2.0",
|
|
73
74
|
"@atlaskit/theme": "^22.0.0",
|
|
74
75
|
"@atlaskit/tile": "^1.0.0",
|
|
75
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
76
|
+
"@atlaskit/tmp-editor-statsig": "^34.0.0",
|
|
76
77
|
"@atlaskit/tokens": "^11.0.0",
|
|
77
78
|
"@atlaskit/tooltip": "^20.14.0",
|
|
78
79
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
107
108
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
108
109
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
109
|
-
"@atlassian/gemini": "^1.
|
|
110
|
+
"@atlassian/gemini": "^1.36.0",
|
|
110
111
|
"@atlassian/testing-library": "^0.4.0",
|
|
111
112
|
"@testing-library/dom": "^10.1.0",
|
|
112
113
|
"@testing-library/jest-dom": "^6.4.5",
|
|
@@ -230,6 +231,9 @@
|
|
|
230
231
|
},
|
|
231
232
|
"platform_sl_3p_auth_rovo_action_kill_switch": {
|
|
232
233
|
"type": "boolean"
|
|
234
|
+
},
|
|
235
|
+
"jpx-833-smart-links-graphql-provider": {
|
|
236
|
+
"type": "boolean"
|
|
233
237
|
}
|
|
234
238
|
},
|
|
235
239
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|