gifted-charts-core 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -4,6 +4,7 @@ import {
4
4
  BarAndLineChartsWrapperTypes,
5
5
  horizSectionPropTypes,
6
6
  } from "../../utils/types";
7
+ import { I18nManager } from "react-native";
7
8
 
8
9
  export const useBarAndLineChartsWrapper = (
9
10
  props: BarAndLineChartsWrapperTypes
@@ -317,18 +318,25 @@ export const useBarAndLineChartsWrapper = (
317
318
  const [canMomentum, setCanMomentum] = useState(false);
318
319
 
319
320
  const isCloseToEnd = ({ layoutMeasurement, contentOffset, contentSize }) => {
320
- return (
321
- layoutMeasurement.width + contentOffset.x >=
322
- contentSize.width - initialSpacing - endReachedOffset
323
- );
321
+ return I18nManager.isRTL
322
+ ? contentOffset.x <= initialSpacing
323
+ : layoutMeasurement.width + contentOffset.x >=
324
+ contentSize.width - initialSpacing - endReachedOffset;
324
325
  };
325
326
 
326
327
  // const isCloseToStart = ({ layoutMeasurement, contentOffset }) => {
327
328
  // return layoutMeasurement.width + contentOffset.x <= initialSpacing;
328
329
  // };
329
330
 
330
- const isCloseToStart = ({ contentOffset }) => {
331
- return contentOffset.x <= initialSpacing;
331
+ const isCloseToStart = ({
332
+ layoutMeasurement,
333
+ contentOffset,
334
+ contentSize,
335
+ }) => {
336
+ return I18nManager.isRTL
337
+ ? layoutMeasurement.width + contentOffset.x >=
338
+ contentSize.width - initialSpacing - endReachedOffset
339
+ : contentOffset.x <= initialSpacing;
332
340
  };
333
341
 
334
342
  useEffect(() => {