@siberiacancode/reactuse 0.3.7 → 0.3.9
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/dist/cjs/hooks/useActiveElement/useActiveElement.cjs +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs.map +1 -1
- package/dist/cjs/hooks/useDebounceEffect/useDebounceEffect.cjs +2 -0
- package/dist/cjs/hooks/useDebounceEffect/useDebounceEffect.cjs.map +1 -0
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.cjs.map +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs.map +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs.map +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs.map +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useFocusTrap/useFocusTrap.cjs +1 -1
- package/dist/cjs/hooks/useFocusTrap/useFocusTrap.cjs.map +1 -1
- package/dist/cjs/hooks/useHotkeys/useHotkeys.cjs +1 -1
- package/dist/cjs/hooks/useHotkeys/useHotkeys.cjs.map +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs.map +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.cjs +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.cjs +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.cjs +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.cjs.map +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.cjs +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.cjs.map +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs.map +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs.map +1 -1
- package/dist/cjs/hooks/useMediaControls/useMediaControls.cjs +1 -1
- package/dist/cjs/hooks/useMediaControls/useMediaControls.cjs.map +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs.map +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs.map +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs.map +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs.map +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useRightClick/useRightClick.cjs +1 -1
- package/dist/cjs/hooks/useRightClick/useRightClick.cjs.map +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.cjs +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs.map +1 -1
- package/dist/cjs/hooks/useSize/useSize.cjs +2 -0
- package/dist/cjs/hooks/useSize/useSize.cjs.map +1 -0
- package/dist/cjs/hooks/useSticky/useSticky.cjs +1 -1
- package/dist/cjs/hooks/useSticky/useSticky.cjs.map +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs.map +1 -1
- package/dist/cjs/hooks/useTextareaAutosize/useTextareaAutosize.cjs +1 -1
- package/dist/cjs/hooks/useTextareaAutosize/useTextareaAutosize.cjs.map +1 -1
- package/dist/cjs/hooks/useThrottleEffect/useThrottleEffect.cjs +2 -0
- package/dist/cjs/hooks/useThrottleEffect/useThrottleEffect.cjs.map +1 -0
- package/dist/cjs/hooks/useVisibility/useVisibility.cjs +1 -1
- package/dist/cjs/hooks/useVisibility/useVisibility.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/helpers/isTarget.cjs +1 -1
- package/dist/cjs/utils/helpers/isTarget.cjs.map +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs +5 -5
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs +6 -6
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs.map +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs +6 -6
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
- package/dist/esm/hooks/useCssVar/useCssVar.mjs +5 -5
- package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
- package/dist/esm/hooks/useDebounceEffect/useDebounceEffect.mjs +19 -0
- package/dist/esm/hooks/useDebounceEffect/useDebounceEffect.mjs.map +1 -0
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.mjs +7 -7
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.mjs.map +1 -1
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs +6 -6
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs +12 -12
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
- package/dist/esm/hooks/useDropZone/useDropZone.mjs +3 -3
- package/dist/esm/hooks/useDropZone/useDropZone.mjs.map +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.mjs +10 -10
- package/dist/esm/hooks/useEventListener/useEventListener.mjs.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.mjs +10 -10
- package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
- package/dist/esm/hooks/useFocusTrap/useFocusTrap.mjs +5 -5
- package/dist/esm/hooks/useFocusTrap/useFocusTrap.mjs.map +1 -1
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs +7 -8
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs.map +1 -1
- package/dist/esm/hooks/useHover/useHover.mjs +7 -7
- package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs +6 -6
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs +17 -18
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs +5 -5
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs +3 -4
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs.map +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs +8 -8
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs.map +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs +8 -8
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs.map +1 -1
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs +13 -13
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.mjs +7 -7
- package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
- package/dist/esm/hooks/useMeasure/useMeasure.mjs +3 -3
- package/dist/esm/hooks/useMeasure/useMeasure.mjs.map +1 -1
- package/dist/esm/hooks/useMediaControls/useMediaControls.mjs +4 -4
- package/dist/esm/hooks/useMediaControls/useMediaControls.mjs.map +1 -1
- package/dist/esm/hooks/useMouse/useMouse.mjs +10 -10
- package/dist/esm/hooks/useMouse/useMouse.mjs.map +1 -1
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs +7 -8
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
- package/dist/esm/hooks/usePaint/usePaint.mjs +15 -15
- package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.mjs +24 -25
- package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs +6 -6
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs.map +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs +7 -7
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
- package/dist/esm/hooks/useRightClick/useRightClick.mjs +5 -5
- package/dist/esm/hooks/useRightClick/useRightClick.mjs.map +1 -1
- package/dist/esm/hooks/useScroll/useScroll.mjs +13 -13
- package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs +9 -9
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs.map +1 -1
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs +1 -1
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs.map +1 -1
- package/dist/esm/hooks/useSize/useSize.mjs +31 -0
- package/dist/esm/hooks/useSize/useSize.mjs.map +1 -0
- package/dist/esm/hooks/useSticky/useSticky.mjs +10 -10
- package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +3 -3
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
- package/dist/esm/hooks/useTextareaAutosize/useTextareaAutosize.mjs +13 -13
- package/dist/esm/hooks/useTextareaAutosize/useTextareaAutosize.mjs.map +1 -1
- package/dist/esm/hooks/useThrottleEffect/useThrottleEffect.mjs +22 -0
- package/dist/esm/hooks/useThrottleEffect/useThrottleEffect.mjs.map +1 -0
- package/dist/esm/hooks/useVisibility/useVisibility.mjs +22 -23
- package/dist/esm/hooks/useVisibility/useVisibility.mjs.map +1 -1
- package/dist/esm/index.mjs +110 -102
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/utils/helpers/isTarget.mjs +12 -7
- package/dist/esm/utils/helpers/isTarget.mjs.map +1 -1
- package/dist/types/hooks/sensors.d.ts +1 -1
- package/dist/types/hooks/useDebounceEffect/useDebounceEffect.d.ts +15 -0
- package/dist/types/hooks/useSize/useSize.d.ts +43 -0
- package/dist/types/hooks/useThrottleEffect/useThrottleEffect.d.ts +15 -0
- package/dist/types/hooks/useVisibility/useVisibility.d.ts +1 -1
- package/dist/types/hooks/utilities.d.ts +2 -0
- package/dist/types/utils/helpers/isTarget.d.ts +10 -4
- package/package.json +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs +0 -2
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs.map +0 -1
- package/dist/esm/hooks/useElementSize/useElementSize.mjs +0 -30
- package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +0 -1
- package/dist/types/hooks/useElementSize/useElementSize.d.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTextareaAutosize.mjs","sources":["../../../../src/hooks/useTextareaAutosize/useTextareaAutosize.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { HookTarget } from '@/utils/helpers';\n\nimport { isTarget } from '@/utils/helpers';\n\nimport type { StateRef } from '../useRefState/useRefState';\n\nimport { useRefState } from '../useRefState/useRefState';\n\n/** The use textarea autosize options */\nexport interface UseTextareaAutosizeOptions {\n /** The initial value for the textarea */\n initialValue?: string;\n /** Callback function called when the textarea size changes */\n onResize?: () => void;\n}\n\n/** The use textarea autosize return type */\nexport interface UseTextareaAutosizeReturn {\n /** The current value of the textarea */\n value: string;\n /** Function to clear the textarea value */\n clear: () => void;\n /** Function to set the textarea value */\n set: (value: string) => void;\n}\n\nexport interface UseTextareaAutosize {\n (target: HookTarget, options?: UseTextareaAutosizeOptions): UseTextareaAutosizeReturn;\n\n (target: HookTarget, initialValue: string): UseTextareaAutosizeReturn;\n\n <Target extends HTMLTextAreaElement = HTMLTextAreaElement>(\n initialValue: string,\n target?: never\n ): UseTextareaAutosizeReturn & {\n ref: StateRef<Target>;\n };\n\n <Target extends HTMLTextAreaElement = HTMLTextAreaElement>(\n options?: UseTextareaAutosizeOptions,\n target?: never\n ): UseTextareaAutosizeReturn & {\n ref: StateRef<Target>;\n };\n}\n\n/**\n * @name useTextareaAutosize\n * @description - Hook that automatically adjusts textarea height based on content\n * @category Elements\n * @usage medium\n *\n * @overload\n * @param {HookTarget} target The target textarea element\n * @param {string} [options.initialValue] The initial value for the textarea\n * @param {Function} [options.onResize] Callback function called when the textarea size changes\n * @returns {UseTextareaAutosizeReturn} An object containing value, setValue and clear\n *\n * @example\n * const { value, setValue, clear } = useTextareaAutosize(ref);\n *\n * @overload\n * @param {HookTarget} target The target textarea element\n * @param {string} initialValue The initial value for the textarea\n * @returns {UseTextareaAutosizeReturn} An object containing value, setValue and clear\n *\n * @example\n * const { value, setValue, clear } = useTextareaAutosize(ref, 'initial');\n *\n * @overload\n * @template Target The textarea element type\n * @param {string} initialValue The initial value for the textarea\n * @returns {UseTextareaAutosizeReturn & { ref: StateRef<Target> }} An object containing ref, value, setValue and clear\n *\n * @example\n * const { ref, value, setValue, clear } = useTextareaAutosize('initial');\n *\n * @overload\n * @template Target The textarea element type\n * @param {string} [options.initialValue] The initial value for the textarea\n * @param {Function} [options.onResize] Callback function called when the textarea size changes\n * @returns {UseTextareaAutosizeReturn & { ref: StateRef<Target> }} An object containing ref, value, setValue and clear\n *\n * @example\n * const { ref, value, setValue, clear } = useTextareaAutosize();\n */\nexport const useTextareaAutosize = ((...params: any[]) => {\n const target = (isTarget(params[0]) ? params[0] : undefined) as HookTarget | undefined;\n\n const options = (\n target\n ? typeof params[1] === 'object'\n ? params[1]\n : { initialValue: params[1] }\n : typeof params[0] === 'object'\n ? params[0]\n : { initialValue: params[0] }\n ) as UseTextareaAutosizeOptions | undefined;\n\n const [value, setValue] = useState(options?.initialValue ?? '');\n const internalRef = useRefState<HTMLTextAreaElement>();\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const scrollHeightRef = useRef(0);\n\n const onTextareaResize = () => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const originalMinHeight = textarea.style.minHeight;\n const originalMaxHeight = textarea.style.maxHeight;\n\n textarea.style.height = 'auto';\n textarea.style.minHeight = 'auto';\n textarea.style.maxHeight = 'none';\n\n const scrollHeight = textarea.scrollHeight;\n\n textarea.style.height = `${scrollHeight}px`;\n textarea.style.minHeight = originalMinHeight;\n textarea.style.maxHeight = originalMaxHeight;\n\n if (scrollHeight !== scrollHeightRef.current) options?.onResize?.();\n scrollHeightRef.current = scrollHeight;\n };\n\n const setTextareaValue = (newValue: string) => {\n setValue(newValue);\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.value = newValue;\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n useEffect(() => {\n if (!target && !internalRef.state) return;\n\n const element = (\n target ? isTarget.getElement(target) : internalRef.current\n ) as HTMLTextAreaElement;\n if (!element) return;\n\n textareaRef.current = element;\n if (options?.initialValue) element.value = options.initialValue;\n\n onTextareaResize();\n\n const onInput = (event: InputEvent) => {\n const newValue = (event.target as HTMLTextAreaElement).value;\n setTextareaValue(newValue);\n\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n const onResize = () => {\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n element.addEventListener('input', onInput as EventListener);\n element.addEventListener('resize', onResize as EventListener);\n\n return () => {\n element.removeEventListener('input', onInput as EventListener);\n element.removeEventListener('resize', onResize as EventListener);\n };\n }, [target
|
|
1
|
+
{"version":3,"file":"useTextareaAutosize.mjs","sources":["../../../../src/hooks/useTextareaAutosize/useTextareaAutosize.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { HookTarget } from '@/utils/helpers';\n\nimport { isTarget } from '@/utils/helpers';\n\nimport type { StateRef } from '../useRefState/useRefState';\n\nimport { useRefState } from '../useRefState/useRefState';\n\n/** The use textarea autosize options */\nexport interface UseTextareaAutosizeOptions {\n /** The initial value for the textarea */\n initialValue?: string;\n /** Callback function called when the textarea size changes */\n onResize?: () => void;\n}\n\n/** The use textarea autosize return type */\nexport interface UseTextareaAutosizeReturn {\n /** The current value of the textarea */\n value: string;\n /** Function to clear the textarea value */\n clear: () => void;\n /** Function to set the textarea value */\n set: (value: string) => void;\n}\n\nexport interface UseTextareaAutosize {\n (target: HookTarget, options?: UseTextareaAutosizeOptions): UseTextareaAutosizeReturn;\n\n (target: HookTarget, initialValue: string): UseTextareaAutosizeReturn;\n\n <Target extends HTMLTextAreaElement = HTMLTextAreaElement>(\n initialValue: string,\n target?: never\n ): UseTextareaAutosizeReturn & {\n ref: StateRef<Target>;\n };\n\n <Target extends HTMLTextAreaElement = HTMLTextAreaElement>(\n options?: UseTextareaAutosizeOptions,\n target?: never\n ): UseTextareaAutosizeReturn & {\n ref: StateRef<Target>;\n };\n}\n\n/**\n * @name useTextareaAutosize\n * @description - Hook that automatically adjusts textarea height based on content\n * @category Elements\n * @usage medium\n *\n * @overload\n * @param {HookTarget} target The target textarea element\n * @param {string} [options.initialValue] The initial value for the textarea\n * @param {Function} [options.onResize] Callback function called when the textarea size changes\n * @returns {UseTextareaAutosizeReturn} An object containing value, setValue and clear\n *\n * @example\n * const { value, setValue, clear } = useTextareaAutosize(ref);\n *\n * @overload\n * @param {HookTarget} target The target textarea element\n * @param {string} initialValue The initial value for the textarea\n * @returns {UseTextareaAutosizeReturn} An object containing value, setValue and clear\n *\n * @example\n * const { value, setValue, clear } = useTextareaAutosize(ref, 'initial');\n *\n * @overload\n * @template Target The textarea element type\n * @param {string} initialValue The initial value for the textarea\n * @returns {UseTextareaAutosizeReturn & { ref: StateRef<Target> }} An object containing ref, value, setValue and clear\n *\n * @example\n * const { ref, value, setValue, clear } = useTextareaAutosize('initial');\n *\n * @overload\n * @template Target The textarea element type\n * @param {string} [options.initialValue] The initial value for the textarea\n * @param {Function} [options.onResize] Callback function called when the textarea size changes\n * @returns {UseTextareaAutosizeReturn & { ref: StateRef<Target> }} An object containing ref, value, setValue and clear\n *\n * @example\n * const { ref, value, setValue, clear } = useTextareaAutosize();\n */\nexport const useTextareaAutosize = ((...params: any[]) => {\n const target = (isTarget(params[0]) ? params[0] : undefined) as HookTarget | undefined;\n\n const options = (\n target\n ? typeof params[1] === 'object'\n ? params[1]\n : { initialValue: params[1] }\n : typeof params[0] === 'object'\n ? params[0]\n : { initialValue: params[0] }\n ) as UseTextareaAutosizeOptions | undefined;\n\n const [value, setValue] = useState(options?.initialValue ?? '');\n const internalRef = useRefState<HTMLTextAreaElement>();\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const scrollHeightRef = useRef(0);\n\n const onTextareaResize = () => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n\n const originalMinHeight = textarea.style.minHeight;\n const originalMaxHeight = textarea.style.maxHeight;\n\n textarea.style.height = 'auto';\n textarea.style.minHeight = 'auto';\n textarea.style.maxHeight = 'none';\n\n const scrollHeight = textarea.scrollHeight;\n\n textarea.style.height = `${scrollHeight}px`;\n textarea.style.minHeight = originalMinHeight;\n textarea.style.maxHeight = originalMaxHeight;\n\n if (scrollHeight !== scrollHeightRef.current) options?.onResize?.();\n scrollHeightRef.current = scrollHeight;\n };\n\n const setTextareaValue = (newValue: string) => {\n setValue(newValue);\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.value = newValue;\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n useEffect(() => {\n if (!target && !internalRef.state) return;\n\n const element = (\n target ? isTarget.getElement(target) : internalRef.current\n ) as HTMLTextAreaElement;\n if (!element) return;\n\n textareaRef.current = element;\n if (options?.initialValue) element.value = options.initialValue;\n\n onTextareaResize();\n\n const onInput = (event: InputEvent) => {\n const newValue = (event.target as HTMLTextAreaElement).value;\n setTextareaValue(newValue);\n\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n const onResize = () => {\n requestAnimationFrame(() => {\n onTextareaResize();\n });\n };\n\n element.addEventListener('input', onInput as EventListener);\n element.addEventListener('resize', onResize as EventListener);\n\n return () => {\n element.removeEventListener('input', onInput as EventListener);\n element.removeEventListener('resize', onResize as EventListener);\n };\n }, [target && isTarget.getRawElement(target), internalRef.state]);\n\n const clear = () => setValue('');\n\n if (target)\n return {\n value,\n set: setTextareaValue,\n clear\n };\n return {\n ref: internalRef,\n value,\n set: setTextareaValue,\n clear\n };\n}) as UseTextareaAutosize;\n"],"names":["useTextareaAutosize","params","target","isTarget","options","value","setValue","useState","internalRef","useRefState","textareaRef","useRef","scrollHeightRef","onTextareaResize","textarea","originalMinHeight","originalMaxHeight","scrollHeight","setTextareaValue","newValue","useEffect","element","onInput","event","onResize","clear"],"mappings":";;;AAwFO,MAAMA,KAAuB,IAAIC,MAAkB;AACxD,QAAMC,IAAUC,EAASF,EAAO,CAAC,CAAC,IAAIA,EAAO,CAAC,IAAI,QAE5CG,IACJF,IACI,OAAOD,EAAO,CAAC,KAAM,WACnBA,EAAO,CAAC,IACR,EAAE,cAAcA,EAAO,CAAC,EAAA,IAC1B,OAAOA,EAAO,CAAC,KAAM,WACnBA,EAAO,CAAC,IACR,EAAE,cAAcA,EAAO,CAAC,EAAA,GAG1B,CAACI,GAAOC,CAAQ,IAAIC,EAASH,GAAS,gBAAgB,EAAE,GACxDI,IAAcC,EAAA,GACdC,IAAcC,EAAmC,IAAI,GACrDC,IAAkBD,EAAO,CAAC,GAE1BE,IAAmB,MAAM;AAC7B,UAAMC,IAAWJ,EAAY;AAC7B,QAAI,CAACI,EAAU;AAEf,UAAMC,IAAoBD,EAAS,MAAM,WACnCE,IAAoBF,EAAS,MAAM;AAEzC,IAAAA,EAAS,MAAM,SAAS,QACxBA,EAAS,MAAM,YAAY,QAC3BA,EAAS,MAAM,YAAY;AAE3B,UAAMG,IAAeH,EAAS;AAE9B,IAAAA,EAAS,MAAM,SAAS,GAAGG,CAAY,MACvCH,EAAS,MAAM,YAAYC,GAC3BD,EAAS,MAAM,YAAYE,GAEvBC,MAAiBL,EAAgB,WAASR,GAAS,WAAA,GACvDQ,EAAgB,UAAUK;AAAA,EAAA,GAGtBC,IAAmB,CAACC,MAAqB;AAC7C,IAAAb,EAASa,CAAQ;AACjB,UAAML,IAAWJ,EAAY;AAC7B,IAAKI,MACLA,EAAS,QAAQK,GACjB,sBAAsB,MAAM;AAC1B,MAAAN,EAAA;AAAA,IAAiB,CAClB;AAAA,EAAA;AAGH,EAAAO,EAAU,MAAM;AACd,QAAI,CAAClB,KAAU,CAACM,EAAY,MAAO;AAEnC,UAAMa,IACJnB,IAASC,EAAS,WAAWD,CAAM,IAAIM,EAAY;AAErD,QAAI,CAACa,EAAS;AAEd,IAAAX,EAAY,UAAUW,GAClBjB,GAAS,iBAAciB,EAAQ,QAAQjB,EAAQ,eAEnDS,EAAA;AAEA,UAAMS,IAAU,CAACC,MAAsB;AACrC,YAAMJ,IAAYI,EAAM,OAA+B;AACvD,MAAAL,EAAiBC,CAAQ,GAEzB,sBAAsB,MAAM;AAC1B,QAAAN,EAAA;AAAA,MAAiB,CAClB;AAAA,IAAA,GAGGW,IAAW,MAAM;AACrB,4BAAsB,MAAM;AAC1B,QAAAX,EAAA;AAAA,MAAiB,CAClB;AAAA,IAAA;AAGH,WAAAQ,EAAQ,iBAAiB,SAASC,CAAwB,GAC1DD,EAAQ,iBAAiB,UAAUG,CAAyB,GAErD,MAAM;AACX,MAAAH,EAAQ,oBAAoB,SAASC,CAAwB,GAC7DD,EAAQ,oBAAoB,UAAUG,CAAyB;AAAA,IAAA;AAAA,EACjE,GACC,CAACtB,KAAUC,EAAS,cAAcD,CAAM,GAAGM,EAAY,KAAK,CAAC;AAEhE,QAAMiB,IAAQ,MAAMnB,EAAS,EAAE;AAE/B,SAAIJ,IACK;AAAA,IACL,OAAAG;AAAA,IACA,KAAKa;AAAA,IACL,OAAAO;AAAA,EAAA,IAEG;AAAA,IACL,KAAKjB;AAAA,IACL,OAAAH;AAAA,IACA,KAAKa;AAAA,IACL,OAAAO;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef as e, useEffect as l } from "react";
|
|
2
|
+
const R = (f, o, i) => {
|
|
3
|
+
const s = e(!0), r = e(void 0), t = e(null), u = e(!1), n = e(f), c = e(o);
|
|
4
|
+
n.current = f, c.current = o, l(() => {
|
|
5
|
+
if (s.current) {
|
|
6
|
+
s.current = !1;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (!u.current)
|
|
10
|
+
return r.current = n.current(), u.current = !0, setTimeout(() => {
|
|
11
|
+
u.current = !1, t.current = setTimeout(() => {
|
|
12
|
+
r.current = n.current();
|
|
13
|
+
}, c.current);
|
|
14
|
+
}, c.current), () => {
|
|
15
|
+
t.current && clearTimeout(t.current), t.current = null, typeof r.current == "function" && r.current();
|
|
16
|
+
};
|
|
17
|
+
}, i);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
R as useThrottleEffect
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useThrottleEffect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThrottleEffect.mjs","sources":["../../../../src/hooks/useThrottleEffect/useThrottleEffect.ts"],"sourcesContent":["import type { DependencyList, EffectCallback } from 'react';\n\nimport { useEffect, useRef } from 'react';\n\n/**\n * @name useThrottleEffect\n * @description – Hook that runs an effect at most once per delay period when dependencies change\n * @category Utilities\n * @usage medium\n *\n * @param {EffectCallback} effect The effect callback to run\n * @param {number} delay The delay in milliseconds\n * @param {DependencyList} deps The dependencies list for the effect\n *\n * @example\n * useThrottleEffect(() => console.log('effect'), 500, [value]);\n */\nexport const useThrottleEffect = (effect: EffectCallback, delay: number, deps?: DependencyList) => {\n const mountedRef = useRef(true);\n const cleanupRef = useRef<ReturnType<EffectCallback>>(undefined);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isCalledRef = useRef(false);\n\n const effectRef = useRef(effect);\n const delayRef = useRef(delay);\n\n effectRef.current = effect;\n delayRef.current = delay;\n\n useEffect(() => {\n if (mountedRef.current) {\n mountedRef.current = false;\n return;\n }\n\n if (isCalledRef.current) return;\n\n cleanupRef.current = effectRef.current();\n isCalledRef.current = true;\n\n setTimeout(() => {\n isCalledRef.current = false;\n\n timeoutRef.current = setTimeout(() => {\n cleanupRef.current = effectRef.current();\n }, delayRef.current);\n }, delayRef.current);\n\n return () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n if (typeof cleanupRef.current === 'function') cleanupRef.current();\n };\n }, deps);\n};\n"],"names":["useThrottleEffect","effect","delay","deps","mountedRef","useRef","cleanupRef","timeoutRef","isCalledRef","effectRef","delayRef","useEffect"],"mappings":";AAiBO,MAAMA,IAAoB,CAACC,GAAwBC,GAAeC,MAA0B;AACjG,QAAMC,IAAaC,EAAO,EAAI,GACxBC,IAAaD,EAAmC,MAAS,GACzDE,IAAaF,EAA6C,IAAI,GAC9DG,IAAcH,EAAO,EAAK,GAE1BI,IAAYJ,EAAOJ,CAAM,GACzBS,IAAWL,EAAOH,CAAK;AAE7B,EAAAO,EAAU,UAAUR,GACpBS,EAAS,UAAUR,GAEnBS,EAAU,MAAM;AACd,QAAIP,EAAW,SAAS;AACtB,MAAAA,EAAW,UAAU;AACrB;AAAA,IAAA;AAGF,QAAI,CAAAI,EAAY;AAEhB,aAAAF,EAAW,UAAUG,EAAU,QAAA,GAC/BD,EAAY,UAAU,IAEtB,WAAW,MAAM;AACf,QAAAA,EAAY,UAAU,IAEtBD,EAAW,UAAU,WAAW,MAAM;AACpC,UAAAD,EAAW,UAAUG,EAAU,QAAA;AAAA,QAAQ,GACtCC,EAAS,OAAO;AAAA,MAAA,GAClBA,EAAS,OAAO,GAEZ,MAAM;AACX,QAAIH,EAAW,WAAS,aAAaA,EAAW,OAAO,GACvDA,EAAW,UAAU,MACjB,OAAOD,EAAW,WAAY,gBAAuB,QAAA;AAAA,MAAQ;AAAA,EACnE,GACCH,CAAI;AACT;"}
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { useState as d, useRef as R, useEffect as
|
|
2
|
-
import { useRefState as
|
|
3
|
-
import { isTarget as
|
|
4
|
-
const
|
|
5
|
-
const n =
|
|
6
|
-
return
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
1
|
+
import { useState as d, useRef as R, useEffect as m } from "react";
|
|
2
|
+
import { useRefState as C } from "../useRefState/useRefState.mjs";
|
|
3
|
+
import { isTarget as r } from "../../utils/helpers/isTarget.mjs";
|
|
4
|
+
const I = ((...e) => {
|
|
5
|
+
const n = r(e[0]) ? e[0] : void 0, t = n ? typeof e[1] == "object" ? e[1] : { onChange: e[1] } : typeof e[0] == "object" ? e[0] : { onChange: e[0] }, f = t?.onChange, l = t?.enabled ?? !0, [u, v] = d(), [s, y] = d(), b = s?.isIntersecting ?? !1, o = C(), g = R(f);
|
|
6
|
+
return g.current = f, m(() => {
|
|
7
|
+
if (!l || !n && !o.state) return;
|
|
8
|
+
const a = n ? r.getElement(n) : o.current;
|
|
9
|
+
if (!a) return;
|
|
10
10
|
const c = new IntersectionObserver(
|
|
11
|
-
(
|
|
12
|
-
const
|
|
13
|
-
y(
|
|
11
|
+
(E, h) => {
|
|
12
|
+
const i = E[0];
|
|
13
|
+
i && (y(i), g.current?.(i, h));
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
...t,
|
|
17
|
-
root: t?.root ?
|
|
17
|
+
root: t?.root ? r.getElement(t.root) : document
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
|
-
return v(c), c.observe(
|
|
20
|
+
return v(c), c.observe(a), () => {
|
|
21
21
|
c.disconnect();
|
|
22
22
|
};
|
|
23
23
|
}, [
|
|
24
|
-
n,
|
|
25
|
-
|
|
26
|
-
s.getRefState(n),
|
|
24
|
+
n && r.getRawElement(n),
|
|
25
|
+
o.state,
|
|
27
26
|
t?.rootMargin,
|
|
28
27
|
t?.threshold,
|
|
29
28
|
t?.root,
|
|
30
|
-
|
|
31
|
-
]), n ? { observer: u, entry:
|
|
29
|
+
l
|
|
30
|
+
]), n ? { observer: u, entry: s, inView: b } : {
|
|
32
31
|
observer: u,
|
|
33
|
-
ref:
|
|
34
|
-
entry:
|
|
35
|
-
inView:
|
|
32
|
+
ref: o,
|
|
33
|
+
entry: s,
|
|
34
|
+
inView: b
|
|
36
35
|
};
|
|
37
36
|
});
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
I as useVisibility
|
|
40
39
|
};
|
|
41
40
|
//# sourceMappingURL=useVisibility.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisibility.mjs","sources":["../../../../src/hooks/useVisibility/useVisibility.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { HookTarget } from '@/utils/helpers';\n\nimport { isTarget } from '@/utils/helpers';\n\nimport type { StateRef } from '../useRefState/useRefState';\n\nimport { useRefState } from '../useRefState/useRefState';\n\n/** The visibility callback type */\nexport type UseVisibilityCallback = (\n entry: IntersectionObserverEntry,\n observer: IntersectionObserver\n) => void;\n\n/** The visibility options type */\nexport interface UseVisibilityOptions extends Omit<IntersectionObserverInit, 'root'> {\n /** The enabled state of the intersection */\n enabled?: boolean;\n /** The callback to execute when intersection is detected */\n onChange?: UseVisibilityCallback;\n /** The root element to observe */\n root?: HookTarget;\n}\n\n/** The intersection observer return type */\nexport interface UseVisibilityReturn {\n /** The intersection observer entry */\n entry?: IntersectionObserverEntry;\n /** The intersection observer in view */\n inView
|
|
1
|
+
{"version":3,"file":"useVisibility.mjs","sources":["../../../../src/hooks/useVisibility/useVisibility.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { HookTarget } from '@/utils/helpers';\n\nimport { isTarget } from '@/utils/helpers';\n\nimport type { StateRef } from '../useRefState/useRefState';\n\nimport { useRefState } from '../useRefState/useRefState';\n\n/** The visibility callback type */\nexport type UseVisibilityCallback = (\n entry: IntersectionObserverEntry,\n observer: IntersectionObserver\n) => void;\n\n/** The visibility options type */\nexport interface UseVisibilityOptions extends Omit<IntersectionObserverInit, 'root'> {\n /** The enabled state of the intersection */\n enabled?: boolean;\n /** The callback to execute when intersection is detected */\n onChange?: UseVisibilityCallback;\n /** The root element to observe */\n root?: HookTarget;\n}\n\n/** The intersection observer return type */\nexport interface UseVisibilityReturn {\n /** The intersection observer entry */\n entry?: IntersectionObserverEntry;\n /** The intersection observer in view */\n inView: boolean;\n /** The intersection observer instance */\n observer?: IntersectionObserver;\n}\n\nexport interface UseVisibility {\n <Target extends Element>(\n options?: UseVisibilityOptions,\n target?: never\n ): UseVisibilityReturn & { ref: StateRef<Target> };\n\n (target: HookTarget, options?: UseVisibilityOptions): UseVisibilityReturn;\n\n <Target extends Element>(\n callback: UseVisibilityCallback,\n target?: never\n ): UseVisibilityReturn & { ref: StateRef<Target> };\n\n (target: HookTarget, callback: UseVisibilityCallback): UseVisibilityReturn;\n}\n\n/**\n * @name useVisibility\n * @description - Hook that gives you visibility observer state\n * @category Sensors\n * @usage medium\n *\n * @browserapi IntersectionObserver https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver\n *\n * @overload\n * @param {HookTarget} target The target element to detect intersection\n * @param {boolean} [options.enabled=true] The Intersection options\n * @param {((entries: IntersectionEntry[], observer: Intersection) => void) | undefined} [options.onChange] The callback to execute when intersection is detected\n * @param {HookTarget} [options.root=document] The root element to observe\n * @returns {UseVisibilityReturn} An object containing the state\n *\n * @example\n * const { ref, entries, observer } = useVisibility();\n *\n * @overload\n * @template Target The target element\n * @param {boolean} [options.enabled=true] The Intersection options\n * @param {((entries: IntersectionEntry[], observer: Intersection) => void) | undefined} [options.onChange] The callback to execute when intersection is detected\n * @param {HookTarget} [options.root=document] The root element to observe\n * @returns {UseVisibilityReturn & { ref: StateRef<Target> }} A React ref to attach to the target element\n *\n * @example\n * const { entries, observer } = useVisibility(ref);\n *\n * @overload\n * @template Target The target element\n * @param {UseVisibilityCallback} callback The callback to execute when intersection is detected\n * @returns {UseVisibilityReturn & { ref: StateRef<Target> }} A React ref to attach to the target element\n *\n * @example\n * const { ref, entries, observer } = useVisibility(() => console.log('callback'));\n *\n * @overload\n * @param {UseVisibilityCallback} callback The callback to execute when intersection is detected\n * @param {HookTarget} target The target element to detect intersection\n * @returns {UseVisibilityReturn} An object containing the state\n *\n * @example\n * const { entries, observer } = useVisibility(ref, () => console.log('callback'));\n */\nexport const useVisibility = ((...params: any[]) => {\n const target = (isTarget(params[0]) ? params[0] : undefined) as HookTarget | undefined;\n\n const options = (\n target\n ? typeof params[1] === 'object'\n ? params[1]\n : { onChange: params[1] }\n : typeof params[0] === 'object'\n ? params[0]\n : { onChange: params[0] }\n ) as UseVisibilityOptions | undefined;\n\n const callback = options?.onChange;\n const enabled = options?.enabled ?? true;\n\n const [observer, setObserver] = useState<IntersectionObserver>();\n const [entry, setEntry] = useState<IntersectionObserverEntry>();\n const inView = entry?.isIntersecting ?? false;\n\n const internalRef = useRefState<Element>();\n const internalCallbackRef = useRef(callback);\n internalCallbackRef.current = callback;\n\n useEffect(() => {\n if (!enabled || (!target && !internalRef.state)) return;\n\n const element = target ? isTarget.getElement(target) : internalRef.current;\n if (!element) return;\n\n const observer = new IntersectionObserver(\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n const firstEntry = entries[0];\n if (firstEntry) {\n setEntry(firstEntry);\n internalCallbackRef.current?.(firstEntry, observer);\n }\n },\n {\n ...options,\n root: options?.root ? (isTarget.getElement(options.root) as Document | Element) : document\n }\n );\n\n setObserver(observer);\n observer.observe(element as Element);\n\n return () => {\n observer.disconnect();\n };\n }, [\n target && isTarget.getRawElement(target),\n internalRef.state,\n options?.rootMargin,\n options?.threshold,\n options?.root,\n enabled\n ]);\n\n if (target) return { observer, entry, inView };\n return {\n observer,\n ref: internalRef,\n entry,\n inView\n };\n}) as UseVisibility;\n"],"names":["useVisibility","params","target","isTarget","options","callback","enabled","observer","setObserver","useState","entry","setEntry","inView","internalRef","useRefState","internalCallbackRef","useRef","useEffect","element","entries","firstEntry"],"mappings":";;;AAgGO,MAAMA,KAAiB,IAAIC,MAAkB;AAClD,QAAMC,IAAUC,EAASF,EAAO,CAAC,CAAC,IAAIA,EAAO,CAAC,IAAI,QAE5CG,IACJF,IACI,OAAOD,EAAO,CAAC,KAAM,WACnBA,EAAO,CAAC,IACR,EAAE,UAAUA,EAAO,CAAC,EAAA,IACtB,OAAOA,EAAO,CAAC,KAAM,WACnBA,EAAO,CAAC,IACR,EAAE,UAAUA,EAAO,CAAC,EAAA,GAGtBI,IAAWD,GAAS,UACpBE,IAAUF,GAAS,WAAW,IAE9B,CAACG,GAAUC,CAAW,IAAIC,EAAA,GAC1B,CAACC,GAAOC,CAAQ,IAAIF,EAAA,GACpBG,IAASF,GAAO,kBAAkB,IAElCG,IAAcC,EAAA,GACdC,IAAsBC,EAAOX,CAAQ;AAsC3C,SArCAU,EAAoB,UAAUV,GAE9BY,EAAU,MAAM;AACd,QAAI,CAACX,KAAY,CAACJ,KAAU,CAACW,EAAY,MAAQ;AAEjD,UAAMK,IAAUhB,IAASC,EAAS,WAAWD,CAAM,IAAIW,EAAY;AACnE,QAAI,CAACK,EAAS;AAEd,UAAMX,IAAW,IAAI;AAAA,MACnB,CAACY,GAAsCZ,MAAmC;AACxE,cAAMa,IAAaD,EAAQ,CAAC;AAC5B,QAAIC,MACFT,EAASS,CAAU,GACnBL,EAAoB,UAAUK,GAAYb,CAAQ;AAAA,MACpD;AAAA,MAEF;AAAA,QACE,GAAGH;AAAA,QACH,MAAMA,GAAS,OAAQD,EAAS,WAAWC,EAAQ,IAAI,IAA2B;AAAA,MAAA;AAAA,IACpF;AAGF,WAAAI,EAAYD,CAAQ,GACpBA,EAAS,QAAQW,CAAkB,GAE5B,MAAM;AACXX,MAAAA,EAAS,WAAA;AAAA,IAAW;AAAA,EACtB,GACC;AAAA,IACDL,KAAUC,EAAS,cAAcD,CAAM;AAAA,IACvCW,EAAY;AAAA,IACZT,GAAS;AAAA,IACTA,GAAS;AAAA,IACTA,GAAS;AAAA,IACTE;AAAA,EAAA,CACD,GAEGJ,IAAe,EAAE,UAAAK,GAAU,OAAAG,GAAO,QAAAE,EAAA,IAC/B;AAAA,IACL,UAAAL;AAAA,IACA,KAAKM;AAAA,IACL,OAAAH;AAAA,IACA,QAAAE;AAAA,EAAA;AAEJ;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -11,14 +11,14 @@ import { useAudio as d } from "./hooks/useAudio/useAudio.mjs";
|
|
|
11
11
|
import { useBattery as P } from "./hooks/useBattery/useBattery.mjs";
|
|
12
12
|
import { useBluetooth as I } from "./hooks/useBluetooth/useBluetooth.mjs";
|
|
13
13
|
import { useBroadcastChannel as O } from "./hooks/useBroadcastChannel/useBroadcastChannel.mjs";
|
|
14
|
-
import { useClipboard as
|
|
14
|
+
import { useClipboard as k } from "./hooks/useClipboard/useClipboard.mjs";
|
|
15
15
|
import { useCopy as _ } from "./hooks/useCopy/useCopy.mjs";
|
|
16
16
|
import { useCssVar as D } from "./hooks/useCssVar/useCssVar.mjs";
|
|
17
17
|
import { useDisplayMedia as M } from "./hooks/useDisplayMedia/useDisplayMedia.mjs";
|
|
18
18
|
import { useDocumentTitle as B } from "./hooks/useDocumentTitle/useDocumentTitle.mjs";
|
|
19
19
|
import { useEventSource as F } from "./hooks/useEventSource/useEventSource.mjs";
|
|
20
20
|
import { useEyeDropper as V } from "./hooks/useEyeDropper/useEyeDropper.mjs";
|
|
21
|
-
import { useFavicon as
|
|
21
|
+
import { useFavicon as H } from "./hooks/useFavicon/useFavicon.mjs";
|
|
22
22
|
import { useFps as z } from "./hooks/useFps/useFps.mjs";
|
|
23
23
|
import { useFullscreen as Q } from "./hooks/useFullscreen/useFullscreen.mjs";
|
|
24
24
|
import { mapGamepadToXbox360Controller as q, useGamepad as Z } from "./hooks/useGamepad/useGamepad.mjs";
|
|
@@ -36,14 +36,14 @@ import { useRaf as Re } from "./hooks/useRaf/useRaf.mjs";
|
|
|
36
36
|
import { useShare as Ce } from "./hooks/useShare/useShare.mjs";
|
|
37
37
|
import { getSpeechRecognition as Ae, useSpeechRecognition as Ie } from "./hooks/useSpeechRecognition/useSpeechRecognition.mjs";
|
|
38
38
|
import { useSpeechSynthesis as Oe } from "./hooks/useSpeechSynthesis/useSpeechSynthesis.mjs";
|
|
39
|
-
import { useVibrate as
|
|
39
|
+
import { useVibrate as ke } from "./hooks/useVibrate/useVibrate.mjs";
|
|
40
40
|
import { useVirtualKeyboard as _e } from "./hooks/useVirtualKeyboard/useVirtualKeyboard.mjs";
|
|
41
41
|
import { useWakeLock as De } from "./hooks/useWakeLock/useWakeLock.mjs";
|
|
42
42
|
import { useWebSocket as Me } from "./hooks/useWebSocket/useWebSocket.mjs";
|
|
43
43
|
import { useLogger as Be } from "./hooks/useLogger/useLogger.mjs";
|
|
44
44
|
import { useRenderCount as Fe } from "./hooks/useRenderCount/useRenderCount.mjs";
|
|
45
45
|
import { useRenderInfo as Ve } from "./hooks/useRenderInfo/useRenderInfo.mjs";
|
|
46
|
-
import { useRerender as
|
|
46
|
+
import { useRerender as He } from "./hooks/useRerender/useRerender.mjs";
|
|
47
47
|
import { useActiveElement as ze } from "./hooks/useActiveElement/useActiveElement.mjs";
|
|
48
48
|
import { useAutoScroll as Qe } from "./hooks/useAutoScroll/useAutoScroll.mjs";
|
|
49
49
|
import { useClickOutside as qe } from "./hooks/useClickOutside/useClickOutside.mjs";
|
|
@@ -60,14 +60,14 @@ import { useRightClick as go } from "./hooks/useRightClick/useRightClick.mjs";
|
|
|
60
60
|
import { SCRIPT_STATUS_ATTRIBUTE_NAME as Co, useScript as Po } from "./hooks/useScript/useScript.mjs";
|
|
61
61
|
import { useSticky as Io } from "./hooks/useSticky/useSticky.mjs";
|
|
62
62
|
import { useTextareaAutosize as Oo } from "./hooks/useTextareaAutosize/useTextareaAutosize.mjs";
|
|
63
|
-
import { useTextDirection as
|
|
63
|
+
import { useTextDirection as ko } from "./hooks/useTextDirection/useTextDirection.mjs";
|
|
64
64
|
import { useFul as _o } from "./hooks/useFul/useFul.mjs";
|
|
65
65
|
import { useLess as Do } from "./hooks/useLess/useLess.mjs";
|
|
66
66
|
import { useOnce as Mo } from "./hooks/useOnce/useOnce.mjs";
|
|
67
67
|
import { useAsyncEffect as Bo } from "./hooks/useAsyncEffect/useAsyncEffect.mjs";
|
|
68
68
|
import { useDidUpdate as Fo } from "./hooks/useDidUpdate/useDidUpdate.mjs";
|
|
69
69
|
import { useIsFirstRender as Vo } from "./hooks/useIsFirstRender/useIsFirstRender.mjs";
|
|
70
|
-
import { useIsomorphicLayoutEffect as
|
|
70
|
+
import { useIsomorphicLayoutEffect as Ho } from "./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs";
|
|
71
71
|
import { useMount as zo } from "./hooks/useMount/useMount.mjs";
|
|
72
72
|
import { deepEqual as Qo, useShallowEffect as Xo } from "./hooks/useShallowEffect/useShallowEffect.mjs";
|
|
73
73
|
import { useUnmount as Zo } from "./hooks/useUnmount/useUnmount.mjs";
|
|
@@ -77,29 +77,29 @@ import { useDeviceOrientation as ar } from "./hooks/useDeviceOrientation/useDevi
|
|
|
77
77
|
import { useDevicePixelRatio as nr } from "./hooks/useDevicePixelRatio/useDevicePixelRatio.mjs";
|
|
78
78
|
import { useDocumentEvent as lr } from "./hooks/useDocumentEvent/useDocumentEvent.mjs";
|
|
79
79
|
import { useDocumentVisibility as Er } from "./hooks/useDocumentVisibility/useDocumentVisibility.mjs";
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
80
|
+
import { useEventListener as gr } from "./hooks/useEventListener/useEventListener.mjs";
|
|
81
|
+
import { isHotkeyMatch as dr, useHotkeys as Cr } from "./hooks/useHotkeys/useHotkeys.mjs";
|
|
82
|
+
import { useIdle as Ar } from "./hooks/useIdle/useIdle.mjs";
|
|
83
|
+
import { useInfiniteScroll as yr } from "./hooks/useInfiniteScroll/useInfiniteScroll.mjs";
|
|
84
|
+
import { useIntersectionObserver as hr } from "./hooks/useIntersectionObserver/useIntersectionObserver.mjs";
|
|
85
|
+
import { useKeyboard as vr } from "./hooks/useKeyboard/useKeyboard.mjs";
|
|
86
|
+
import { useKeyPress as br } from "./hooks/useKeyPress/useKeyPress.mjs";
|
|
87
|
+
import { useKeyPressEvent as Lr } from "./hooks/useKeyPressEvent/useKeyPressEvent.mjs";
|
|
88
|
+
import { useKeysPressed as Nr } from "./hooks/useKeysPressed/useKeysPressed.mjs";
|
|
89
|
+
import { useLockScroll as Kr } from "./hooks/useLockScroll/useLockScroll.mjs";
|
|
90
|
+
import { useMeasure as Ur } from "./hooks/useMeasure/useMeasure.mjs";
|
|
91
|
+
import { useMediaQuery as wr } from "./hooks/useMediaQuery/useMediaQuery.mjs";
|
|
92
|
+
import { useMouse as Wr } from "./hooks/useMouse/useMouse.mjs";
|
|
93
|
+
import { useMutationObserver as Gr } from "./hooks/useMutationObserver/useMutationObserver.mjs";
|
|
94
|
+
import { useOrientation as Xr } from "./hooks/useOrientation/useOrientation.mjs";
|
|
95
|
+
import { usePageLeave as Zr } from "./hooks/usePageLeave/usePageLeave.mjs";
|
|
96
|
+
import { useParallax as Jr } from "./hooks/useParallax/useParallax.mjs";
|
|
97
|
+
import { usePerformanceObserver as $r } from "./hooks/usePerformanceObserver/usePerformanceObserver.mjs";
|
|
98
|
+
import { useResizeObserver as ot } from "./hooks/useResizeObserver/useResizeObserver.mjs";
|
|
99
|
+
import { useScroll as tt } from "./hooks/useScroll/useScroll.mjs";
|
|
100
|
+
import { useScrollIntoView as ut } from "./hooks/useScrollIntoView/useScrollIntoView.mjs";
|
|
101
|
+
import { useScrollTo as pt } from "./hooks/useScrollTo/useScrollTo.mjs";
|
|
102
|
+
import { useSize as xt } from "./hooks/useSize/useSize.mjs";
|
|
103
103
|
import { getRangesSelection as it, useTextSelection as nt } from "./hooks/useTextSelection/useTextSelection.mjs";
|
|
104
104
|
import { useVisibility as lt } from "./hooks/useVisibility/useVisibility.mjs";
|
|
105
105
|
import { useWindowEvent as Et } from "./hooks/useWindowEvent/useWindowEvent.mjs";
|
|
@@ -107,10 +107,10 @@ import { useWindowFocus as gt } from "./hooks/useWindowFocus/useWindowFocus.mjs"
|
|
|
107
107
|
import { scrollTo as dt, useWindowScroll as Ct } from "./hooks/useWindowScroll/useWindowScroll.mjs";
|
|
108
108
|
import { useWindowSize as At } from "./hooks/useWindowSize/useWindowSize.mjs";
|
|
109
109
|
import { useBoolean as yt } from "./hooks/useBoolean/useBoolean.mjs";
|
|
110
|
-
import { useControllableState as
|
|
110
|
+
import { useControllableState as ht } from "./hooks/useControllableState/useControllableState.mjs";
|
|
111
111
|
import { COOKIE_EVENT as vt, dispatchCookieEvent as _t, getCookie as bt, getCookies as Dt, removeCookie as Lt, removeCookieItem as Mt, setCookie as Nt, setCookieItem as Bt, useCookie as Kt } from "./hooks/useCookie/useCookie.mjs";
|
|
112
112
|
import { clearCookies as Ut, useCookies as Vt } from "./hooks/useCookies/useCookies.mjs";
|
|
113
|
-
import { useCounter as
|
|
113
|
+
import { useCounter as Ht } from "./hooks/useCounter/useCounter.mjs";
|
|
114
114
|
import { useDefault as zt } from "./hooks/useDefault/useDefault.mjs";
|
|
115
115
|
import { useDisclosure as Qt } from "./hooks/useDisclosure/useDisclosure.mjs";
|
|
116
116
|
import { useField as qt } from "./hooks/useField/useField.mjs";
|
|
@@ -127,11 +127,11 @@ import { useSessionStorage as gs } from "./hooks/useSessionStorage/useSessionSto
|
|
|
127
127
|
import { useSet as ds } from "./hooks/useSet/useSet.mjs";
|
|
128
128
|
import { stateHistoryReducer as Ps, useStateHistory as As } from "./hooks/useStateHistory/useStateHistory.mjs";
|
|
129
129
|
import { useStep as ys } from "./hooks/useStep/useStep.mjs";
|
|
130
|
-
import { STORAGE_EVENT as
|
|
130
|
+
import { STORAGE_EVENT as hs, dispatchStorageEvent as ks, useStorage as vs } from "./hooks/useStorage/useStorage.mjs";
|
|
131
131
|
import { useToggle as bs } from "./hooks/useToggle/useToggle.mjs";
|
|
132
132
|
import { URL_SEARCH_PARAMS_EVENT as Ls, createQueryString as Ms, dispatchUrlSearchParamsEvent as Ns, getUrlSearchParams as Bs, useUrlSearchParam as Ks } from "./hooks/useUrlSearchParam/useUrlSearchParam.mjs";
|
|
133
133
|
import { useUrlSearchParams as Us } from "./hooks/useUrlSearchParams/useUrlSearchParams.mjs";
|
|
134
|
-
import { useWizard as
|
|
134
|
+
import { useWizard as ws } from "./hooks/useWizard/useWizard.mjs";
|
|
135
135
|
import { useInterval as Ws } from "./hooks/useInterval/useInterval.mjs";
|
|
136
136
|
import { useStopwatch as Gs } from "./hooks/useStopwatch/useStopwatch.mjs";
|
|
137
137
|
import { useTime as Xs } from "./hooks/useTime/useTime.mjs";
|
|
@@ -147,21 +147,23 @@ import { usePreferredReducedMotion as cu } from "./hooks/usePreferredReducedMoti
|
|
|
147
147
|
import { useBatchedCallback as Su } from "./hooks/useBatchedCallback/useBatchedCallback.mjs";
|
|
148
148
|
import { useConst as Tu } from "./hooks/useConst/useConst.mjs";
|
|
149
149
|
import { useDebounceCallback as Ru } from "./hooks/useDebounceCallback/useDebounceCallback.mjs";
|
|
150
|
-
import {
|
|
151
|
-
import {
|
|
152
|
-
import {
|
|
153
|
-
import {
|
|
154
|
-
import {
|
|
155
|
-
import {
|
|
156
|
-
import {
|
|
157
|
-
import {
|
|
158
|
-
import {
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
162
|
-
import {
|
|
163
|
-
import {
|
|
164
|
-
import {
|
|
150
|
+
import { useDebounceEffect as Cu } from "./hooks/useDebounceEffect/useDebounceEffect.mjs";
|
|
151
|
+
import { useDebounceState as Au } from "./hooks/useDebounceState/useDebounceState.mjs";
|
|
152
|
+
import { useDebounceValue as yu } from "./hooks/useDebounceValue/useDebounceValue.mjs";
|
|
153
|
+
import { useEvent as hu } from "./hooks/useEvent/useEvent.mjs";
|
|
154
|
+
import { useLastChanged as vu } from "./hooks/useLastChanged/useLastChanged.mjs";
|
|
155
|
+
import { useLatest as bu } from "./hooks/useLatest/useLatest.mjs";
|
|
156
|
+
import { usePrevious as Lu } from "./hooks/usePrevious/usePrevious.mjs";
|
|
157
|
+
import { useThrottleCallback as Nu } from "./hooks/useThrottleCallback/useThrottleCallback.mjs";
|
|
158
|
+
import { useThrottleEffect as Ku } from "./hooks/useThrottleEffect/useThrottleEffect.mjs";
|
|
159
|
+
import { useThrottleState as Uu } from "./hooks/useThrottleState/useThrottleState.mjs";
|
|
160
|
+
import { useThrottleValue as wu } from "./hooks/useThrottleValue/useThrottleValue.mjs";
|
|
161
|
+
import { copy as Wu, legacyCopyToClipboard as zu } from "./utils/helpers/copy.mjs";
|
|
162
|
+
import { debounce as Qu } from "./utils/helpers/debounce.mjs";
|
|
163
|
+
import { getDate as qu } from "./utils/helpers/getDate.mjs";
|
|
164
|
+
import { getRetry as ju } from "./utils/helpers/getRetry.mjs";
|
|
165
|
+
import { getRawElement as Yu, getRefState as $u, isBrowserTarget as em, isRef as om, isRefState as rm, isTarget as tm, target as sm, targetSymbol as um } from "./utils/helpers/isTarget.mjs";
|
|
166
|
+
import { throttle as pm } from "./utils/helpers/throttle.mjs";
|
|
165
167
|
export {
|
|
166
168
|
Jo as BREAKPOINTS_ANT_DESIGN,
|
|
167
169
|
Yo as BREAKPOINTS_BOOTSTRAP_V5,
|
|
@@ -178,37 +180,41 @@ export {
|
|
|
178
180
|
lo as Paint,
|
|
179
181
|
So as Pointer,
|
|
180
182
|
Co as SCRIPT_STATUS_ATTRIBUTE_NAME,
|
|
181
|
-
|
|
183
|
+
hs as STORAGE_EVENT,
|
|
182
184
|
Ls as URL_SEARCH_PARAMS_EVENT,
|
|
183
185
|
us as assignRef,
|
|
184
186
|
Ut as clearCookies,
|
|
185
|
-
|
|
187
|
+
Wu as copy,
|
|
186
188
|
r as createContext,
|
|
187
189
|
s as createEventEmitter,
|
|
188
190
|
Ms as createQueryString,
|
|
189
191
|
m as createReactiveContext,
|
|
190
192
|
Ss as createRefState,
|
|
191
193
|
f as createStore,
|
|
192
|
-
|
|
194
|
+
Qu as debounce,
|
|
193
195
|
Qo as deepEqual,
|
|
194
196
|
_t as dispatchCookieEvent,
|
|
195
|
-
|
|
197
|
+
ks as dispatchStorageEvent,
|
|
196
198
|
Ns as dispatchUrlSearchParamsEvent,
|
|
197
199
|
se as getConnection,
|
|
198
200
|
bt as getCookie,
|
|
199
201
|
Dt as getCookies,
|
|
200
|
-
|
|
202
|
+
qu as getDate,
|
|
201
203
|
jt as getHash,
|
|
202
204
|
ru as getOperatingSystem,
|
|
203
205
|
it as getRangesSelection,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
Yu as getRawElement,
|
|
207
|
+
$u as getRefState,
|
|
208
|
+
ju as getRetry,
|
|
206
209
|
Ae as getSpeechRecognition,
|
|
207
210
|
Js as getTimeFromSeconds,
|
|
208
211
|
Bs as getUrlSearchParams,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
em as isBrowserTarget,
|
|
213
|
+
dr as isHotkeyMatch,
|
|
214
|
+
om as isRef,
|
|
215
|
+
rm as isRefState,
|
|
216
|
+
tm as isTarget,
|
|
217
|
+
zu as legacyCopyToClipboard,
|
|
212
218
|
q as mapGamepadToXbox360Controller,
|
|
213
219
|
ms as mergeRefs,
|
|
214
220
|
Lt as removeCookie,
|
|
@@ -217,9 +223,9 @@ export {
|
|
|
217
223
|
Nt as setCookie,
|
|
218
224
|
Bt as setCookieItem,
|
|
219
225
|
Ps as stateHistoryReducer,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
226
|
+
sm as target,
|
|
227
|
+
um as targetSymbol,
|
|
228
|
+
pm as throttle,
|
|
223
229
|
$ as timeRangeToArray,
|
|
224
230
|
ze as useActiveElement,
|
|
225
231
|
a as useAsync,
|
|
@@ -234,17 +240,18 @@ export {
|
|
|
234
240
|
O as useBroadcastChannel,
|
|
235
241
|
eu as useBrowserLanguage,
|
|
236
242
|
qe as useClickOutside,
|
|
237
|
-
|
|
243
|
+
k as useClipboard,
|
|
238
244
|
Tu as useConst,
|
|
239
|
-
|
|
245
|
+
ht as useControllableState,
|
|
240
246
|
Kt as useCookie,
|
|
241
247
|
Vt as useCookies,
|
|
242
248
|
_ as useCopy,
|
|
243
|
-
|
|
249
|
+
Ht as useCounter,
|
|
244
250
|
D as useCssVar,
|
|
245
251
|
Ru as useDebounceCallback,
|
|
246
|
-
Cu as
|
|
247
|
-
Au as
|
|
252
|
+
Cu as useDebounceEffect,
|
|
253
|
+
Au as useDebounceState,
|
|
254
|
+
yu as useDebounceValue,
|
|
248
255
|
zt as useDefault,
|
|
249
256
|
fr as useDeviceMotion,
|
|
250
257
|
ar as useDeviceOrientation,
|
|
@@ -257,12 +264,11 @@ export {
|
|
|
257
264
|
Er as useDocumentVisibility,
|
|
258
265
|
Je as useDoubleClick,
|
|
259
266
|
$e as useDropZone,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
dr as useEventListener,
|
|
267
|
+
hu as useEvent,
|
|
268
|
+
gr as useEventListener,
|
|
263
269
|
F as useEventSource,
|
|
264
270
|
V as useEyeDropper,
|
|
265
|
-
|
|
271
|
+
H as useFavicon,
|
|
266
272
|
qt as useField,
|
|
267
273
|
oo as useFileDialog,
|
|
268
274
|
to as useFocus,
|
|
@@ -273,50 +279,50 @@ export {
|
|
|
273
279
|
Z as useGamepad,
|
|
274
280
|
J as useGeolocation,
|
|
275
281
|
Jt as useHash,
|
|
276
|
-
|
|
282
|
+
Cr as useHotkeys,
|
|
277
283
|
fo as useHover,
|
|
278
|
-
|
|
284
|
+
Ar as useIdle,
|
|
279
285
|
ao as useImage,
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
yr as useInfiniteScroll,
|
|
287
|
+
hr as useIntersectionObserver,
|
|
282
288
|
Ws as useInterval,
|
|
283
289
|
Vo as useIsFirstRender,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
Ho as useIsomorphicLayoutEffect,
|
|
291
|
+
br as useKeyPress,
|
|
292
|
+
Lr as useKeyPressEvent,
|
|
293
|
+
vr as useKeyboard,
|
|
294
|
+
Nr as useKeysPressed,
|
|
295
|
+
vu as useLastChanged,
|
|
296
|
+
bu as useLatest,
|
|
291
297
|
Do as useLess,
|
|
292
298
|
$t as useList,
|
|
293
299
|
os as useLocalStorage,
|
|
294
300
|
n as useLockCallback,
|
|
295
|
-
|
|
301
|
+
Kr as useLockScroll,
|
|
296
302
|
Be as useLogger,
|
|
297
303
|
no as useLongPress,
|
|
298
304
|
ts as useMap,
|
|
299
|
-
|
|
305
|
+
Ur as useMeasure,
|
|
300
306
|
ee as useMediaControls,
|
|
301
|
-
|
|
307
|
+
wr as useMediaQuery,
|
|
302
308
|
re as useMemory,
|
|
303
309
|
ps as useMergedRef,
|
|
304
310
|
zo as useMount,
|
|
305
|
-
|
|
311
|
+
Wr as useMouse,
|
|
306
312
|
l as useMutation,
|
|
307
|
-
|
|
313
|
+
Gr as useMutationObserver,
|
|
308
314
|
ue as useNetwork,
|
|
309
315
|
xs as useOffsetPagination,
|
|
310
316
|
Mo as useOnce,
|
|
311
317
|
pe as useOnline,
|
|
312
318
|
tu as useOperatingSystem,
|
|
313
319
|
E as useOptimistic,
|
|
314
|
-
|
|
320
|
+
Xr as useOrientation,
|
|
315
321
|
xe as useOtpCredential,
|
|
316
|
-
|
|
322
|
+
Zr as usePageLeave,
|
|
317
323
|
Eo as usePaint,
|
|
318
|
-
|
|
319
|
-
|
|
324
|
+
Jr as useParallax,
|
|
325
|
+
$r as usePerformanceObserver,
|
|
320
326
|
ie as usePermission,
|
|
321
327
|
ce as usePictureInPicture,
|
|
322
328
|
Se as usePointerLock,
|
|
@@ -326,7 +332,7 @@ export {
|
|
|
326
332
|
xu as usePreferredDark,
|
|
327
333
|
iu as usePreferredLanguages,
|
|
328
334
|
cu as usePreferredReducedMotion,
|
|
329
|
-
|
|
335
|
+
Lu as usePrevious,
|
|
330
336
|
g as useQuery,
|
|
331
337
|
is as useQueue,
|
|
332
338
|
Re as useRaf,
|
|
@@ -334,17 +340,18 @@ export {
|
|
|
334
340
|
Es as useRefState,
|
|
335
341
|
Fe as useRenderCount,
|
|
336
342
|
Ve as useRenderInfo,
|
|
337
|
-
|
|
338
|
-
|
|
343
|
+
He as useRerender,
|
|
344
|
+
ot as useResizeObserver,
|
|
339
345
|
go as useRightClick,
|
|
340
346
|
Po as useScript,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
347
|
+
tt as useScroll,
|
|
348
|
+
ut as useScrollIntoView,
|
|
349
|
+
pt as useScrollTo,
|
|
344
350
|
gs as useSessionStorage,
|
|
345
351
|
ds as useSet,
|
|
346
352
|
Xo as useShallowEffect,
|
|
347
353
|
Ce as useShare,
|
|
354
|
+
xt as useSize,
|
|
348
355
|
Ie as useSpeechRecognition,
|
|
349
356
|
Oe as useSpeechSynthesis,
|
|
350
357
|
As as useStateHistory,
|
|
@@ -352,12 +359,13 @@ export {
|
|
|
352
359
|
Io as useSticky,
|
|
353
360
|
Gs as useStopwatch,
|
|
354
361
|
vs as useStorage,
|
|
355
|
-
|
|
362
|
+
ko as useTextDirection,
|
|
356
363
|
nt as useTextSelection,
|
|
357
364
|
Oo as useTextareaAutosize,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
365
|
+
Nu as useThrottleCallback,
|
|
366
|
+
Ku as useThrottleEffect,
|
|
367
|
+
Uu as useThrottleState,
|
|
368
|
+
wu as useThrottleValue,
|
|
361
369
|
Xs as useTime,
|
|
362
370
|
Zs as useTimeout,
|
|
363
371
|
Ys as useTimer,
|
|
@@ -365,7 +373,7 @@ export {
|
|
|
365
373
|
Zo as useUnmount,
|
|
366
374
|
Ks as useUrlSearchParam,
|
|
367
375
|
Us as useUrlSearchParams,
|
|
368
|
-
|
|
376
|
+
ke as useVibrate,
|
|
369
377
|
_e as useVirtualKeyboard,
|
|
370
378
|
lt as useVisibility,
|
|
371
379
|
De as useWakeLock,
|
|
@@ -374,6 +382,6 @@ export {
|
|
|
374
382
|
gt as useWindowFocus,
|
|
375
383
|
Ct as useWindowScroll,
|
|
376
384
|
At as useWindowSize,
|
|
377
|
-
|
|
385
|
+
ws as useWizard
|
|
378
386
|
};
|
|
379
387
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
const u = /* @__PURE__ */ Symbol("target"),
|
|
1
|
+
const u = /* @__PURE__ */ Symbol("target"), c = (e) => ({
|
|
2
2
|
value: e,
|
|
3
3
|
type: u
|
|
4
|
-
}),
|
|
5
|
-
n.wrap =
|
|
6
|
-
n.getElement =
|
|
7
|
-
n.getRefState =
|
|
4
|
+
}), f = (e) => typeof e == "object" && "current" in e, o = (e) => typeof e == "function" && "state" in e && "current" in e, i = (e) => typeof e == "object" && e && "type" in e && e.type === u && "value" in e, n = (e) => f(e) || o(e) || i(e), l = (e) => "current" in e ? e.current : typeof e.value == "function" ? e.value() : typeof e.value == "string" ? document.querySelector(e.value) : (e.value instanceof Document || e.value instanceof Window || e.value instanceof Element, e.value), s = (e) => e && "state" in e && e.state, t = (e) => o(e) ? e.state : i(e) ? e.value : e;
|
|
5
|
+
n.wrap = c;
|
|
6
|
+
n.getElement = l;
|
|
7
|
+
n.getRefState = s;
|
|
8
|
+
n.getRawElement = t;
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
t as getRawElement,
|
|
11
|
+
s as getRefState,
|
|
12
|
+
i as isBrowserTarget,
|
|
13
|
+
f as isRef,
|
|
14
|
+
o as isRefState,
|
|
10
15
|
n as isTarget,
|
|
11
|
-
|
|
16
|
+
c as target,
|
|
12
17
|
u as targetSymbol
|
|
13
18
|
};
|
|
14
19
|
//# sourceMappingURL=isTarget.mjs.map
|