@fluentui-react-native/pressable 0.13.0 → 0.13.1
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 +13 -0
- package/lib/Pressable.d.ts +4 -11
- package/lib/Pressable.js +12 -12
- package/lib/Pressable.props.d.ts +7 -7
- package/lib/Pressable.props.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/Pressable.d.ts +4 -11
- package/lib-commonjs/Pressable.js +17 -17
- package/lib-commonjs/Pressable.props.d.ts +7 -7
- package/lib-commonjs/Pressable.props.js +3 -3
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +5 -10
- package/package.json +16 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/pressable
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0d6e9c1: chore: migrate to `oxfmt`
|
|
8
|
+
- ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
|
|
9
|
+
- Updated dependencies [0d6e9c1]
|
|
10
|
+
- Updated dependencies [ac6e7af]
|
|
11
|
+
- @uifabricshared/foundation-composable@0.14.1
|
|
12
|
+
- @uifabricshared/foundation-settings@0.16.1
|
|
13
|
+
- @fluentui-react-native/interactive-hooks@0.28.1
|
|
14
|
+
- @fluentui-react-native/adapters@0.14.1
|
|
15
|
+
|
|
3
16
|
## 0.13.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/lib/Pressable.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { IPressableProps } from './Pressable.props';
|
|
2
|
-
export declare const Pressable: import(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
IPressableProps,
|
|
6
|
-
{
|
|
7
|
-
root: import('@fluentui-react-native/adapters').IViewProps;
|
|
8
|
-
},
|
|
9
|
-
object
|
|
10
|
-
>
|
|
11
|
-
>;
|
|
2
|
+
export declare const Pressable: import("@uifabricshared/foundation-composable").IWithComposable<import("react").FunctionComponent<IPressableProps>, import("@uifabricshared/foundation-composable").IComposable<IPressableProps, {
|
|
3
|
+
root: import("@fluentui-react-native/adapters").IViewProps;
|
|
4
|
+
}, object>>;
|
|
12
5
|
export default Pressable;
|
|
13
|
-
//# sourceMappingURL=Pressable.d.ts.map
|
|
6
|
+
//# sourceMappingURL=Pressable.d.ts.map
|
package/lib/Pressable.js
CHANGED
|
@@ -14,17 +14,17 @@ import { useAsPressable } from '@fluentui-react-native/interactive-hooks';
|
|
|
14
14
|
import { composable } from '@uifabricshared/foundation-composable';
|
|
15
15
|
import { mergeSettings } from '@uifabricshared/foundation-settings';
|
|
16
16
|
export const Pressable = composable({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
slots: { root: View },
|
|
18
|
+
usePrepareProps: (userProps, useStyling) => {
|
|
19
|
+
const { renderStyle, ...rest } = userProps;
|
|
20
|
+
const { props, state } = useAsPressable(rest);
|
|
21
|
+
const styleProps = useStyling(props);
|
|
22
|
+
renderStyle && (props.style = renderStyle(state));
|
|
23
|
+
return {
|
|
24
|
+
slotProps: mergeSettings(styleProps, { root: props }),
|
|
25
|
+
state: { state },
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
28
|
});
|
|
29
29
|
export default Pressable;
|
|
30
|
-
//# sourceMappingURL=Pressable.js.map
|
|
30
|
+
//# sourceMappingURL=Pressable.js.map
|
package/lib/Pressable.props.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { IViewProps, IViewStyle } from '@fluentui-react-native/adapters';
|
|
|
4
4
|
import type { IWithPressableOptions, IPressableState } from '@fluentui-react-native/interactive-hooks';
|
|
5
5
|
type ObjectBase = {};
|
|
6
6
|
export type IPressableProps = IWithPressableOptions<IViewProps> & {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
renderStyle?: IRenderStyle<IPressableState, IViewStyle>;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Used by IRenderChild, it simply describes a function that takes
|
|
@@ -29,10 +29,10 @@ export type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
|
|
|
29
29
|
*/
|
|
30
30
|
export type IRenderStyle<T, S extends ViewStyle> = (state: T) => S;
|
|
31
31
|
export type IPressableType<TBase extends ObjectBase = IViewProps> = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
props: IPressableProps;
|
|
33
|
+
slotProps: {
|
|
34
|
+
root: TBase;
|
|
35
|
+
};
|
|
36
36
|
};
|
|
37
37
|
export {};
|
|
38
|
-
//# sourceMappingURL=Pressable.props.d.ts.map
|
|
38
|
+
//# sourceMappingURL=Pressable.props.d.ts.map
|
package/lib/Pressable.props.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Pressable.props.js.map
|
|
2
|
+
//# sourceMappingURL=Pressable.props.js.map
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Pressable } from './Pressable';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { IPressableProps } from './Pressable.props';
|
|
2
|
-
export declare const Pressable: import(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
IPressableProps,
|
|
6
|
-
{
|
|
7
|
-
root: import('@fluentui-react-native/adapters').IViewProps;
|
|
8
|
-
},
|
|
9
|
-
object
|
|
10
|
-
>
|
|
11
|
-
>;
|
|
2
|
+
export declare const Pressable: import("@uifabricshared/foundation-composable").IWithComposable<import("react").FunctionComponent<IPressableProps>, import("@uifabricshared/foundation-composable").IComposable<IPressableProps, {
|
|
3
|
+
root: import("@fluentui-react-native/adapters").IViewProps;
|
|
4
|
+
}, object>>;
|
|
12
5
|
export default Pressable;
|
|
13
|
-
//# sourceMappingURL=Pressable.d.ts.map
|
|
6
|
+
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
* provides an overview over how touchables work and interact with the gesture responder system.
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
|
-
Object.defineProperty(exports,
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Pressable = void 0;
|
|
14
|
-
const react_native_1 = require(
|
|
15
|
-
const interactive_hooks_1 = require(
|
|
16
|
-
const foundation_composable_1 = require(
|
|
17
|
-
const foundation_settings_1 = require(
|
|
14
|
+
const react_native_1 = require("react-native");
|
|
15
|
+
const interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
|
|
16
|
+
const foundation_composable_1 = require("@uifabricshared/foundation-composable");
|
|
17
|
+
const foundation_settings_1 = require("@uifabricshared/foundation-settings");
|
|
18
18
|
exports.Pressable = (0, foundation_composable_1.composable)({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
slots: { root: react_native_1.View },
|
|
20
|
+
usePrepareProps: (userProps, useStyling) => {
|
|
21
|
+
const { renderStyle, ...rest } = userProps;
|
|
22
|
+
const { props, state } = (0, interactive_hooks_1.useAsPressable)(rest);
|
|
23
|
+
const styleProps = useStyling(props);
|
|
24
|
+
renderStyle && (props.style = renderStyle(state));
|
|
25
|
+
return {
|
|
26
|
+
slotProps: (0, foundation_settings_1.mergeSettings)(styleProps, { root: props }),
|
|
27
|
+
state: { state },
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
30
|
});
|
|
31
31
|
exports.default = exports.Pressable;
|
|
32
|
-
//# sourceMappingURL=Pressable.js.map
|
|
32
|
+
//# sourceMappingURL=Pressable.js.map
|
|
@@ -4,8 +4,8 @@ import type { IViewProps, IViewStyle } from '@fluentui-react-native/adapters';
|
|
|
4
4
|
import type { IWithPressableOptions, IPressableState } from '@fluentui-react-native/interactive-hooks';
|
|
5
5
|
type ObjectBase = {};
|
|
6
6
|
export type IPressableProps = IWithPressableOptions<IViewProps> & {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
renderStyle?: IRenderStyle<IPressableState, IViewStyle>;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Used by IRenderChild, it simply describes a function that takes
|
|
@@ -29,10 +29,10 @@ export type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
|
|
|
29
29
|
*/
|
|
30
30
|
export type IRenderStyle<T, S extends ViewStyle> = (state: T) => S;
|
|
31
31
|
export type IPressableType<TBase extends ObjectBase = IViewProps> = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
props: IPressableProps;
|
|
33
|
+
slotProps: {
|
|
34
|
+
root: TBase;
|
|
35
|
+
};
|
|
36
36
|
};
|
|
37
37
|
export {};
|
|
38
|
-
//# sourceMappingURL=Pressable.props.d.ts.map
|
|
38
|
+
//# sourceMappingURL=Pressable.props.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=Pressable.props.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=Pressable.props.js.map
|
package/lib-commonjs/index.d.ts
CHANGED
package/lib-commonjs/index.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Pressable = void 0;
|
|
4
|
-
const Pressable_1 = require(
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
get: function () {
|
|
8
|
-
return Pressable_1.Pressable;
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
+
const Pressable_1 = require("./Pressable");
|
|
5
|
+
Object.defineProperty(exports, "Pressable", { enumerable: true, get: function () { return Pressable_1.Pressable; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/pressable",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "A cross-platform Pressable component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "",
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|
|
7
9
|
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
8
10
|
"directory": "packages/components/Pressable"
|
|
9
11
|
},
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
+
"main": "lib-commonjs/index.js",
|
|
13
|
+
"module": "lib/index.js",
|
|
14
|
+
"types": "lib/index.d.ts",
|
|
12
15
|
"exports": {
|
|
13
16
|
".": {
|
|
14
17
|
"types": "./lib/index.d.ts",
|
|
15
18
|
"import": "./lib/index.js",
|
|
16
|
-
"require": "./lib-commonjs/index.js"
|
|
19
|
+
"require": "./lib-commonjs/index.js",
|
|
20
|
+
"default": "./src/index.ts"
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
|
-
"main": "lib-commonjs/index.js",
|
|
20
|
-
"module": "lib/index.js",
|
|
21
|
-
"types": "lib/index.d.ts",
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "fluentui-scripts build",
|
|
24
25
|
"build-cjs": "tsgo --outDir lib-commonjs",
|
|
25
|
-
"build-
|
|
26
|
+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
|
|
26
27
|
"clean": "fluentui-scripts clean",
|
|
27
28
|
"depcheck": "fluentui-scripts depcheck",
|
|
28
29
|
"lint": "fluentui-scripts eslint",
|
|
29
30
|
"lint-package": "fluentui-scripts lint-package",
|
|
30
|
-
"
|
|
31
|
+
"format": "fluentui-scripts format",
|
|
31
32
|
"test": "fluentui-scripts jest",
|
|
32
33
|
"update-snapshots": "fluentui-scripts jest -u"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@fluentui-react-native/adapters": "0.14.
|
|
36
|
-
"@fluentui-react-native/interactive-hooks": "0.28.
|
|
37
|
-
"@uifabricshared/foundation-composable": "0.14.
|
|
38
|
-
"@uifabricshared/foundation-settings": "0.16.
|
|
36
|
+
"@fluentui-react-native/adapters": "0.14.1",
|
|
37
|
+
"@fluentui-react-native/interactive-hooks": "0.28.1",
|
|
38
|
+
"@uifabricshared/foundation-composable": "0.14.1",
|
|
39
|
+
"@uifabricshared/foundation-settings": "0.16.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@babel/core": "^7.20.0",
|
|
42
43
|
"@fluentui-react-native/babel-config": "0.1.1",
|
|
43
|
-
"@fluentui-react-native/eslint-config-rules": "0.1.
|
|
44
|
+
"@fluentui-react-native/eslint-config-rules": "0.1.2",
|
|
44
45
|
"@fluentui-react-native/kit-config": "0.1.2",
|
|
45
|
-
"@fluentui-react-native/scripts": "0.1.
|
|
46
|
+
"@fluentui-react-native/scripts": "0.1.0",
|
|
46
47
|
"@react-native-community/cli": "^20.0.0",
|
|
47
48
|
"@react-native-community/cli-platform-android": "^20.0.0",
|
|
48
49
|
"@react-native-community/cli-platform-ios": "^20.0.0",
|