@shopify/flash-list 1.0.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.
Files changed (206) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/LICENSE.md +7 -0
  3. package/README.md +65 -0
  4. package/RNFlashList.podspec +26 -0
  5. package/android/build.gradle +59 -0
  6. package/android/src/main/AndroidManifest.xml +3 -0
  7. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt +94 -0
  8. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt +79 -0
  9. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutViewManager.kt +69 -0
  10. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainer.java +16 -0
  11. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerImpl.kt +16 -0
  12. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerManager.kt +27 -0
  13. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/FlashListPackage.kt +19 -0
  14. package/android/src/test/java/com/shopify/reactnative/flash_list/AutoLayoutShadowTest.kt +146 -0
  15. package/android/src/test/java/com/shopify/reactnative/flash_list/models/Rect.kt +59 -0
  16. package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestCollection.kt +6 -0
  17. package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestDataModel.kt +8 -0
  18. package/android/src/test/resources/LayoutTestData.json +708 -0
  19. package/dist/AnimatedFlashList.d.ts +6 -0
  20. package/dist/AnimatedFlashList.d.ts.map +1 -0
  21. package/dist/AnimatedFlashList.js +8 -0
  22. package/dist/AnimatedFlashList.js.map +1 -0
  23. package/dist/FlashList.d.ts +121 -0
  24. package/dist/FlashList.d.ts.map +1 -0
  25. package/dist/FlashList.js +502 -0
  26. package/dist/FlashList.js.map +1 -0
  27. package/dist/FlashListProps.d.ts +251 -0
  28. package/dist/FlashListProps.d.ts.map +1 -0
  29. package/dist/FlashListProps.js +3 -0
  30. package/dist/FlashListProps.js.map +1 -0
  31. package/dist/GridLayoutProviderWithProps.d.ts +30 -0
  32. package/dist/GridLayoutProviderWithProps.d.ts.map +1 -0
  33. package/dist/GridLayoutProviderWithProps.js +80 -0
  34. package/dist/GridLayoutProviderWithProps.js.map +1 -0
  35. package/dist/PureComponentWrapper.d.ts +22 -0
  36. package/dist/PureComponentWrapper.d.ts.map +1 -0
  37. package/dist/PureComponentWrapper.js +37 -0
  38. package/dist/PureComponentWrapper.js.map +1 -0
  39. package/dist/__tests__/AverageWindow.test.d.ts +2 -0
  40. package/dist/__tests__/AverageWindow.test.d.ts.map +1 -0
  41. package/dist/__tests__/AverageWindow.test.js +69 -0
  42. package/dist/__tests__/AverageWindow.test.js.map +1 -0
  43. package/dist/__tests__/FlashList.test.d.ts +2 -0
  44. package/dist/__tests__/FlashList.test.d.ts.map +1 -0
  45. package/dist/__tests__/FlashList.test.js +656 -0
  46. package/dist/__tests__/FlashList.test.js.map +1 -0
  47. package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts +2 -0
  48. package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts.map +1 -0
  49. package/dist/__tests__/GridLayoutProviderWithProps.test.js +133 -0
  50. package/dist/__tests__/GridLayoutProviderWithProps.test.js.map +1 -0
  51. package/dist/__tests__/PlatformHelper.web.test.d.ts +2 -0
  52. package/dist/__tests__/PlatformHelper.web.test.d.ts.map +1 -0
  53. package/dist/__tests__/PlatformHelper.web.test.js +25 -0
  54. package/dist/__tests__/PlatformHelper.web.test.js.map +1 -0
  55. package/dist/__tests__/ViewabilityHelper.test.d.ts +2 -0
  56. package/dist/__tests__/ViewabilityHelper.test.d.ts.map +1 -0
  57. package/dist/__tests__/ViewabilityHelper.test.js +187 -0
  58. package/dist/__tests__/ViewabilityHelper.test.js.map +1 -0
  59. package/dist/__tests__/helpers/mountFlashList.d.ts +20 -0
  60. package/dist/__tests__/helpers/mountFlashList.d.ts.map +1 -0
  61. package/dist/__tests__/helpers/mountFlashList.js +44 -0
  62. package/dist/__tests__/helpers/mountFlashList.js.map +1 -0
  63. package/dist/__tests__/useBlankAreaTracker.test.d.ts +2 -0
  64. package/dist/__tests__/useBlankAreaTracker.test.d.ts.map +1 -0
  65. package/dist/__tests__/useBlankAreaTracker.test.js +179 -0
  66. package/dist/__tests__/useBlankAreaTracker.test.js.map +1 -0
  67. package/dist/benchmark/AutoScrollHelper.d.ts +18 -0
  68. package/dist/benchmark/AutoScrollHelper.d.ts.map +1 -0
  69. package/dist/benchmark/AutoScrollHelper.js +68 -0
  70. package/dist/benchmark/AutoScrollHelper.js.map +1 -0
  71. package/dist/benchmark/JSFPSMonitor.d.ts +23 -0
  72. package/dist/benchmark/JSFPSMonitor.d.ts.map +1 -0
  73. package/dist/benchmark/JSFPSMonitor.js +65 -0
  74. package/dist/benchmark/JSFPSMonitor.js.map +1 -0
  75. package/dist/benchmark/roundToDecimalPlaces.d.ts +2 -0
  76. package/dist/benchmark/roundToDecimalPlaces.d.ts.map +1 -0
  77. package/dist/benchmark/roundToDecimalPlaces.js +9 -0
  78. package/dist/benchmark/roundToDecimalPlaces.js.map +1 -0
  79. package/dist/benchmark/useBenchmark.d.ts +35 -0
  80. package/dist/benchmark/useBenchmark.d.ts.map +1 -0
  81. package/dist/benchmark/useBenchmark.js +167 -0
  82. package/dist/benchmark/useBenchmark.js.map +1 -0
  83. package/dist/benchmark/useBlankAreaTracker.d.ts +34 -0
  84. package/dist/benchmark/useBlankAreaTracker.d.ts.map +1 -0
  85. package/dist/benchmark/useBlankAreaTracker.js +67 -0
  86. package/dist/benchmark/useBlankAreaTracker.js.map +1 -0
  87. package/dist/benchmark/useDataMultiplier.d.ts +9 -0
  88. package/dist/benchmark/useDataMultiplier.d.ts.map +1 -0
  89. package/dist/benchmark/useDataMultiplier.js +25 -0
  90. package/dist/benchmark/useDataMultiplier.js.map +1 -0
  91. package/dist/benchmark/useFlatListBenchmark.d.ts +13 -0
  92. package/dist/benchmark/useFlatListBenchmark.d.ts.map +1 -0
  93. package/dist/benchmark/useFlatListBenchmark.js +100 -0
  94. package/dist/benchmark/useFlatListBenchmark.js.map +1 -0
  95. package/dist/errors/CustomError.d.ts +8 -0
  96. package/dist/errors/CustomError.d.ts.map +1 -0
  97. package/dist/errors/CustomError.js +14 -0
  98. package/dist/errors/CustomError.js.map +1 -0
  99. package/dist/errors/ExceptionList.d.ts +20 -0
  100. package/dist/errors/ExceptionList.d.ts.map +1 -0
  101. package/dist/errors/ExceptionList.js +22 -0
  102. package/dist/errors/ExceptionList.js.map +1 -0
  103. package/dist/errors/Warnings.d.ts +10 -0
  104. package/dist/errors/Warnings.d.ts.map +1 -0
  105. package/dist/errors/Warnings.js +15 -0
  106. package/dist/errors/Warnings.js.map +1 -0
  107. package/dist/index.d.ts +13 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +28 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/native/auto-layout/AutoLayoutView.d.ts +21 -0
  112. package/dist/native/auto-layout/AutoLayoutView.d.ts.map +1 -0
  113. package/dist/native/auto-layout/AutoLayoutView.js +48 -0
  114. package/dist/native/auto-layout/AutoLayoutView.js.map +1 -0
  115. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts +4 -0
  116. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts.map +1 -0
  117. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js +6 -0
  118. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js.map +1 -0
  119. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.web.d.ts +5 -0
  120. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.web.d.ts.map +1 -0
  121. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.web.js +6 -0
  122. package/dist/native/auto-layout/AutoLayoutViewNativeComponent.web.js.map +1 -0
  123. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts +14 -0
  124. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts.map +1 -0
  125. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js +3 -0
  126. package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js.map +1 -0
  127. package/dist/native/cell-container/CellContainer.d.ts +6 -0
  128. package/dist/native/cell-container/CellContainer.d.ts.map +1 -0
  129. package/dist/native/cell-container/CellContainer.js +9 -0
  130. package/dist/native/cell-container/CellContainer.js.map +1 -0
  131. package/dist/native/cell-container/CellContainer.web.d.ts +7 -0
  132. package/dist/native/cell-container/CellContainer.web.d.ts.map +1 -0
  133. package/dist/native/cell-container/CellContainer.web.js +13 -0
  134. package/dist/native/cell-container/CellContainer.web.js.map +1 -0
  135. package/dist/tsconfig.tsbuildinfo +1 -0
  136. package/dist/utils/AverageWindow.d.ts +21 -0
  137. package/dist/utils/AverageWindow.d.ts.map +1 -0
  138. package/dist/utils/AverageWindow.js +49 -0
  139. package/dist/utils/AverageWindow.js.map +1 -0
  140. package/dist/utils/PlatformHelper.d.ts +14 -0
  141. package/dist/utils/PlatformHelper.d.ts.map +1 -0
  142. package/dist/utils/PlatformHelper.js +16 -0
  143. package/dist/utils/PlatformHelper.js.map +1 -0
  144. package/dist/utils/PlatformHelper.web.d.ts +14 -0
  145. package/dist/utils/PlatformHelper.web.d.ts.map +1 -0
  146. package/dist/utils/PlatformHelper.web.js +18 -0
  147. package/dist/utils/PlatformHelper.web.js.map +1 -0
  148. package/dist/viewability/ViewToken.d.ts +8 -0
  149. package/dist/viewability/ViewToken.d.ts.map +1 -0
  150. package/dist/viewability/ViewToken.js +3 -0
  151. package/dist/viewability/ViewToken.js.map +1 -0
  152. package/dist/viewability/ViewabilityHelper.d.ts +25 -0
  153. package/dist/viewability/ViewabilityHelper.d.ts.map +1 -0
  154. package/dist/viewability/ViewabilityHelper.js +104 -0
  155. package/dist/viewability/ViewabilityHelper.js.map +1 -0
  156. package/dist/viewability/ViewabilityManager.d.ts +24 -0
  157. package/dist/viewability/ViewabilityManager.d.ts.map +1 -0
  158. package/dist/viewability/ViewabilityManager.js +94 -0
  159. package/dist/viewability/ViewabilityManager.js.map +1 -0
  160. package/ios/RNFlashList.xcodeproj/project.pbxproj +3 -0
  161. package/ios/RNFlashList.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  162. package/ios/Sources/AutoLayoutView.swift +218 -0
  163. package/ios/Sources/AutoLayoutViewManager.m +14 -0
  164. package/ios/Sources/AutoLayoutViewManager.swift +12 -0
  165. package/ios/Sources/CellContainer.swift +9 -0
  166. package/ios/Sources/CellContainerManager.m +8 -0
  167. package/ios/Sources/CellContainerManager.swift +12 -0
  168. package/ios/Sources/FlatListPro-Bridging-Header.h +8 -0
  169. package/ios/Tests/AutoLayoutViewTests.swift +113 -0
  170. package/jestSetup.js +15 -0
  171. package/package.json +75 -0
  172. package/src/AnimatedFlashList.ts +11 -0
  173. package/src/FlashList.tsx +801 -0
  174. package/src/FlashListProps.ts +312 -0
  175. package/src/GridLayoutProviderWithProps.ts +137 -0
  176. package/src/PureComponentWrapper.tsx +42 -0
  177. package/src/__tests__/AverageWindow.test.ts +80 -0
  178. package/src/__tests__/FlashList.test.tsx +738 -0
  179. package/src/__tests__/GridLayoutProviderWithProps.test.ts +150 -0
  180. package/src/__tests__/PlatformHelper.web.test.ts +29 -0
  181. package/src/__tests__/ViewabilityHelper.test.ts +283 -0
  182. package/src/__tests__/helpers/mountFlashList.tsx +62 -0
  183. package/src/__tests__/useBlankAreaTracker.test.tsx +206 -0
  184. package/src/benchmark/AutoScrollHelper.ts +70 -0
  185. package/src/benchmark/JSFPSMonitor.ts +74 -0
  186. package/src/benchmark/roundToDecimalPlaces.ts +4 -0
  187. package/src/benchmark/useBenchmark.ts +240 -0
  188. package/src/benchmark/useBlankAreaTracker.ts +117 -0
  189. package/src/benchmark/useDataMultiplier.ts +19 -0
  190. package/src/benchmark/useFlatListBenchmark.ts +107 -0
  191. package/src/errors/CustomError.ts +10 -0
  192. package/src/errors/ExceptionList.ts +23 -0
  193. package/src/errors/Warnings.ts +18 -0
  194. package/src/index.ts +32 -0
  195. package/src/native/auto-layout/AutoLayoutView.tsx +72 -0
  196. package/src/native/auto-layout/AutoLayoutViewNativeComponent.ts +7 -0
  197. package/src/native/auto-layout/AutoLayoutViewNativeComponent.web.ts +8 -0
  198. package/src/native/auto-layout/AutoLayoutViewNativeComponentProps.ts +14 -0
  199. package/src/native/cell-container/CellContainer.ts +7 -0
  200. package/src/native/cell-container/CellContainer.web.tsx +9 -0
  201. package/src/utils/AverageWindow.ts +49 -0
  202. package/src/utils/PlatformHelper.ts +16 -0
  203. package/src/utils/PlatformHelper.web.ts +20 -0
  204. package/src/viewability/ViewToken.ts +7 -0
  205. package/src/viewability/ViewabilityHelper.ts +162 -0
  206. package/src/viewability/ViewabilityManager.ts +133 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlashList.js","sourceRoot":"","sources":["../src/FlashList.tsx"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,6CAOsB;AACtB,qDAO0B;AAC1B,2EAAgF;AAEhF,+FAAiE;AACjE,gGAAkE;AAClE,+DAA8D;AAC9D,sGAAwE;AACxE,6EAA+C;AAC/C,iFAAmD;AACnD,uEAA4C;AAC5C,gGAAkE;AAElE,yDAIgC;AAKhC,IAAM,qBAAqB,GACzB,gBAAoD,CAAC;AAevD;IAA2B,qCAG1B;IAiCC,mBAAY,KAAwB;QAApC,iBAiBC;;gBAhBC,kBAAM,KAAK,CAAC;QA/BN,4BAAsB,GAAG,CAAC,CAAC;QAC3B,oBAAc,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACjD,wBAAkB,GAAG,CAAC,CAAC;QACvB,kBAAY,GAAiB,EAAE,CAAC;QAChC,mBAAa,GAAG,CAAC,CAAC;QAClB,kBAAY,GAAG,KAAK,CAAC;QACrB,4BAAsB,GAA2B;YACvD,KAAK,EAAE;gBACL,WAAW,EAA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AC,MAAM,0CAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;IAEM,qCAAiB,GAAxB;;QACE,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,iBAAiB,kDAAI,KAAI,IAAI,CAAC;IACpD,CAAC;IAOD,sBAAW,8CAAuB;QALlC;;;WAGG;QACH,yDAAyD;aACzD;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;;;OAAA;IAKD,sBAAW,sCAAe;QAH1B;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAC;QACjC,CAAC;;;OAAA;IAjsBM,sBAAY,GAAG;QACpB,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,CAAC;KACd,CAAC;IAusBJ,gBAAC;CAAA,AAzuBD,CAA2B,eAAK,CAAC,aAAa,GAyuB7C;AAED,kBAAe,SAAS,CAAC"}
