@react-xp/aeiou 0.1.0-beta.11 → 0.1.0-beta.13
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/components/a/a.native.js +4 -6
- package/dist/cjs/components/a/a.web.js +4 -6
- package/dist/cjs/components/e/e.native.js +3 -12
- package/dist/cjs/components/e/e.web.js +3 -7
- package/dist/cjs/components/l/l.web.js +3 -7
- package/dist/cjs/components/t/t.native.js +3 -6
- package/dist/cjs/components/t/t.web.js +3 -6
- package/dist/cjs/components/u/errorBoundary.js +27 -0
- package/dist/cjs/components/u/provider.native.js +3 -2
- package/dist/cjs/components/u/provider.web.js +3 -2
- package/dist/cjs/hooks/index.js +0 -2
- package/dist/cjs/hooks/index.native.js +0 -2
- package/dist/cjs/hooks/index.web.js +0 -2
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.native.js +65 -5
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.web.js +62 -21
- package/dist/esm/components/a/a.native.js +5 -7
- package/dist/esm/components/a/a.web.js +5 -7
- package/dist/esm/components/e/e.native.js +4 -13
- package/dist/esm/components/e/e.web.js +4 -8
- package/dist/esm/components/l/l.web.js +4 -8
- package/dist/esm/components/t/t.native.js +4 -7
- package/dist/esm/components/t/t.web.js +4 -7
- package/dist/esm/components/u/errorBoundary.js +23 -0
- package/dist/esm/components/u/provider.native.js +3 -2
- package/dist/esm/components/u/provider.web.js +3 -2
- package/dist/esm/hooks/index.js +0 -2
- package/dist/esm/hooks/index.native.js +0 -2
- package/dist/esm/hooks/index.web.js +0 -2
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.native.js +66 -6
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.web.js +62 -21
- package/dist/native/cjs/components/a/a.native.js +4 -6
- package/dist/native/cjs/components/a/a.web.js +4 -6
- package/dist/native/cjs/components/e/e.native.js +3 -12
- package/dist/native/cjs/components/e/e.web.js +3 -7
- package/dist/native/cjs/components/l/l.web.js +3 -7
- package/dist/native/cjs/components/t/t.native.js +3 -6
- package/dist/native/cjs/components/t/t.web.js +3 -6
- package/dist/native/cjs/components/u/errorBoundary.js +27 -0
- package/dist/native/cjs/components/u/provider.native.js +3 -2
- package/dist/native/cjs/components/u/provider.web.js +3 -2
- package/dist/native/cjs/hooks/index.js +0 -2
- package/dist/native/cjs/hooks/index.native.js +0 -2
- package/dist/native/cjs/hooks/index.web.js +0 -2
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.native.js +65 -5
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.web.js +62 -21
- package/dist/native/esm/components/a/a.native.js +5 -7
- package/dist/native/esm/components/a/a.web.js +5 -7
- package/dist/native/esm/components/e/e.native.js +4 -13
- package/dist/native/esm/components/e/e.web.js +4 -8
- package/dist/native/esm/components/l/l.web.js +4 -8
- package/dist/native/esm/components/t/t.native.js +4 -7
- package/dist/native/esm/components/t/t.web.js +4 -7
- package/dist/native/esm/components/u/errorBoundary.js +23 -0
- package/dist/native/esm/components/u/provider.native.js +3 -2
- package/dist/native/esm/components/u/provider.web.js +3 -2
- package/dist/native/esm/hooks/index.js +0 -2
- package/dist/native/esm/hooks/index.native.js +0 -2
- package/dist/native/esm/hooks/index.web.js +0 -2
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.native.js +66 -6
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.web.js +62 -21
- package/dist/native/tsconfig.native.cjs.tsbuildinfo +1 -1
- package/dist/native/tsconfig.native.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/components/a/a.native.d.ts +1 -1
- package/dist/types/components/a/a.native.d.ts.map +1 -1
- package/dist/types/components/a/a.web.d.ts +1 -1
- package/dist/types/components/a/a.web.d.ts.map +1 -1
- package/dist/types/components/e/e.native.d.ts +1 -1
- package/dist/types/components/e/e.native.d.ts.map +1 -1
- package/dist/types/components/e/e.web.d.ts +1 -1
- package/dist/types/components/e/e.web.d.ts.map +1 -1
- package/dist/types/components/i/useIUtils.d.ts +2 -2
- package/dist/types/components/l/l.web.d.ts +1 -1
- package/dist/types/components/l/l.web.d.ts.map +1 -1
- package/dist/types/components/t/t.native.d.ts +1 -1
- package/dist/types/components/t/t.native.d.ts.map +1 -1
- package/dist/types/components/t/t.web.d.ts +1 -1
- package/dist/types/components/t/t.web.d.ts.map +1 -1
- package/dist/types/components/u/errorBoundary.d.ts +18 -0
- package/dist/types/components/u/errorBoundary.d.ts.map +1 -0
- package/dist/types/components/u/provider.native.d.ts +1 -1
- package/dist/types/components/u/provider.native.d.ts.map +1 -1
- package/dist/types/components/u/provider.web.d.ts +1 -1
- package/dist/types/components/u/provider.web.d.ts.map +1 -1
- package/dist/types/components/u/types.d.ts +5 -0
- package/dist/types/components/u/types.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -2
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/index.native.d.ts +0 -2
- package/dist/types/hooks/index.native.d.ts.map +1 -1
- package/dist/types/hooks/index.web.d.ts +0 -2
- package/dist/types/hooks/index.web.d.ts.map +1 -1
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts +13 -5
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts.map +1 -1
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts +2 -2
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts.map +1 -1
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts +10 -7
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts.map +1 -1
- package/dist/types/types/base.d.ts +14 -4
- package/dist/types/types/base.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/hooks/useAction/types.js +0 -2
- package/dist/cjs/hooks/useAction/useAction.native.js +0 -18
- package/dist/cjs/hooks/useAction/useAction.web.js +0 -21
- package/dist/cjs/hooks/useOnHoverOrPress.js +0 -21
- package/dist/esm/hooks/useAction/types.js +0 -1
- package/dist/esm/hooks/useAction/useAction.native.js +0 -14
- package/dist/esm/hooks/useAction/useAction.web.js +0 -17
- package/dist/esm/hooks/useOnHoverOrPress.js +0 -17
- package/dist/native/cjs/hooks/useAction/types.js +0 -2
- package/dist/native/cjs/hooks/useAction/useAction.native.js +0 -18
- package/dist/native/cjs/hooks/useAction/useAction.web.js +0 -21
- package/dist/native/cjs/hooks/useOnHoverOrPress.js +0 -21
- package/dist/native/esm/hooks/useAction/types.js +0 -1
- package/dist/native/esm/hooks/useAction/useAction.native.js +0 -14
- package/dist/native/esm/hooks/useAction/useAction.web.js +0 -17
- package/dist/native/esm/hooks/useOnHoverOrPress.js +0 -17
- package/dist/types/hooks/useAction/types.d.ts +0 -7
- package/dist/types/hooks/useAction/types.d.ts.map +0 -1
- package/dist/types/hooks/useAction/useAction.native.d.ts +0 -5
- package/dist/types/hooks/useAction/useAction.native.d.ts.map +0 -1
- package/dist/types/hooks/useAction/useAction.web.d.ts +0 -5
- package/dist/types/hooks/useAction/useAction.web.d.ts.map +0 -1
- package/dist/types/hooks/useOnHoverOrPress.d.ts +0 -12
- package/dist/types/hooks/useOnHoverOrPress.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TElementProps } from '../../types';
|
|
2
|
-
export declare function E({ className, children,
|
|
2
|
+
export declare function E({ className, children, ref, style, ...rest }: TElementProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Element: typeof E;
|
|
4
4
|
//# sourceMappingURL=e.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e.web.d.ts","sourceRoot":"","sources":["../../../../src/components/e/e.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAE5D,wBAAgB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"e.web.d.ts","sourceRoot":"","sources":["../../../../src/components/e/e.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAE5D,wBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,2CAe5E;AAED,eAAO,MAAM,OAAO,UAAI,CAAC"}
|
|
@@ -2,8 +2,8 @@ import type { TInputProps } from '../../types';
|
|
|
2
2
|
export declare const useIUtils: () => {
|
|
3
3
|
treatTypeModeAndKeyboardType: ({ inputMode, keyboardType, type, }: Pick<TInputProps, "inputMode" | "keyboardType" | "type">) => {
|
|
4
4
|
masterInputKeyboardType: "url" | "numeric" | "default" | "email-address" | "phone-pad" | "decimal-pad" | undefined;
|
|
5
|
-
masterInputMode: "
|
|
6
|
-
masterInputType: "number" | "
|
|
5
|
+
masterInputMode: "search" | "text" | "email" | "url" | "tel" | "numeric" | "decimal" | undefined;
|
|
6
|
+
masterInputType: "number" | "text" | "checkbox" | "password" | "email" | "url" | "tel" | "date" | "file" | "hidden" | (string & {});
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=useIUtils.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TLinkProps } from '../../types';
|
|
2
|
-
export declare function L({ className, children, to, href,
|
|
2
|
+
export declare function L({ className, children, to, href, preventDefault, ref, style, ...rest }: TLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Link: typeof L;
|
|
4
4
|
//# sourceMappingURL=l.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l.web.d.ts","sourceRoot":"","sources":["../../../../src/components/l/l.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"l.web.d.ts","sourceRoot":"","sources":["../../../../src/components/l/l.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AAEzD,wBAAgB,CAAC,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,EAAE,EACF,IAAI,EACJ,cAAc,EACd,GAAG,EACH,KAAK,EACL,GAAG,IAAI,EACR,EAAE,UAAU,2CAiBZ;AAED,eAAO,MAAM,IAAI,UAAI,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TTextProps } from '../../types';
|
|
2
|
-
export declare function T({ className, children,
|
|
2
|
+
export declare function T({ className, children, ref, ...rest }: Omit<TTextProps, 'as'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Text: typeof T;
|
|
4
4
|
//# sourceMappingURL=t.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"t.native.d.ts","sourceRoot":"","sources":["../../../../src/components/t/t.native.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,CAAC,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"t.native.d.ts","sourceRoot":"","sources":["../../../../src/components/t/t.native.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,CAAC,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,2CAcxB;AAED,eAAO,MAAM,IAAI,UAAI,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TTextProps } from '../../types';
|
|
2
|
-
export declare function T({ className, children, as,
|
|
2
|
+
export declare function T({ className, children, as, ref, ...rest }: TTextProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Text: typeof T;
|
|
4
4
|
//# sourceMappingURL=t.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"t.web.d.ts","sourceRoot":"","sources":["../../../../src/components/t/t.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,CAAC,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,EAAW,EACX,
|
|
1
|
+
{"version":3,"file":"t.web.d.ts","sourceRoot":"","sources":["../../../../src/components/t/t.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,CAAC,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,EAAW,EACX,GAAG,EACH,GAAG,IAAI,EACR,EAAE,UAAU,2CAeZ;AAED,eAAO,MAAM,IAAI,UAAI,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { TUniverseOnError } from './types';
|
|
3
|
+
export type TErrorBoundaryProps = PropsWithChildren & {
|
|
4
|
+
onError?: TUniverseOnError;
|
|
5
|
+
};
|
|
6
|
+
type TState = {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare class ErrorBoundary extends Component<TErrorBoundaryProps, TState> {
|
|
10
|
+
constructor(props: TErrorBoundaryProps);
|
|
11
|
+
static getDerivedStateFromError(): {
|
|
12
|
+
hasError: boolean;
|
|
13
|
+
};
|
|
14
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
15
|
+
render(): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=errorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/u/errorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qBAAa,aAAc,SAAQ,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC;gBAC3D,KAAK,EAAE,mBAAmB;IAKtC,MAAM,CAAC,wBAAwB;;;IAItB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAI1D,MAAM;CAWhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TUniverseProps } from './types';
|
|
2
|
-
export declare function U({ children, config }: TUniverseProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function U({ children, config, onError }: TUniverseProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Universe: typeof U;
|
|
4
4
|
//# sourceMappingURL=provider.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.native.d.ts","sourceRoot":"","sources":["../../../../src/components/u/provider.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.native.d.ts","sourceRoot":"","sources":["../../../../src/components/u/provider.native.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,2CA0B9D;AAED,eAAO,MAAM,QAAQ,UAAI,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TUniverseProps } from './types';
|
|
2
|
-
export declare function U({ children, config }: TUniverseProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function U({ children, config, onError }: TUniverseProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const Universe: typeof U;
|
|
4
4
|
//# sourceMappingURL=provider.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.web.d.ts","sourceRoot":"","sources":["../../../../src/components/u/provider.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.web.d.ts","sourceRoot":"","sources":["../../../../src/components/u/provider.web.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,2CAwB9D;AAED,eAAO,MAAM,QAAQ,UAAI,CAAC"}
|
|
@@ -15,5 +15,10 @@ export type TUniverseContext = TUniverseConfig;
|
|
|
15
15
|
export type TUniverseProps = {
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
config?: TUniverseConfig;
|
|
18
|
+
onError?: TUniverseOnError;
|
|
19
|
+
};
|
|
20
|
+
export type TUniverseOnError = {
|
|
21
|
+
callback?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
22
|
+
render?: ReactNode;
|
|
18
23
|
};
|
|
19
24
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/u/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,o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,cAAc,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IAC9D,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export * from './useAction/useAction.web';
|
|
2
1
|
export * from './useCn';
|
|
3
2
|
export * from './useInteractiveState/useInteractiveState.web';
|
|
4
3
|
export * from './useOnChange';
|
|
5
|
-
export * from './useOnHoverOrPress';
|
|
6
4
|
export * from './useProps';
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export * from './useAction/useAction.native';
|
|
2
1
|
export * from './useCn';
|
|
3
2
|
export * from './useInteractiveState/useInteractiveState.native';
|
|
4
3
|
export * from './useOnChange';
|
|
5
|
-
export * from './useOnHoverOrPress';
|
|
6
4
|
export * from './useProps';
|
|
7
5
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.native.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,kDAAkD,CAAC;AACjE,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export * from './useAction/useAction.web';
|
|
2
1
|
export * from './useCn';
|
|
3
2
|
export * from './useInteractiveState/useInteractiveState.web';
|
|
4
3
|
export * from './useOnChange';
|
|
5
|
-
export * from './useOnHoverOrPress';
|
|
6
4
|
export * from './useProps';
|
|
7
5
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.web.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import type { GestureResponderEvent } from 'react-native';
|
|
2
|
-
import type {
|
|
1
|
+
import type { GestureResponderEvent, NativeSyntheticEvent, TargetedEvent } from 'react-native';
|
|
2
|
+
import type { TAny } from '../../types';
|
|
3
|
+
import type { TInteractiveState, TUseInteractiveStateOptions } from './useInteractiveState.types';
|
|
3
4
|
export declare function useInteractiveState(options?: TUseInteractiveStateOptions): {
|
|
4
|
-
state:
|
|
5
|
+
state: TInteractiveState;
|
|
5
6
|
dataAttrs: {
|
|
6
|
-
readonly 'data-state':
|
|
7
|
-
readonly 'data-pressed': "true" | "false";
|
|
7
|
+
readonly 'data-state': TInteractiveState;
|
|
8
8
|
readonly 'data-disabled': "true" | "false";
|
|
9
|
+
readonly 'data-focused': "true" | "false";
|
|
10
|
+
readonly 'data-hovered': "true" | "false";
|
|
11
|
+
readonly 'data-pressed': "true" | "false";
|
|
9
12
|
};
|
|
10
13
|
eventHandlers: {
|
|
14
|
+
onBlur: (e: NativeSyntheticEvent<TargetedEvent>) => void;
|
|
15
|
+
onFocus: (e: NativeSyntheticEvent<TargetedEvent>) => void;
|
|
16
|
+
onIn: (e: TAny) => void;
|
|
17
|
+
onPress: (e: GestureResponderEvent) => void;
|
|
11
18
|
onPressIn: (e: GestureResponderEvent) => void;
|
|
12
19
|
onPressOut: (e: GestureResponderEvent) => void;
|
|
20
|
+
onOut: (e: TAny) => void;
|
|
13
21
|
};
|
|
14
22
|
};
|
|
15
23
|
//# sourceMappingURL=useInteractiveState.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractiveState.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useInteractiveState.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,2BAAgC;;;;;;;;;;oBA0B7D,oBAAoB,CAAC,aAAa,CAAC;qBAUlC,oBAAoB,CAAC,aAAa,CAAC;kBAStC,IAAI;qBASD,qBAAqB;uBAyBnB,qBAAqB;wBASpB,qBAAqB;mBAS1B,IAAI;;EAYlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TAny } from '../../types';
|
|
1
|
+
import type { TAny, TBaseInteractionProps } from '../../types';
|
|
2
2
|
export type TInteractiveState = 'idle' | 'hovered' | 'pressed' | 'focused' | 'disabled';
|
|
3
3
|
export type TInteractionDataAttrs = {
|
|
4
4
|
'data-state': TInteractiveState;
|
|
@@ -7,7 +7,7 @@ export type TInteractionDataAttrs = {
|
|
|
7
7
|
'data-focused': string;
|
|
8
8
|
'data-disabled': string;
|
|
9
9
|
};
|
|
10
|
-
export type TUseInteractiveStateOptions = {
|
|
10
|
+
export type TUseInteractiveStateOptions = TBaseInteractionProps & {
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type TUseInteractiveStateResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractiveState.types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useInteractiveState.types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,iBAAiB,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,GAAG;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,SAAS,EAAE,qBAAqB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CACrC,CAAC"}
|
|
@@ -4,18 +4,21 @@ export declare function useInteractiveState(options?: TUseInteractiveStateOption
|
|
|
4
4
|
state: TInteractiveState;
|
|
5
5
|
dataAttrs: {
|
|
6
6
|
readonly 'data-state': TInteractiveState;
|
|
7
|
+
readonly 'data-disabled': "true" | "false";
|
|
8
|
+
readonly 'data-focused': "true" | "false";
|
|
7
9
|
readonly 'data-hovered': "true" | "false";
|
|
8
10
|
readonly 'data-pressed': "true" | "false";
|
|
9
|
-
readonly 'data-focused': "true" | "false";
|
|
10
|
-
readonly 'data-disabled': "true" | "false";
|
|
11
11
|
};
|
|
12
12
|
eventHandlers: {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
onBlur: (e: React.FocusEvent<TAny>) => void;
|
|
14
|
+
onClick: (e: React.MouseEvent<TAny>) => void;
|
|
15
|
+
onFocus: (e: React.FocusEvent<TAny>) => void;
|
|
16
|
+
onIn: (e: React.MouseEvent<TAny>) => void;
|
|
15
17
|
onMouseDown: (e: React.MouseEvent<TAny>) => void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
onMouseEnter: (e: React.MouseEvent<TAny>) => void;
|
|
19
|
+
onMouseLeave: (e: React.MouseEvent<TAny>) => void;
|
|
20
|
+
onMouseUp: (e: React.MouseEvent<TAny>) => void;
|
|
21
|
+
onOut: (e: React.MouseEvent<TAny>) => void;
|
|
19
22
|
};
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=useInteractiveState.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractiveState.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,2BAAgC
|
|
1
|
+
{"version":3,"file":"useInteractiveState.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInteractiveState/useInteractiveState.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,2BAAgC;;;;;;;;;;oBAyB7D,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;qBAarB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;qBAetB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;kBAWzB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;yBASf,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;0BASrB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;0BAWtB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;uBAYzB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;mBAS1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;;EAYpC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode, Ref } from 'react';
|
|
2
|
-
import type { StyleProp, TextStyle } from 'react-native';
|
|
2
|
+
import type { AccessibilityRole, AccessibilityState, StyleProp, TextStyle } from 'react-native';
|
|
3
3
|
export type TAny = any;
|
|
4
4
|
export type TNativeStyle<TStyle = TextStyle> = StyleProp<TStyle>;
|
|
5
5
|
export type TWebStyle = CSSProperties;
|
|
@@ -10,12 +10,22 @@ export type TBasePrimitiveProps = {
|
|
|
10
10
|
ref?: Ref<TAny>;
|
|
11
11
|
style?: TUniversalStyle;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export type TBaseInteractionProps = {
|
|
14
|
+
onBlur?: (e?: TAny) => void;
|
|
15
|
+
onClick?: (e?: TAny) => void;
|
|
16
|
+
onFocus?: (e?: TAny) => void;
|
|
17
|
+
onIn?: (e?: TAny) => void;
|
|
18
|
+
onOut?: (e?: TAny) => void;
|
|
19
|
+
onPress?: (e?: TAny) => void;
|
|
16
20
|
};
|
|
21
|
+
export type TBasePrimitiveWithActionProps = TBasePrimitiveProps & TBaseInteractionProps;
|
|
17
22
|
export type TActionProps = TBasePrimitiveWithActionProps & {
|
|
23
|
+
accessibilityLabel?: string;
|
|
24
|
+
accessibilityRole?: AccessibilityRole;
|
|
25
|
+
accessibilityState?: AccessibilityState;
|
|
18
26
|
disabled?: boolean;
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
testID?: string;
|
|
19
29
|
};
|
|
20
30
|
export type TElementProps = TBasePrimitiveWithActionProps & {
|
|
21
31
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/types/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/types/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC;AAEvB,MAAM,MAAM,YAAY,CAAC,MAAM,GAAG,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;AACjE,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AACtC,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,SAAS,CAAC;AAEvD,MA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C;IACb,MAAM,CAAC,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,6BAA6B,GAAG;IACvD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAction = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useAction = ({ onClick, onPress, }) => {
|
|
6
|
-
return (0, react_1.useMemo)(() => ({
|
|
7
|
-
onAction: (event) => {
|
|
8
|
-
if (onPress) {
|
|
9
|
-
onPress(event);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (onClick) {
|
|
13
|
-
onClick(event);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}), [onClick, onPress]);
|
|
17
|
-
};
|
|
18
|
-
exports.useAction = useAction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAction = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useAction = ({ onClick, onPress, preventDefault, }) => {
|
|
6
|
-
return (0, react_1.useMemo)(() => ({
|
|
7
|
-
onAction: (event) => {
|
|
8
|
-
if (preventDefault && event && 'preventDefault' in event) {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
}
|
|
11
|
-
if (onClick) {
|
|
12
|
-
onClick(event);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (onPress) {
|
|
16
|
-
onPress(event);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
}), [onClick, onPress, preventDefault]);
|
|
20
|
-
};
|
|
21
|
-
exports.useAction = useAction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useOnHoverOrPress = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
6
|
-
const value = (0, react_1.useRef)('on');
|
|
7
|
-
return (0, react_1.useMemo)(() => ({
|
|
8
|
-
onMouseEnter: onIn,
|
|
9
|
-
onMouseLeave: onOut,
|
|
10
|
-
onPress: (event) => {
|
|
11
|
-
if (value.current === 'on') {
|
|
12
|
-
value.current = 'off';
|
|
13
|
-
onOut?.(event);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
value.current = 'on';
|
|
17
|
-
onIn?.(event);
|
|
18
|
-
},
|
|
19
|
-
}), [onIn, onOut]);
|
|
20
|
-
};
|
|
21
|
-
exports.useOnHoverOrPress = useOnHoverOrPress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
export const useAction = ({ onClick, onPress, }) => {
|
|
3
|
-
return useMemo(() => ({
|
|
4
|
-
onAction: (event) => {
|
|
5
|
-
if (onPress) {
|
|
6
|
-
onPress(event);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (onClick) {
|
|
10
|
-
onClick(event);
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
}), [onClick, onPress]);
|
|
14
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
export const useAction = ({ onClick, onPress, preventDefault, }) => {
|
|
3
|
-
return useMemo(() => ({
|
|
4
|
-
onAction: (event) => {
|
|
5
|
-
if (preventDefault && event && 'preventDefault' in event) {
|
|
6
|
-
event.preventDefault();
|
|
7
|
-
}
|
|
8
|
-
if (onClick) {
|
|
9
|
-
onClick(event);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (onPress) {
|
|
13
|
-
onPress(event);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}), [onClick, onPress, preventDefault]);
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
-
export const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
3
|
-
const value = useRef('on');
|
|
4
|
-
return useMemo(() => ({
|
|
5
|
-
onMouseEnter: onIn,
|
|
6
|
-
onMouseLeave: onOut,
|
|
7
|
-
onPress: (event) => {
|
|
8
|
-
if (value.current === 'on') {
|
|
9
|
-
value.current = 'off';
|
|
10
|
-
onOut?.(event);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
value.current = 'on';
|
|
14
|
-
onIn?.(event);
|
|
15
|
-
},
|
|
16
|
-
}), [onIn, onOut]);
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAction = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useAction = ({ onClick, onPress, }) => {
|
|
6
|
-
return (0, react_1.useMemo)(() => ({
|
|
7
|
-
onAction: (event) => {
|
|
8
|
-
if (onPress) {
|
|
9
|
-
onPress(event);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (onClick) {
|
|
13
|
-
onClick(event);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}), [onClick, onPress]);
|
|
17
|
-
};
|
|
18
|
-
exports.useAction = useAction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAction = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useAction = ({ onClick, onPress, preventDefault, }) => {
|
|
6
|
-
return (0, react_1.useMemo)(() => ({
|
|
7
|
-
onAction: (event) => {
|
|
8
|
-
if (preventDefault && event && 'preventDefault' in event) {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
}
|
|
11
|
-
if (onClick) {
|
|
12
|
-
onClick(event);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (onPress) {
|
|
16
|
-
onPress(event);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
}), [onClick, onPress, preventDefault]);
|
|
20
|
-
};
|
|
21
|
-
exports.useAction = useAction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useOnHoverOrPress = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
6
|
-
const value = (0, react_1.useRef)('on');
|
|
7
|
-
return (0, react_1.useMemo)(() => ({
|
|
8
|
-
onMouseEnter: onIn,
|
|
9
|
-
onMouseLeave: onOut,
|
|
10
|
-
onPress: (event) => {
|
|
11
|
-
if (value.current === 'on') {
|
|
12
|
-
value.current = 'off';
|
|
13
|
-
onOut?.(event);
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
value.current = 'on';
|
|
17
|
-
onIn?.(event);
|
|
18
|
-
},
|
|
19
|
-
}), [onIn, onOut]);
|
|
20
|
-
};
|
|
21
|
-
exports.useOnHoverOrPress = useOnHoverOrPress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
export const useAction = ({ onClick, onPress, }) => {
|
|
3
|
-
return useMemo(() => ({
|
|
4
|
-
onAction: (event) => {
|
|
5
|
-
if (onPress) {
|
|
6
|
-
onPress(event);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (onClick) {
|
|
10
|
-
onClick(event);
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
}), [onClick, onPress]);
|
|
14
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
export const useAction = ({ onClick, onPress, preventDefault, }) => {
|
|
3
|
-
return useMemo(() => ({
|
|
4
|
-
onAction: (event) => {
|
|
5
|
-
if (preventDefault && event && 'preventDefault' in event) {
|
|
6
|
-
event.preventDefault();
|
|
7
|
-
}
|
|
8
|
-
if (onClick) {
|
|
9
|
-
onClick(event);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (onPress) {
|
|
13
|
-
onPress(event);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}), [onClick, onPress, preventDefault]);
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
-
export const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
3
|
-
const value = useRef('on');
|
|
4
|
-
return useMemo(() => ({
|
|
5
|
-
onMouseEnter: onIn,
|
|
6
|
-
onMouseLeave: onOut,
|
|
7
|
-
onPress: (event) => {
|
|
8
|
-
if (value.current === 'on') {
|
|
9
|
-
value.current = 'off';
|
|
10
|
-
onOut?.(event);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
value.current = 'on';
|
|
14
|
-
onIn?.(event);
|
|
15
|
-
},
|
|
16
|
-
}), [onIn, onOut]);
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAction/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,IAAI,IAAI;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAction.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAction/useAction.native.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,SAAS,GAAI,MAAM,EAAG,uBAGhC,eAAe,CAAC,MAAM,CAAC;uBAGD,MAAM;CAc9B,CAAC"}
|