@aiszlab/relax 1.2.28-beta.1 → 1.2.28-beta.3

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.
@@ -1,12 +1,6 @@
1
1
  import { useState, useCallback, useMemo } from 'react';
2
2
  import { clamp } from '../utils/clamp.mjs';
3
- import '../utils/debounce.mjs';
4
- import 'rxjs';
5
3
  import { useDefault } from './use-default.mjs';
6
- import './use-scroll-locker.mjs';
7
- import '../dom/scroll-to.mjs';
8
- import './use-toggleable.mjs';
9
- import 'react-is';
10
4
 
11
5
  /**
12
6
  * @author murukal
@@ -11,5 +11,5 @@ type UseFoucsBy<T> = Pick<DOMAttributes<T>, 'onFocus' | 'onBlur'> & {
11
11
  * dom attributes
12
12
  */
13
13
  type UsedFocus<T> = [boolean, Required<Pick<DOMAttributes<T>, 'onFocus' | 'onBlur'>>];
14
- export declare const useFoucs: <T = Element>(useBy: UseFoucsBy<T>) => UsedFocus<T>;
14
+ export declare const useFoucs: <T = Element>(useBy?: UseFoucsBy<T> | undefined) => UsedFocus<T>;
15
15
  export {};
@@ -5,11 +5,11 @@ import { chain } from '../utils/chain.mjs';
5
5
  const useFoucs = (useBy) => {
6
6
  const [isFocused, { turnOn, turnOff }] = useBoolean(false);
7
7
  const onFocus = useCallback(() => {
8
- chain(useBy.onFocus, turnOn, () => { var _a; return (_a = useBy.onFocusChange) === null || _a === void 0 ? void 0 : _a.call(useBy, true); })();
9
- }, [useBy.onFocus, useBy.onFocusChange]);
8
+ chain(useBy === null || useBy === void 0 ? void 0 : useBy.onFocus, turnOn, () => { var _a; return (_a = useBy === null || useBy === void 0 ? void 0 : useBy.onFocusChange) === null || _a === void 0 ? void 0 : _a.call(useBy, true); })();
9
+ }, [useBy === null || useBy === void 0 ? void 0 : useBy.onFocus, useBy === null || useBy === void 0 ? void 0 : useBy.onFocusChange]);
10
10
  const onBlur = useCallback(() => {
11
- chain(useBy.onBlur, turnOff, () => { var _a; return (_a = useBy.onFocusChange) === null || _a === void 0 ? void 0 : _a.call(useBy, false); })();
12
- }, [useBy.onBlur, useBy.onFocusChange]);
11
+ chain(useBy === null || useBy === void 0 ? void 0 : useBy.onBlur, turnOff, () => { var _a; return (_a = useBy === null || useBy === void 0 ? void 0 : useBy.onFocusChange) === null || _a === void 0 ? void 0 : _a.call(useBy, false); })();
12
+ }, [useBy === null || useBy === void 0 ? void 0 : useBy.onBlur, useBy === null || useBy === void 0 ? void 0 : useBy.onFocusChange]);
13
13
  return [isFocused, { onFocus, onBlur }];
14
14
  };
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.2.28-beta.1",
3
+ "version": "1.2.28-beta.3",
4
4
  "description": "react utils collection",
5
5
  "type": "module",
6
6
  "exports": {