@atlaskit/onboarding 10.4.0 → 10.4.1

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,11 @@
1
1
  # @atlaskit/onboarding
2
2
 
3
+ ## 10.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e4b612d1c48`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4b612d1c48) - Internal migration to bind-event-listener for safer DOM Event cleanup
8
+
3
9
  ## 10.4.0
4
10
 
5
11
  ### Minor Changes
@@ -54,7 +54,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
54
54
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
55
55
 
56
56
  var packageName = "@atlaskit/onboarding";
57
- var packageVersion = "10.4.0";
57
+ var packageVersion = "10.4.1";
58
58
 
59
59
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
60
60
  (0, _inherits2.default)(SpotlightDialog, _Component);
@@ -33,7 +33,7 @@ var baseShadow = "0 0 0 2px ".concat("var(--ds-border-discovery, ".concat(_color
33
33
  var easing = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
34
34
  var pulseKeyframes = (0, _core.keyframes)({
35
35
  '0%, 33%': {
36
- boxShadow: "".concat(baseShadow, ", 0 0 0 ").concat("var(--ds-border-discovery, rgba(101, 84, 192, 1))")
36
+ boxShadow: "".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, rgba(101, 84, 192, 1))")
37
37
  },
38
38
  '66%, 100%': {
39
39
  boxShadow: "".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")
@@ -11,6 +11,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
 
12
12
  var _react = require("react");
13
13
 
14
+ var _bindEventListener = require("bind-event-listener");
15
+
14
16
  var getElementRect = function getElementRect(element) {
15
17
  var _element$getBoundingC = element.getBoundingClientRect(),
16
18
  height = _element$getBoundingC.height,
@@ -53,10 +55,10 @@ var useElementBox = function useElementBox(element) {
53
55
  });
54
56
  };
55
57
 
56
- window.addEventListener('resize', onResize);
57
- return function () {
58
- window.removeEventListener('resize', onResize);
59
- };
58
+ return (0, _bindEventListener.bind)(window, {
59
+ type: 'resize',
60
+ listener: onResize
61
+ });
60
62
  }, [element]);
61
63
  return box;
62
64
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,7 @@ import { DialogImage } from '../styled/dialog';
7
7
  import SpotlightCard from './spotlight-card';
8
8
  import ValueChanged from './value-changed';
9
9
  const packageName = "@atlaskit/onboarding";
10
- const packageVersion = "10.4.0";
10
+ const packageVersion = "10.4.1";
11
11
 
12
12
  class SpotlightDialog extends Component {
13
13
  constructor(...args) {
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useLayoutEffect, useState } from 'react';
2
+ import { bind } from 'bind-event-listener';
2
3
 
3
4
  const getElementRect = element => {
4
5
  const {
@@ -38,10 +39,10 @@ export const useElementBox = element => {
38
39
  });
39
40
  };
40
41
 
41
- window.addEventListener('resize', onResize);
42
- return () => {
43
- window.removeEventListener('resize', onResize);
44
- };
42
+ return bind(window, {
43
+ type: 'resize',
44
+ listener: onResize
45
+ });
45
46
  }, [element]);
46
47
  return box;
47
48
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -24,7 +24,7 @@ import { DialogImage } from '../styled/dialog';
24
24
  import SpotlightCard from './spotlight-card';
25
25
  import ValueChanged from './value-changed';
26
26
  var packageName = "@atlaskit/onboarding";
27
- var packageVersion = "10.4.0";
27
+ var packageVersion = "10.4.1";
28
28
 
29
29
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
30
30
  _inherits(SpotlightDialog, _Component);
@@ -19,7 +19,7 @@ var baseShadow = "0 0 0 2px ".concat("var(--ds-border-discovery, ".concat(P300,
19
19
  var easing = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
20
20
  var pulseKeyframes = keyframes({
21
21
  '0%, 33%': {
22
- boxShadow: "".concat(baseShadow, ", 0 0 0 ").concat("var(--ds-border-discovery, rgba(101, 84, 192, 1))")
22
+ boxShadow: "".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, rgba(101, 84, 192, 1))")
23
23
  },
24
24
  '66%, 100%': {
25
25
  boxShadow: "".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")
@@ -1,5 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useEffect, useLayoutEffect, useState } from 'react';
3
+ import { bind } from 'bind-event-listener';
3
4
 
4
5
  var getElementRect = function getElementRect(element) {
5
6
  var _element$getBoundingC = element.getBoundingClientRect(),
@@ -43,10 +44,10 @@ export var useElementBox = function useElementBox(element) {
43
44
  });
44
45
  };
45
46
 
46
- window.addEventListener('resize', onResize);
47
- return function () {
48
- window.removeEventListener('resize', onResize);
49
- };
47
+ return bind(window, {
48
+ type: 'resize',
49
+ listener: onResize
50
+ });
50
51
  }, [element]);
51
52
  return box;
52
53
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "description": "An onboarding spotlight introduces new features to users through focused messages or multi-step tours.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,7 +20,8 @@
20
20
  "deprecatedAutoEntryPoints": true,
21
21
  "releaseModel": "scheduled",
22
22
  "website": {
23
- "name": "Onboarding (spotlight)"
23
+ "name": "Onboarding (spotlight)",
24
+ "category": "Components"
24
25
  }
25
26
  },
26
27
  "dependencies": {
@@ -33,6 +34,7 @@
33
34
  "@atlaskit/tokens": "^0.10.0",
34
35
  "@babel/runtime": "^7.0.0",
35
36
  "@emotion/core": "^10.0.9",
37
+ "bind-event-listener": "^2.1.0",
36
38
  "exenv": "^1.2.2",
37
39
  "memoize-one": "^6.0.0",
38
40
  "react-focus-lock": "^2.5.2",
@@ -67,6 +69,7 @@
67
69
  "import-structure": "atlassian-conventions"
68
70
  },
69
71
  "@repo/internal": {
72
+ "dom-events": "use-bind-event-listener",
70
73
  "analytics": "analytics-next",
71
74
  "theming": "tokens",
72
75
  "styling": [