@react-xp/aeiou 0.1.0-beta.12 → 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/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/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/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/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/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,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAction.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAction/useAction.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,KAAK,EAAE,uCAI7C,eAAe,CAAC,MAAM,CAAC;uBAGD,MAAM;CAiB9B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { TAny } from '../types';
|
|
2
|
-
type TUseOnHoverOrPressProps = {
|
|
3
|
-
onIn: ((event?: TAny) => void) | undefined;
|
|
4
|
-
onOut: ((event?: TAny) => void) | undefined;
|
|
5
|
-
};
|
|
6
|
-
export declare const useOnHoverOrPress: ({ onIn, onOut }: TUseOnHoverOrPressProps) => {
|
|
7
|
-
onMouseEnter: ((event?: TAny) => void) | undefined;
|
|
8
|
-
onMouseLeave: ((event?: TAny) => void) | undefined;
|
|
9
|
-
onPress: (event?: TAny) => void;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=useOnHoverOrPress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOnHoverOrPress.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOnHoverOrPress.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,uBAAuB,GAAG;IAC7B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,uBAAuB;4BAJxD,IAAI,KAAK,IAAI;4BACZ,IAAI,KAAK,IAAI;sBAUR,IAAI;CAgB3B,CAAC"}
|