@draftbit/core 54.0.2 → 54.0.3

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.
Files changed (39) hide show
  1. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
  2. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
  3. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
  4. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
  5. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
  6. package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +1 -1
  7. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
  8. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
  9. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
  10. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
  11. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
  12. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
  13. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
  14. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
  15. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
  16. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
  17. package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts +3 -1
  18. package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +11 -9
  19. package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
  20. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +3 -3
  22. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
  23. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
  24. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +4 -2
  25. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
  26. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
  27. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +4 -2
  28. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
  29. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
  30. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +4 -2
  31. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
  32. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
  33. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +4 -2
  34. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
  35. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
  36. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +4 -2
  37. package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +11 -9
  38. package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
  39. package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts +14 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "54.0.2",
3
+ "version": "54.0.3",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "homepage": "https://github.com/draftbit/react-native-jigsaw#readme",
41
41
  "dependencies": {
42
42
  "@draftbit/react-theme-provider": "^2.1.1",
43
- "@draftbit/theme": "54.0.2",
43
+ "@draftbit/theme": "54.0.3",
44
44
  "@emotion/react": "^11.13.5",
45
45
  "@emotion/styled": "^11.13.5",
46
46
  "@expo/vector-icons": "^15.0.3",
@@ -120,5 +120,5 @@
120
120
  ],
121
121
  "testEnvironment": "node"
122
122
  },
123
- "gitHead": "8e6093eb0d44d66833c60b26bd7267d386776245"
123
+ "gitHead": "eceef38dbc6dc703d1f555fa2cdfd2cebd82a8ef"
124
124
  }
@@ -6,7 +6,7 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
8
  const SimpleStyleFlatList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
- const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
9
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, { isFlashList: false });
10
10
  return (React.createElement(FlatList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
11
  });
12
12
  export default SimpleStyleFlatList;
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAClD,GAAiC,EACjC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAClD,GAAiC,EACjC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -17,8 +17,10 @@ const SimpleStyleFlatList = React.forwardRef(
17
17
  }: Omit<FlatListProps<T>, "contentContainerStyle">,
18
18
  ref: React.Ref<FlatListComponent>
19
19
  ) => {
20
- const { style, contentContainerStyle } =
21
- useSplitContentContainerStyles(styleProp);
20
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
21
+ styleProp,
22
+ { isFlashList: false }
23
+ );
22
24
 
23
25
  return (
24
26
  <FlatList
@@ -6,7 +6,7 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
8
  const SimpleStyleKeyboardAwareScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
9
- const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
9
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, { isFlashList: false });
10
10
  return (React.createElement(KeyboardAwareScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
11
11
  });
12
12
  export default SimpleStyleKeyboardAwareScrollView;
@@ -1 +1 @@
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,GAAG,KAAK,CAAC,UAAU,CACzD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACqD,EAC9D,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,IACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
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,GAAG,KAAK,CAAC,UAAU,CACzD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACqD,EAC9D,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;IAEF,OAAO,CACL,oBAAC,uBAAuB,IACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
@@ -15,8 +15,10 @@ const SimpleStyleKeyboardAwareScrollView = React.forwardRef(
15
15
  }: Omit<KeyboardAwareScrollViewProps, "contentContainerStyle">,
16
16
  ref: React.Ref<KeyboardAwareScrollView>
17
17
  ) => {
18
- const { style, contentContainerStyle } =
19
- useSplitContentContainerStyles(styleProp);
18
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
19
+ styleProp,
20
+ { isFlashList: false }
21
+ );
20
22
 
21
23
  return (
22
24
  <KeyboardAwareScrollView
@@ -6,7 +6,7 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
8
  const SimpleStyleScrollView = React.forwardRef(({ style: styleProp, onRefresh, refreshing = false, ...rest }, ref) => {
9
- const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
9
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, { isFlashList: false });
10
10
  return (React.createElement(ScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, refreshControl: onRefresh ? (React.createElement(RefreshControl, { refreshing: refreshing, onRefresh: onRefresh })) : undefined, ...rest }));
11
11
  });
12
12
  export default SimpleStyleScrollView;
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO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OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EACZ,SAAS,CAAC,CAAC,CAAC,CACV,oBAAC,cAAc,IAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAI,CACjE,CAAC,CAAC,CAAC,SAAS,KAEX,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -17,8 +17,10 @@ const SimpleStyleScrollView = React.forwardRef(
17
17
  { style: styleProp, onRefresh, refreshing = false, ...rest }: Props,
18
18
  ref: React.Ref<ScrollView>
19
19
  ) => {
20
- const { style, contentContainerStyle } =
21
- useSplitContentContainerStyles(styleProp);
20
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
21
+ styleProp,
22
+ { isFlashList: false }
23
+ );
22
24
 
