@mwakidenis/logx-react 0.0.0-stage → 0.1.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 +18 -0
- package/LICENSE +23 -0
- package/README.md +151 -3
- package/dist/components/index.d.mts +71 -0
- package/dist/components/index.d.ts +71 -0
- package/dist/components/index.js +268 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +262 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +316 -0
- package/dist/hooks/index.d.ts +316 -0
- package/dist/hooks/index.js +638 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +615 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/storage/index.d.mts +40 -0
- package/dist/hooks/storage/index.d.ts +40 -0
- package/dist/hooks/storage/index.js +119 -0
- package/dist/hooks/storage/index.js.map +1 -0
- package/dist/hooks/storage/index.mjs +116 -0
- package/dist/hooks/storage/index.mjs.map +1 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1066 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +974 -0
- package/dist/index.mjs.map +1 -0
- package/dist/providers/LogxProvider.d.mts +134 -0
- package/dist/providers/LogxProvider.d.ts +134 -0
- package/dist/providers/LogxProvider.js +117 -0
- package/dist/providers/LogxProvider.js.map +1 -0
- package/dist/providers/LogxProvider.mjs +114 -0
- package/dist/providers/LogxProvider.mjs.map +1 -0
- package/dist/types/index.d.mts +87 -0
- package/dist/types/index.d.ts +87 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +3 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utilities/index.d.mts +140 -0
- package/dist/utilities/index.d.ts +140 -0
- package/dist/utilities/index.js +167 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/index.mjs +104 -0
- package/dist/utilities/index.mjs.map +1 -0
- package/package.json +127 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useToggle.ts","../src/hooks/useBoolean.ts","../src/hooks/useCounter.ts","../src/hooks/usePrevious.ts","../src/hooks/useLatest.ts","../src/hooks/useMounted.ts","../src/internal/logx.ts","../src/hooks/useArray.ts","../src/hooks/useObject.ts","../src/hooks/useDebouncedValue.ts","../src/hooks/useDebouncedCallback.ts","../src/hooks/useThrottle.ts","../src/internal/storage.ts","../src/hooks/storage/useLocalStorage.ts","../src/hooks/storage/useSessionStorage.ts","../src/hooks/useMediaQuery.ts","../src/hooks/useWindowSize.ts","../src/hooks/useClickOutside.ts","../src/hooks/useEventListener.ts","../src/hooks/useClipboard.ts","../src/hooks/useOnlineStatus.ts","../src/hooks/useTimeout.ts","../src/hooks/useInterval.ts","../src/hooks/useAsync.ts","../src/components/CopyButton/index.tsx","../src/components/DebouncedInput/index.tsx","../src/components/PasswordInput/index.tsx","../src/components/Responsive/index.tsx","../src/components/ErrorBoundary/index.tsx","../src/utilities/array.ts","../src/utilities/object.ts","../src/utilities/string.ts","../src/utilities/number.ts","../src/utilities/validation.ts","../src/utilities/date.ts","../src/utilities/browser.ts","../src/providers/LogxProvider.tsx"],"names":["set","useState","useCallback","useRef","useEffect","logxDebounce","logxHasLocalStorage","logxHasSessionStorage","logxIsBrowser","logxIsNode","logxLocalStorageHelpers","logxSafeStorage","logxSessionStorageHelpers","logxThrottle","unique","compact","shuffle","timeout","jsx","required","chunk","difference","drop","flatten","flattenDeep","intersection","last","partition","sample","take","union","first","clone","deepClone","entries","get","has","keys","mapKeys","mapValues","merge","omit","pick","values","camelCase","capitalize","escapeHtml","kebabCase","pascalCase","snakeCase","trim","truncate","clamp","inRange","round","percentage","randomInt","isArray","isBoolean","isEmail","isEmpty","isFunction","isNil","isNull","isNumber","isObject","isString","isURL","addDays","isValidDate"],"mappings":";;;;;;;;;;;;;;;;;AAUO,SAAS,SAAA,CACd,eAAwB,K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AAA,GAAY,YAAA,EAA6B;AAChF,EAAA,IAAIL,MAAAA,CAAM,KAAK,CAAA,EAAG,OAAO,GAAG,SAAS,CAAA,YAAA,CAAA;AACrC,EAAA,IAAII,SAAAA,CAAS,KAAK,CAAA,IAAK,KAAA,CAAM,MAAK,KAAM,EAAA,EAAI,OAAO,CAAA,EAAG,SAAS,CAAA,YAAA,CAAA;AAC/D,EAAA,OAAO,IAAA;AACT;;;ACjCO,IAAME,QAAAA,GAAU;AAChB,IAAMC,YAAAA,GAAc;;;ACKpB,IAAM,eAAA,GAAkB/D;AACxB,IAAM,iBAAA,GAAoBC;AAC1B,IAAM,SAAA,GAAYC;AAClB,IAAM,MAAA,GAASC;ACVtB,IAAM,WAAA,GAAc,cAAuC,IAAI,CAAA;AAWxD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAS,EAAyC;AAC/E,EAAA,uBACES,IAAC,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,EAAE,IAAA,EAAA,YAAA,EAAK,EACjC,QAAA,EACH,CAAA;AAEJ;AAMO,SAAS,OAAA,GAAmC;AACjD,EAAA,OAAO,WAAW,WAAW,CAAA;AAC/B","file":"index.mjs","sourcesContent":["import { useCallback, useState } from \"react\";\r\n\r\n/**\r\n * A boolean toggle hook.\r\n *\r\n * Returns the current boolean value and a stable set of actions to mutate it.\r\n * All callbacks are stable (no unnecessary re-renders of consumers).\r\n *\r\n * @param initialValue - Initial boolean value (defaults to false)\r\n */\r\nexport function useToggle(\r\n initialValue: boolean = false,\r\n): [\r\n boolean,\r\n {\r\n toggle: () => void;\r\n set: (next?: boolean) => void;\r\n setTrue: () => void;\r\n setFalse: () => void;\r\n },\r\n] {\r\n const [value, setValue] = useState(!!initialValue);\r\n\r\n const toggle = useCallback(() => setValue((current) => !current), []);\r\n const setTrue = useCallback(() => setValue(true), []);\r\n const setFalse = useCallback(() => setValue(false), []);\r\n const set = useCallback(\r\n (next?: boolean) =>\r\n setValue((current) => (typeof next === \"boolean\" ? next : !current)),\r\n [],\r\n );\r\n\r\n return [value, { toggle, set, setTrue, setFalse }];\r\n}\r\n","import { useCallback, useState } from \"react\";\r\n\r\n/**\r\n * A boolean state hook with explicit setTrue/setFalse/toggle actions.\r\n *\r\n * Alias of useToggle with a more descriptive name. Provides stable callbacks.\r\n *\r\n * @param initialValue - Initial boolean value (defaults to false)\r\n */\r\nexport function useBoolean(\r\n initialValue: boolean = false,\r\n): [\r\n boolean,\r\n {\r\n setTrue: () => void;\r\n setFalse: () => void;\r\n toggle: () => void;\r\n set: (next?: boolean) => void;\r\n },\r\n] {\r\n const [value, setValue] = useState(!!initialValue);\r\n\r\n const setTrue = useCallback(() => setValue(true), []);\r\n const setFalse = useCallback(() => setValue(false), []);\r\n const toggle = useCallback(() => setValue((current) => !current), []);\r\n const set = useCallback(\r\n (next?: boolean) =>\r\n setValue((current) => (typeof next === \"boolean\" ? next : !current)),\r\n [],\r\n );\r\n\r\n return [value, { setTrue, setFalse, toggle, set }];\r\n}\r\n","import { useCallback, useState } from \"react\";\r\n\r\n/**\r\n * A numeric counter hook.\r\n *\r\n * @param initialValue - Starting value (defaults to 0)\r\n */\r\nexport function useCounter(\r\n initialValue: number = 0,\r\n): {\r\n count: number;\r\n increment: (step?: number) => void;\r\n decrement: (step?: number) => void;\r\n reset: () => void;\r\n set: (value: number) => void;\r\n} {\r\n const [count, setCount] = useState(initialValue);\r\n\r\n const increment = useCallback(\r\n (step: number = 1) => setCount((current) => current + step),\r\n [],\r\n );\r\n const decrement = useCallback(\r\n (step: number = 1) => setCount((current) => current - step),\r\n [],\r\n );\r\n const reset = useCallback(() => setCount(initialValue), [initialValue]);\r\n const set = useCallback((value: number) => setCount(value), []);\r\n\r\n return { count, increment, decrement, reset, set };\r\n}\r\n","import { useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * Returns the previous value of a tracked value.\r\n *\r\n * On first render returns undefined (there is no previous value yet).\r\n * The returned ref updates after each render so the value is always the\r\n * value from the previous committed render.\r\n *\r\n * @param value - The value to track\r\n */\r\nexport function usePrevious<T>(value: T): T | undefined {\r\n const ref = useRef<T | undefined>(undefined);\r\n\r\n useEffect(() => {\r\n ref.current = value;\r\n });\r\n\r\n return ref.current;\r\n}\r\n","import { useRef } from \"react\";\r\n\r\n/**\r\n * Returns a ref whose `.current` always holds the latest value without\r\n * triggering re-renders. Useful for accessing the most recent value inside\r\n * timers, callbacks or event listeners without stale closures.\r\n *\r\n * @param value - The value to track\r\n */\r\nexport function useLatest<T>(value: T): { current: T } {\r\n const ref = useRef(value);\r\n ref.current = value;\r\n return ref;\r\n}\r\n","import { useEffect, useState } from \"react\";\r\n\r\n/**\r\n * Returns whether the component is mounted.\r\n *\r\n * The value starts false (SSR-safe) and becomes true after mount. It returns\r\n * to false on unmount. Use sparingly; prefer event-driven logic where possible.\r\n *\r\n * NOTE: Reading this during render can cause a flash of unmounted content on\r\n * the client. Prefer using it inside effects or event handlers.\r\n */\r\nexport function useMounted(): boolean {\r\n const [mounted, setMounted] = useState(false);\r\n\r\n useEffect(() => {\r\n setMounted(true);\r\n return () => setMounted(false);\r\n }, []);\r\n\r\n return mounted;\r\n}\r\n","/**\r\n * LOGX integration layer.\r\n *\r\n * This module is the single place where @mwakidenis/logx is imported. Every hook,\r\n * component or utility that needs a LOGX capability imports it from here rather\r\n * than importing @mwakidenis/logx directly. That keeps React-specific behaviour\r\n * separate from core utility behaviour and makes the dependency boundary obvious.\r\n *\r\n * Only confirmed, publicly exported LOGX functions are re-exported. No LOGX\r\n * internals are copied into this project and the parent repository is not modified.\r\n */\r\n\r\nimport {\r\n debounce as logxDebounce,\r\n throttle as logxThrottle,\r\n type Cancelable,\r\n} from \"@mwakidenis/logx/function\";\r\nimport {\r\n isBrowser as logxIsBrowser,\r\n isNode as logxIsNode,\r\n hasLocalStorage as logxHasLocalStorage,\r\n hasSessionStorage as logxHasSessionStorage,\r\n localStorageHelpers as logxLocalStorageHelpers,\r\n sessionStorageHelpers as logxSessionStorageHelpers,\r\n safeStorage as logxSafeStorage,\r\n type StorageHelpers,\r\n} from \"@mwakidenis/logx/browser\";\r\nimport {\r\n isArray,\r\n isBoolean,\r\n isEmail,\r\n isEmpty,\r\n isFunction,\r\n isNil,\r\n isNull,\r\n isNumber,\r\n isObject,\r\n isString,\r\n isURL,\r\n} from \"@mwakidenis/logx/validation\";\r\nimport {\r\n clone,\r\n deepClone,\r\n entries,\r\n get,\r\n has,\r\n invert,\r\n keys,\r\n mapKeys,\r\n mapValues,\r\n merge,\r\n omit,\r\n pick,\r\n set,\r\n values,\r\n} from \"@mwakidenis/logx/object\";\r\nimport {\r\n clamp,\r\n inRange,\r\n percentage,\r\n randomInt,\r\n round,\r\n} from \"@mwakidenis/logx/number\";\r\nimport {\r\n unique,\r\n partition,\r\n compact,\r\n first,\r\n last,\r\n take,\r\n drop,\r\n shuffle,\r\n sample,\r\n chunk,\r\n flatten,\r\n flattenDeep,\r\n difference,\r\n intersection,\r\n union,\r\n} from \"@mwakidenis/logx/array\";\r\nimport { sleep, retry, withTimeout, timeout } from \"@mwakidenis/logx/async\";\r\nimport { addDays, isValidDate } from \"@mwakidenis/logx/date\";\r\nimport {\r\n escapeHtml,\r\n trim,\r\n truncate,\r\n camelCase,\r\n capitalize,\r\n kebabCase,\r\n pascalCase,\r\n snakeCase,\r\n} from \"@mwakidenis/logx/string\";\r\n\r\nexport {\r\n logxDebounce as debounce,\r\n logxThrottle as throttle,\r\n type Cancelable,\r\n logxIsBrowser as isBrowser,\r\n logxIsNode as isNode,\r\n logxHasLocalStorage as hasLocalStorage,\r\n logxHasSessionStorage as hasSessionStorage,\r\n logxLocalStorageHelpers as localStorageHelpers,\r\n logxSessionStorageHelpers as sessionStorageHelpers,\r\n logxSafeStorage as safeStorage,\r\n type StorageHelpers,\r\n isNil,\r\n isString,\r\n isNumber,\r\n isBoolean,\r\n isArray,\r\n isObject,\r\n isEmpty,\r\n isEmail,\r\n isFunction,\r\n isNull,\r\n isURL,\r\n clone,\r\n deepClone,\r\n get,\r\n set,\r\n pick,\r\n omit,\r\n merge,\r\n entries,\r\n keys,\r\n values,\r\n has,\r\n invert,\r\n mapKeys,\r\n mapValues,\r\n clamp,\r\n inRange,\r\n round,\r\n percentage,\r\n randomInt,\r\n unique,\r\n partition,\r\n compact,\r\n first,\r\n last,\r\n take,\r\n drop,\r\n shuffle,\r\n sample,\r\n chunk,\r\n flatten,\r\n flattenDeep,\r\n difference,\r\n intersection,\r\n union,\r\n sleep,\r\n retry,\r\n withTimeout,\r\n timeout,\r\n addDays,\r\n isValidDate,\r\n escapeHtml,\r\n trim,\r\n truncate,\r\n camelCase,\r\n capitalize,\r\n kebabCase,\r\n pascalCase,\r\n snakeCase,\r\n};\r\n\r\n/**\r\n * React-friendly wrapper around LOGX debounce that exposes a stable Cancelable\r\n * and validates the wait argument. Leading edge is not invoked by LOGX debounce\r\n * (trailing edge only); document this in hooks that use it.\r\n */\r\nexport interface LogxDebounceResult<F extends (...args: unknown[]) => unknown> {\r\n fn: F & Cancelable;\r\n cancel: () => void;\r\n flush: () => void;\r\n pending: () => boolean;\r\n}\r\n\r\nexport function createLogxDebounce<F extends (...args: unknown[]) => unknown>(\r\n func: F,\r\n wait: number,\r\n): LogxDebounceResult<F> {\r\n if (!Number.isFinite(wait) || wait < 0) {\r\n throw new RangeError(\"debounce: wait must be a non-negative number\");\r\n }\r\n const debounced = logxDebounce(func, wait);\r\n return {\r\n fn: debounced,\r\n cancel: () => debounced.cancel(),\r\n flush: () => debounced.flush(),\r\n pending: () => debounced.pending(),\r\n };\r\n}\r\n","import { useCallback, useState } from \"react\";\r\nimport {\r\n compact as logxCompact,\r\n difference,\r\n first,\r\n flatten,\r\n intersection,\r\n last,\r\n partition,\r\n shuffle as logxShuffle,\r\n take,\r\n drop,\r\n union,\r\n unique as logxUnique,\r\n} from \"../internal/logx\";\r\n\r\n/**\r\n * Array state with immutable helpers.\r\n *\r\n * Several helpers delegate to @mwakidenis/logx array utilities (unique,\r\n * compact, first, last, take, drop, shuffle, partition, difference,\r\n * intersection, union, flatten). React-specific state management is kept in\r\n * this hook; LOGX provides the pure array transformations.\r\n *\r\n * @param initialValue - Initial array (defaults to [])\r\n */\r\nexport function useArray<T>(initialValue: T[] = []): {\r\n array: T[];\r\n set: (value: T[] | ((prev: T[]) => T[])) => void;\r\n push: (...items: T[]) => void;\r\n unshift: (...items: T[]) => void;\r\n remove: (index: number) => void;\r\n removeBy: (predicate: (value: T, index: number) => unknown) => void;\r\n update: (index: number, value: T) => void;\r\n clear: () => void;\r\n reset: () => void;\r\n unique: () => void;\r\n compact: () => void;\r\n shuffle: () => void;\r\n first: () => T | undefined;\r\n last: () => T | undefined;\r\n take: (count: number) => T[];\r\n drop: (count: number) => T[];\r\n difference: (...others: T[][]) => T[];\r\n intersection: (...others: T[][]) => T[];\r\n union: (...others: T[][]) => T[];\r\n partition: (predicate: (value: T, index: number) => unknown) => [T[], T[]];\r\n flatten: () => unknown[];\r\n} {\r\n const [array, setArray] = useState<T[]>(initialValue);\r\n\r\n const set = useCallback(\r\n (value: T[] | ((prev: T[]) => T[])) =>\r\n setArray((prev) =>\r\n typeof value === \"function\" ? (value as (prev: T[]) => T[])(prev) : value,\r\n ),\r\n [],\r\n );\r\n const push = useCallback((...items: T[]) => setArray((prev) => [...prev, ...items]), []);\r\n const unshift = useCallback((...items: T[]) => setArray((prev) => [...items, ...prev]), []);\r\n const remove = useCallback((index: number) =>\r\n setArray((prev) => prev.filter((_, i) => i !== index)),\r\n []);\r\n const removeBy = useCallback(\r\n (predicate: (value: T, index: number) => unknown) =>\r\n setArray((prev) => prev.filter((v, i) => !predicate(v, i))),\r\n [],\r\n );\r\n const update = useCallback((index: number, value: T) =>\r\n setArray((prev) => prev.map((v, i) => (i === index ? value : v))),\r\n []);\r\n const clear = useCallback(() => setArray([]), []);\r\n const reset = useCallback(() => setArray(initialValue), [initialValue]);\r\n const unique = useCallback(() => setArray((prev) => logxUnique(prev)), []);\r\n const compact = useCallback(() => setArray((prev) => logxCompact(prev)), []);\r\n const shuffle = useCallback(() => setArray((prev) => logxShuffle(prev)), []);\r\n\r\n const firstValue = useCallback(() => first(array), [array]);\r\n const lastValue = useCallback(() => last(array), [array]);\r\n const takeValue = useCallback(\r\n (count: number) => take(array, count),\r\n [array],\r\n );\r\n const dropValue = useCallback(\r\n (count: number) => drop(array, count),\r\n [array],\r\n );\r\n\r\n return {\r\n array,\r\n set,\r\n push,\r\n unshift,\r\n remove,\r\n removeBy,\r\n update,\r\n clear,\r\n reset,\r\n unique,\r\n compact,\r\n shuffle,\r\n first: firstValue,\r\n last: lastValue,\r\n take: takeValue,\r\n drop: dropValue,\r\n // Expose LOGX-derived pure helpers for consumers who need them.\r\n difference: useCallback(\r\n (...others: T[][]) => difference(array, ...others),\r\n [array],\r\n ),\r\n intersection: useCallback(\r\n (...others: T[][]) => intersection(array, ...others),\r\n [array],\r\n ),\r\n union: useCallback(\r\n (...others: T[][]) => union(array, ...others),\r\n [array],\r\n ),\r\n partition: useCallback(\r\n (predicate: (value: T, index: number) => unknown) => partition(array, predicate),\r\n [array],\r\n ),\r\n flatten: useCallback(() => flatten(array as unknown[]), [array]),\r\n };\r\n}\r\n","import { useCallback, useState } from \"react\";\r\nimport {\r\n clone,\r\n deepClone,\r\n entries,\r\n get,\r\n keys,\r\n mapValues,\r\n merge,\r\n omit,\r\n pick,\r\n values,\r\n} from \"../internal/logx\";\r\n\r\n/**\r\n * Object state with immutable helpers.\r\n *\r\n * Several helpers delegate to @mwakidenis/logx object utilities (get, set,\r\n * pick, omit, merge, keys, values, entries, clone, deepClone, mapValues).\r\n * React-specific state management is kept in this hook; LOGX provides the pure\r\n * object transformations.\r\n *\r\n * @param initialValue - Initial object (defaults to {})\r\n */\r\nexport function useObject<T extends Record<string, unknown>>(\r\n initialValue: T = {} as T,\r\n): {\r\n object: T;\r\n set: (value: T | ((prev: T) => T)) => void;\r\n setKey: (key: string, value: unknown) => void;\r\n removeKey: (key: string) => void;\r\n clear: () => void;\r\n reset: () => void;\r\n pick: (keys: readonly string[]) => Partial<T>;\r\n omit: (keys: readonly string[]) => Partial<T>;\r\n merge: (sources: Partial<T>[]) => T;\r\n get: (path: string | Array<string | number>) => unknown;\r\n keys: () => string[];\r\n values: () => unknown[];\r\n entries: () => [string, unknown][];\r\n clone: () => T;\r\n deepClone: () => T;\r\n mapValues: <U>(iteratee: (value: unknown, key: string) => U) => Record<string, U>;\r\n} {\r\n const [object, setObject] = useState<T>(initialValue);\r\n\r\n const set = useCallback(\r\n (value: T | ((prev: T) => T)) =>\r\n setObject((prev) =>\r\n typeof value === \"function\"\r\n ? (value as (prev: T) => T)(prev)\r\n : value,\r\n ),\r\n [],\r\n );\r\n const setKey = useCallback((key: string, value: unknown) =>\r\n setObject((prev) => ({ ...prev, [key]: value }) as T),\r\n []);\r\n const removeKey = useCallback((key: string) =>\r\n setObject((prev) => {\r\n const next = { ...prev };\r\n delete next[key];\r\n return next as T;\r\n }),\r\n []);\r\n const clear = useCallback(() => setObject({} as T), []);\r\n const reset = useCallback(() => setObject(initialValue), [initialValue]);\r\n\r\n const pickValue = useCallback(\r\n (pickedKeys: readonly string[]) => pick(object, pickedKeys),\r\n [object],\r\n );\r\n const omitValue = useCallback(\r\n (omittedKeys: readonly string[]) => omit(object, omittedKeys),\r\n [object],\r\n );\r\n const mergeValue = useCallback(\r\n (sources: Partial<T>[]) => merge(object, ...sources) as T,\r\n [object],\r\n );\r\n const getValue = useCallback(\r\n (path: string | Array<string | number>) => get(object, path),\r\n [object],\r\n );\r\n const keysValue = useCallback(() => keys(object), [object]);\r\n const valuesValue = useCallback(() => values(object), [object]);\r\n const entriesValue = useCallback(() => entries(object), [object]);\r\n const cloneValue = useCallback(() => clone(object) as T, [object]);\r\n const deepCloneValue = useCallback(() => deepClone(object) as T, [object]);\r\n const mapValuesValue = useCallback(\r\n <U>(iteratee: (value: unknown, key: string) => U) =>\r\n mapValues(object, iteratee),\r\n [object],\r\n );\r\n\r\n return {\r\n object,\r\n set,\r\n setKey,\r\n removeKey,\r\n clear,\r\n reset,\r\n pick: pickValue,\r\n omit: omitValue,\r\n merge: mergeValue,\r\n get: getValue,\r\n keys: keysValue,\r\n values: valuesValue,\r\n entries: entriesValue,\r\n clone: cloneValue,\r\n deepClone: deepCloneValue,\r\n mapValues: mapValuesValue,\r\n };\r\n}\r\n","import { useEffect, useRef, useState } from \"react\";\r\nimport { useLatest } from \"./useLatest\";\r\nimport type { DebouncedValueOptions } from \"../types\";\r\n\r\n/**\r\n * Debounce a value.\r\n *\r\n * Returns the value after it has stopped changing for `delay` milliseconds.\r\n * Uses reference equality to detect changes; for objects/arrays pass a new\r\n * reference only when you want a debounce to restart.\r\n *\r\n * LOGX provides function debouncing (@mwakidenis/logx/function). This hook\r\n * implements value debouncing (a React-specific behaviour) on top of timers;\r\n * it does not map to an existing LOGX function.\r\n *\r\n * @param value - The value to debounce\r\n * @param options - delay (ms, default 300) and leading (default false)\r\n */\r\nexport function useDebouncedValue<T>(\r\n value: T,\r\n options: DebouncedValueOptions = {},\r\n): T {\r\n const { delay = 300, leading = false } = options;\r\n const [debounced, setDebounced] = useState(value);\r\n const latest = useLatest(value);\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n const lastLeadingRef = useRef<T | undefined>(undefined);\r\n\r\n useEffect(() => {\r\n if (timerRef.current !== null) {\r\n clearTimeout(timerRef.current);\r\n timerRef.current = null;\r\n }\r\n timerRef.current = setTimeout(() => {\r\n setDebounced(latest.current);\r\n timerRef.current = null;\r\n }, delay);\r\n return () => {\r\n if (timerRef.current !== null) {\r\n clearTimeout(timerRef.current);\r\n timerRef.current = null;\r\n }\r\n };\r\n }, [value, delay]);\r\n\r\n useEffect(() => {\r\n if (!leading) return;\r\n const current = latest.current;\r\n if (lastLeadingRef.current !== current) {\r\n lastLeadingRef.current = current;\r\n setDebounced(current);\r\n }\r\n }, [value, leading]);\r\n\r\n return debounced;\r\n}\r\n","import { useCallback, useEffect, useRef } from \"react\";\r\nimport { debounce as logxDebounce, type Cancelable } from \"../internal/logx\";\r\nimport { useLatest } from \"./useLatest\";\r\n\r\n/**\r\n * Debounce a callback using LOGX's `debounce` (@mwakidenis/logx/function).\r\n *\r\n * LOGX debounce is trailing-edge only: the function is invoked after `delay`\r\n * milliseconds of inactivity. It exposes `cancel`, `flush` and `pending`.\r\n *\r\n * The latest callback reference is captured internally so the debounced\r\n * function never holds a stale closure, even if `callback` changes every render.\r\n *\r\n * @param callback - Function to debounce\r\n * @param delay - Delay in milliseconds\r\n */\r\nexport function useDebouncedCallback<\r\n F extends (...args: unknown[]) => unknown,\r\n>(\r\n callback: F,\r\n delay: number,\r\n): {\r\n (...args: Parameters<F>): void;\r\n cancel: () => void;\r\n flush: () => void;\r\n pending: () => boolean;\r\n} {\r\n const latest = useLatest(callback);\r\n const debouncedRef = useRef<((...args: Parameters<F>) => void) & Cancelable | null>(null);\r\n\r\n useEffect(() => {\r\n const debounced = logxDebounce(\r\n (...args: unknown[]) => {\r\n latest.current(...(args as Parameters<F>));\r\n },\r\n delay,\r\n );\r\n debouncedRef.current = debounced as ((...args: Parameters<F>) => void) & Cancelable;\r\n return () => {\r\n debounced.cancel();\r\n };\r\n }, [delay]);\r\n\r\n const invoke = useCallback((...args: Parameters<F>) => {\r\n debouncedRef.current?.(...args);\r\n }, []);\r\n\r\n const cancel = useCallback(() => {\r\n debouncedRef.current?.cancel();\r\n }, []);\r\n const flush = useCallback(() => {\r\n debouncedRef.current?.flush();\r\n }, []);\r\n const pending = useCallback(() => debouncedRef.current?.pending() ?? false, []);\r\n\r\n return Object.assign(invoke, { cancel, flush, pending });\r\n}\r\n","import { useCallback, useEffect, useRef } from \"react\";\r\nimport { throttle as logxThrottle, type Cancelable } from \"../internal/logx\";\r\nimport { useLatest } from \"./useLatest\";\r\n\r\n/**\r\n * Throttle a callback using LOGX's `throttle` (@mwakidenis/logx/function).\r\n *\r\n * LOGX throttle invokes on the leading edge and flushes the trailing edge at\r\n * the end of the wait period. It exposes `cancel`, `flush` and `pending`.\r\n *\r\n * @param callback - Function to throttle\r\n * @param wait - Wait period in milliseconds\r\n */\r\nexport function useThrottle<F extends (...args: unknown[]) => unknown>(\r\n callback: F,\r\n wait: number,\r\n): {\r\n (...args: Parameters<F>): void;\r\n cancel: () => void;\r\n flush: () => void;\r\n pending: () => boolean;\r\n} {\r\n const latest = useLatest(callback);\r\n const throttledRef = useRef<((...args: Parameters<F>) => void) & Cancelable | null>(null);\r\n\r\n useEffect(() => {\r\n const throttled = logxThrottle(\r\n (...args: unknown[]) => {\r\n latest.current(...(args as Parameters<F>));\r\n },\r\n wait,\r\n );\r\n throttledRef.current = throttled as ((...args: Parameters<F>) => void) & Cancelable;\r\n return () => {\r\n throttled.cancel();\r\n };\r\n }, [wait]);\r\n\r\n const invoke = useCallback((...args: Parameters<F>) => {\r\n throttledRef.current?.(...args);\r\n }, []);\r\n\r\n const cancel = useCallback(() => {\r\n throttledRef.current?.cancel();\r\n }, []);\r\n const flush = useCallback(() => {\r\n throttledRef.current?.flush();\r\n }, []);\r\n const pending = useCallback(() => throttledRef.current?.pending() ?? false, []);\r\n\r\n return Object.assign(invoke, { cancel, flush, pending });\r\n}\r\n","/**\r\n * Storage utilities.\r\n *\r\n * React-specific storage logic lives here. The underlying safe, exception-guarded\r\n * storage operations come from @mwakidenis/logx (safeStorage, localStorageHelpers,\r\n * sessionStorageHelpers) and are re-exported through the LOGX integration layer\r\n * so the consumer sees a single integration boundary.\r\n */\r\n\r\nexport interface StorageValue<T> {\r\n value: T | null;\r\n error: Error | null;\r\n}\r\n\r\nexport interface Serializer<T> {\r\n serialize(value: T): string;\r\n deserialize(raw: string | null): T | null;\r\n}\r\n\r\nexport const jsonSerializer: Serializer<unknown> = {\r\n serialize: (value) => JSON.stringify(value),\r\n deserialize: (raw) => {\r\n if (raw === null) return null;\r\n try {\r\n return JSON.parse(raw);\r\n } catch {\r\n return null;\r\n }\r\n },\r\n};\r\n\r\nexport function createSerializer<T>(): Serializer<T> {\r\n return {\r\n serialize: (value) => JSON.stringify(value) as unknown as string,\r\n deserialize: (raw) => {\r\n if (raw === null) return null;\r\n try {\r\n return JSON.parse(raw) as T;\r\n } catch {\r\n return null;\r\n }\r\n },\r\n };\r\n}\r\n","import { useCallback, useEffect, useState } from \"react\";\r\nimport { localStorageHelpers } from \"../../internal/logx\";\r\nimport { jsonSerializer } from \"../../internal/storage\";\r\nimport type { Serializer } from \"../../internal/storage\";\r\nimport type { SetValue } from \"../../types\";\r\n\r\n/**\r\n * State synchronized with localStorage.\r\n *\r\n * Uses @mwakidenis/logx `localStorageHelpers` / `safeStorage` under the hood,\r\n * so storage access is exception-guarded and returns gracefully when\r\n * localStorage is unavailable (e.g. private browsing, SSR).\r\n *\r\n * Hydration-safe: the initial render returns `initialValue` on both server\r\n * and client; storage is read in an effect after mount.\r\n *\r\n * @param key - Storage key\r\n * @param initialValue - Fallback value when nothing is stored or on SSR\r\n * @param options - Optional custom serializer\r\n */\r\nexport function useLocalStorage<T>(\r\n key: string,\r\n initialValue: T,\r\n options?: { serializer?: Serializer<T> },\r\n): [T, (value: SetValue<T>) => void, () => void] {\r\n const serializer = options?.serializer ?? (jsonSerializer as Serializer<T>);\r\n const [value, setValue] = useState<T>(initialValue);\r\n\r\n useEffect(() => {\r\n const helpers = localStorageHelpers();\r\n if (!helpers) return;\r\n const raw = helpers.get(key);\r\n if (raw === null) return;\r\n const parsed = serializer.deserialize(raw);\r\n if (parsed !== null) setValue(parsed as T);\r\n }, [key, serializer]);\r\n\r\n const set = useCallback(\r\n (next: T | ((prev: T) => T)) =>\r\n setValue((prev) => {\r\n const resolved = typeof next === \"function\"\r\n ? (next as (prev: T) => T)(prev)\r\n : next;\r\n const helpers = localStorageHelpers();\r\n if (helpers) {\r\n try {\r\n helpers.set(key, serializer.serialize(resolved));\r\n } catch {\r\n // Storage write failed; state is still updated locally.\r\n }\r\n }\r\n return resolved;\r\n }),\r\n [key, serializer],\r\n );\r\n\r\n const remove = useCallback(() => {\r\n setValue(initialValue);\r\n const helpers = localStorageHelpers();\r\n if (helpers) {\r\n try {\r\n helpers.remove(key);\r\n } catch {\r\n // Ignore storage removal failures.\r\n }\r\n }\r\n }, [key, initialValue]);\r\n\r\n useEffect(() => {\r\n if (typeof window === \"undefined\") return;\r\n const handle = (event: StorageEvent) => {\r\n if (event.key === key && event.storageArea === localStorage) {\r\n const parsed =\r\n event.newValue === null\r\n ? null\r\n : serializer.deserialize(event.newValue);\r\n if (parsed !== null) setValue(parsed as T);\r\n }\r\n };\r\n window.addEventListener(\"storage\", handle);\r\n return () => window.removeEventListener(\"storage\", handle);\r\n }, [key, serializer]);\r\n\r\n return [value, set, remove];\r\n}\r\n","import { useCallback, useEffect, useState } from \"react\";\r\nimport { sessionStorageHelpers } from \"../../internal/logx\";\r\nimport { jsonSerializer } from \"../../internal/storage\";\r\nimport type { Serializer } from \"../../internal/storage\";\r\nimport type { SetValue } from \"../../types\";\r\n\r\n/**\r\n * State synchronized with sessionStorage.\r\n *\r\n * Same contract as useLocalStorage but backed by sessionStorage (tab-scoped,\r\n * cleared when the tab/session ends).\r\n *\r\n * @param key - Storage key\r\n * @param initialValue - Fallback value when nothing is stored or on SSR\r\n * @param options - Optional custom serializer\r\n */\r\nexport function useSessionStorage<T>(\r\n key: string,\r\n initialValue: T,\r\n options?: { serializer?: Serializer<T> },\r\n): [T, (value: SetValue<T>) => void, () => void] {\r\n const serializer = options?.serializer ?? (jsonSerializer as Serializer<T>);\r\n const [value, setValue] = useState<T>(initialValue);\r\n\r\n useEffect(() => {\r\n const helpers = sessionStorageHelpers();\r\n if (!helpers) return;\r\n const raw = helpers.get(key);\r\n if (raw === null) return;\r\n const parsed = serializer.deserialize(raw);\r\n if (parsed !== null) setValue(parsed as T);\r\n }, [key, serializer]);\r\n\r\n const set = useCallback(\r\n (next: T | ((prev: T) => T)) =>\r\n setValue((prev) => {\r\n const resolved = typeof next === \"function\"\r\n ? (next as (prev: T) => T)(prev)\r\n : next;\r\n const helpers = sessionStorageHelpers();\r\n if (helpers) {\r\n try {\r\n helpers.set(key, serializer.serialize(resolved));\r\n } catch {\r\n // Ignore storage write failures.\r\n }\r\n }\r\n return resolved;\r\n }),\r\n [key, serializer],\r\n );\r\n\r\n const remove = useCallback(() => {\r\n setValue(initialValue);\r\n const helpers = sessionStorageHelpers();\r\n if (helpers) {\r\n try {\r\n helpers.remove(key);\r\n } catch {\r\n // Ignore storage removal failures.\r\n }\r\n }\r\n }, [key, initialValue]);\r\n\r\n return [value, set, remove];\r\n}\r\n","import { useEffect, useState } from \"react\";\r\n\r\n/**\r\n * Track whether a media query matches.\r\n *\r\n * SSR-safe: returns `false` on the server and before mount, then reflects the\r\n * real match status after mount. Listens for `change` events and cleans up on\r\n * unmount.\r\n *\r\n * @param query - A CSS media query string\r\n */\r\nexport function useMediaQuery(query: string): boolean {\r\n const [matches, setMatches] = useState(false);\r\n\r\n useEffect(() => {\r\n if (typeof window === \"undefined\") return;\r\n const media = window.matchMedia(query);\r\n setMatches(media.matches);\r\n const handler = (event: MediaQueryListEvent) => setMatches(event.matches);\r\n media.addEventListener(\"change\", handler);\r\n return () => {\r\n media.removeEventListener(\"change\", handler);\r\n };\r\n }, [query]);\r\n\r\n return matches;\r\n}\r\n","import { useEffect, useState } from \"react\";\r\n\r\n/**\r\n * Track the window size (innerWidth / innerHeight).\r\n *\r\n * SSR-safe: returns { width: 0, height: 0 } on the server and first client\r\n * render, then updates on resize. Cleans up the listener on unmount.\r\n */\r\nexport function useWindowSize(): { width: number; height: number } {\r\n const [size, setSize] = useState<{ width: number; height: number }>(\r\n () => (typeof window !== \"undefined\"\r\n ? { width: window.innerWidth, height: window.innerHeight }\r\n : { width: 0, height: 0 }),\r\n );\r\n\r\n useEffect(() => {\r\n if (typeof window === \"undefined\") return;\r\n const handler = () =>\r\n setSize({ width: window.innerWidth, height: window.innerHeight });\r\n window.addEventListener(\"resize\", handler);\r\n return () => window.removeEventListener(\"resize\", handler);\r\n }, []);\r\n\r\n return size;\r\n}\r\n","import { useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * Fire a handler when a click occurs outside a ref'd element.\r\n *\r\n * Uses useLatest internally so the handler is always current without\r\n * re-subscribing the document listeners every render.\r\n *\r\n * @param ref - A ref to the element to ignore clicks for\r\n * @param handler - Callback fired on outside click\r\n */\r\nexport function useClickOutside(\r\n ref: { current: HTMLElement | null | undefined },\r\n handler: (event: MouseEvent | TouchEvent) => void,\r\n): void {\r\n const latest = useRef(handler);\r\n latest.current = handler;\r\n\r\n useEffect(() => {\r\n const handle = (event: MouseEvent | TouchEvent) => {\r\n if (ref.current && !ref.current.contains(event.target as Node)) {\r\n latest.current(event);\r\n }\r\n };\r\n if (typeof document !== \"undefined\") {\r\n document.addEventListener(\"mousedown\", handle);\r\n document.addEventListener(\"touchstart\", handle);\r\n return () => {\r\n document.removeEventListener(\"mousedown\", handle);\r\n document.removeEventListener(\"touchstart\", handle);\r\n };\r\n }\r\n return undefined;\r\n }, [ref]);\r\n}\r\n","import { useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * Attach an event listener with automatic cleanup on unmount.\r\n *\r\n * Supports window, document, element, or Document/Window targets. The listener\r\n * is captured via a ref so it stays current without re-attaching.\r\n *\r\n * @param target - EventTarget (window, document, element) or null/undefined\r\n * @param type - Event type\r\n * @param listener - Event listener\r\n * @param options - AddEventListenerOptions or capture boolean\r\n */\r\nexport function useEventListener(\r\n target: EventTarget | null | undefined,\r\n type: string,\r\n listener: EventListener,\r\n options?: boolean | AddEventListenerOptions,\r\n): void {\r\n const latest = useRef(listener);\r\n latest.current = listener;\r\n\r\n useEffect(() => {\r\n if (!target) return undefined;\r\n const handle = (event: Event) => latest.current(event);\r\n target.addEventListener(type, handle, options);\r\n return () => {\r\n target.removeEventListener(type, handle, options);\r\n };\r\n }, [target, type, options]);\r\n}\r\n","import { useCallback } from \"react\";\r\n\r\n/**\r\n * Copy text to the clipboard.\r\n *\r\n * Uses the Clipboard API when available, with a textarea fallback for older\r\n * browsers. Never throws; returns false on failure.\r\n */\r\nexport function useClipboard(): {\r\n copy: (text: string) => Promise<boolean>;\r\n isSupported: boolean;\r\n} {\r\n const isSupported =\r\n typeof navigator !== \"undefined\" && !!navigator.clipboard && !!navigator.clipboard.writeText;\r\n\r\n const copy = useCallback(async (text: string): Promise<boolean> => {\r\n try {\r\n if (isSupported && typeof navigator !== \"undefined\") {\r\n await navigator.clipboard.writeText(text);\r\n return true;\r\n }\r\n // Fallback for environments without the Clipboard API.\r\n if (typeof document !== \"undefined\") {\r\n const textarea = document.createElement(\"textarea\");\r\n textarea.value = text;\r\n textarea.setAttribute(\"readonly\", \"\");\r\n textarea.style.position = \"absolute\";\r\n textarea.style.position = \"fixed\";\r\n textarea.style.opacity = \"0\";\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n document.execCommand(\"copy\");\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n return true;\r\n }\r\n return false;\r\n } catch {\r\n return false;\r\n }\r\n }, [isSupported]);\r\n\r\n return { copy, isSupported };\r\n}\r\n","import { useEffect, useState } from \"react\";\r\n\r\n/**\r\n * Track online/offline status.\r\n *\r\n * SSR-safe: assumes `true` on the server, then reads `navigator.onLine` after\r\n * mount and listens for `online`/`offline` events.\r\n */\r\nexport function useOnlineStatus(): boolean {\r\n const [online, setOnline] = useState<boolean>(\r\n () => (typeof navigator !== \"undefined\" ? navigator.onLine : true),\r\n );\r\n\r\n useEffect(() => {\r\n if (typeof window === \"undefined\") return;\r\n setOnline(navigator.onLine);\r\n const onOnline = () => setOnline(true);\r\n const onOffline = () => setOnline(false);\r\n window.addEventListener(\"online\", onOnline);\r\n window.addEventListener(\"offline\", onOffline);\r\n return () => {\r\n window.removeEventListener(\"online\", onOnline);\r\n window.removeEventListener(\"offline\", onOffline);\r\n };\r\n }, []);\r\n\r\n return online;\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\r\nimport { useLatest } from \"./useLatest\";\r\n\r\n/**\r\n * A controllable timeout hook.\r\n *\r\n * Provides start/stop/reset and clears the timer on unmount. The callback is\r\n * captured via useLatest so it never goes stale. `active` reflects whether a\r\n * timeout is currently scheduled.\r\n *\r\n * @param callback - Function to invoke after the delay\r\n * @param delay - Delay in milliseconds, or null to disable\r\n */\r\nexport function useTimeout(\r\n callback: () => void,\r\n delay: number | null,\r\n): {\r\n start: () => void;\r\n stop: () => void;\r\n reset: () => void;\r\n active: boolean;\r\n} {\r\n const latest = useLatest(callback);\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n const [active, setActive] = useState(false);\r\n\r\n const stop = useCallback(() => {\r\n if (timerRef.current !== null) {\r\n clearTimeout(timerRef.current);\r\n timerRef.current = null;\r\n }\r\n setActive(false);\r\n }, []);\r\n\r\n const start = useCallback(() => {\r\n stop();\r\n if (delay !== null && delay >= 0) {\r\n timerRef.current = setTimeout(() => {\r\n timerRef.current = null;\r\n setActive(false);\r\n latest.current();\r\n }, delay);\r\n setActive(true);\r\n }\r\n }, [delay]);\r\n\r\n const reset = useCallback(() => {\r\n start();\r\n }, [start]);\r\n\r\n useEffect(() => {\r\n start();\r\n return () => stop();\r\n }, [delay, start, stop]);\r\n\r\n return { start, stop, reset, active };\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\r\nimport { useLatest } from \"./useLatest\";\r\n\r\n/**\r\n * A controllable interval hook.\r\n *\r\n * Provides start/stop and clears the interval on unmount. The callback is\r\n * captured via useLatest so it never goes stale. `active` reflects whether an\r\n * interval is currently scheduled.\r\n *\r\n * @param callback - Function to invoke every `delay` milliseconds\r\n * @param delay - Delay in milliseconds, or null to disable\r\n */\r\nexport function useInterval(\r\n callback: () => void,\r\n delay: number | null,\r\n): {\r\n start: () => void;\r\n stop: () => void;\r\n active: boolean;\r\n} {\r\n const latest = useLatest(callback);\r\n const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);\r\n const [active, setActive] = useState(false);\r\n\r\n const stop = useCallback(() => {\r\n if (timerRef.current !== null) {\r\n clearInterval(timerRef.current);\r\n timerRef.current = null;\r\n }\r\n setActive(false);\r\n }, []);\r\n\r\n const start = useCallback(() => {\r\n stop();\r\n if (delay !== null && delay >= 0) {\r\n timerRef.current = setInterval(() => latest.current(), delay);\r\n setActive(true);\r\n }\r\n }, [delay]);\r\n\r\n useEffect(() => {\r\n start();\r\n return () => stop();\r\n }, [delay, start, stop]);\r\n\r\n return { start, stop, active };\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\r\nimport { useLatest } from \"./useLatest\";\r\nimport type { AsyncState } from \"../types\";\r\n\r\n/**\r\n * Manage an asynchronous operation with loading, success and error states.\r\n *\r\n * Supports cancellation via AbortController, race-condition protection (only\r\n * the latest invocation updates state), and manual execute / reset.\r\n *\r\n * @param asyncFn - Function returning a Promise\r\n * @param immediate - Whether to invoke immediately on mount (default true)\r\n */\r\nexport function useAsync<T>(\r\n asyncFn: () => Promise<T>,\r\n immediate: boolean = true,\r\n): AsyncState<T> & {\r\n execute: () => Promise<void>;\r\n setData: (data: T) => void;\r\n setError: (error: Error) => void;\r\n reset: () => void;\r\n cancel: () => void;\r\n} {\r\n const [state, setState] = useState<AsyncState<T>>({\r\n data: null,\r\n error: null,\r\n isLoading: false,\r\n isSuccess: false,\r\n isError: false,\r\n });\r\n const latest = useLatest(asyncFn);\r\n const abortRef = useRef<AbortController | null>(null);\r\n const seqRef = useRef(0);\r\n\r\n const cancel = useCallback(() => {\r\n if (abortRef.current) {\r\n abortRef.current.abort();\r\n abortRef.current = null;\r\n setState({ data: null, error: null, isLoading: false, isSuccess: false, isError: false });\r\n }\r\n }, []);\r\n\r\n const setData = useCallback((data: T) => {\r\n setState({ data, error: null, isLoading: false, isSuccess: true, isError: false });\r\n }, []);\r\n\r\n const setError = useCallback((error: Error) => {\r\n setState({ data: null, error, isLoading: false, isSuccess: false, isError: true });\r\n }, []);\r\n\r\n const reset = useCallback(() => {\r\n cancel();\r\n setState({ data: null, error: null, isLoading: false, isSuccess: false, isError: false });\r\n }, [cancel]);\r\n\r\n const execute = useCallback(async () => {\r\n cancel();\r\n const controller = new AbortController();\r\n abortRef.current = controller;\r\n const seq = ++seqRef.current;\r\n setState({ data: null, error: null, isLoading: true, isSuccess: false, isError: false });\r\n try {\r\n const data = await latest.current();\r\n if (controller.signal.aborted || seq !== seqRef.current) return;\r\n setState({ data, error: null, isLoading: false, isSuccess: true, isError: false });\r\n } catch (err) {\r\n if (controller.signal.aborted || seq !== seqRef.current) return;\r\n const error = err instanceof Error ? err : new Error(String(err));\r\n setState({ data: null, error, isLoading: false, isSuccess: false, isError: true });\r\n } finally {\r\n if (abortRef.current === controller) abortRef.current = null;\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!immediate) return;\r\n void execute();\r\n return () => cancel();\r\n }, [immediate, execute, cancel]);\r\n\r\n return { ...state, execute, setData, setError, reset, cancel };\r\n}\r\n","import { useCallback, useState } from \"react\";\r\nimport { useClipboard } from \"../../hooks\";\r\nimport type { CopyButtonProps } from \"../../types\";\r\n\r\n/**\r\n * Accessible copy-to-clipboard button.\r\n *\r\n * - Copies the supplied `text` to the clipboard.\r\n * - Shows idle / copying / success / error states.\r\n * - Supports custom labels per state and a custom className.\r\n * - Keyboard accessible (native button). No icon library dependency.\r\n *\r\n * @param props - Component props\r\n */\r\nexport function CopyButton({\r\n text,\r\n label = \"Copy\",\r\n copyingLabel = \"Copying...\",\r\n successLabel = \"Copied!\",\r\n errorLabel = \"Error\",\r\n className,\r\n onCopy,\r\n onError,\r\n timeout = 2000,\r\n}: CopyButtonProps): JSX.Element {\r\n const [status, setStatus] = useState<\"idle\" | \"copying\" | \"success\" | \"error\">(\"idle\");\r\n const { copy } = useClipboard();\r\n\r\n const handleCopy = useCallback(async () => {\r\n setStatus(\"copying\");\r\n try {\r\n const ok = await copy(text);\r\n if (ok) {\r\n setStatus(\"success\");\r\n onCopy?.(text);\r\n } else {\r\n setStatus(\"error\");\r\n onError?.(new Error(\"Failed to copy to clipboard\"));\r\n }\r\n } catch (err) {\r\n setStatus(\"error\");\r\n onError?.(err as Error);\r\n }\r\n setTimeout(() => setStatus(\"idle\"), timeout);\r\n }, [text, copy, onCopy, onError, timeout]);\r\n\r\n const displayLabel =\r\n status === \"copying\"\r\n ? copyingLabel\r\n : status === \"success\"\r\n ? successLabel\r\n : status === \"error\"\r\n ? errorLabel\r\n : label;\r\n\r\n return (\r\n <button\r\n type=\"button\"\r\n className={className}\r\n disabled={status === \"copying\"}\r\n onClick={handleCopy}\r\n aria-label={status === \"success\" ? \"Copied to clipboard\" : label}\r\n aria-pressed={status === \"success\"}\r\n >\r\n {displayLabel}\r\n </button>\r\n );\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from \"react\";\r\nimport type { ChangeEvent } from \"react\";\r\nimport { useDebouncedValue } from \"../../hooks\";\r\nimport type { DebouncedInputProps } from \"../../types\";\r\n\r\n/**\r\n * Controlled input with a separate debounced value.\r\n *\r\n * - `value`/`defaultValue` for controlled/uncontrolled usage.\r\n * - `delay` controls debounce duration.\r\n * - `onChange` fires immediately; `onDebouncedChange` fires after debounce.\r\n * - Accepts standard input attributes for form integration.\r\n *\r\n * @param props - Component props\r\n */\r\nexport function DebouncedInput({\r\n value,\r\n defaultValue,\r\n onChange,\r\n onDebouncedChange,\r\n delay = 300,\r\n ...rest\r\n}: DebouncedInputProps): JSX.Element {\r\n const [internalValue, setInternalValue] = useState(defaultValue ?? \"\");\r\n const isControlled = value !== undefined;\r\n const currentValue = isControlled ? (value ?? \"\") : internalValue;\r\n\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n const next = event.target.value;\r\n if (!isControlled) setInternalValue(next);\r\n onChange?.(next);\r\n },\r\n [isControlled, onChange],\r\n );\r\n\r\n const debounced = useDebouncedValue(currentValue, { delay });\r\n const initialized = useRef(false);\r\n\r\n useEffect(() => {\r\n if (!initialized.current) {\r\n initialized.current = true;\r\n return;\r\n }\r\n onDebouncedChange?.(debounced);\r\n }, [debounced, onDebouncedChange]);\r\n\r\n return <input {...rest} value={currentValue} onChange={handleChange} />;\r\n}\r\n","import { useCallback, useState } from \"react\";\r\nimport type { ChangeEvent } from \"react\";\r\nimport type { PasswordInputProps } from \"../../types\";\r\n\r\n/**\r\n * Accessible show/hide password input.\r\n *\r\n * - Controlled/uncontrolled value.\r\n * - Accessible toggle button labels.\r\n * - Keyboard accessible; no external UI framework dependency.\r\n *\r\n * @param props - Component props\r\n */\r\nexport function PasswordInput({\r\n value,\r\n defaultValue,\r\n onChange,\r\n label = \"Password\",\r\n placeholder,\r\n disabled = false,\r\n required = false,\r\n name,\r\n id,\r\n showToggle = true,\r\n className,\r\n}: PasswordInputProps): JSX.Element {\r\n const [show, setShow] = useState(false);\r\n const [internalValue, setInternalValue] = useState(defaultValue ?? \"\");\r\n const isControlled = value !== undefined;\r\n const currentValue = isControlled ? (value ?? \"\") : internalValue;\r\n\r\n const handleChange = useCallback(\r\n (event: ChangeEvent<HTMLInputElement>) => {\r\n const next = event.target.value;\r\n if (!isControlled) setInternalValue(next);\r\n onChange?.(next);\r\n },\r\n [isControlled, onChange],\r\n );\r\n\r\n const toggle = useCallback(() => setShow((current) => !current), []);\r\n\r\n return (\r\n <div className={className}>\r\n {label && <label htmlFor={id}>{label}</label>}\r\n <input\r\n id={id}\r\n name={name}\r\n type={show ? \"text\" : \"password\"}\r\n value={currentValue}\r\n onChange={handleChange}\r\n placeholder={placeholder}\r\n disabled={disabled}\r\n required={required}\r\n aria-label={label}\r\n />\r\n {showToggle && (\r\n <button\r\n type=\"button\"\r\n onClick={toggle}\r\n aria-label={show ? \"Hide password\" : \"Show password\"}\r\n aria-pressed={show}\r\n >\r\n {show ? \"Hide password\" : \"Show password\"}\r\n </button>\r\n )}\r\n </div>\r\n );\r\n}\r\n","import { useCallback } from \"react\";\r\nimport { useMediaQuery } from \"../../hooks\";\r\nimport type { ResponsiveProps } from \"../../types\";\r\n\r\n/**\r\n * Conditionally render content based on a media query.\r\n *\r\n * SSR-safe: on the server and before mount, renders `fallback` (or null),\r\n * avoiding hydration mismatches. After mount, renders `children(matches)` when\r\n * the query matches, otherwise `fallback`.\r\n *\r\n * @param props - Component props\r\n */\r\nexport function Responsive({ children, query, fallback }: ResponsiveProps): JSX.Element {\r\n const matches = useMediaQuery(query);\r\n const renderChildren = useCallback(\r\n (m: boolean) => (m ? children(m) : fallback ?? null),\r\n [children, fallback],\r\n );\r\n return <>{renderChildren(matches)}</>;\r\n}\r\n","import { Component, ReactNode } from \"react\";\r\nimport type { ErrorBoundaryProps, ErrorBoundaryState } from \"../../types\";\r\n\r\n/**\r\n * React error boundary.\r\n *\r\n * Captures descendant rendering errors, supports a fallback UI (element or\r\n * render function receiving the error and React error info), an optional\r\n * onError callback, and optional reset via `resetKeys` changes.\r\n *\r\n * Limitations: does not catch errors in event handlers, asynchronous code\r\n * (setTimeout, promises), or server-side rendering. Those must be handled\r\n * separately (try/catch, error-first callbacks, etc.).\r\n *\r\n * @param props - Component props\r\n */\r\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\r\n state: ErrorBoundaryState = { hasError: false, error: null, info: null };\r\n\r\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\r\n return { hasError: true, error, info: null };\r\n }\r\n\r\n componentDidCatch(error: Error, info: React.ErrorInfo): void {\r\n this.setState({ info });\r\n this.props.onError?.(error, info);\r\n }\r\n\r\n componentDidUpdate(prevProps: ErrorBoundaryProps): void {\r\n if (this.props.resetKeys !== prevProps.resetKeys) {\r\n const prev = JSON.stringify(prevProps.resetKeys);\r\n const next = JSON.stringify(this.props.resetKeys);\r\n if (prev !== next) {\r\n this.setState({ hasError: false, error: null, info: null });\r\n }\r\n }\r\n }\r\n\r\n render(): ReactNode {\r\n if (this.state.hasError) {\r\n const { fallback } = this.props;\r\n if (fallback === undefined) return null;\r\n if (typeof fallback === \"function\") {\r\n return (fallback as (error: Error, info: React.ErrorInfo) => ReactNode)(\r\n this.state.error!,\r\n this.state.info!,\r\n );\r\n }\r\n return fallback;\r\n }\r\n return this.props.children;\r\n }\r\n}\r\n","/**\r\n * Array utilities.\r\n *\r\n * Pure, tree-shakable wrappers around @mwakidenis/logx array functions plus a\r\n * few React-oriented helpers. LOGX provides the core transformations; this\r\n * module exposes them with stable, documented signatures.\r\n */\r\n\r\nimport {\r\n chunk as logxChunk,\r\n compact as logxCompact,\r\n difference as logxDifference,\r\n drop as logxDrop,\r\n flatten as logxFlatten,\r\n flattenDeep as logxFlattenDeep,\r\n intersection as logxIntersection,\r\n last as logxLast,\r\n partition as logxPartition,\r\n sample as logxSample,\r\n shuffle as logxShuffle,\r\n take as logxTake,\r\n union as logxUnion,\r\n unique as logxUnique,\r\n} from \"../internal/logx\";\r\n\r\nexport const chunk = logxChunk;\r\nexport const compact = logxCompact;\r\nexport const difference = logxDifference;\r\nexport const drop = logxDrop;\r\nexport const flatten = logxFlatten;\r\nexport const flattenDeep = logxFlattenDeep;\r\nexport const intersection = logxIntersection;\r\nexport const last = logxLast;\r\nexport const partition = logxPartition;\r\nexport const sample = logxSample;\r\nexport const shuffle = logxShuffle;\r\nexport const take = logxTake;\r\nexport const union = logxUnion;\r\nexport const unique = logxUnique;\r\n\r\n/**\r\n * Return the first element of an array, or undefined.\r\n */\r\nexport function first<T>(array: readonly T[]): T | undefined {\r\n return array[0];\r\n}\r\n\r\n/**\r\n * Remove duplicates from an array using LOGX unique.\r\n */\r\nexport function distinct<T>(array: readonly T[]): T[] {\r\n return unique(array);\r\n}\r\n","/**\r\n * Object utilities.\r\n *\r\n * Wrappers around @mwakidenis/logx object functions with stable signatures.\r\n */\r\n\r\nimport {\r\n clone as logxClone,\r\n deepClone as logxDeepClone,\r\n entries as logxEntries,\r\n get as logxGet,\r\n has as logxHas,\r\n keys as logxKeys,\r\n mapKeys as logxMapKeys,\r\n mapValues as logxMapValues,\r\n merge as logxMerge,\r\n omit as logxOmit,\r\n pick as logxPick,\r\n set as logxSet,\r\n values as logxValues,\r\n} from \"../internal/logx\";\r\n\r\nexport const clone = logxClone;\r\nexport const deepClone = logxDeepClone;\r\nexport const entries = logxEntries;\r\nexport const get = logxGet;\r\nexport const has = logxHas;\r\nexport const keys = logxKeys;\r\nexport const mapKeys = logxMapKeys;\r\nexport const mapValues = logxMapValues;\r\nexport const merge = logxMerge;\r\nexport const omit = logxOmit;\r\nexport const pick = logxPick;\r\nexport const set = logxSet;\r\nexport const values = logxValues;\r\n\r\n/**\r\n * Safely get a nested value, returning undefined when the path is missing.\r\n */\r\nexport function safeGet<T>(object: unknown, path: string | Array<string | number>): T | undefined {\r\n const result = logxGet(object, path);\r\n return result === undefined ? undefined : (result as T);\r\n}\r\n","/**\r\n * String utilities.\r\n *\r\n * Wrappers around @mwakidenis/logx string functions plus a React-oriented\r\n * HTML escaper for safe rendering.\r\n */\r\n\r\nimport {\r\n camelCase as logxCamelCase,\r\n capitalize as logxCapitalize,\r\n escapeHtml as logxEscapeHtml,\r\n kebabCase as logxKebabCase,\r\n pascalCase as logxPascalCase,\r\n snakeCase as logxSnakeCase,\r\n trim as logxTrim,\r\n truncate as logxTruncate,\r\n} from \"../internal/logx\";\r\n\r\nexport const camelCase = logxCamelCase;\r\nexport const capitalize = logxCapitalize;\r\nexport const escapeHtml = logxEscapeHtml;\r\nexport const kebabCase = logxKebabCase;\r\nexport const pascalCase = logxPascalCase;\r\nexport const snakeCase = logxSnakeCase;\r\nexport const trim = logxTrim;\r\nexport const truncate = logxTruncate;\r\n\r\n/**\r\n * Escape HTML special characters so a string can be interpolated safely.\r\n * Delegates to @mwakidenis/logx escapeHtml.\r\n */\r\nexport function htmlEscape(input: string): string {\r\n return escapeHtml(input);\r\n}\r\n","/**\r\n * Number utilities.\r\n *\r\n * Wrappers around @mwakidenis/logx number functions.\r\n */\r\n\r\nimport {\r\n clamp as logxClamp,\r\n inRange as logxInRange,\r\n round as logxRound,\r\n percentage as logxPercentage,\r\n randomInt as logxRandomInt,\r\n} from \"../internal/logx\";\r\n\r\nexport const clamp = logxClamp;\r\nexport const inRange = logxInRange;\r\nexport const round = logxRound;\r\nexport const percentage = logxPercentage;\r\nexport const randomInt = logxRandomInt;\r\n","/**\r\n * Validation utilities.\r\n *\r\n * Wrappers around @mwakidenis/logx validation functions with type-guard\r\n * signatures preserved, plus React-oriented helpers.\r\n */\r\n\r\nimport {\r\n isArray as logxIsArray,\r\n isBoolean as logxIsBoolean,\r\n isEmail as logxIsEmail,\r\n isEmpty as logxIsEmpty,\r\n isFunction as logxIsFunction,\r\n isNil as logxIsNil,\r\n isNull as logxIsNull,\r\n isNumber as logxIsNumber,\r\n isObject as logxIsObject,\r\n isString as logxIsString,\r\n isURL as logxIsURL,\r\n} from \"../internal/logx\";\r\n\r\nexport const isArray = logxIsArray;\r\nexport const isBoolean = logxIsBoolean;\r\nexport const isEmail = logxIsEmail;\r\nexport const isEmpty = logxIsEmpty;\r\nexport const isFunction = logxIsFunction;\r\nexport const isNil = logxIsNil;\r\nexport const isNull = logxIsNull;\r\nexport const isNumber = logxIsNumber;\r\nexport const isObject = logxIsObject;\r\nexport const isString = logxIsString;\r\nexport const isURL = logxIsURL;\r\n\r\n/**\r\n * Required-field validator: returns an error message when the value is nil or\r\n * an empty string, otherwise null.\r\n */\r\nexport function required(value: unknown, fieldName = \"This field\"): string | null {\r\n if (isNil(value)) return `${fieldName} is required`;\r\n if (isString(value) && value.trim() === \"\") return `${fieldName} is required`;\r\n return null;\r\n}\r\n","/**\r\n * Date utilities.\r\n *\r\n * Wrappers around @mwakidenis/logx date functions.\r\n */\r\n\r\nimport { addDays as logxAddDays, isValidDate as logxIsValidDate } from \"../internal/logx\";\r\n\r\nexport const addDays = logxAddDays;\r\nexport const isValidDate = logxIsValidDate;\r\n","/**\r\n * Browser environment utilities.\r\n *\r\n * Re-exports @mwakidenis/logx browser detection helpers so consumers can\r\n * write SSR-safe code without importing @mwakidenis/logx directly.\r\n */\r\n\r\nimport {\r\n hasLocalStorage as logxHasLocalStorage,\r\n hasSessionStorage as logxHasSessionStorage,\r\n isBrowser as logxIsBrowser,\r\n isNode as logxIsNode,\r\n} from \"../internal/logx\";\r\n\r\nexport const hasLocalStorage = logxHasLocalStorage;\r\nexport const hasSessionStorage = logxHasSessionStorage;\r\nexport const isBrowser = logxIsBrowser;\r\nexport const isNode = logxIsNode;\r\n","import { createContext, useContext, ReactNode } from \"react\";\r\nimport * as logx from \"../internal/logx\";\r\n\r\nexport interface LogxContextValue {\r\n logx: typeof logx;\r\n}\r\n\r\nconst LogxContext = createContext<LogxContextValue | null>(null);\r\n\r\n/**\r\n * Provider that exposes the LOGX integration layer via React context.\r\n *\r\n * Wrap your application (or a subtree) so components and hooks can access\r\n * LOGX utilities through context instead of importing @mwakidenis/logx\r\n * directly. This is optional; all hooks and components work standalone.\r\n *\r\n * @param props - Component props\r\n */\r\nexport function LogxProvider({ children }: { children: ReactNode }): JSX.Element {\r\n return (\r\n <LogxContext.Provider value={{ logx }}>\r\n {children}\r\n </LogxContext.Provider>\r\n );\r\n}\r\n\r\n/**\r\n * Consume the LOGX integration layer from context.\r\n * Returns null when used outside a LogxProvider.\r\n */\r\nexport function useLogx(): LogxContextValue | null {\r\n return useContext(LogxContext);\r\n}\r\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Cancelable, debounce, throttle } from '@mwakidenis/logx/function';
|
|
3
|
+
import { StorageHelpers, hasLocalStorage, hasSessionStorage, isBrowser, isNode, localStorageHelpers, safeStorage, sessionStorageHelpers } from '@mwakidenis/logx/browser';
|
|
4
|
+
import { isArray, isBoolean, isEmail, isEmpty, isFunction, isNil, isNull, isNumber, isObject, isString, isURL } from '@mwakidenis/logx/validation';
|
|
5
|
+
import { clone, deepClone, entries, get, has, invert, keys, mapKeys, mapValues, merge, omit, pick, set, values } from '@mwakidenis/logx/object';
|
|
6
|
+
import { clamp, inRange, percentage, randomInt, round } from '@mwakidenis/logx/number';
|
|
7
|
+
import { chunk, compact, difference, drop, first, flatten, flattenDeep, intersection, last, partition, sample, shuffle, take, union, unique } from '@mwakidenis/logx/array';
|
|
8
|
+
import { retry, sleep, timeout, withTimeout } from '@mwakidenis/logx/async';
|
|
9
|
+
import { addDays, isValidDate } from '@mwakidenis/logx/date';
|
|
10
|
+
import { camelCase, capitalize, escapeHtml, kebabCase, pascalCase, snakeCase, trim, truncate } from '@mwakidenis/logx/string';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* LOGX integration layer.
|
|
14
|
+
*
|
|
15
|
+
* This module is the single place where @mwakidenis/logx is imported. Every hook,
|
|
16
|
+
* component or utility that needs a LOGX capability imports it from here rather
|
|
17
|
+
* than importing @mwakidenis/logx directly. That keeps React-specific behaviour
|
|
18
|
+
* separate from core utility behaviour and makes the dependency boundary obvious.
|
|
19
|
+
*
|
|
20
|
+
* Only confirmed, publicly exported LOGX functions are re-exported. No LOGX
|
|
21
|
+
* internals are copied into this project and the parent repository is not modified.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* React-friendly wrapper around LOGX debounce that exposes a stable Cancelable
|
|
26
|
+
* and validates the wait argument. Leading edge is not invoked by LOGX debounce
|
|
27
|
+
* (trailing edge only); document this in hooks that use it.
|
|
28
|
+
*/
|
|
29
|
+
interface LogxDebounceResult<F extends (...args: unknown[]) => unknown> {
|
|
30
|
+
fn: F & Cancelable;
|
|
31
|
+
cancel: () => void;
|
|
32
|
+
flush: () => void;
|
|
33
|
+
pending: () => boolean;
|
|
34
|
+
}
|
|
35
|
+
declare function createLogxDebounce<F extends (...args: unknown[]) => unknown>(func: F, wait: number): LogxDebounceResult<F>;
|
|
36
|
+
|
|
37
|
+
declare const logx_Cancelable: typeof Cancelable;
|
|
38
|
+
type logx_LogxDebounceResult<F extends (...args: unknown[]) => unknown> = LogxDebounceResult<F>;
|
|
39
|
+
declare const logx_StorageHelpers: typeof StorageHelpers;
|
|
40
|
+
declare const logx_addDays: typeof addDays;
|
|
41
|
+
declare const logx_camelCase: typeof camelCase;
|
|
42
|
+
declare const logx_capitalize: typeof capitalize;
|
|
43
|
+
declare const logx_chunk: typeof chunk;
|
|
44
|
+
declare const logx_clamp: typeof clamp;
|
|
45
|
+
declare const logx_clone: typeof clone;
|
|
46
|
+
declare const logx_compact: typeof compact;
|
|
47
|
+
declare const logx_createLogxDebounce: typeof createLogxDebounce;
|
|
48
|
+
declare const logx_debounce: typeof debounce;
|
|
49
|
+
declare const logx_deepClone: typeof deepClone;
|
|
50
|
+
declare const logx_difference: typeof difference;
|
|
51
|
+
declare const logx_drop: typeof drop;
|
|
52
|
+
declare const logx_entries: typeof entries;
|
|
53
|
+
declare const logx_escapeHtml: typeof escapeHtml;
|
|
54
|
+
declare const logx_first: typeof first;
|
|
55
|
+
declare const logx_flatten: typeof flatten;
|
|
56
|
+
declare const logx_flattenDeep: typeof flattenDeep;
|
|
57
|
+
declare const logx_get: typeof get;
|
|
58
|
+
declare const logx_has: typeof has;
|
|
59
|
+
declare const logx_hasLocalStorage: typeof hasLocalStorage;
|
|
60
|
+
declare const logx_hasSessionStorage: typeof hasSessionStorage;
|
|
61
|
+
declare const logx_inRange: typeof inRange;
|
|
62
|
+
declare const logx_intersection: typeof intersection;
|
|
63
|
+
declare const logx_invert: typeof invert;
|
|
64
|
+
declare const logx_isArray: typeof isArray;
|
|
65
|
+
declare const logx_isBoolean: typeof isBoolean;
|
|
66
|
+
declare const logx_isBrowser: typeof isBrowser;
|
|
67
|
+
declare const logx_isEmail: typeof isEmail;
|
|
68
|
+
declare const logx_isEmpty: typeof isEmpty;
|
|
69
|
+
declare const logx_isFunction: typeof isFunction;
|
|
70
|
+
declare const logx_isNil: typeof isNil;
|
|
71
|
+
declare const logx_isNode: typeof isNode;
|
|
72
|
+
declare const logx_isNull: typeof isNull;
|
|
73
|
+
declare const logx_isNumber: typeof isNumber;
|
|
74
|
+
declare const logx_isObject: typeof isObject;
|
|
75
|
+
declare const logx_isString: typeof isString;
|
|
76
|
+
declare const logx_isURL: typeof isURL;
|
|
77
|
+
declare const logx_isValidDate: typeof isValidDate;
|
|
78
|
+
declare const logx_kebabCase: typeof kebabCase;
|
|
79
|
+
declare const logx_keys: typeof keys;
|
|
80
|
+
declare const logx_last: typeof last;
|
|
81
|
+
declare const logx_localStorageHelpers: typeof localStorageHelpers;
|
|
82
|
+
declare const logx_mapKeys: typeof mapKeys;
|
|
83
|
+
declare const logx_mapValues: typeof mapValues;
|
|
84
|
+
declare const logx_merge: typeof merge;
|
|
85
|
+
declare const logx_omit: typeof omit;
|
|
86
|
+
declare const logx_partition: typeof partition;
|
|
87
|
+
declare const logx_pascalCase: typeof pascalCase;
|
|
88
|
+
declare const logx_percentage: typeof percentage;
|
|
89
|
+
declare const logx_pick: typeof pick;
|
|
90
|
+
declare const logx_randomInt: typeof randomInt;
|
|
91
|
+
declare const logx_retry: typeof retry;
|
|
92
|
+
declare const logx_round: typeof round;
|
|
93
|
+
declare const logx_safeStorage: typeof safeStorage;
|
|
94
|
+
declare const logx_sample: typeof sample;
|
|
95
|
+
declare const logx_sessionStorageHelpers: typeof sessionStorageHelpers;
|
|
96
|
+
declare const logx_set: typeof set;
|
|
97
|
+
declare const logx_shuffle: typeof shuffle;
|
|
98
|
+
declare const logx_sleep: typeof sleep;
|
|
99
|
+
declare const logx_snakeCase: typeof snakeCase;
|
|
100
|
+
declare const logx_take: typeof take;
|
|
101
|
+
declare const logx_throttle: typeof throttle;
|
|
102
|
+
declare const logx_timeout: typeof timeout;
|
|
103
|
+
declare const logx_trim: typeof trim;
|
|
104
|
+
declare const logx_truncate: typeof truncate;
|
|
105
|
+
declare const logx_union: typeof union;
|
|
106
|
+
declare const logx_unique: typeof unique;
|
|
107
|
+
declare const logx_values: typeof values;
|
|
108
|
+
declare const logx_withTimeout: typeof withTimeout;
|
|
109
|
+
declare namespace logx {
|
|
110
|
+
export { logx_Cancelable as Cancelable, type logx_LogxDebounceResult as LogxDebounceResult, logx_StorageHelpers as StorageHelpers, logx_addDays as addDays, logx_camelCase as camelCase, logx_capitalize as capitalize, logx_chunk as chunk, logx_clamp as clamp, logx_clone as clone, logx_compact as compact, logx_createLogxDebounce as createLogxDebounce, logx_debounce as debounce, logx_deepClone as deepClone, logx_difference as difference, logx_drop as drop, logx_entries as entries, logx_escapeHtml as escapeHtml, logx_first as first, logx_flatten as flatten, logx_flattenDeep as flattenDeep, logx_get as get, logx_has as has, logx_hasLocalStorage as hasLocalStorage, logx_hasSessionStorage as hasSessionStorage, logx_inRange as inRange, logx_intersection as intersection, logx_invert as invert, logx_isArray as isArray, logx_isBoolean as isBoolean, logx_isBrowser as isBrowser, logx_isEmail as isEmail, logx_isEmpty as isEmpty, logx_isFunction as isFunction, logx_isNil as isNil, logx_isNode as isNode, logx_isNull as isNull, logx_isNumber as isNumber, logx_isObject as isObject, logx_isString as isString, logx_isURL as isURL, logx_isValidDate as isValidDate, logx_kebabCase as kebabCase, logx_keys as keys, logx_last as last, logx_localStorageHelpers as localStorageHelpers, logx_mapKeys as mapKeys, logx_mapValues as mapValues, logx_merge as merge, logx_omit as omit, logx_partition as partition, logx_pascalCase as pascalCase, logx_percentage as percentage, logx_pick as pick, logx_randomInt as randomInt, logx_retry as retry, logx_round as round, logx_safeStorage as safeStorage, logx_sample as sample, logx_sessionStorageHelpers as sessionStorageHelpers, logx_set as set, logx_shuffle as shuffle, logx_sleep as sleep, logx_snakeCase as snakeCase, logx_take as take, logx_throttle as throttle, logx_timeout as timeout, logx_trim as trim, logx_truncate as truncate, logx_union as union, logx_unique as unique, logx_values as values, logx_withTimeout as withTimeout };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface LogxContextValue {
|
|
114
|
+
logx: typeof logx;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Provider that exposes the LOGX integration layer via React context.
|
|
118
|
+
*
|
|
119
|
+
* Wrap your application (or a subtree) so components and hooks can access
|
|
120
|
+
* LOGX utilities through context instead of importing @mwakidenis/logx
|
|
121
|
+
* directly. This is optional; all hooks and components work standalone.
|
|
122
|
+
*
|
|
123
|
+
* @param props - Component props
|
|
124
|
+
*/
|
|
125
|
+
declare function LogxProvider({ children }: {
|
|
126
|
+
children: ReactNode;
|
|
127
|
+
}): JSX.Element;
|
|
128
|
+
/**
|
|
129
|
+
* Consume the LOGX integration layer from context.
|
|
130
|
+
* Returns null when used outside a LogxProvider.
|
|
131
|
+
*/
|
|
132
|
+
declare function useLogx(): LogxContextValue | null;
|
|
133
|
+
|
|
134
|
+
export { type LogxContextValue, LogxProvider, useLogx };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Cancelable, debounce, throttle } from '@mwakidenis/logx/function';
|
|
3
|
+
import { StorageHelpers, hasLocalStorage, hasSessionStorage, isBrowser, isNode, localStorageHelpers, safeStorage, sessionStorageHelpers } from '@mwakidenis/logx/browser';
|
|
4
|
+
import { isArray, isBoolean, isEmail, isEmpty, isFunction, isNil, isNull, isNumber, isObject, isString, isURL } from '@mwakidenis/logx/validation';
|
|
5
|
+
import { clone, deepClone, entries, get, has, invert, keys, mapKeys, mapValues, merge, omit, pick, set, values } from '@mwakidenis/logx/object';
|
|
6
|
+
import { clamp, inRange, percentage, randomInt, round } from '@mwakidenis/logx/number';
|
|
7
|
+
import { chunk, compact, difference, drop, first, flatten, flattenDeep, intersection, last, partition, sample, shuffle, take, union, unique } from '@mwakidenis/logx/array';
|
|
8
|
+
import { retry, sleep, timeout, withTimeout } from '@mwakidenis/logx/async';
|
|
9
|
+
import { addDays, isValidDate } from '@mwakidenis/logx/date';
|
|
10
|
+
import { camelCase, capitalize, escapeHtml, kebabCase, pascalCase, snakeCase, trim, truncate } from '@mwakidenis/logx/string';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* LOGX integration layer.
|
|
14
|
+
*
|
|
15
|
+
* This module is the single place where @mwakidenis/logx is imported. Every hook,
|
|
16
|
+
* component or utility that needs a LOGX capability imports it from here rather
|
|
17
|
+
* than importing @mwakidenis/logx directly. That keeps React-specific behaviour
|
|
18
|
+
* separate from core utility behaviour and makes the dependency boundary obvious.
|
|
19
|
+
*
|
|
20
|
+
* Only confirmed, publicly exported LOGX functions are re-exported. No LOGX
|
|
21
|
+
* internals are copied into this project and the parent repository is not modified.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* React-friendly wrapper around LOGX debounce that exposes a stable Cancelable
|
|
26
|
+
* and validates the wait argument. Leading edge is not invoked by LOGX debounce
|
|
27
|
+
* (trailing edge only); document this in hooks that use it.
|
|
28
|
+
*/
|
|
29
|
+
interface LogxDebounceResult<F extends (...args: unknown[]) => unknown> {
|
|
30
|
+
fn: F & Cancelable;
|
|
31
|
+
cancel: () => void;
|
|
32
|
+
flush: () => void;
|
|
33
|
+
pending: () => boolean;
|
|
34
|
+
}
|
|
35
|
+
declare function createLogxDebounce<F extends (...args: unknown[]) => unknown>(func: F, wait: number): LogxDebounceResult<F>;
|
|
36
|
+
|
|
37
|
+
declare const logx_Cancelable: typeof Cancelable;
|
|
38
|
+
type logx_LogxDebounceResult<F extends (...args: unknown[]) => unknown> = LogxDebounceResult<F>;
|
|
39
|
+
declare const logx_StorageHelpers: typeof StorageHelpers;
|
|
40
|
+
declare const logx_addDays: typeof addDays;
|
|
41
|
+
declare const logx_camelCase: typeof camelCase;
|
|
42
|
+
declare const logx_capitalize: typeof capitalize;
|
|
43
|
+
declare const logx_chunk: typeof chunk;
|
|
44
|
+
declare const logx_clamp: typeof clamp;
|
|
45
|
+
declare const logx_clone: typeof clone;
|
|
46
|
+
declare const logx_compact: typeof compact;
|
|
47
|
+
declare const logx_createLogxDebounce: typeof createLogxDebounce;
|
|
48
|
+
declare const logx_debounce: typeof debounce;
|
|
49
|
+
declare const logx_deepClone: typeof deepClone;
|
|
50
|
+
declare const logx_difference: typeof difference;
|
|
51
|
+
declare const logx_drop: typeof drop;
|
|
52
|
+
declare const logx_entries: typeof entries;
|
|
53
|
+
declare const logx_escapeHtml: typeof escapeHtml;
|
|
54
|
+
declare const logx_first: typeof first;
|
|
55
|
+
declare const logx_flatten: typeof flatten;
|
|
56
|
+
declare const logx_flattenDeep: typeof flattenDeep;
|
|
57
|
+
declare const logx_get: typeof get;
|
|
58
|
+
declare const logx_has: typeof has;
|
|
59
|
+
declare const logx_hasLocalStorage: typeof hasLocalStorage;
|
|
60
|
+
declare const logx_hasSessionStorage: typeof hasSessionStorage;
|
|
61
|
+
declare const logx_inRange: typeof inRange;
|
|
62
|
+
declare const logx_intersection: typeof intersection;
|
|
63
|
+
declare const logx_invert: typeof invert;
|
|
64
|
+
declare const logx_isArray: typeof isArray;
|
|
65
|
+
declare const logx_isBoolean: typeof isBoolean;
|
|
66
|
+
declare const logx_isBrowser: typeof isBrowser;
|
|
67
|
+
declare const logx_isEmail: typeof isEmail;
|
|
68
|
+
declare const logx_isEmpty: typeof isEmpty;
|
|
69
|
+
declare const logx_isFunction: typeof isFunction;
|
|
70
|
+
declare const logx_isNil: typeof isNil;
|
|
71
|
+
declare const logx_isNode: typeof isNode;
|
|
72
|
+
declare const logx_isNull: typeof isNull;
|
|
73
|
+
declare const logx_isNumber: typeof isNumber;
|
|
74
|
+
declare const logx_isObject: typeof isObject;
|
|
75
|
+
declare const logx_isString: typeof isString;
|
|
76
|
+
declare const logx_isURL: typeof isURL;
|
|
77
|
+
declare const logx_isValidDate: typeof isValidDate;
|
|
78
|
+
declare const logx_kebabCase: typeof kebabCase;
|
|
79
|
+
declare const logx_keys: typeof keys;
|
|
80
|
+
declare const logx_last: typeof last;
|
|
81
|
+
declare const logx_localStorageHelpers: typeof localStorageHelpers;
|
|
82
|
+
declare const logx_mapKeys: typeof mapKeys;
|
|
83
|
+
declare const logx_mapValues: typeof mapValues;
|
|
84
|
+
declare const logx_merge: typeof merge;
|
|
85
|
+
declare const logx_omit: typeof omit;
|
|
86
|
+
declare const logx_partition: typeof partition;
|
|
87
|
+
declare const logx_pascalCase: typeof pascalCase;
|
|
88
|
+
declare const logx_percentage: typeof percentage;
|
|
89
|
+
declare const logx_pick: typeof pick;
|
|
90
|
+
declare const logx_randomInt: typeof randomInt;
|
|
91
|
+
declare const logx_retry: typeof retry;
|
|
92
|
+
declare const logx_round: typeof round;
|
|
93
|
+
declare const logx_safeStorage: typeof safeStorage;
|
|
94
|
+
declare const logx_sample: typeof sample;
|
|
95
|
+
declare const logx_sessionStorageHelpers: typeof sessionStorageHelpers;
|
|
96
|
+
declare const logx_set: typeof set;
|
|
97
|
+
declare const logx_shuffle: typeof shuffle;
|
|
98
|
+
declare const logx_sleep: typeof sleep;
|
|
99
|
+
declare const logx_snakeCase: typeof snakeCase;
|
|
100
|
+
declare const logx_take: typeof take;
|
|
101
|
+
declare const logx_throttle: typeof throttle;
|
|
102
|
+
declare const logx_timeout: typeof timeout;
|
|
103
|
+
declare const logx_trim: typeof trim;
|
|
104
|
+
declare const logx_truncate: typeof truncate;
|
|
105
|
+
declare const logx_union: typeof union;
|
|
106
|
+
declare const logx_unique: typeof unique;
|
|
107
|
+
declare const logx_values: typeof values;
|
|
108
|
+
declare const logx_withTimeout: typeof withTimeout;
|
|
109
|
+
declare namespace logx {
|
|
110
|
+
export { logx_Cancelable as Cancelable, type logx_LogxDebounceResult as LogxDebounceResult, logx_StorageHelpers as StorageHelpers, logx_addDays as addDays, logx_camelCase as camelCase, logx_capitalize as capitalize, logx_chunk as chunk, logx_clamp as clamp, logx_clone as clone, logx_compact as compact, logx_createLogxDebounce as createLogxDebounce, logx_debounce as debounce, logx_deepClone as deepClone, logx_difference as difference, logx_drop as drop, logx_entries as entries, logx_escapeHtml as escapeHtml, logx_first as first, logx_flatten as flatten, logx_flattenDeep as flattenDeep, logx_get as get, logx_has as has, logx_hasLocalStorage as hasLocalStorage, logx_hasSessionStorage as hasSessionStorage, logx_inRange as inRange, logx_intersection as intersection, logx_invert as invert, logx_isArray as isArray, logx_isBoolean as isBoolean, logx_isBrowser as isBrowser, logx_isEmail as isEmail, logx_isEmpty as isEmpty, logx_isFunction as isFunction, logx_isNil as isNil, logx_isNode as isNode, logx_isNull as isNull, logx_isNumber as isNumber, logx_isObject as isObject, logx_isString as isString, logx_isURL as isURL, logx_isValidDate as isValidDate, logx_kebabCase as kebabCase, logx_keys as keys, logx_last as last, logx_localStorageHelpers as localStorageHelpers, logx_mapKeys as mapKeys, logx_mapValues as mapValues, logx_merge as merge, logx_omit as omit, logx_partition as partition, logx_pascalCase as pascalCase, logx_percentage as percentage, logx_pick as pick, logx_randomInt as randomInt, logx_retry as retry, logx_round as round, logx_safeStorage as safeStorage, logx_sample as sample, logx_sessionStorageHelpers as sessionStorageHelpers, logx_set as set, logx_shuffle as shuffle, logx_sleep as sleep, logx_snakeCase as snakeCase, logx_take as take, logx_throttle as throttle, logx_timeout as timeout, logx_trim as trim, logx_truncate as truncate, logx_union as union, logx_unique as unique, logx_values as values, logx_withTimeout as withTimeout };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface LogxContextValue {
|
|
114
|
+
logx: typeof logx;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Provider that exposes the LOGX integration layer via React context.
|
|
118
|
+
*
|
|
119
|
+
* Wrap your application (or a subtree) so components and hooks can access
|
|
120
|
+
* LOGX utilities through context instead of importing @mwakidenis/logx
|
|
121
|
+
* directly. This is optional; all hooks and components work standalone.
|
|
122
|
+
*
|
|
123
|
+
* @param props - Component props
|
|
124
|
+
*/
|
|
125
|
+
declare function LogxProvider({ children }: {
|
|
126
|
+
children: ReactNode;
|
|
127
|
+
}): JSX.Element;
|
|
128
|
+
/**
|
|
129
|
+
* Consume the LOGX integration layer from context.
|
|
130
|
+
* Returns null when used outside a LogxProvider.
|
|
131
|
+
*/
|
|
132
|
+
declare function useLogx(): LogxContextValue | null;
|
|
133
|
+
|
|
134
|
+
export { type LogxContextValue, LogxProvider, useLogx };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var _function = require('@mwakidenis/logx/function');
|
|
5
|
+
var browser = require('@mwakidenis/logx/browser');
|
|
6
|
+
var validation = require('@mwakidenis/logx/validation');
|
|
7
|
+
var object = require('@mwakidenis/logx/object');
|
|
8
|
+
var number = require('@mwakidenis/logx/number');
|
|
9
|
+
var array = require('@mwakidenis/logx/array');
|
|
10
|
+
var async = require('@mwakidenis/logx/async');
|
|
11
|
+
var date = require('@mwakidenis/logx/date');
|
|
12
|
+
var string = require('@mwakidenis/logx/string');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
+
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// src/internal/logx.ts
|
|
22
|
+
var logx_exports = {};
|
|
23
|
+
__export(logx_exports, {
|
|
24
|
+
addDays: () => date.addDays,
|
|
25
|
+
camelCase: () => string.camelCase,
|
|
26
|
+
capitalize: () => string.capitalize,
|
|
27
|
+
chunk: () => array.chunk,
|
|
28
|
+
clamp: () => number.clamp,
|
|
29
|
+
clone: () => object.clone,
|
|
30
|
+
compact: () => array.compact,
|
|
31
|
+
createLogxDebounce: () => createLogxDebounce,
|
|
32
|
+
debounce: () => _function.debounce,
|
|
33
|
+
deepClone: () => object.deepClone,
|
|
34
|
+
difference: () => array.difference,
|
|
35
|
+
drop: () => array.drop,
|
|
36
|
+
entries: () => object.entries,
|
|
37
|
+
escapeHtml: () => string.escapeHtml,
|
|
38
|
+
first: () => array.first,
|
|
39
|
+
flatten: () => array.flatten,
|
|
40
|
+
flattenDeep: () => array.flattenDeep,
|
|
41
|
+
get: () => object.get,
|
|
42
|
+
has: () => object.has,
|
|
43
|
+
hasLocalStorage: () => browser.hasLocalStorage,
|
|
44
|
+
hasSessionStorage: () => browser.hasSessionStorage,
|
|
45
|
+
inRange: () => number.inRange,
|
|
46
|
+
intersection: () => array.intersection,
|
|
47
|
+
invert: () => object.invert,
|
|
48
|
+
isArray: () => validation.isArray,
|
|
49
|
+
isBoolean: () => validation.isBoolean,
|
|
50
|
+
isBrowser: () => browser.isBrowser,
|
|
51
|
+
isEmail: () => validation.isEmail,
|
|
52
|
+
isEmpty: () => validation.isEmpty,
|
|
53
|
+
isFunction: () => validation.isFunction,
|
|
54
|
+
isNil: () => validation.isNil,
|
|
55
|
+
isNode: () => browser.isNode,
|
|
56
|
+
isNull: () => validation.isNull,
|
|
57
|
+
isNumber: () => validation.isNumber,
|
|
58
|
+
isObject: () => validation.isObject,
|
|
59
|
+
isString: () => validation.isString,
|
|
60
|
+
isURL: () => validation.isURL,
|
|
61
|
+
isValidDate: () => date.isValidDate,
|
|
62
|
+
kebabCase: () => string.kebabCase,
|
|
63
|
+
keys: () => object.keys,
|
|
64
|
+
last: () => array.last,
|
|
65
|
+
localStorageHelpers: () => browser.localStorageHelpers,
|
|
66
|
+
mapKeys: () => object.mapKeys,
|
|
67
|
+
mapValues: () => object.mapValues,
|
|
68
|
+
merge: () => object.merge,
|
|
69
|
+
omit: () => object.omit,
|
|
70
|
+
partition: () => array.partition,
|
|
71
|
+
pascalCase: () => string.pascalCase,
|
|
72
|
+
percentage: () => number.percentage,
|
|
73
|
+
pick: () => object.pick,
|
|
74
|
+
randomInt: () => number.randomInt,
|
|
75
|
+
retry: () => async.retry,
|
|
76
|
+
round: () => number.round,
|
|
77
|
+
safeStorage: () => browser.safeStorage,
|
|
78
|
+
sample: () => array.sample,
|
|
79
|
+
sessionStorageHelpers: () => browser.sessionStorageHelpers,
|
|
80
|
+
set: () => object.set,
|
|
81
|
+
shuffle: () => array.shuffle,
|
|
82
|
+
sleep: () => async.sleep,
|
|
83
|
+
snakeCase: () => string.snakeCase,
|
|
84
|
+
take: () => array.take,
|
|
85
|
+
throttle: () => _function.throttle,
|
|
86
|
+
timeout: () => async.timeout,
|
|
87
|
+
trim: () => string.trim,
|
|
88
|
+
truncate: () => string.truncate,
|
|
89
|
+
union: () => array.union,
|
|
90
|
+
unique: () => array.unique,
|
|
91
|
+
values: () => object.values,
|
|
92
|
+
withTimeout: () => async.withTimeout
|
|
93
|
+
});
|
|
94
|
+
function createLogxDebounce(func, wait) {
|
|
95
|
+
if (!Number.isFinite(wait) || wait < 0) {
|
|
96
|
+
throw new RangeError("debounce: wait must be a non-negative number");
|
|
97
|
+
}
|
|
98
|
+
const debounced = _function.debounce(func, wait);
|
|
99
|
+
return {
|
|
100
|
+
fn: debounced,
|
|
101
|
+
cancel: () => debounced.cancel(),
|
|
102
|
+
flush: () => debounced.flush(),
|
|
103
|
+
pending: () => debounced.pending()
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
var LogxContext = react.createContext(null);
|
|
107
|
+
function LogxProvider({ children }) {
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LogxContext.Provider, { value: { logx: logx_exports }, children });
|
|
109
|
+
}
|
|
110
|
+
function useLogx() {
|
|
111
|
+
return react.useContext(LogxContext);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
exports.LogxProvider = LogxProvider;
|
|
115
|
+
exports.useLogx = useLogx;
|
|
116
|
+
//# sourceMappingURL=LogxProvider.js.map
|
|
117
|
+
//# sourceMappingURL=LogxProvider.js.map
|