@shopify/flash-list 1.4.1 → 1.4.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 (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt +28 -22
  3. package/android/src/test/java/com/shopify/reactnative/flash_list/AutoLayoutShadowTest.kt +10 -9
  4. package/android/src/test/java/com/shopify/reactnative/flash_list/models/Rect.kt +3 -1
  5. package/android/src/test/resources/LayoutTestData.json +160 -80
  6. package/dist/FlashList.d.ts.map +1 -1
  7. package/dist/FlashList.js +1 -1
  8. package/dist/FlashList.js.map +1 -1
  9. package/dist/FlashListProps.d.ts +1 -0
  10. package/dist/FlashListProps.d.ts.map +1 -1
  11. package/dist/native/config/PlatformHelper.android.d.ts +5 -0
  12. package/dist/native/config/PlatformHelper.android.d.ts.map +1 -1
  13. package/dist/native/config/PlatformHelper.android.js +2 -0
  14. package/dist/native/config/PlatformHelper.android.js.map +1 -1
  15. package/dist/native/config/PlatformHelper.d.ts +5 -0
  16. package/dist/native/config/PlatformHelper.d.ts.map +1 -1
  17. package/dist/native/config/PlatformHelper.ios.d.ts +5 -0
  18. package/dist/native/config/PlatformHelper.ios.d.ts.map +1 -1
  19. package/dist/native/config/PlatformHelper.ios.js +1 -0
  20. package/dist/native/config/PlatformHelper.ios.js.map +1 -1
  21. package/dist/native/config/PlatformHelper.js +1 -0
  22. package/dist/native/config/PlatformHelper.js.map +1 -1
  23. package/dist/native/config/PlatformHelper.web.d.ts +5 -0
  24. package/dist/native/config/PlatformHelper.web.d.ts.map +1 -1
  25. package/dist/native/config/PlatformHelper.web.js +1 -0
  26. package/dist/native/config/PlatformHelper.web.js.map +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/ios/Sources/AutoLayoutView.swift +27 -22
  29. package/package.json +2 -2
  30. package/src/FlashList.tsx +1 -1
  31. package/src/FlashListProps.ts +1 -0
  32. package/src/native/config/PlatformHelper.android.ts +2 -0
  33. package/src/native/config/PlatformHelper.ios.ts +1 -0
  34. package/src/native/config/PlatformHelper.ts +1 -0
  35. package/src/native/config/PlatformHelper.web.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/flash-list",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "keywords": [
5
5
  "react-native",
6
6
  "recyclerview",
@@ -28,7 +28,7 @@
28
28
  "main": "dist/index.js",
29
29
  "types": "dist/index.d.ts",
30
30
  "scripts": {
31
- "up": "bundle install && yarn fixture-up && yarn e2e-up && yarn build && yarn fixture-web-up",
31
+ "up": "bundle install && yarn fixture-up && yarn e2e-up && yarn build",
32
32
  "fixture-web-up": "cd fixture/web-app && yarn && cd ../../",
33
33
  "fixture-up": "cd fixture && yarn && cd ios && bundle exec pod install && cd ../../",
34
34
  "e2e-up": "cd fixture/ios && brew tap wix/brew && brew install applesimutils && cd ../../",
package/src/FlashList.tsx CHANGED
@@ -69,7 +69,7 @@ class FlashList<T> extends React.PureComponent<
69
69
  private rlvRef?: RecyclerListView<RecyclerListViewProps, any>;
70
70
  private stickyContentContainerRef?: PureComponentWrapper;
71
71
  private listFixedDimensionSize = 0;
72
- private transformStyle = { transform: [{ scaleY: -1 }] };
72
+ private transformStyle = PlatformConfig.invertedTransformStyle;
73
73
  private transformStyleHorizontal = { transform: [{ scaleX: -1 }] };
74
74
  private distanceFromWindow = 0;
75
75
  private contentStyle: ContentStyleExplicit = {
@@ -56,6 +56,7 @@ export interface FlashListProps<TItem> extends ScrollViewProps {
56
56
  * );
57
57
  * ...
58
58
  * <FlashList data={[{title: 'Title Text', key: 'item1'}]} renderItem={renderItem} />
59
+ * ```
59
60
  *
60
61
  * Provides additional metadata like `index`
61
62
  *
@@ -2,6 +2,8 @@ import { BaseItemAnimator } from "recyclerlistview";
2
2
 
3
3
  const PlatformConfig = {
4
4
  defaultDrawDistance: 250,
5
+ // Using rotate instead of scaleY on Android to avoid performance issues. Issue: https://github.com/Shopify/flash-list/issues/751
6
+ invertedTransformStyle: { transform: [{ rotate: "180deg" }] },
5
7
  };
6
8
  const getCellContainerPlatformStyles = (
7
9
  inverted: boolean,
@@ -2,6 +2,7 @@ import { BaseItemAnimator } from "recyclerlistview";
2
2
 
3
3
  const PlatformConfig = {
4
4
  defaultDrawDistance: 250,
5
+ invertedTransformStyle: { transform: [{ scaleY: -1 }] },
5
6
  };
6
7
  const getCellContainerPlatformStyles = (
7
8
  inverted: boolean,
@@ -3,6 +3,7 @@ import { DefaultJSItemAnimator } from "recyclerlistview/dist/reactnative/platfor
3
3
 
4
4
  const PlatformConfig = {
5
5
  defaultDrawDistance: 250,
6
+ invertedTransformStyle: { transform: [{ scaleY: -1 }] },
6
7
  };
7
8
  const getCellContainerPlatformStyles = (
8
9
  inverted: boolean,
@@ -5,6 +5,7 @@ import { DefaultJSItemAnimator } from "recyclerlistview/dist/reactnative/platfor
5
5
 
6
6
  const PlatformConfig = {
7
7
  defaultDrawDistance: 2000,
8
+ invertedTransformStyle: { transform: [{ scaleY: -1 }] },
8
9
  };
9
10
  const getCellContainerPlatformStyles = (
10
11
  inverted: boolean,