@reactuses/core 5.0.5 → 5.0.6

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/README.md CHANGED
@@ -58,7 +58,7 @@ Refer to [documentations](https://reactuse.com/) for more details.
58
58
 
59
59
  ## Feedback
60
60
 
61
- You can submit an [issue](https://github.com/childrentime/reactuse/issues) or provide feedback on [Discord](https://discord.gg/WzDtCCFF).
61
+ You can submit an [issue](https://github.com/childrentime/reactuse/issues) or provide feedback on [Discord](https://discord.gg/HMsq6cFkKp).
62
62
 
63
63
  <hr/>
64
64
 
package/dist/index.cjs CHANGED
@@ -885,7 +885,8 @@ const useDraggable = (target, options = {})=>{
885
885
  return [
886
886
  position.x,
887
887
  position.y,
888
- !!pressedDelta
888
+ !!pressedDelta,
889
+ setPositon
889
890
  ];
890
891
  };
891
892
 
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, useEffect, Dispatch, SetStateAction, useLayoutEffect } from 'react';
2
+ import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, Dispatch, SetStateAction, useEffect, useLayoutEffect } from 'react';
3
3
  import Cookies from 'js-cookie';
4
4
  import { DebounceSettings, ThrottleSettings, DebouncedFunc as DebouncedFunc$1 } from 'lodash-es';
5
5
  import * as lodash from 'lodash';
@@ -448,10 +448,12 @@ interface Position {
448
448
  * - x
449
449
  * - y
450
450
  * - 元素是否在拖动中
451
+ * - 设置元素的位置
451
452
  * @returns_en A tuple with the following elements:
452
453
  * - x
453
454
  * - y
454
455
  * - Whether the element is being dragged
456
+ * set the element position
455
457
  */
456
458
  type UseDraggable = (
457
459
  /**
@@ -463,7 +465,7 @@ target: RefObject<HTMLElement | SVGElement>,
463
465
  * @zh 可选参数
464
466
  * @en optional params
465
467
  */
466
- options?: UseDraggableOptions) => readonly [number, number, boolean];
468
+ options?: UseDraggableOptions) => readonly [number, number, boolean, Dispatch<SetStateAction<Position>>];
467
469
  /**
468
470
  * @title UseDraggableOptions
469
471
  */
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, useEffect, Dispatch, SetStateAction, useLayoutEffect } from 'react';
2
+ import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, Dispatch, SetStateAction, useEffect, useLayoutEffect } from 'react';
3
3
  import Cookies from 'js-cookie';
4
4
  import { DebounceSettings, ThrottleSettings, DebouncedFunc as DebouncedFunc$1 } from 'lodash-es';
5
5
  import * as lodash from 'lodash';
@@ -448,10 +448,12 @@ interface Position {
448
448
  * - x
449
449
  * - y
450
450
  * - 元素是否在拖动中
451
+ * - 设置元素的位置
451
452
  * @returns_en A tuple with the following elements:
452
453
  * - x
453
454
  * - y
454
455
  * - Whether the element is being dragged
456
+ * set the element position
455
457
  */
456
458
  type UseDraggable = (
457
459
  /**
@@ -463,7 +465,7 @@ target: RefObject<HTMLElement | SVGElement>,
463
465
  * @zh 可选参数
464
466
  * @en optional params
465
467
  */
466
- options?: UseDraggableOptions) => readonly [number, number, boolean];
468
+ options?: UseDraggableOptions) => readonly [number, number, boolean, Dispatch<SetStateAction<Position>>];
467
469
  /**
468
470
  * @title UseDraggableOptions
469
471
  */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, useEffect, Dispatch, SetStateAction, useLayoutEffect } from 'react';
2
+ import react__default, { DependencyList, RefObject, MutableRefObject, EffectCallback, Dispatch, SetStateAction, useEffect, useLayoutEffect } from 'react';
3
3
  import Cookies from 'js-cookie';
4
4
  import { DebounceSettings, ThrottleSettings, DebouncedFunc as DebouncedFunc$1 } from 'lodash-es';
5
5
  import * as lodash from 'lodash';
@@ -448,10 +448,12 @@ interface Position {
448
448
  * - x
449
449
  * - y
450
450
  * - 元素是否在拖动中
451
+ * - 设置元素的位置
451
452
  * @returns_en A tuple with the following elements:
452
453
  * - x
453
454
  * - y
454
455
  * - Whether the element is being dragged
456
+ * set the element position
455
457
  */
456
458
  type UseDraggable = (
457
459
  /**
@@ -463,7 +465,7 @@ target: RefObject<HTMLElement | SVGElement>,
463
465
  * @zh 可选参数
464
466
  * @en optional params
465
467
  */
466
- options?: UseDraggableOptions) => readonly [number, number, boolean];
468
+ options?: UseDraggableOptions) => readonly [number, number, boolean, Dispatch<SetStateAction<Position>>];
467
469
  /**
468
470
  * @title UseDraggableOptions
469
471
  */
package/dist/index.mjs CHANGED
@@ -878,7 +878,8 @@ const useDraggable = (target, options = {})=>{
878
878
  return [
879
879
  position.x,
880
880
  position.y,
881
- !!pressedDelta
881
+ !!pressedDelta,
882
+ setPositon
882
883
  ];
883
884
  };
884
885
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactuses/core",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "license": "Unlicense",
5
5
  "homepage": "https://www.reactuse.com/",
6
6
  "repository": {