@atlaskit/onboarding 14.3.8 → 14.4.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,13 @@
1
1
  # @atlaskit/onboarding
2
2
 
3
+ ## 14.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`098c92cc2bdcd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098c92cc2bdcd) -
8
+ Add `checkVisibility` to `useSpotlight` return value, allowing consumers to determine whether a
9
+ spotlight target is visible as determined by `checkVisibility`
10
+
3
11
  ## 14.3.8
4
12
 
5
13
  ### Patch Changes
@@ -19,9 +19,16 @@ function useSpotlight() {
19
19
  var isTargetRendered = (0, _react.useCallback)(function (target) {
20
20
  return !!targetRef.current[target];
21
21
  }, []);
22
+ var checkVisibility = (0, _react.useCallback)(function (target) {
23
+ var _targetRef$current$ta;
24
+ return ((_targetRef$current$ta = targetRef.current[target]) === null || _targetRef$current$ta === void 0 ? void 0 : _targetRef$current$ta.checkVisibility) || function () {
25
+ return false;
26
+ };
27
+ }, []);
22
28
  return (0, _react.useMemo)(function () {
23
29
  return {
24
- isTargetRendered: isTargetRendered
30
+ isTargetRendered: isTargetRendered,
31
+ checkVisibility: checkVisibility
25
32
  };
26
- }, [isTargetRendered]);
33
+ }, [isTargetRendered, checkVisibility]);
27
34
  }
@@ -13,7 +13,12 @@ export default function useSpotlight() {
13
13
  targetRef.current = targets;
14
14
  }, [targets]);
15
15
  const isTargetRendered = useCallback(target => !!targetRef.current[target], []);
16
+ const checkVisibility = useCallback(target => {
17
+ var _targetRef$current$ta;
18
+ return ((_targetRef$current$ta = targetRef.current[target]) === null || _targetRef$current$ta === void 0 ? void 0 : _targetRef$current$ta.checkVisibility) || (() => false);
19
+ }, []);
16
20
  return useMemo(() => ({
17
- isTargetRendered
18
- }), [isTargetRendered]);
21
+ isTargetRendered,
22
+ checkVisibility
23
+ }), [isTargetRendered, checkVisibility]);
19
24
  }
@@ -14,9 +14,16 @@ export default function useSpotlight() {
14
14
  var isTargetRendered = useCallback(function (target) {
15
15
  return !!targetRef.current[target];
16
16
  }, []);
17
+ var checkVisibility = useCallback(function (target) {
18
+ var _targetRef$current$ta;
19
+ return ((_targetRef$current$ta = targetRef.current[target]) === null || _targetRef$current$ta === void 0 ? void 0 : _targetRef$current$ta.checkVisibility) || function () {
20
+ return false;
21
+ };
22
+ }, []);
17
23
  return useMemo(function () {
18
24
  return {
19
- isTargetRendered: isTargetRendered
25
+ isTargetRendered: isTargetRendered,
26
+ checkVisibility: checkVisibility
20
27
  };
21
- }, [isTargetRendered]);
28
+ }, [isTargetRendered, checkVisibility]);
22
29
  }
@@ -3,4 +3,5 @@
3
3
  */
4
4
  export default function useSpotlight(): {
5
5
  isTargetRendered: (target: string) => boolean;
6
+ checkVisibility: (target: string) => (options?: CheckVisibilityOptions) => boolean;
6
7
  };
@@ -3,4 +3,5 @@
3
3
  */
4
4
  export default function useSpotlight(): {
5
5
  isTargetRendered: (target: string) => boolean;
6
+ checkVisibility: (target: string) => (options?: CheckVisibilityOptions) => boolean;
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "14.3.8",
3
+ "version": "14.4.0",
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/"