23
25
  return (
24
26
  <ScrollView
@@ -6,7 +6,7 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
8
  const SimpleStyleSectionList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
- const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
9
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, { isFlashList: rest.listComponent === "FlashList" });
10
10
  return (
11
11
  //@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
12
12
  React.createElement(SectionList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
@@ -1 +1 @@
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;AAI9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAC7C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyD,EACzD,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,WAAW,IACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
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;AAI9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAC7C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyD,EACzD,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,KAAK,WAAW,EAAE,CACpD,CAAC;IAEF,OAAO;IACL,gHAAgH;IAChH,oBAAC,WAAW,IACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -24,8 +24,10 @@ const SimpleStyleSectionList = React.forwardRef(
24
24
  >,
25
25
  ref: React.Ref<FlatListComponent | typeof FlashList<any>>
26
26
  ) => {
27
- const { style, contentContainerStyle } =
28
- useSplitContentContainerStyles(styleProp);
27
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
28
+ styleProp,
29
+ { isFlashList: rest.listComponent === "FlashList" }
30
+ );
29
31
 
30
32
  return (
31
33
  //@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
@@ -6,7 +6,7 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
8
  const SimpleStyleSwipeableList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
- const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
9
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, { isFlashList: rest.listComponent === "FlashList" });
10
10
  return (
11
11
  //@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
12
12
  React.createElement(SwipeableList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
@@ -1 +1 @@
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;AAI9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAC/C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyD,EACzD,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,aAAa,IACZ,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
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;AAI9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAC/C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EACD,GAAyD,EACzD,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GAAG,8BAA8B,CACrE,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,KAAK,WAAW,EAAE,CACpD,CAAC;IAEF,OAAO;IACL,gHAAgH;IAChH,oBAAC,aAAa,IACZ,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -24,8 +24,10 @@ const SimpleStyleSwipeableList = React.forwardRef(
24
24
  >,
25
25
  ref: React.Ref<FlatListComponent | typeof FlashList<any>>
26
26
  ) => {
27
- const { style, contentContainerStyle } =
28
- useSplitContentContainerStyles(styleProp);
27
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
28
+ styleProp,
29
+ { isFlashList: rest.listComponent === "FlashList" }
30
+ );
29
31
 
30
32
  return (
31
33
  //@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
@@ -22,20 +22,22 @@ export const contentContainerStyleNames = [
22
22
  "columnGap",
23
23
  "rowGap",
24
24
  ];
25
- export default function useSplitContentContainerStyles(originalStyle) {
25
+ export default function useSplitContentContainerStyles(originalStyle, options) {
26
26
  return useDeepCompareMemo(() => {
27
27
  const flattenedStyle = StyleSheet.flatten(originalStyle);
28
28
  const contentContainerStyle = pick(flattenedStyle, contentContainerStyleNames);
29
29
  // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children.
30
30
  contentContainerStyle.flexGrow = 1;
31
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 };
32
+ if (!options.isFlashList) {
33
+ // ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
34
+ // See: https://github.com/facebook/react-native/issues/3422
35
+ if (style.flex === undefined) {
36
+ style = { flexGrow: 0, ...style };
37
+ }
38
+ else if (style.flexGrow === undefined) {
39
+ style = { flexGrow: style.flex, ...style };
40
+ }
39
41
  }
40
42
  return {
41
43
  style,
@@ -44,7 +46,7 @@ export default function useSplitContentContainerStyles(originalStyle) {
44
46
  }, [originalStyle]);
45
47
  }
46
48
  export function useFlashListSplitContentContainerStyles(originalStyle) {
47
- const { style, contentContainerStyle } = useSplitContentContainerStyles(originalStyle);
49
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(originalStyle, { isFlashList: true });
48
50
  // FlashList only supports a subset of contentContainerStyles
49
51
  // See https://shopify.github.io/flash-list/docs/usage/#contentcontainerstyle
50
52
  const flashListContentContainerStyle = pick(contentContainerStyle, [
@@ -1 +1 @@
1
- {"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,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mBAAmB;wBACtB,8BAA8B,CAAC,GAAG,CAAC;4BACjC,YAAY,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;wBAClC,MAAM;oBACR,KAAK,YAAY,CAAC;oBAClB,KAAK,eAAe,CAAC;oBACrB,KAAK,iBAAiB;wBACpB,8BAA8B,CAAC,GAAG,CAAC;4BACjC,aAAa,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;wBACnC,MAAM;gBACV,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK;QACL,qBAAqB,EAAE,8BAA8B;KACtD,CAAC;AACJ,CAAC"}
@@ -31,7 +31,8 @@ export const contentContainerStyleNames = [
31
31
  ];
32
32
 
33
33
  export default function useSplitContentContainerStyles(
34
- originalStyle: StyleProp<ViewStyle>
34
+ originalStyle: StyleProp<ViewStyle>,
35
+ options: { isFlashList: boolean }
35
36
  ) {
36
37
  return useDeepCompareMemo<Styles>(() => {
37
38
  const flattenedStyle = StyleSheet.flatten(originalStyle);
@@ -46,12 +47,14 @@ export default function useSplitContentContainerStyles(
46
47
 
47
48
  let style = omit(flattenedStyle, contentContainerStyleNames);
48
49
 
49
- // ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
50
- // See: https://github.com/facebook/react-native/issues/3422
51
- if (style.flex === undefined) {
52
- style = { flexGrow: 0, ...style };
53
- } else if (style.flexGrow === undefined) {
54
- style = { flexGrow: style.flex, ...style };
50
+ if (!options.isFlashList) {
51
+ // ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
52
+ // See: https://github.com/facebook/react-native/issues/3422
53
+ if (style.flex === undefined) {
54
+ style = { flexGrow: 0, ...style };
55
+ } else if (style.flexGrow === undefined) {
56
+ style = { flexGrow: style.flex, ...style };
57
+ }
55
58
  }
56
59
 
57
60
  return {
@@ -64,8 +67,10 @@ export default function useSplitContentContainerStyles(
64
67
  export function useFlashListSplitContentContainerStyles(
65
68
  originalStyle: StyleProp<ViewStyle>
66
69
  ): Styles {
67
- const { style, contentContainerStyle } =
68
- useSplitContentContainerStyles(originalStyle);
70
+ const { style, contentContainerStyle } = useSplitContentContainerStyles(
71
+ originalStyle,
72
+ { isFlashList: true }
73
+ );
69
74
 
70
75
  // FlashList only supports a subset of contentContainerStyles
71
76
  // See https://shopify.github.io/flash-list/docs/usage/#contentcontainerstyle