@draftbit/core 49.3.2-0a7a74.2 → 49.3.2-bc13e1.2
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/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.d.ts +2 -2
- package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
- package/lib/typescript/src/components/SectionList/index.d.ts +0 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +2 -2
- package/lib/typescript/src/components/SwipeableItem/index.d.ts +0 -1
- package/lib/typescript/src/components/TextInput.d.ts +1 -0
- package/lib/typescript/src/components/TextInput.js +7 -3
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -7
- package/lib/typescript/src/index.js +0 -7
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -5
- package/src/components/SectionList/SectionList.js.map +1 -1
- package/src/components/SectionList/SectionList.tsx +2 -5
- package/src/components/SectionList/index.tsx +0 -4
- package/src/components/SwipeableItem/SwipeableList.tsx +2 -2
- package/src/components/SwipeableItem/index.tsx +0 -4
- package/src/components/TextInput.js +7 -3
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +18 -1
- package/src/index.js +0 -7
- package/src/index.js.map +1 -1
- package/src/index.tsx +0 -7
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +0 -1
- package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +0 -18
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +0 -18
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +0 -18
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +0 -18
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +0 -18
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +0 -10
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +0 -20
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +0 -10
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +0 -20
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +0 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts +0 -8
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +0 -43
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +0 -1
- package/src/components/SimpleStyleScrollables/README.md +0 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +0 -18
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +0 -36
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +0 -18
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +0 -36
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +0 -18
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +0 -35
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +0 -18
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +0 -36
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +0 -18
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +0 -35
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +0 -20
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +0 -43
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +0 -20
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +0 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +0 -43
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +0 -43
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +0 -1
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts +0 -60
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleFlashList = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(FlashList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
|
-
};
|
|
17
|
-
export default SimpleStyleFlashList;
|
|
18
|
-
//# sourceMappingURL=SimpleStyleFlashList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAgB,EAC3C,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EAC0C,EAAE,EAAE;IACrD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,KACxD,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import type { FlashListProps, ContentStyle } from "@shopify/flash-list";
|
|
4
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
8
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
9
|
-
*/
|
|
10
|
-
const SimpleStyleFlashList = <T extends any>({
|
|
11
|
-
style: styleProp,
|
|
12
|
-
...rest
|
|
13
|
-
}: Omit<FlashListProps<T>, "contentContainerStyle">) => {
|
|
14
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
15
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
16
|
-
|
|
17
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
18
|
-
styleProp,
|
|
19
|
-
measuredWidth,
|
|
20
|
-
measuredHeight
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<FlashList
|
|
25
|
-
onLayout={(event) => {
|
|
26
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
27
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
28
|
-
}}
|
|
29
|
-
style={style}
|
|
30
|
-
contentContainerStyle={contentContainerStyle as ContentStyle}
|
|
31
|
-
{...rest}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default SimpleStyleFlashList;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FlatList } from "react-native";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleFlatList = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(FlatList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
|
-
};
|
|
17
|
-
export default SimpleStyleFlatList;
|
|
18
|
-
//# sourceMappingURL=SimpleStyleFlatList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAgB,EAC1C,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACyC,EAAE,EAAE;IACpD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,IACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FlatList } from "react-native";
|
|
3
|
-
import type { FlatListProps } from "react-native";
|
|
4
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
8
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
9
|
-
*/
|
|
10
|
-
const SimpleStyleFlatList = <T extends any>({
|
|
11
|
-
style: styleProp,
|
|
12
|
-
...rest
|
|
13
|
-
}: Omit<FlatListProps<T>, "contentContainerStyle">) => {
|
|
14
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
15
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
16
|
-
|
|
17
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
18
|
-
styleProp,
|
|
19
|
-
measuredWidth,
|
|
20
|
-
measuredHeight
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<FlatList
|
|
25
|
-
onLayout={(event) => {
|
|
26
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
27
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
28
|
-
}}
|
|
29
|
-
style={style}
|
|
30
|
-
contentContainerStyle={contentContainerStyle}
|
|
31
|
-
{...rest}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default SimpleStyleFlatList;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleKeyboardAwareScrollView = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(KeyboardAwareScrollView, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
|
-
};
|
|
17
|
-
export default SimpleStyleKeyboardAwareScrollView;
|
|
18
|
-
//# sourceMappingURL=SimpleStyleKeyboardAwareScrollView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["SimpleStyleKeyboardAwareScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,kCAAkC,GAEpC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,uBAAuB,IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
3
|
-
import type { KeyboardAwareScrollViewProps } from "react-native-keyboard-aware-scroll-view";
|
|
4
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
|
|
8
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
9
|
-
*/
|
|
10
|
-
const SimpleStyleKeyboardAwareScrollView: React.FC<
|
|
11
|
-
Omit<KeyboardAwareScrollViewProps, "contentContainerStyle">
|
|
12
|
-
> = ({ style: styleProp, ...rest }) => {
|
|
13
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
14
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
15
|
-
|
|
16
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
17
|
-
styleProp,
|
|
18
|
-
measuredWidth,
|
|
19
|
-
measuredHeight
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<KeyboardAwareScrollView
|
|
24
|
-
onLayout={(event) => {
|
|
25
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
26
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
27
|
-
}}
|
|
28
|
-
style={style}
|
|
29
|
-
contentContainerStyle={contentContainerStyle}
|
|
30
|
-
{...rest}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default SimpleStyleKeyboardAwareScrollView;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MasonryFlashList } from "@shopify/flash-list";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleMasonryFlashList = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(MasonryFlashList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
|
-
};
|
|
17
|
-
export default SimpleStyleMasonryFlashList;
|
|
18
|
-
//# sourceMappingURL=SimpleStyleMasonryFlashList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,CAAgB,EAClD,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACiD,EAAE,EAAE;IAC5D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,KACxD,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MasonryFlashList } from "@shopify/flash-list";
|
|
3
|
-
import type { MasonryFlashListProps, ContentStyle } from "@shopify/flash-list";
|
|
4
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
|
|
8
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
9
|
-
*/
|
|
10
|
-
const SimpleStyleMasonryFlashList = <T extends any>({
|
|
11
|
-
style: styleProp,
|
|
12
|
-
...rest
|
|
13
|
-
}: Omit<MasonryFlashListProps<T>, "contentContainerStyle">) => {
|
|
14
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
15
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
16
|
-
|
|
17
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
18
|
-
styleProp,
|
|
19
|
-
measuredWidth,
|
|
20
|
-
measuredHeight
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<MasonryFlashList
|
|
25
|
-
onLayout={(event) => {
|
|
26
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
27
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
28
|
-
}}
|
|
29
|
-
style={style}
|
|
30
|
-
contentContainerStyle={contentContainerStyle as ContentStyle}
|
|
31
|
-
{...rest}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default SimpleStyleMasonryFlashList;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ScrollView } from "react-native";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A ScrollView wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleScrollView = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(ScrollView, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
|
-
};
|
|
17
|
-
export default SimpleStyleScrollView;
|
|
18
|
-
//# sourceMappingURL=SimpleStyleScrollView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,GAEvB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ScrollView } from "react-native";
|
|
3
|
-
import type { ScrollViewProps } from "react-native";
|
|
4
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A ScrollView wrapper that takes a single `style` prop and internally extracts
|
|
8
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
9
|
-
*/
|
|
10
|
-
const SimpleStyleScrollView: React.FC<
|
|
11
|
-
Omit<ScrollViewProps, "contentContainerStyle">
|
|
12
|
-
> = ({ style: styleProp, ...rest }) => {
|
|
13
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
14
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
15
|
-
|
|
16
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
17
|
-
styleProp,
|
|
18
|
-
measuredWidth,
|
|
19
|
-
measuredHeight
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<ScrollView
|
|
24
|
-
onLayout={(event) => {
|
|
25
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
26
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
27
|
-
}}
|
|
28
|
-
style={style}
|
|
29
|
-
contentContainerStyle={contentContainerStyle}
|
|
30
|
-
{...rest}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default SimpleStyleScrollView;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SectionList } from "../SectionList";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A SectionList wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleSectionList = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (
|
|
13
|
-
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
14
|
-
React.createElement(SectionList, { onLayout: (event) => {
|
|
15
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
16
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
17
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
18
|
-
};
|
|
19
|
-
export default SimpleStyleSectionList;
|
|
20
|
-
//# sourceMappingURL=SimpleStyleSectionList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSectionList.js","sourceRoot":"","sources":["SimpleStyleSectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAmC,EAChE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO;IACL,gHAAgH;IAChH,oBAAC,WAAW,IACV,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SectionList } from "../SectionList";
|
|
3
|
-
import type {
|
|
4
|
-
FlatListSectionListProps,
|
|
5
|
-
FlashListSectionListProps,
|
|
6
|
-
} from "../SectionList";
|
|
7
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A SectionList wrapper that takes a single `style` prop and internally extracts
|
|
11
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
12
|
-
*/
|
|
13
|
-
const SimpleStyleSectionList = <T extends { [key: string]: any }>({
|
|
14
|
-
style: styleProp,
|
|
15
|
-
...rest
|
|
16
|
-
}: Omit<
|
|
17
|
-
FlatListSectionListProps<T> | FlashListSectionListProps<T>,
|
|
18
|
-
"contentContainerStyle"
|
|
19
|
-
>) => {
|
|
20
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
21
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
22
|
-
|
|
23
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
24
|
-
styleProp,
|
|
25
|
-
measuredWidth,
|
|
26
|
-
measuredHeight
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
31
|
-
<SectionList
|
|
32
|
-
onLayout={(event) => {
|
|
33
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
34
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
35
|
-
}}
|
|
36
|
-
style={style}
|
|
37
|
-
contentContainerStyle={contentContainerStyle}
|
|
38
|
-
{...rest}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default SimpleStyleSectionList;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SwipeableList } from "../SwipeableItem";
|
|
3
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
|
-
/**
|
|
5
|
-
* A SwipeableList wrapper that takes a single `style` prop and internally extracts
|
|
6
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
7
|
-
*/
|
|
8
|
-
const SimpleStyleSwipeableList = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const [measuredWidth, setMeasuredWidth] = React.useState();
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (
|
|
13
|
-
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
14
|
-
React.createElement(SwipeableList, { onLayout: (event) => {
|
|
15
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
16
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
17
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
18
|
-
};
|
|
19
|
-
export default SimpleStyleSwipeableList;
|
|
20
|
-
//# sourceMappingURL=SimpleStyleSwipeableList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSwipeableList.js","sourceRoot":"","sources":["SimpleStyleSwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,CAAmC,EAClE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IAErE,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,aAAa,EACb,cAAc,CACf,CAAC;IAEF,OAAO;IACL,gHAAgH;IAChH,oBAAC,aAAa,IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,EACD,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SwipeableList } from "../SwipeableItem";
|
|
3
|
-
import type {
|
|
4
|
-
FlashListSwipeableListProps,
|
|
5
|
-
FlatListSwipeableListProps,
|
|
6
|
-
} from "../SwipeableItem";
|
|
7
|
-
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A SwipeableList wrapper that takes a single `style` prop and internally extracts
|
|
11
|
-
* the appropriate style keys into the `contentContainerStyle`
|
|
12
|
-
*/
|
|
13
|
-
const SimpleStyleSwipeableList = <T extends { [key: string]: any }>({
|
|
14
|
-
style: styleProp,
|
|
15
|
-
...rest
|
|
16
|
-
}: Omit<
|
|
17
|
-
FlashListSwipeableListProps<T> | FlatListSwipeableListProps<T>,
|
|
18
|
-
"contentContainerStyle"
|
|
19
|
-
>) => {
|
|
20
|
-
const [measuredWidth, setMeasuredWidth] = React.useState<number>();
|
|
21
|
-
const [measuredHeight, setMeasuredHeight] = React.useState<number>();
|
|
22
|
-
|
|
23
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(
|
|
24
|
-
styleProp,
|
|
25
|
-
measuredWidth,
|
|
26
|
-
measuredHeight
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
31
|
-
<SwipeableList
|
|
32
|
-
onLayout={(event) => {
|
|
33
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
34
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
35
|
-
}}
|
|
36
|
-
style={style}
|
|
37
|
-
contentContainerStyle={contentContainerStyle}
|
|
38
|
-
{...rest}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default SimpleStyleSwipeableList;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
2
|
-
import { pick, omit } from "lodash";
|
|
3
|
-
import { useDeepCompareMemo } from "../../utilities";
|
|
4
|
-
export const contentContainerStyleNames = [
|
|
5
|
-
"padding",
|
|
6
|
-
"paddingBottom",
|
|
7
|
-
"paddingEnd",
|
|
8
|
-
"paddingHorizontal",
|
|
9
|
-
"paddingLeft",
|
|
10
|
-
"paddingRight",
|
|
11
|
-
"paddingStart",
|
|
12
|
-
"paddingTop",
|
|
13
|
-
"paddingVertical",
|
|
14
|
-
"justifyContent",
|
|
15
|
-
"alignItems",
|
|
16
|
-
"alignContent",
|
|
17
|
-
"flexDirection",
|
|
18
|
-
"flexWrap",
|
|
19
|
-
];
|
|
20
|
-
export default function useSplitContentContainerStyles(originalStyle, measuredWidth, measuredHeight) {
|
|
21
|
-
return useDeepCompareMemo(() => {
|
|
22
|
-
const flattenedStyle = StyleSheet.flatten(originalStyle);
|
|
23
|
-
let contentContainerStyle = pick(flattenedStyle, contentContainerStyleNames);
|
|
24
|
-
// contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children
|
|
25
|
-
if (measuredWidth) {
|
|
26
|
-
contentContainerStyle.minWidth = measuredWidth;
|
|
27
|
-
}
|
|
28
|
-
if (measuredHeight) {
|
|
29
|
-
contentContainerStyle.minHeight = measuredHeight;
|
|
30
|
-
}
|
|
31
|
-
let style = omit(flattenedStyle, contentContainerStyleNames);
|
|
32
|
-
// ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
|
|
33
|
-
// See: https://github.com/facebook/react-native/issues/3422
|
|
34
|
-
if (style.flex === undefined) {
|
|
35
|
-
style = { flexGrow: 0, ...style };
|
|
36
|
-
}
|
|
37
|
-
else if (style.flexGrow === undefined) {
|
|
38
|
-
style = { flexGrow: style.flex, ...style };
|
|
39
|
-
}
|
|
40
|
-
return { style, contentContainerStyle };
|
|
41
|
-
}, [originalStyle, measuredWidth, measuredHeight]);
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=useSplitContentContainerStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAOrD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,aAAmC,EACnC,aAAsB,EACtB,cAAuB;IAEvB,OAAO,kBAAkB,CAAS,GAAG,EAAE;QACrC,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAEzD,IAAI,qBAAqB,GAAG,IAAI,CAC9B,cAAc,EACd,0BAA0B,CAC3B,CAAC;QAEF,oIAAoI;QACpI,IAAI,aAAa,EAAE;YACjB,qBAAqB,CAAC,QAAQ,GAAG,aAAa,CAAC;SAChD;QACD,IAAI,cAAc,EAAE;YAClB,qBAAqB,CAAC,SAAS,GAAG,cAAc,CAAC;SAClD;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAE7D,kIAAkI;QAClI,4DAA4D;QAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5B,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;SACnC;aAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;SAC5C;QAED,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle, StyleSheet } from "react-native";
|
|
2
|
-
import { pick, omit } from "lodash";
|
|
3
|
-
import { useDeepCompareMemo } from "../../utilities";
|
|
4
|
-
|
|
5
|
-
interface Styles {
|
|
6
|
-
style?: StyleProp<ViewStyle>;
|
|
7
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const contentContainerStyleNames = [
|
|
11
|
-
"padding",
|
|
12
|
-
"paddingBottom",
|
|
13
|
-
"paddingEnd",
|
|
14
|
-
"paddingHorizontal",
|
|
15
|
-
"paddingLeft",
|
|
16
|
-
"paddingRight",
|
|
17
|
-
"paddingStart",
|
|
18
|
-
"paddingTop",
|
|
19
|
-
"paddingVertical",
|
|
20
|
-
"justifyContent",
|
|
21
|
-
"alignItems",
|
|
22
|
-
"alignContent",
|
|
23
|
-
"flexDirection",
|
|
24
|
-
"flexWrap",
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export default function useSplitContentContainerStyles(
|
|
28
|
-
originalStyle: StyleProp<ViewStyle>,
|
|
29
|
-
measuredWidth?: number,
|
|
30
|
-
measuredHeight?: number
|
|
31
|
-
) {
|
|
32
|
-
return useDeepCompareMemo<Styles>(() => {
|
|
33
|
-
const flattenedStyle = StyleSheet.flatten(originalStyle);
|
|
34
|
-
|
|
35
|
-
let contentContainerStyle = pick(
|
|
36
|
-
flattenedStyle,
|
|
37
|
-
contentContainerStyleNames
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
// contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children
|
|
41
|
-
if (measuredWidth) {
|
|
42
|
-
contentContainerStyle.minWidth = measuredWidth;
|
|
43
|
-
}
|
|
44
|
-
if (measuredHeight) {
|
|
45
|
-
contentContainerStyle.minHeight = measuredHeight;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let style = omit(flattenedStyle, contentContainerStyleNames);
|
|
49
|
-
|
|
50
|
-
// ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
|
|
51
|
-
// See: https://github.com/facebook/react-native/issues/3422
|
|
52
|
-
if (style.flex === undefined) {
|
|
53
|
-
style = { flexGrow: 0, ...style };
|
|
54
|
-
} else if (style.flexGrow === undefined) {
|
|
55
|
-
style = { flexGrow: style.flex, ...style };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return { style, contentContainerStyle };
|
|
59
|
-
}, [originalStyle, measuredWidth, measuredHeight]);
|
|
60
|
-
}
|