@draftbit/core 49.5.2-5ac7d2.2 → 49.5.2-e8f32c.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.
Files changed (65) hide show
  1. package/lib/commonjs/components/SectionList/SectionList.js +1 -1
  2. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
  3. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
  4. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
  5. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
  6. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
  7. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
  8. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
  9. package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
  10. package/lib/typescript/src/components/SectionList/SectionList.d.ts +6 -4
  11. package/lib/typescript/src/components/SectionList/SectionList.js +4 -4
  12. package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
  13. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.d.ts +2 -1
  14. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
  15. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
  16. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +2 -1
  17. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
  18. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
  19. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.d.ts +2 -1
  20. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
  21. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
  22. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.d.ts +2 -2
  23. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
  24. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
  25. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.d.ts +2 -1
  26. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
  27. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
  28. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +6 -2
  29. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
  30. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
  31. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +6 -2
  32. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
  33. package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
  34. package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +3 -3
  35. package/lib/typescript/src/components/SwipeableItem/SwipeableList.js +4 -4
  36. package/lib/typescript/src/components/SwipeableItem/SwipeableList.js.map +1 -1
  37. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +3 -3
  39. package/src/components/SectionList/SectionList.js +4 -4
  40. package/src/components/SectionList/SectionList.js.map +1 -1
  41. package/src/components/SectionList/SectionList.tsx +152 -145
  42. package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
  43. package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
  44. package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +22 -16
  45. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
  46. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
  47. package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +22 -16
  48. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
  49. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
  50. package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +20 -13
  51. package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
  52. package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
  53. package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +27 -17
  54. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
  55. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
  56. package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +20 -13
  57. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
  58. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
  59. package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +28 -20
  60. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
  61. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
  62. package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +28 -20
  63. package/src/components/SwipeableItem/SwipeableList.js +4 -4
  64. package/src/components/SwipeableItem/SwipeableList.js.map +1 -1
  65. package/src/components/SwipeableItem/SwipeableList.tsx +47 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "49.5.2-5ac7d2.2+5ac7d25",
3
+ "version": "49.5.2-e8f32c.2+e8f32cf",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^49.5.2-5ac7d2.2+5ac7d25",
44
+ "@draftbit/types": "^49.5.2-e8f32c.2+e8f32cf",
45
45
  "@expo/vector-icons": "^13.0.0",
46
46
  "@gorhom/bottom-sheet": "5.0.0-alpha.7",
47
47
  "@material-ui/core": "^4.11.0",
@@ -116,5 +116,5 @@
116
116
  ],
117
117
  "testEnvironment": "node"
118
118
  },
119
- "gitHead": "5ac7d2593399deabff664d0a0d22a6b9a341fc92"
119
+ "gitHead": "e8f32cf626996cc9442250d7929a97d82c93eaf5"
120
120
  }
@@ -4,7 +4,7 @@ import { FlatList } from "react-native";
4
4
  import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
5
5
  import { flattenReactFragments } from "../../utilities";
6
6
  export const DEFAULT_SECTION = "Uncategorized";