@@ -0,0 +1,251 @@
1
+ /// <reference types="react" />
2
+ import { StyleProp, ScrollViewProps, ViewabilityConfig, ViewabilityConfigCallbackPairs, ViewStyle, ColorValue } from "react-native";
3
+ import { BlankAreaEventHandler } from "./native/auto-layout/AutoLayoutView";
4
+ import ViewToken from "./viewability/ViewToken";
5
+ export interface ListRenderItemInfo<TItem> {
6
+ item: TItem;
7
+ index: number;
8
+ }
9
+ export declare type ListRenderItem<TItem> = (info: ListRenderItemInfo<TItem>) => React.ReactElement | null;
10
+ export interface ContentStyle {
11
+ backgroundColor?: ColorValue;
12
+ paddingTop?: string | number;
13
+ paddingLeft?: string | number;
14
+ paddingRight?: string | number;
15
+ paddingBottom?: string | number;
16
+ padding?: string | number;
17
+ paddingVertical?: string | number;
18
+ paddingHorizontal?: string | number;
19
+ }
20
+ export interface FlashListProps<TItem> extends ScrollViewProps {
21
+ /**
22
+ * Takes an item from `data` and renders it into the list. Typical usage:
23
+ * ```ts
24
+ * renderItem = ({item}) => (
25
+ * <Text>{item.title}</Text>
26
+ * );
27
+ * ...
28
+ * <FlashList data={[{title: 'Title Text', key: 'item1'}]} renderItem={renderItem} />
29
+ *
30
+ * Provides additional metadata like `index`
31
+ *
32
+ * - `item` (`Object`): The item from `data` being rendered.
33
+ * - `index` (`number`): The index corresponding to this item in the `data` array.
34
+ */
35
+ renderItem: ListRenderItem<TItem> | null | undefined;
36
+ /**
37
+ * For simplicity, data is a plain array of items of a given type.
38
+ */
39
+ data: ReadonlyArray<TItem> | null | undefined;
40
+ /**
41
+ * Average or median size for elements in the list. Doesn't have to be very accurate but a good estimate can improve performance.
42
+ * A quick look at `Element Inspector` can help you determine this. If you're confused between two values, the smaller value is a better choice.
43
+ * For vertical lists provide average height and for horizontal average width.
44
+ * Read more about it here: https://shopify.github.io/flash-list/docs/estimated-item-size
45
+ */
46
+ estimatedItemSize?: number;
47
+ /**
48
+ * Each cell is rendered using this element.
49
+ * Can be a React Component Class, or a render function.
50
+ * The root component should always be a `CellContainer` which is also the default component used.
51
+ * Ensure that the original `props` are passed to the returned `CellContainer`. The `props` will include the following:
52
+ * - `onLayout`: Method for updating data about the real `CellContainer` layout
53
+ * - `index`: Index of the cell in the list, you can use this to query data if needed
54
+ * - `style`: Style of `CellContainer`, including:
55
+ * - `flexDirection`: Depends on whether your list is horizontal or vertical
56
+ * - `position`: Value of this will be `absolute` as that's how `FlashList` positions elements
57
+ * - `left`: Determines position of the element on x axis
58
+ * - `top`: Determines position of the element on y axis
59
+ * - `width`: Determines width of the element (present when list is vertical)
60
+ * - `height`: Determines height of the element (present when list is horizontal)
61
+ *
62
+ * Note: Changing layout of the cell can conflict with the native layout operations. You may need to set `disableAutoLayout` to `true` to prevent this.
63
+ */
64
+ CellRendererComponent?: React.ComponentType<any> | undefined;
65
+ /**
66
+ * Rendered in between each item, but not at the top or bottom. By default, `leadingItem` and `trailingItem` (if available) props are provided.
67
+ */
68
+ ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
69
+ /**
70
+ * Rendered when the list is empty. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. `<SomeComponent />`).
71
+ */
72
+ ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
73
+ /**
74
+ * Rendered at the bottom of all the items. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. `<SomeComponent />`).
75
+ */
76
+ ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
77
+ /**
78
+ * Styling for internal View for `ListFooterComponent`.
79
+ */
80
+ ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
81
+ /**
82
+ * Rendered at the top of all the items. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. `<SomeComponent />`).
83
+ */
84
+ ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
85
+ /**
86
+ * Styling for internal View for `ListHeaderComponent`.
87
+ */
88
+ ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
89
+ /**
90
+ * You can use `contentContainerStyle` to apply padding that will be applied to the whole content itself.
91
+ * For example, you can apply this padding, so that all of your items have leading and trailing space.
92
+ * Note: horizontal padding is ignored on vertical lists and vertical padding on horizontal ones.
93
+ */
94
+ contentContainerStyle?: ContentStyle;
95
+ /**
96
+ * Draw distance for advanced rendering (in dp/px)
97
+ */
98
+ drawDistance?: number;
99
+ /**
100
+ * Specifies how far the first item is drawn from start of the list window or, offset of the first item of the list (not the header).
101
+ * Needed if you're using initialScrollIndex prop. Before the initial draw the list cannot figure out the size of header or, any special margin/padding that might have been applied
102
+ * using header styles etc.
103
+ * If this isn't provided initialScrollIndex might not scroll to the provided index.
104
+ */
105
+ estimatedFirstItemOffset?: number;
106
+ /**
107
+ * Visible height and width of the list. This is not the scroll content size.
108
+ */
109
+ estimatedListSize?: {
110
+ height: number;
111
+ width: number;
112
+ };
113
+ /**
114
+ * A marker property for telling the list to re-render (since it implements PureComponent).
115
+ * If any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the `data` prop,
116
+ * stick it here and treat it immutably.
117
+ */
118
+ extraData?: any;
119
+ /**
120
+ * If true, renders items next to each other horizontally instead of stacked vertically.
121
+ */
122
+ horizontal?: boolean | null | undefined;
123
+ /**
124
+ * Instead of starting at the top with the first item, start at initialScrollIndex.
125
+ */
126
+ initialScrollIndex?: number | null | undefined;
127
+ /**
128
+ * Reverses the direction of scroll. Uses scale transforms of -1.
129
+ */
130
+ inverted?: boolean | null | undefined;
131
+ /**
132
+ * Used to extract a unique key for a given item at the specified index.
133
+ * Key is used for optimizing performance. Defining `keyExtractor` is also necessary
134
+ * when doing [layout animations](https://flash-list.docs.shopify.io/guides/layout-animation)
135
+ * to uniquely identify animated components.
136
+ */
137
+ keyExtractor?: ((item: TItem, index: number) => string) | undefined;
138
+ /**
139
+ * Multiple columns can only be rendered with `horizontal={false}` and will zig-zag like a `flexWrap` layout.
140
+ * Items should all be the same height - masonry layouts are not supported.
141
+ */
142
+ numColumns?: number | undefined;
143
+ /**
144
+ * Computes blank space that is visible to the user during scroll or list load. If list doesn't have enough items to fill the screen even then this will be raised.
145
+ * Values reported: {
146
+ * offsetStart -> visible blank space on top of the screen (while going up). If value is greater than 0 then it's visible to user.
147
+ * offsetEnd -> visible blank space at the end of the screen (while going down). If value is greater than 0 then it's visible to user.
148
+ * blankArea -> max(offsetStart, offsetEnd) use this directly and look for values > 0
149
+ * }
150
+ * Please note that this event isn't synced with onScroll event but works with native onDraw/layoutSubviews. Events with values > 0 are blanks.
151
+ * This event is raised even when there is no visible blank with negative values for extensibility however, for most use cases check blankArea > 0 and use the value.
152
+ */
153
+ onBlankArea?: BlankAreaEventHandler;
154
+ /**
155
+ * Called once when the scroll position gets within onEndReachedThreshold of the rendered content.
156
+ */
157
+ onEndReached?: (() => void) | null | undefined;
158
+ /**
159
+ * How far from the end (in units of visible length of the list) the bottom edge of the
160
+ * list must be from the end of the content to trigger the `onEndReached` callback.
161
+ * Thus a value of 0.5 will trigger `onEndReached` when the end of the content is
162
+ * within half the visible length of the list.
163
+ */
164
+ onEndReachedThreshold?: number | null | undefined;
165
+ /**
166
+ * This event is raised once the list has drawn items on the screen. It also reports @param elapsedTimeInMs which is the time it took to draw the items.
167
+ * This is required because FlashList doesn't render items in the first cycle. Items are drawn after it measures itself at the end of first render.
168
+ * If you're using ListEmptyComponent, this event is raised as soon as ListEmptyComponent is rendered.
169
+ */
170
+ onLoad?: (info: {
171
+ elapsedTimeInMs: number;
172
+ }) => void;
173
+ /**
174
+ * Called when the viewability of rows changes, as defined by the `viewabilityConfig` prop.
175
+ * Array of `changed` includes `ViewToken`s that both visible and non-visible items. You can use the `isViewable` flag to filter the items.
176
+ *
177
+ * If you are tracking the time a view becomes (non-)visible, use the `timestamp` property.
178
+ * We make no guarantees that in the future viewability callbacks will be invoked as soon as they happen - for example,
179
+ * they might be deferred until JS thread is less busy.
180
+ */
181
+ onViewableItemsChanged?: ((info: {
182
+ viewableItems: ViewToken[];
183
+ changed: ViewToken[];
184
+ }) => void) | null | undefined;
185
+ /**
186
+ * If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality.
187
+ * Make sure to also set the refreshing prop correctly.
188
+ */
189
+ onRefresh?: (() => void) | null | undefined;
190
+ /**
191
+ * Allows developers to override type of items. This will improve recycling if you have different types of items in the list
192
+ * Right type will be used for the right item. Default type is 0
193
+ * If you don't want to change for an indexes just return undefined.
194
+ * Performance: This method is called very frequently. Keep it fast.
195
+ */
196
+ getItemType?: (item: TItem, index: number, extraData?: any) => string | number | undefined;
197
+ /**
198
+ * This method can be used to provide explicit size estimates or change column span of an item.
199
+ *
200
+ * Providing specific estimates is a good idea when you can calculate sizes reliably. FlashList will prefer this value over `estimatedItemSize` for that specific item.
201
+ * Precise estimates will also improve precision of `scrollToIndex` method and `initialScrollIndex` prop. If you have a `separator` below your items you can include its size in the estimate.
202
+ *
203
+ * Changing item span is useful when you have grid layouts (numColumns > 1) and you want few items to be bigger than the rest.
204
+ *
205
+ * Modify the given layout. Do not return. FlashList will fallback to default values if this is ignored.
206
+ *
207
+ * Performance: This method is called very frequently. Keep it fast.
208
+ */
209
+ overrideItemLayout?: (layout: {
210
+ span?: number;
211
+ size?: number;
212
+ }, item: TItem, index: number, maxColumns: number, extraData?: any) => void;
213
+ /**
214
+ * For debugging and exception use cases, internal props will be overriden with these values if used
215
+ */
216
+ overrideProps?: object;
217
+ /**
218
+ * Set this when offset is needed for the loading indicator to show correctly.
219
+ * @platform android
220
+ */
221
+ progressViewOffset?: number | undefined;
222
+ /**
223
+ * Set this true while waiting for new data from a refresh.
224
+ */
225
+ refreshing?: boolean | null | undefined;
226
+ /**
227
+ * `viewabilityConfig` is a default configuration for determining whether items are viewable.
228
+ *
229
+ * Changing viewabilityConfig on the fly is not supported.
230
+ */
231
+ viewabilityConfig?: ViewabilityConfig | null | undefined;
232
+ /**
233
+ * List of `ViewabilityConfig`/`onViewableItemsChanged` pairs.
234
+ * A specific `onViewableItemsChanged` will be called when its corresponding `ViewabilityConfig`'s conditions are met.
235
+ */
236
+ viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs | undefined;
237
+ /**
238
+ * FlashList attempts to measure size of horizontal lists by drawing an extra list item in advance. This can sometimes cause issues when used with `initialScrollIndex` in lists
239
+ * with very little content. You might see some amount of over scroll. When set to true the list's rendered size needs to be deterministic (i.e., height and width greater than 0)
240
+ * as FlashList will skip rendering the extra item for measurement. Default value is `false`.
241
+ */
242
+ disableHorizontalListHeightMeasurement?: boolean;
243
+ /**
244
+ * FlashList applies some fixes to layouts of its children which can conflict with custom `CellRendererComponent`
245
+ * implementations. You can disable this behavior by setting this to `true`.
246
+ * Recommendation: Set this to `true` while you apply special behavior to the `CellRendererComponent`. Once done set this to
247
+ * `false` again.
248
+ */
249
+ disableAutoLayout?: boolean;
250
+ }
251
+ //# sourceMappingURL=FlashListProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlashListProps.d.ts","sourceRoot":"","sources":["../src/FlashListProps.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT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AE,MAAM,CAAC;IAEvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;IAExC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAEzD;;;OAGG;IACH,8BAA8B,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IAE5E;;;;OAIG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;IAEjD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FlashListProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlashListProps.js","sourceRoot":"","sources":["../src/FlashListProps.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import { Dimension, GridLayoutProvider, Layout, LayoutManager } from "recyclerlistview";
2
+ import { FlashListProps } from "./FlashListProps";
3
+ export default class GridLayoutProviderWithProps<T> extends GridLayoutProvider {
4
+ private props;
5
+ private layoutObject;
6
+ private averageWindow;
7
+ defaultEstimatedItemSize: number;
8
+ constructor(maxSpan: number, getLayoutType: (index: number, props: FlashListProps<T>, mutableLayout: {
9
+ span?: number;
10
+ size?: number;
11
+ }) => string | number, getSpan: (index: number, props: FlashListProps<T>, mutableLayout: {
12
+ span?: number;
13
+ size?: number;
14
+ }) => number, getHeightOrWidth: (index: number, props: FlashListProps<T>, mutableLayout: {
15
+ span?: number;
16
+ size?: number;
17
+ }) => number | undefined, props: FlashListProps<T>, acceptableRelayoutDelta?: number);
18
+ updateProps(props: FlashListProps<T>): void;
19
+ /**
20
+ * Calling this method will help the layout provider track average item sizes on its own
21
+ * Overriding layout manager can help achieve the same thing without relying on this method being called however, it will make implementation very complex for a simple use case
22
+ * @param index Index of the item being reported
23
+ */
24
+ reportItemLayout(index: number): void;
25
+ get averageItemSize(): number;
26
+ newLayoutManager(renderWindowSize: Dimension, isHorizontal?: boolean, cachedLayouts?: Layout[]): LayoutManager;
27
+ private updateCachedDimensions;
28
+ private getCleanLayoutObj;
29
+ }
30
+ //# sourceMappingURL=GridLayoutProviderWithProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridLayoutProviderWithProps.d.ts","sourceRoot":"","sources":["../src/GridLayoutProviderWithProps.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,2BAA2B,CAAC,CAAC,CAAE,SAAQ,kBAAkB;IAC5E,OAAO,CAAC,KAAK,CAAoB;IACjC,OAAO,CAAC,YAAY,CAAwC;IAE5D,OAAO,CAAC,aAAa,CAAgB;IAC9B,wBAAwB,SAAO;gBAGpC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,CACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EACxB,aAAa,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5C,MAAM,GAAG,MAAM,EACpB,OAAO,EAAE,CACP,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EACxB,aAAa,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5C,MAAM,EACX,gBAAgB,EAAE,CAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EACxB,aAAa,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAC5C,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EACxB,uBAAuB,CAAC,EAAE,MAAM;IA0B3B,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;IAI3C;;;;OAIG;IACI,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAYrC,IAAW,eAAe,WAEzB;IAEM,gBAAgB,CACrB,gBAAgB,EAAE,SAAS,EAC3B,YAAY,CAAC,EAAE,OAAO,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,aAAa;IA0BhB,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,iBAAiB;CAK1B"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var recyclerlistview_1 = require("recyclerlistview");
5
+ var AverageWindow_1 = require("./utils/AverageWindow");
6
+ var GridLayoutProviderWithProps = /** @class */ (function (_super) {
7
+ tslib_1.__extends(GridLayoutProviderWithProps, _super);
8
+ function GridLayoutProviderWithProps(maxSpan, getLayoutType, getSpan, getHeightOrWidth, props, acceptableRelayoutDelta) {
9
+ var _this = this;
10
+ var _a;
11
+ _this = _super.call(this, maxSpan, function (i) {
12
+ return getLayoutType(i, _this.props, _this.getCleanLayoutObj());
13
+ }, function (i) {
14
+ return getSpan(i, _this.props, _this.getCleanLayoutObj());
15
+ }, function (i) {
16
+ var _a;
17
+ return (
18
+ // Using average item size if no override has been provided by the developer
19
+ (_a = getHeightOrWidth(i, _this.props, _this.getCleanLayoutObj())) !== null && _a !== void 0 ? _a : _this.averageItemSize);
20
+ }, acceptableRelayoutDelta) || this;
21
+ _this.layoutObject = { span: undefined, size: undefined };
22
+ _this.defaultEstimatedItemSize = 100;
23
+ _this.props = props;
24
+ _this.averageWindow = new AverageWindow_1.AverageWindow(1, (_a = props.estimatedItemSize) !== null && _a !== void 0 ? _a : _this.defaultEstimatedItemSize);
25
+ return _this;
26
+ }
27
+ GridLayoutProviderWithProps.prototype.updateProps = function (props) {
28
+ this.props = props;
29
+ };
30
+ /**
31
+ * Calling this method will help the layout provider track average item sizes on its own
32
+ * Overriding layout manager can help achieve the same thing without relying on this method being called however, it will make implementation very complex for a simple use case
33
+ * @param index Index of the item being reported
34
+ */
35
+ GridLayoutProviderWithProps.prototype.reportItemLayout = function (index) {
36
+ var _a;
37
+ var layout = (_a = this.getLayoutManager()) === null || _a === void 0 ? void 0 : _a.getLayouts()[index];
38
+ if (layout) {
39
+ // For the same index we can now return different estimates because average is updated in realtime
40
+ // Marking the layout as overridden will help layout manager avoid using the average after initial measurement
41
+ layout.isOverridden = true;
42
+ this.averageWindow.addValue(this.props.horizontal ? layout.width : layout.height);
43
+ }
44
+ };
45
+ Object.defineProperty(GridLayoutProviderWithProps.prototype, "averageItemSize", {
46
+ get: function () {
47
+ return this.averageWindow.currentValue;
48
+ },
49
+ enumerable: false,
50
+ configurable: true
51
+ });
52
+ GridLayoutProviderWithProps.prototype.newLayoutManager = function (renderWindowSize, isHorizontal, cachedLayouts) {
53
+ var _a;
54
+ // Average window is updated whenever a new layout manager is created. This is because old values are not relevant anymore.
55
+ var estimatedItemCount = Math.max(3, Math.round((this.props.horizontal
56
+ ? renderWindowSize.width
57
+ : renderWindowSize.height) /
58
+ ((_a = this.props.estimatedItemSize) !== null && _a !== void 0 ? _a : this.defaultEstimatedItemSize)));
59
+ this.averageWindow = new AverageWindow_1.AverageWindow(2 * (this.props.numColumns || 1) * estimatedItemCount, this.averageWindow.currentValue);
60
+ var newLayoutManager = _super.prototype.newLayoutManager.call(this, renderWindowSize, isHorizontal, cachedLayouts);
61
+ if (cachedLayouts) {
62
+ this.updateCachedDimensions(cachedLayouts, newLayoutManager);
63
+ }
64
+ return newLayoutManager;
65
+ };
66
+ GridLayoutProviderWithProps.prototype.updateCachedDimensions = function (cachedLayouts, layoutManager) {
67
+ var layoutCount = cachedLayouts.length;
68
+ for (var i = 0; i < layoutCount; i++) {
69
+ cachedLayouts[i] = tslib_1.__assign(tslib_1.__assign({}, cachedLayouts[i]), layoutManager.getStyleOverridesForIndex(i));
70
+ }
71
+ };
72
+ GridLayoutProviderWithProps.prototype.getCleanLayoutObj = function () {
73
+ this.layoutObject.size = undefined;
74
+ this.layoutObject.span = undefined;
75
+ return this.layoutObject;
76
+ };
77
+ return GridLayoutProviderWithProps;
78
+ }(recyclerlistview_1.GridLayoutProvider));
79
+ exports.default = GridLayoutProviderWithProps;
80
+ //# sourceMappingURL=GridLayoutProviderWithProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridLayoutProviderWithProps.js","sourceRoot":"","sources":["../src/GridLayoutProviderWithProps.ts"],"names":[],"mappings":";;;AAAA,qDAK0B;AAG1B,uDAAsD;AAEtD;IAA4D,uDAAkB;IAO5E,qCACE,OAAe,EACf,aAIoB,EACpB,OAIW,EACX,gBAIuB,EACvB,KAAwB,EACxB,uBAAgC;QAlBlC,iBA0CC;;gBAtBC,kBACE,OAAO,EACP,UAAC,CAAC;YACA,OAAO,aAAa,CAAC,CAAC,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChE,CAAC,EACD,UAAC,CAAC;YACA,OAAO,OAAO,CAAC,CAAC,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC1D,CAAC,EACD,UAAC,CAAC;;YACA,OAAO;YACL,4EAA4E;YAC5E,MAAA,gBAAgB,CAAC,CAAC,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,iBAAiB,EAAE,CAAC,mCACzD,KAAI,CAAC,eAAe,CACrB,CAAC;QACJ,CAAC,EACD,uBAAuB,CACxB;QAzCK,kBAAY,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAGrD,8BAAwB,GAAG,GAAG,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CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC,GAAG,kBAAkB,EACrD,IAAI,CAAC,aAAa,CAAC,YAAY,CAChC,CAAC;QACF,IAAM,gBAAgB,GAAG,iBAAM,gBAAgB,YAC7C,gBAAgB,EAChB,YAAY,EACZ,aAAa,CACd,CAAC;QACF,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,sBAAsB,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;SAC9D;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEO,4DAAsB,GAA9B,UACE,aAAuB,EACvB,aAA4B;QAE5B,IAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;YACpC,aAAa,CAAC,CAAC,CAAC,yCACX,aAAa,CAAC,CAAC,CAAC,GAGhB,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAC9C,CAAC;SACH;IACH,CAAC;IAEO,uDAAiB,GAAzB;QACE,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACH,kCAAC;AAAD,CAAC,AA9HD,CAA4D,qCAAkB,GA8H7E"}
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ export interface PureComponentWrapperProps {
3
+ renderer: (arg: unknown) => JSX.Element | null;
4
+ /** Renderer is called with this argument.
5
+ * Don't change this value everytime or else component will always rerender. Prefer primitives. */
6
+ arg?: unknown;
7
+ enabled?: boolean;
8
+ [other: string]: unknown;
9
+ }
10
+ /**
11
+ * Pure component wrapper that can be used to prevent renders of the `renderer` method passed to the component. Any change in props will lead to `renderer` getting called.
12
+ */
13
+ export declare class PureComponentWrapper extends React.PureComponent<PureComponentWrapperProps> {
14
+ static defaultProps: {
15
+ enabled: boolean;
16
+ };
17
+ private overrideEnabled;
18
+ /** Once set explicitly, prop will be ignored. Not using state because of performance reasons. */
19
+ setEnabled(enabled: boolean): void;
20
+ render(): JSX.Element | null;
21
+ }
22
+ //# sourceMappingURL=PureComponentWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PureComponentWrapper.d.ts","sourceRoot":"","sources":["../src/PureComponentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IAE/C;sGACkG;IAClG,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK,CAAC,aAAa,CAAC,yBAAyB,CAAC;IACtF,MAAM,CAAC,YAAY;;MAEjB;IAEF,OAAO,CAAC,eAAe,CAAkC;IAEzD,iGAAiG;IAC1F,UAAU,CAAC,OAAO,EAAE,OAAO;IAOlC,MAAM;CAWP"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PureComponentWrapper = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = tslib_1.__importDefault(require("react"));
6
+ /**
7
+ * Pure component wrapper that can be used to prevent renders of the `renderer` method passed to the component. Any change in props will lead to `renderer` getting called.
8
+ */
9
+ var PureComponentWrapper = /** @class */ (function (_super) {
10
+ tslib_1.__extends(PureComponentWrapper, _super);
11
+ function PureComponentWrapper() {
12
+ var _this = _super !== null && _super.apply(this, arguments) || this;
13
+ _this.overrideEnabled = undefined;
14
+ return _this;
15
+ }
16
+ /** Once set explicitly, prop will be ignored. Not using state because of performance reasons. */
17
+ PureComponentWrapper.prototype.setEnabled = function (enabled) {
18
+ if (enabled !== this.overrideEnabled) {
19
+ this.overrideEnabled = enabled;
20
+ this.forceUpdate();
21
+ }
22
+ };
23
+ PureComponentWrapper.prototype.render = function () {
24
+ if (this.overrideEnabled === undefined) {
25
+ return ((this.props.enabled && this.props.renderer(this.props.arg)) || null);
26
+ }
27
+ else {
28
+ return ((this.overrideEnabled && this.props.renderer(this.props.arg)) || null);
29
+ }
30
+ };
31
+ PureComponentWrapper.defaultProps = {
32
+ enabled: true,
33
+ };
34
+ return PureComponentWrapper;
35
+ }(react_1.default.PureComponent));
36
+ exports.PureComponentWrapper = PureComponentWrapper;
37
+ //# sourceMappingURL=PureComponentWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PureComponentWrapper.js","sourceRoot":"","sources":["../src/PureComponentWrapper.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAY1B;;GAEG;AACH;IAA0C,gDAA8C;IAAxF;QAAA,qEA0BC;QArBS,qBAAe,GAAwB,SAAS,CAAC;;IAqB3D,CAAC;IAnBC,iGAAiG;IAC1F,yCAAU,GAAjB,UAAkB,OAAgB;QAChC,IAAI,OAAO,KAAK,IAAI,CAAC,eAAe,EAAE;YACpC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;YAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;IACH,CAAC;IAED,qCAAM,GAAN;QACE,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE;YACtC,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CACpE,CAAC;SACH;aAAM;YACL,OAAO,CACL,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CACtE,CAAC;SACH;IACH,CAAC;IAxBM,iCAAY,GAAG;QACpB,OAAO,EAAE,IAAI;KACd,CAAC;IAuBJ,2BAAC;CAAA,AA1BD,CAA0C,eAAK,CAAC,aAAa,GA0B5D;AA1BY,oDAAoB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AverageWindow.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AverageWindow.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/AverageWindow.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var AverageWindow_1 = require("../utils/AverageWindow");
4
+ describe("AverageWindow", function () {
5
+ var fillAverageWindow = function (averageWindow, from, to) {
6
+ for (var i = from; i < to; i++) {
7
+ averageWindow.addValue(i);
8
+ }
9
+ };
10
+ it("all input window values should be filled with correct values", function () {
11
+ var commonValue = 50;
12
+ var size = 100;
13
+ var averageWindow = new AverageWindow_1.AverageWindow(size);
14
+ var inputValues = averageWindow["inputValues"];
15
+ for (var i = 0; i < size; i++) {
16
+ averageWindow.addValue(commonValue);
17
+ }
18
+ expect(Math.round(averageWindow.currentValue)).toBe(commonValue);
19
+ expect(inputValues.every(function (val) { return val === commonValue; })).toBe(true);
20
+ });
21
+ it("computes correct average", function () {
22
+ // We're gonna check if average from internal array matches the current average value
23
+ var size = 100;
24
+ var averageWindow = new AverageWindow_1.AverageWindow(size);
25
+ var inputValues = averageWindow["inputValues"];
26
+ fillAverageWindow(averageWindow, 0, 200);
27
+ // calculate average directly
28
+ var reduceObj = inputValues.reduce(function (obj, val) {
29
+ if (val !== undefined) {
30
+ obj.sum += val;
31
+ obj.count++;
32
+ }
33
+ return obj;
34
+ }, { sum: 0, count: 0 });
35
+ // running average could be different by few decimal points so floor is required
36
+ expect(Math.floor(averageWindow.currentValue)).toBe(Math.floor(reduceObj.sum / reduceObj.count));
37
+ });
38
+ it("should prioritize new values quickly", function () {
39
+ var size = 30;
40
+ var averageWindow = new AverageWindow_1.AverageWindow(size);
41
+ fillAverageWindow(averageWindow, 0, 100);
42
+ expect(averageWindow.currentValue).toBeGreaterThan(70);
43
+ fillAverageWindow(averageWindow, 0, 30);
44
+ expect(averageWindow.currentValue).toBeLessThan(30);
45
+ });
46
+ it("reports initial average correctly", function () {
47
+ var size = 30;
48
+ var averageWindow = new AverageWindow_1.AverageWindow(size, 25);
49
+ expect(averageWindow.currentValue).toBe(25);
50
+ });
51
+ it("updates initial average correctly", function () {
52
+ var size = 30;
53
+ var averageWindow = new AverageWindow_1.AverageWindow(size, 10);
54
+ averageWindow.addValue(20);
55
+ expect(averageWindow.currentValue).toBe(15);
56
+ });
57
+ it("increments next index correctly", function () {
58
+ var size = 30;
59
+ var averageWindow = new AverageWindow_1.AverageWindow(size);
60
+ for (var i = 0; i < 300; i++) {
61
+ expect(averageWindow["getNextIndex"]()).toBe(i % size);
62
+ }
63
+ var averageWindow2 = new AverageWindow_1.AverageWindow(size, 1);
64
+ for (var i = 1; i < 300; i++) {
65
+ expect(averageWindow2["getNextIndex"]()).toBe(i % size);
66
+ }
67
+ });
68
+ });
69
+ //# sourceMappingURL=AverageWindow.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AverageWindow.test.js","sourceRoot":"","sources":["../../src/__tests__/AverageWindow.test.ts"],"names":[],"mappings":";;AAAA,wDAAuD;AAEvD,QAAQ,CAAC,eAAe,EAAE;IACxB,IAAM,iBAAiB,GAAG,UACxB,aAA4B,EAC5B,IAAY,EACZ,EAAU;QAEV,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;YAC9B,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SAC3B;IACH,CAAC,CAAC;IACF,EAAE,CAAC,8DAA8D,EAAE;QACjE,IAAM,WAAW,GAAG,EAAE,CAAC;QACvB,IAA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KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC5B,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;SACxD;QACD,IAAM,cAAc,GAAG,IAAI,6BAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC5B,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;SACzD;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import "@quilted/react-testing/matchers";
2
+ //# sourceMappingURL=FlashList.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlashList.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/FlashList.test.tsx"],"names":[],"mappings":"AAEA,OAAO,iCAAiC,CAAC"}