@atlaskit/smart-card 26.1.5 → 26.2.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,22 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`877b4f8f7fc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/877b4f8f7fc) - Remove iframe dwell tracking feature flag. Smart card embedded iframes will always track dwell events.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 26.1.6
14
+
15
+ ### Patch Changes
16
+
17
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
18
+ - Updated dependencies
19
+
3
20
  ## 26.1.5
4
21
 
5
22
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.1.5",
3
+ "version": "26.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,6 @@ var _react = require("@emotion/react");
11
11
  var _react2 = _interopRequireWildcard(require("react"));
12
12
  var _utils = require("../../../utils");
13
13
  var _IframeDwellTracker = require("./IframeDwellTracker");
14
- var _linkProvider = require("@atlaskit/link-provider");
15
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
16
  /** @jsx jsx */
@@ -48,7 +47,6 @@ var Frame = /*#__PURE__*/_react2.default.forwardRef(function (_ref, iframeRef) {
48
47
  setWindowFocused = _useState6[1];
49
48
  var ref = (0, _react2.useRef)();
50
49
  var mergedRef = mergeRefs([iframeRef, ref]);
51
- var trackIframeDwellEvents = (0, _linkProvider.useFeatureFlag)('trackIframeDwellEvents');
52
50
  var _useState7 = (0, _react2.useState)(0),
53
51
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
54
52
  percentVisible = _useState8[0],
@@ -63,9 +61,6 @@ var Frame = /*#__PURE__*/_react2.default.forwardRef(function (_ref, iframeRef) {
63
61
  _useState10 = (0, _slicedToArray2.default)(_useState9, 1),
64
62
  threshold = _useState10[0];
65
63
  (0, _react2.useEffect)(function () {
66
- if (!trackIframeDwellEvents) {
67
- return;
68
- }
69
64
  if (!ref || !ref.current) {
70
65
  return;
71
66
  }
@@ -80,11 +75,8 @@ var Frame = /*#__PURE__*/_react2.default.forwardRef(function (_ref, iframeRef) {
80
75
  return function () {
81
76
  observer.disconnect();
82
77
  };
83
- }, [trackIframeDwellEvents, threshold, mergedRef]);
78
+ }, [threshold, mergedRef]);
84
79
  (0, _react2.useEffect)(function () {
85
- if (!trackIframeDwellEvents) {
86
- return;
87
- }
88
80
  var onBlur = function onBlur() {
89
81
  setWindowFocused(false);
90
82
  if (document.activeElement === ref.current) {
@@ -100,17 +92,17 @@ var Frame = /*#__PURE__*/_react2.default.forwardRef(function (_ref, iframeRef) {
100
92
  window.removeEventListener('blur', onBlur);
101
93
  window.removeEventListener('focus', onFocus);
102
94
  };
103
- }, [trackIframeDwellEvents, ref, onIframeFocus]);
95
+ }, [ref, onIframeFocus]);
104
96
  if (!url) {
105
97
  return null;
106
98
  }
107
- return (0, _react.jsx)(_react2.default.Fragment, null, trackIframeDwellEvents ? (0, _react.jsx)(_IframeDwellTracker.IframeDwellTracker, {
99
+ return (0, _react.jsx)(_react2.default.Fragment, null, (0, _react.jsx)(_IframeDwellTracker.IframeDwellTracker, {
108
100
  isIframeLoaded: isIframeLoaded,
109
101
  isMouseOver: isMouseOver,
110
102
  isWindowFocused: isWindowFocused,
111
103
  iframePercentVisible: percentVisible,
112
104
  onIframeDwell: onIframeDwell
113
- }) : null, (0, _react.jsx)("iframe", {
105
+ }), (0, _react.jsx)("iframe", {
114
106
  ref: mergedRef,
115
107
  src: url,
116
108
  "data-testid": "".concat(testId, "-frame"),
@@ -125,12 +117,12 @@ var Frame = /*#__PURE__*/_react2.default.forwardRef(function (_ref, iframeRef) {
125
117
  overflow: 'hidden',
126
118
  borderRadius: '3px'
127
119
  },
128
- onMouseEnter: trackIframeDwellEvents ? function () {
120
+ onMouseEnter: function onMouseEnter() {
129
121
  return setMouseOver(true);
130
- } : undefined,
131
- onMouseLeave: trackIframeDwellEvents ? function () {
122
+ },
123
+ onMouseLeave: function onMouseLeave() {
132
124
  return setMouseOver(false);
133
- } : undefined,
125
+ },
134
126
  allowFullScreen: true,
135
127
  scrolling: "yes",
136
128
  allow: "autoplay; encrypted-media; clipboard-write",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.1.5",
3
+ "version": "26.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,6 @@ import { jsx } from '@emotion/react';
3
3
  import React, { useEffect, useState, useRef } from 'react';
4
4
  import { getIframeSandboxAttribute } from '../../../utils';
5
5
  import { IframeDwellTracker } from './IframeDwellTracker';
6
- import { useFeatureFlag } from '@atlaskit/link-provider';
7
6
  function mergeRefs(refs) {
8
7
  return value => {
9
8
  refs.forEach(ref => {
@@ -27,7 +26,6 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
27
26
  const [isWindowFocused, setWindowFocused] = useState(true);
28
27
  const ref = useRef();
29
28
  const mergedRef = mergeRefs([iframeRef, ref]);
30
- const trackIframeDwellEvents = useFeatureFlag('trackIframeDwellEvents');
31
29
  const [percentVisible, setPercentVisible] = useState(0);
32
30
 
33
31
  /**
@@ -37,9 +35,6 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
37
35
  */
38
36
  const [threshold] = useState([0.75, 0.8, 0.85, 0.9, 0.95, 1]);
39
37
  useEffect(() => {
40
- if (!trackIframeDwellEvents) {
41
- return;
42
- }
43
38
  if (!ref || !ref.current) {
44
39
  return;
45
40
  }
@@ -54,11 +49,8 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
54
49
  return () => {
55
50
  observer.disconnect();
56
51
  };
57
- }, [trackIframeDwellEvents, threshold, mergedRef]);
52
+ }, [threshold, mergedRef]);
58
53
  useEffect(() => {
59
- if (!trackIframeDwellEvents) {
60
- return;
61
- }
62
54
  const onBlur = () => {
63
55
  setWindowFocused(false);
64
56
  if (document.activeElement === ref.current) {
@@ -74,17 +66,17 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
74
66
  window.removeEventListener('blur', onBlur);
75
67
  window.removeEventListener('focus', onFocus);
76
68
  };
77
- }, [trackIframeDwellEvents, ref, onIframeFocus]);
69
+ }, [ref, onIframeFocus]);
78
70
  if (!url) {
79
71
  return null;
80
72
  }
81
- return jsx(React.Fragment, null, trackIframeDwellEvents ? jsx(IframeDwellTracker, {
73
+ return jsx(React.Fragment, null, jsx(IframeDwellTracker, {
82
74
  isIframeLoaded: isIframeLoaded,
83
75
  isMouseOver: isMouseOver,
84
76
  isWindowFocused: isWindowFocused,
85
77
  iframePercentVisible: percentVisible,
86
78
  onIframeDwell: onIframeDwell
87
- }) : null, jsx("iframe", {
79
+ }), jsx("iframe", {
88
80
  ref: mergedRef,
89
81
  src: url,
90
82
  "data-testid": `${testId}-frame`,
@@ -99,8 +91,8 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
99
91
  overflow: 'hidden',
100
92
  borderRadius: '3px'
101
93
  },
102
- onMouseEnter: trackIframeDwellEvents ? () => setMouseOver(true) : undefined,
103
- onMouseLeave: trackIframeDwellEvents ? () => setMouseOver(false) : undefined,
94
+ onMouseEnter: () => setMouseOver(true),
95
+ onMouseLeave: () => setMouseOver(false),
104
96
  allowFullScreen: true,
105
97
  scrolling: "yes",
106
98
  allow: "autoplay; encrypted-media; clipboard-write",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.1.5",
3
+ "version": "26.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,6 @@ import { jsx } from '@emotion/react';
4
4
  import React, { useEffect, useState, useRef } from 'react';
5
5
  import { getIframeSandboxAttribute } from '../../../utils';
6
6
  import { IframeDwellTracker } from './IframeDwellTracker';
7
- import { useFeatureFlag } from '@atlaskit/link-provider';
8
7
  function mergeRefs(refs) {
9
8
  return function (value) {
10
9
  refs.forEach(function (ref) {
@@ -37,7 +36,6 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
37
36
  setWindowFocused = _useState6[1];
38
37
  var ref = useRef();
39
38
  var mergedRef = mergeRefs([iframeRef, ref]);
40
- var trackIframeDwellEvents = useFeatureFlag('trackIframeDwellEvents');
41
39
  var _useState7 = useState(0),
42
40
  _useState8 = _slicedToArray(_useState7, 2),
43
41
  percentVisible = _useState8[0],
@@ -52,9 +50,6 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
52
50
  _useState10 = _slicedToArray(_useState9, 1),
53
51
  threshold = _useState10[0];
54
52
  useEffect(function () {
55
- if (!trackIframeDwellEvents) {
56
- return;
57
- }
58
53
  if (!ref || !ref.current) {
59
54
  return;
60
55
  }
@@ -69,11 +64,8 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
69
64
  return function () {
70
65
  observer.disconnect();
71
66
  };
72
- }, [trackIframeDwellEvents, threshold, mergedRef]);
67
+ }, [threshold, mergedRef]);
73
68
  useEffect(function () {
74
- if (!trackIframeDwellEvents) {
75
- return;
76
- }
77
69
  var onBlur = function onBlur() {
78
70
  setWindowFocused(false);
79
71
  if (document.activeElement === ref.current) {
@@ -89,17 +81,17 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
89
81
  window.removeEventListener('blur', onBlur);
90
82
  window.removeEventListener('focus', onFocus);
91
83
  };
92
- }, [trackIframeDwellEvents, ref, onIframeFocus]);
84
+ }, [ref, onIframeFocus]);
93
85
  if (!url) {
94
86
  return null;
95
87
  }
96
- return jsx(React.Fragment, null, trackIframeDwellEvents ? jsx(IframeDwellTracker, {
88
+ return jsx(React.Fragment, null, jsx(IframeDwellTracker, {
97
89
  isIframeLoaded: isIframeLoaded,
98
90
  isMouseOver: isMouseOver,
99
91
  isWindowFocused: isWindowFocused,
100
92
  iframePercentVisible: percentVisible,
101
93
  onIframeDwell: onIframeDwell
102
- }) : null, jsx("iframe", {
94
+ }), jsx("iframe", {
103
95
  ref: mergedRef,
104
96
  src: url,
105
97
  "data-testid": "".concat(testId, "-frame"),
@@ -114,12 +106,12 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
114
106
  overflow: 'hidden',
115
107
  borderRadius: '3px'
116
108
  },
117
- onMouseEnter: trackIframeDwellEvents ? function () {
109
+ onMouseEnter: function onMouseEnter() {
118
110
  return setMouseOver(true);
119
- } : undefined,
120
- onMouseLeave: trackIframeDwellEvents ? function () {
111
+ },
112
+ onMouseLeave: function onMouseLeave() {
121
113
  return setMouseOver(false);
122
- } : undefined,
114
+ },
123
115
  allowFullScreen: true,
124
116
  scrolling: "yes",
125
117
  allow: "autoplay; encrypted-media; clipboard-write",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.1.5",
3
+ "version": "26.2.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,15 +35,15 @@
35
35
  "@atlaskit/avatar": "^21.3.0",
36
36
  "@atlaskit/avatar-group": "^9.3.0",
37
37
  "@atlaskit/button": "^16.7.0",
38
- "@atlaskit/dropdown-menu": "^11.8.0",
38
+ "@atlaskit/dropdown-menu": "^11.9.0",
39
39
  "@atlaskit/icon": "^21.12.0",
40
40
  "@atlaskit/icon-file-type": "^6.4.0",
41
41
  "@atlaskit/icon-object": "^6.3.0",
42
42
  "@atlaskit/icon-priority": "^6.3.0",
43
43
  "@atlaskit/in-product-testing": "^0.2.0",
44
44
  "@atlaskit/link-client-extension": "^1.1.0",
45
- "@atlaskit/linking-common": "^2.10.0",
46
- "@atlaskit/linking-types": "^1.5.0",
45
+ "@atlaskit/linking-common": "^2.11.0",
46
+ "@atlaskit/linking-types": "^1.6.0",
47
47
  "@atlaskit/logo": "^13.14.0",
48
48
  "@atlaskit/lozenge": "^11.4.0",
49
49
  "@atlaskit/media-common": "^4.1.0",
@@ -69,7 +69,7 @@
69
69
  "uuid": "^3.1.0"
70
70
  },
71
71
  "peerDependencies": {
72
- "@atlaskit/link-provider": "^1.6.1",
72
+ "@atlaskit/link-provider": "^1.6.2",
73
73
  "react": "^16.8.0",
74
74
  "react-dom": "^16.8.0",
75
75
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -88,7 +88,7 @@
88
88
  "@atlaskit/media-integration-test-helpers": "^2.6.0",
89
89
  "@atlaskit/media-test-helpers": "^33.0.0",
90
90
  "@atlaskit/page": "^12.3.0",
91
- "@atlaskit/radio": "^5.5.0",
91
+ "@atlaskit/radio": "^5.6.0",
92
92
  "@atlaskit/range": "^7.1.0",
93
93
  "@atlaskit/section-message": "^6.4.0",
94
94
  "@atlaskit/select": "^16.2.0",
package/report.api.md CHANGED
@@ -1264,7 +1264,7 @@ type VoteCount = {
1264
1264
 
1265
1265
  ```json
1266
1266
  {
1267
- "@atlaskit/link-provider": "^1.6.1",
1267
+ "@atlaskit/link-provider": "^1.6.2",
1268
1268
  "react": "^16.8.0",
1269
1269
  "react-dom": "^16.8.0",
1270
1270
  "react-intl-next": "npm:react-intl@^5.18.1"