@ledgerhq/native-ui 0.57.0 → 0.58.0-nightly.20260228025221
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.
|
@@ -16,7 +16,7 @@ export type SlidesProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
as?: React.ComponentType<any>;
|
|
18
18
|
testID?: string;
|
|
19
|
-
} & Omit<FlatListProps<React.ReactElement>, "data" | "renderItem" | "
|
|
19
|
+
} & Omit<FlatListProps<React.ReactElement>, "data" | "renderItem" | "horizontal" | "pagingEnabled" | "onScroll" | "onMomentumScrollEnd" | "initialScrollIndex" | "onViewableItemsChanged">;
|
|
20
20
|
export declare function Slides({ children, onSlideChange, initialSlideIndex, style, testID, as, ...flatListProps }: SlidesProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=Slides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slides.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Slides/Slides.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAKL,SAAS,EACT,aAAa,EACd,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMtD,KAAK,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,wBAAwB,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC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M,EACN,EAAqB,EACrB,GAAG,aAAa,EACjB,EAAE,WAAW,2CA6Kb"}
|
|
@@ -58,9 +58,6 @@ export function Slides({ children, onSlideChange, initialSlideIndex = 0, style,
|
|
|
58
58
|
const newIndex = Math.round(offsetX / width);
|
|
59
59
|
if (newIndex !== currentIndex) {
|
|
60
60
|
scheduleOnRN(setCurrentIndex, newIndex);
|
|
61
|
-
if (onSlideChange) {
|
|
62
|
-
scheduleOnRN(onSlideChange, newIndex);
|
|
63
|
-
}
|
|
64
61
|
}
|
|
65
62
|
},
|
|
66
63
|
});
|
|
@@ -81,13 +78,21 @@ export function Slides({ children, onSlideChange, initialSlideIndex = 0, style,
|
|
|
81
78
|
flatListRef,
|
|
82
79
|
scrollProgressSharedValue,
|
|
83
80
|
}), [currentIndex, totalSlides, goToNext, goToPrevious, goToSlide]);
|
|
81
|
+
const onViewableItemsChanged = useCallback(({ viewableItems, }) => {
|
|
82
|
+
const items = viewableItems.filter((item) => item.isViewable);
|
|
83
|
+
// Since it's a horizontal scroll view, and we display one by one, we only want to trigger the onSlideChange event when one item is visible.
|
|
84
|
+
if (items.length === 1) {
|
|
85
|
+
const index = items[0].index;
|
|
86
|
+
onSlideChange?.(index);
|
|
87
|
+
}
|
|
88
|
+
}, [onSlideChange]);
|
|
84
89
|
const renderOrderedChildren = useCallback(() => {
|
|
85
90
|
return React.Children.map(children, (child) => {
|
|
86
91
|
if (isElementOfType(child, Content)) {
|
|
87
92
|
if (width <= 0) {
|
|
88
93
|
return null;
|
|
89
94
|
}
|
|
90
|
-
return (_jsx(ListComponent, { ref: flatListRef, data: slideChildren, renderItem: renderItem, keyExtractor: (_, index) => `slide-${index}`, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: scrollHandler, scrollEventThrottle: 16, getItemLayout: getItemLayout, initialScrollIndex: initialSlideIndex, ...flatListProps }, "slides-content"));
|
|
95
|
+
return (_jsx(ListComponent, { ref: flatListRef, data: slideChildren, renderItem: renderItem, keyExtractor: (_, index) => `slide-${index}`, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: scrollHandler, scrollEventThrottle: 16, getItemLayout: getItemLayout, initialScrollIndex: initialSlideIndex, onViewableItemsChanged: onViewableItemsChanged, ...flatListProps }, "slides-content"));
|
|
91
96
|
}
|
|
92
97
|
if (isElementOfType(child, Footer) || isElementOfType(child, ProgressIndicator)) {
|
|
93
98
|
return child;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0-nightly.20260228025221",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"rn-range-slider": "2.1.1",
|
|
42
42
|
"styled-system": "5.1.5",
|
|
43
43
|
"stylis": "4.0.0",
|
|
44
|
-
"@ledgerhq/icons-ui": "^0.
|
|
44
|
+
"@ledgerhq/icons-ui": "^0.20.0-nightly.20260228025221",
|
|
45
45
|
"@ledgerhq/ui-shared": "^0.5.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|