7
- const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }) => {
7
+ const SectionList = React.forwardRef(({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }, ref) => {
8
8
  const data = React.useMemo(() => (Array.isArray(dataProp) ? dataProp : []), [dataProp]);
9
9
  const dataWithSections = React.useMemo(() => {
10
10
  var _a;
@@ -102,10 +102,10 @@ const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatLi
102
102
  };
103
103
  switch (listComponent) {
104
104
  case "FlatList":
105
- return (React.createElement(FlatList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
105
+ return (React.createElement(FlatList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
106
106
  case "FlashList":
107
- return (React.createElement(FlashList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
107
+ return (React.createElement(FlashList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
108
108
  }
109
- };
109
+ });
110
110
  export default SectionList;
111
111
  //# sourceMappingURL=SectionList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionList.js","sourceRoot":"","sources":["SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqCxD,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,WAAW,GAAG,CAAmC,EACrD,UAAU,EACV,YAAY,GAAG,KAAK,EACpB,aAAa,GAAG,UAAU,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAc,EAC1B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,IAAI,EACoD,EAAE,EAAE;IAC/D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAQ,EACtD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QAC1C,MAAM,MAAM,GAAyB,EAAE,CAAC;QACxC,MAAM,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,IAA2C,EAChD,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;KACL;AACH,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -41,168 +41,175 @@ type SectionListItem<T> = SectionListDataItem<T> | SectionListSectionItem;
41
41
 
42
42
  export const DEFAULT_SECTION = "Uncategorized";
43
43
 
44
- const SectionList = <T extends { [key: string]: any }>({
45
- sectionKey,
46
- stickyHeader = false,
47
- listComponent = "FlatList",
48
- data: dataProp,
49
- renderItem: renderItemProp,
50
- keyExtractor: keyExtractorProp,
51
- ...rest
52
- }: FlatListSectionListProps<T> | FlashListSectionListProps<T>) => {
53
- const data = React.useMemo(
54
- () => (Array.isArray(dataProp) ? dataProp : []) as T[],
55
- [dataProp]
56
- );
57
-
58
- const dataWithSections = React.useMemo(() => {
59
- const result: SectionListItem<T>[] = [];
60
- const sectionDataItems: { [key: string]: T[] } = {};
61
-
62
- for (const item of data) {
63
- const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
64
- if (sectionDataItems[section]) {
65
- sectionDataItems[section].push(item);
66
- } else {
67
- sectionDataItems[section] = [item];
68
- }
69
- }
44
+ const SectionList = React.forwardRef(
45
+ <T extends { [key: string]: any }>(
46
+ {
47
+ sectionKey,
48
+ stickyHeader = false,
49
+ listComponent = "FlatList",
50
+ data: dataProp,
51
+ renderItem: renderItemProp,
52
+ keyExtractor: keyExtractorProp,
53
+ ...rest
54
+ }: FlatListSectionListProps<T> | FlashListSectionListProps<T>,
55
+ ref: React.Ref<FlatList | FlashList<any>>
56
+ ) => {
57
+ const data = React.useMemo(
58
+ () => (Array.isArray(dataProp) ? dataProp : []) as T[],
59
+ [dataProp]
60
+ );
70
61
 
71
- for (const section in sectionDataItems) {
72
- result.push({ type: "SECTION_ITEM", title: section });
73
- const sectionItems: SectionListDataItem<T>[] = sectionDataItems[
74
- section
75
- ].map((item) => ({ type: "DATA_ITEM", data: item }));
76
- result.push(...sectionItems);
77
- }
62
+ const dataWithSections = React.useMemo(() => {
63
+ const result: SectionListItem<T>[] = [];
64
+ const sectionDataItems: { [key: string]: T[] } = {};
78
65
 
79
- return result;
80
- }, [data, sectionKey]);
81
-
82
- const sectionHeaderIndicies = React.useMemo(
83
- () =>
84
- stickyHeader
85
- ? dataWithSections
86
- .filter((item) => item.type === "SECTION_ITEM")
87
- .map((item) => dataWithSections.indexOf(item))
88
- : undefined,
89
- [dataWithSections, stickyHeader]
90
- );
91
-
92
- const extractSectionHeader = (
93
- element: JSX.Element | null
94
- ): JSX.Element | null => {
95
- if (!element) {
96
- return null;
97
- }
66
+ for (const item of data) {
67
+ const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
68
+ if (sectionDataItems[section]) {
69
+ sectionDataItems[section].push(item);
70
+ } else {
71
+ sectionDataItems[section] = [item];
72
+ }
73
+ }
74
+
75
+ for (const section in sectionDataItems) {
76
+ result.push({ type: "SECTION_ITEM", title: section });
77
+ const sectionItems: SectionListDataItem<T>[] = sectionDataItems[
78
+ section
79
+ ].map((item) => ({ type: "DATA_ITEM", data: item }));
80
+ result.push(...sectionItems);
81
+ }
98
82
 
99
- const props = element.props || {};
100
- const children = flattenReactFragments(
101
- React.Children.toArray(props.children) as React.ReactElement[]
83
+ return result;
84
+ }, [data, sectionKey]);
85
+
86
+ const sectionHeaderIndicies = React.useMemo(
87
+ () =>
88
+ stickyHeader
89
+ ? dataWithSections
90
+ .filter((item) => item.type === "SECTION_ITEM")
91
+ .map((item) => dataWithSections.indexOf(item))
92
+ : undefined,
93
+ [dataWithSections, stickyHeader]
102
94
  );
103
95
 
104
- if (element.type === SectionHeader) {
105
- return element;
106
- } else {
107
- for (const child of children) {
108
- if (child.type === SectionHeader) {
109
- return child;
110
- }
96
+ const extractSectionHeader = (
97
+ element: JSX.Element | null
98
+ ): JSX.Element | null => {
99
+ if (!element) {
100
+ return null;
111
101
  }
112
- }
113
- return null;
114
- };
115
102
 
116
- const extractRemainingNonSectionHeader = (
117
- element: JSX.Element | null
118
- ): JSX.Element | null => {
119
- if (!element) {
120
- return null;
121
- }
103
+ const props = element.props || {};
104
+ const children = flattenReactFragments(
105
+ React.Children.toArray(props.children) as React.ReactElement[]
106
+ );
122
107
 
123
- const props = element.props || {};
124
- const children = flattenReactFragments(
125
- React.Children.toArray(props.children) as React.ReactElement[]
126
- );
127
- if (element.type === SectionHeader) {
128
- return null;
129
- } else {
130
- const newChildren = [];
131
- for (const child of children) {
132
- if (child.type !== SectionHeader) {
133
- newChildren.push(child);
108
+ if (element.type === SectionHeader) {
109
+ return element;
110
+ } else {
111
+ for (const child of children) {
112
+ if (child.type === SectionHeader) {
113
+ return child;
114
+ }
134
115
  }
135
116
  }
136
- return React.cloneElement(element, {
137
- ...props,
138
- children: newChildren,
139
- });
140
- }
141
- };
117
+ return null;
118
+ };
142
119
 
143
- const renderItem = ({
144
- item,
145
- index,
146
- }: {
147
- item: SectionListItem<T>;
148
- index: number;
149
- }) => {
150
- switch (item.type) {
151
- case "SECTION_ITEM": {
152
- const renderedItem = renderItemProp({
153
- index,
154
- section: item.title,
155
- });
156
- return (
157
- extractSectionHeader(renderedItem) || (
158
- <DefaultSectionHeader title={item.title} />
159
- )
160
- );
120
+ const extractRemainingNonSectionHeader = (
121
+ element: JSX.Element | null
122
+ ): JSX.Element | null => {
123
+ if (!element) {
124
+ return null;
161
125
  }
162
- case "DATA_ITEM": {
163
- const renderedItem = renderItemProp({
164
- item: item.data,
165
- index,
166
- section: item.data[sectionKey] || DEFAULT_SECTION,
126
+
127
+ const props = element.props || {};
128
+ const children = flattenReactFragments(
129
+ React.Children.toArray(props.children) as React.ReactElement[]
130
+ );
131
+ if (element.type === SectionHeader) {
132
+ return null;
133
+ } else {
134
+ const newChildren = [];
135
+ for (const child of children) {
136
+ if (child.type !== SectionHeader) {
137
+ newChildren.push(child);
138
+ }
139
+ }
140
+ return React.cloneElement(element, {
141
+ ...props,
142
+ children: newChildren,
167
143
  });
168
- return extractRemainingNonSectionHeader(renderedItem);
169
144
  }
170
- }
171
- };
172
-
173
- const keyExtractor = (item: SectionListItem<T>, index: number) => {
174
- switch (item.type) {
175
- case "SECTION_ITEM": {
176
- return `section_${index.toString()}`;
145
+ };
146
+
147
+ const renderItem = ({
148
+ item,
149
+ index,
150
+ }: {
151
+ item: SectionListItem<T>;
152
+ index: number;
153
+ }) => {
154
+ switch (item.type) {
155
+ case "SECTION_ITEM": {
156
+ const renderedItem = renderItemProp({
157
+ index,
158
+ section: item.title,
159
+ });
160
+ return (
161
+ extractSectionHeader(renderedItem) || (
162
+ <DefaultSectionHeader title={item.title} />
163
+ )
164
+ );
165
+ }
166
+ case "DATA_ITEM": {
167
+ const renderedItem = renderItemProp({
168
+ item: item.data,
169
+ index,
170
+ section: item.data[sectionKey] || DEFAULT_SECTION,
171
+ });
172
+ return extractRemainingNonSectionHeader(renderedItem);
173
+ }
177
174
  }
178
- case "DATA_ITEM": {
179
- return keyExtractorProp?.(item.data, index) || index.toString();
175
+ };
176
+
177
+ const keyExtractor = (item: SectionListItem<T>, index: number) => {
178
+ switch (item.type) {
179
+ case "SECTION_ITEM": {
180
+ return `section_${index.toString()}`;
181
+ }
182
+ case "DATA_ITEM": {
183
+ return keyExtractorProp?.(item.data, index) || index.toString();
184
+ }
180
185
  }
186
+ };
187
+
188
+ switch (listComponent) {
189
+ case "FlatList":
190
+ return (
191
+ <FlatList
192
+ ref={ref as React.Ref<FlatList>}
193
+ stickyHeaderIndices={sectionHeaderIndicies}
194
+ {...(rest as FlatListProps<SectionListItem<T>>)}
195
+ data={dataWithSections}
196
+ renderItem={renderItem}
197
+ keyExtractor={keyExtractor}
198
+ />
199
+ );
200
+ case "FlashList":
201
+ return (
202
+ <FlashList
203
+ ref={ref as React.Ref<FlashList<SectionListItem<T>>>}
204
+ stickyHeaderIndices={sectionHeaderIndicies}
205
+ {...(rest as FlashListProps<SectionListItem<T>>)}
206
+ data={dataWithSections}
207
+ renderItem={renderItem}
208
+ keyExtractor={keyExtractor}
209
+ />
210
+ );
181
211
  }
182
- };
183
-
184
- switch (listComponent) {
185
- case "FlatList":
186
- return (
187
- <FlatList
188
- stickyHeaderIndices={sectionHeaderIndicies}
189
- {...(rest as FlatListProps<SectionListItem<T>>)}
190
- data={dataWithSections}
191
- renderItem={renderItem}
192
- keyExtractor={keyExtractor}
193
- />
194
- );
195
- case "FlashList":
196
- return (
197
- <FlashList
198
- stickyHeaderIndices={sectionHeaderIndicies}
199
- {...(rest as FlashListProps<SectionListItem<T>>)}
200
- data={dataWithSections}
201
- renderItem={renderItem}
202
- keyExtractor={keyExtractor}
203
- />
204
- );
205
212
  }
206
- };
213
+ );
207
214
 
208
215
  export default SectionList;
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
5
5
  * A FlashList wrapper that takes a single `style` prop and internally extracts
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
- const SimpleStyleFlashList = ({ style: styleProp, data, ...rest }) => {
8
+ const SimpleStyleFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
9
  const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
10
- return (React.createElement(FlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
- };
10
+ return (React.createElement(FlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
+ });
12
12
  export default SimpleStyleFlashList;
13
13
  //# sourceMappingURL=SimpleStyleFlashList.js.map
@@ -1 +1 @@
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,IAAI,EACJ,GAAG,IAAI,EAC0C,EAAE,EAAE;IACrD,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
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,KAAK,CAAC,UAAU,CAC3C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EACnD,GAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
7
7
  * A FlashList wrapper that takes a single `style` prop and internally extracts
8
8
  * the appropriate style keys into the `contentContainerStyle`
9
9
  */
10
- const SimpleStyleFlashList = <T extends any>({
11
- style: styleProp,
12
- data,
13
- ...rest
14
- }: Omit<FlashListProps<T>, "contentContainerStyle">) => {
15
- const { style, contentContainerStyle } =
16
- useSplitContentContainerStyles(styleProp);
10
+ const SimpleStyleFlashList = React.forwardRef(
11
+ <T extends any>(
12
+ {
13
+ style: styleProp,
14
+ data,
15
+ ...rest
16
+ }: Omit<FlashListProps<T>, "contentContainerStyle">,
17
+ ref: React.Ref<FlashList<any>>
18
+ ) => {
19
+ const { style, contentContainerStyle } =
20
+ useSplitContentContainerStyles(styleProp);
17
21
 
18
- return (
19
- <FlashList
20
- style={style}
21
- contentContainerStyle={contentContainerStyle as ContentStyle}
22
- data={data}
23
- {...rest}
24
- />
25
- );
26
- };
22
+ return (
23
+ <FlashList
24
+ ref={ref}
25
+ style={style}
26
+ contentContainerStyle={contentContainerStyle as ContentStyle}
27
+ data={data}
28
+ {...rest}
29
+ />
30
+ );
31
+ }
32
+ );
27
33
 
28
34
  export default SimpleStyleFlashList;
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
5
5
  * A FlatList wrapper that takes a single `style` prop and internally extracts
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
- const SimpleStyleFlatList = ({ style: styleProp, data, ...rest }) => {
8
+ const SimpleStyleFlatList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
9
  const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
10
- return (React.createElement(FlatList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
- };
10
+ return (React.createElement(FlatList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
+ });
12
12
  export default SimpleStyleFlatList;
13
13
  //# sourceMappingURL=SimpleStyleFlatList.js.map
@@ -1 +1 @@
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,IAAI,EACJ,GAAG,IAAI,EACyC,EAAE,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,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,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,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,GAAwB,EACxB,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"}
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
7
7
  * A FlatList wrapper that takes a single `style` prop and internally extracts
8
8
  * the appropriate style keys into the `contentContainerStyle`
9
9
  */
10
- const SimpleStyleFlatList = <T extends any>({
11
- style: styleProp,
12
- data,
13
- ...rest
14
- }: Omit<FlatListProps<T>, "contentContainerStyle">) => {
15
- const { style, contentContainerStyle } =
16
- useSplitContentContainerStyles(styleProp);
10
+ const SimpleStyleFlatList = React.forwardRef(
11
+ <T extends any>(
12
+ {
13
+ style: styleProp,
14
+ data,
15
+ ...rest
16
+ }: Omit<FlatListProps<T>, "contentContainerStyle">,
17
+ ref: React.Ref<FlatList>
18
+ ) => {
19
+ const { style, contentContainerStyle } =
20
+ useSplitContentContainerStyles(styleProp);
17
21
 
18
- return (
19
- <FlatList
20
- style={style}
21
- contentContainerStyle={contentContainerStyle}
22
- data={data}
23
- {...rest}
24
- />
25
- );
26
- };
22
+ return (
23
+ <FlatList
24
+ ref={ref}
25
+ style={style}
26
+ contentContainerStyle={contentContainerStyle}
27
+ data={data}
28
+ {...rest}
29
+ />
30
+ );
31
+ }
32
+ );
27
33
 
28
34
  export default SimpleStyleFlatList;
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
5
5
  * A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
- const SimpleStyleKeyboardAwareScrollView = ({ style: styleProp, ...rest }) => {
8
+ const SimpleStyleKeyboardAwareScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
9
9
  const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
10
- return (React.createElement(KeyboardAwareScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
11
- };
10
+ return (React.createElement(KeyboardAwareScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
11
+ });
12
12
  export default SimpleStyleKeyboardAwareScrollView;
13
13
  //# sourceMappingURL=SimpleStyleKeyboardAwareScrollView.js.map
@@ -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,GAEpC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,IACtB,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,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,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"}
@@ -7,19 +7,26 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
7
7
  * A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
8
8
  * the appropriate style keys into the `contentContainerStyle`
9
9
  */
10
- const SimpleStyleKeyboardAwareScrollView: React.FC<
11
- Omit<KeyboardAwareScrollViewProps, "contentContainerStyle">
12
- > = ({ style: styleProp, ...rest }) => {
13
- const { style, contentContainerStyle } =
14
- useSplitContentContainerStyles(styleProp);
10
+ const SimpleStyleKeyboardAwareScrollView = React.forwardRef(
11
+ (
12
+ {
13
+ style: styleProp,
14
+ ...rest
15
+ }: Omit<KeyboardAwareScrollViewProps, "contentContainerStyle">,
16
+ ref: React.Ref<KeyboardAwareScrollView>
17
+ ) => {
18
+ const { style, contentContainerStyle } =
19
+ useSplitContentContainerStyles(styleProp);
15
20
 
16
- return (
17
- <KeyboardAwareScrollView
18
- style={style}
19
- contentContainerStyle={contentContainerStyle}
20
- {...rest}
21
- />
22
- );
23
- };
21
+ return (
22
+ <KeyboardAwareScrollView
23
+ ref={ref}
24
+ style={style}
25
+ contentContainerStyle={contentContainerStyle}
26
+ {...rest}
27
+ />
28
+ );
29
+ }
30
+ );
24
31
 
25
32
  export default SimpleStyleKeyboardAwareScrollView;
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
5
5
  * A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
6
6
  * the appropriate style keys into the `contentContainerStyle`
7
7
  */
8
- const SimpleStyleMasonryFlashList = ({ style: styleProp, data, ...rest }) => {
8
+ const SimpleStyleMasonryFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
9
9
  const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
10
- return (React.createElement(MasonryFlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
- };
10
+ return (React.createElement(MasonryFlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
11
+ });
12
12
  export default SimpleStyleMasonryFlashList;
13
13
  //# sourceMappingURL=SimpleStyleMasonryFlashList.js.map
@@ -1 +1 @@
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,IAAI,EACJ,GAAG,IAAI,EACiD,EAAE,EAAE;IAC5D,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
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;AAMvD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,KAAK,CAAC,UAAU,CAClD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACiD,EAC1D,GAAwC,EACxC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAU,EACf,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,2BAA2B,CAAC"}