decathlon-ui 0.2.2 → 0.2.4

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 (172) hide show
  1. package/dist/components/accordion/accordion.component.d.ts +1 -1
  2. package/dist/components/accordion/accordion.component.d.ts.map +1 -1
  3. package/dist/components/accordion/accordion.component.js +5 -15
  4. package/dist/components/action-button/action-button.component.d.ts +1 -1
  5. package/dist/components/action-button/action-button.component.d.ts.map +1 -1
  6. package/dist/components/action-button/action-button.component.js +7 -8
  7. package/dist/components/badge/badge.component.d.ts +2 -5
  8. package/dist/components/badge/badge.component.d.ts.map +1 -1
  9. package/dist/components/badge/badge.component.js +4 -1
  10. package/dist/components/badge/index.d.ts +1 -1
  11. package/dist/components/badge/index.d.ts.map +1 -1
  12. package/dist/components/banner-carousel/banner-carousel.component.d.ts +5 -0
  13. package/dist/components/banner-carousel/banner-carousel.component.d.ts.map +1 -0
  14. package/dist/components/banner-carousel/banner-carousel.component.js +68 -0
  15. package/dist/components/banner-carousel/banner-carousel.styles.d.ts +17 -0
  16. package/dist/components/banner-carousel/banner-carousel.styles.d.ts.map +1 -0
  17. package/dist/components/banner-carousel/banner-carousel.styles.js +20 -0
  18. package/dist/components/banner-carousel/banner-carousel.types.d.ts +11 -0
  19. package/dist/components/banner-carousel/banner-carousel.types.d.ts.map +1 -0
  20. package/dist/components/banner-carousel/banner-carousel.types.js +1 -0
  21. package/dist/components/banner-carousel/index.d.ts +3 -0
  22. package/dist/components/banner-carousel/index.d.ts.map +1 -0
  23. package/dist/components/banner-carousel/index.js +1 -0
  24. package/dist/components/button/button.component.d.ts +1 -1
  25. package/dist/components/button/button.component.d.ts.map +1 -1
  26. package/dist/components/button/button.component.js +7 -3
  27. package/dist/components/card/card.component.d.ts +1 -1
  28. package/dist/components/card/card.component.d.ts.map +1 -1
  29. package/dist/components/card/card.component.js +4 -1
  30. package/dist/components/cashback-banner/cashback-banner.component.d.ts +1 -1
  31. package/dist/components/cashback-banner/cashback-banner.component.d.ts.map +1 -1
  32. package/dist/components/cashback-banner/cashback-banner.component.js +4 -1
  33. package/dist/components/category-item/category-item.component.d.ts +1 -4
  34. package/dist/components/category-item/category-item.component.d.ts.map +1 -1
  35. package/dist/components/category-item/category-item.component.js +9 -7
  36. package/dist/components/category-item/category-item.styles.d.ts +2 -2
  37. package/dist/components/category-item/category-item.styles.js +2 -2
  38. package/dist/components/category-item/category-item.types.d.ts +2 -2
  39. package/dist/components/category-item/category-item.types.d.ts.map +1 -1
  40. package/dist/components/checkbox/checkbox.component.d.ts +1 -1
  41. package/dist/components/checkbox/checkbox.component.d.ts.map +1 -1
  42. package/dist/components/checkbox/checkbox.component.js +3 -1
  43. package/dist/components/event-card/event-card.component.d.ts +4 -0
  44. package/dist/components/event-card/event-card.component.d.ts.map +1 -0
  45. package/dist/components/event-card/event-card.component.js +23 -0
  46. package/dist/components/event-card/event-card.styles.d.ts +15 -0
  47. package/dist/components/event-card/event-card.styles.d.ts.map +1 -0
  48. package/dist/components/event-card/event-card.styles.js +62 -0
  49. package/dist/components/event-card/event-card.types.d.ts +25 -0
  50. package/dist/components/event-card/event-card.types.d.ts.map +1 -0
  51. package/dist/components/event-card/event-card.types.js +1 -0
  52. package/dist/components/event-card/index.d.ts +3 -0
  53. package/dist/components/event-card/index.d.ts.map +1 -0
  54. package/dist/components/event-card/index.js +1 -0
  55. package/dist/components/filter-chip/filter-chip.component.d.ts +1 -4
  56. package/dist/components/filter-chip/filter-chip.component.d.ts.map +1 -1
  57. package/dist/components/filter-chip/filter-chip.component.js +4 -1
  58. package/dist/components/image-gallery/image-gallery.component.d.ts +3 -0
  59. package/dist/components/image-gallery/image-gallery.component.d.ts.map +1 -0
  60. package/dist/components/image-gallery/image-gallery.component.js +50 -0
  61. package/dist/components/image-gallery/image-gallery.styles.d.ts +58 -0
  62. package/dist/components/image-gallery/image-gallery.styles.d.ts.map +1 -0
  63. package/dist/components/image-gallery/image-gallery.styles.js +62 -0
  64. package/dist/components/image-gallery/image-gallery.types.d.ts +11 -0
  65. package/dist/components/image-gallery/image-gallery.types.d.ts.map +1 -0
  66. package/dist/components/image-gallery/image-gallery.types.js +1 -0
  67. package/dist/components/image-gallery/index.d.ts +2 -0
  68. package/dist/components/image-gallery/index.d.ts.map +1 -0
  69. package/dist/components/image-gallery/index.js +1 -0
  70. package/dist/components/image-viewing/components/image-default-header.d.ts +13 -0
  71. package/dist/components/image-viewing/components/image-default-header.d.ts.map +1 -0
  72. package/dist/components/image-viewing/components/image-default-header.js +27 -0
  73. package/dist/components/image-viewing/components/image-item/image-item.component.android.d.ts +14 -0
  74. package/dist/components/image-viewing/components/image-item/image-item.component.android.d.ts.map +1 -0
  75. package/dist/components/image-viewing/components/image-item/image-item.component.android.js +74 -0
  76. package/dist/components/image-viewing/components/image-item/image-item.component.d.ts +11 -0
  77. package/dist/components/image-viewing/components/image-item/image-item.component.d.ts.map +1 -0
  78. package/dist/components/image-viewing/components/image-item/image-item.component.ios.d.ts +14 -0
  79. package/dist/components/image-viewing/components/image-item/image-item.component.ios.d.ts.map +1 -0
  80. package/dist/components/image-viewing/components/image-item/image-item.component.ios.js +66 -0
  81. package/dist/components/image-viewing/components/image-item/image-item.component.js +5 -0
  82. package/dist/components/image-viewing/components/image-item/image-item.constants.d.ts +4 -0
  83. package/dist/components/image-viewing/components/image-item/image-item.constants.d.ts.map +1 -0
  84. package/dist/components/image-viewing/components/image-item/image-item.constants.js +5 -0
  85. package/dist/components/image-viewing/components/image-item/image-loading.component.d.ts +2 -0
  86. package/dist/components/image-viewing/components/image-item/image-loading.component.d.ts.map +1 -0
  87. package/dist/components/image-viewing/components/image-item/image-loading.component.js +14 -0
  88. package/dist/components/image-viewing/components/status-bar-manager.d.ts +6 -0
  89. package/dist/components/image-viewing/components/status-bar-manager.d.ts.map +1 -0
  90. package/dist/components/image-viewing/components/status-bar-manager.js +14 -0
  91. package/dist/components/image-viewing/hooks/index.d.ts +8 -0
  92. package/dist/components/image-viewing/hooks/index.d.ts.map +1 -0
  93. package/dist/components/image-viewing/hooks/index.js +7 -0
  94. package/dist/components/image-viewing/hooks/useAnimatedComponents.d.ts +19 -0
  95. package/dist/components/image-viewing/hooks/useAnimatedComponents.d.ts.map +1 -0
  96. package/dist/components/image-viewing/hooks/useAnimatedComponents.js +41 -0
  97. package/dist/components/image-viewing/hooks/useDoubleTapToZoom.d.ts +17 -0
  98. package/dist/components/image-viewing/hooks/useDoubleTapToZoom.d.ts.map +1 -0
  99. package/dist/components/image-viewing/hooks/useDoubleTapToZoom.js +49 -0
  100. package/dist/components/image-viewing/hooks/useImageDimensions.d.ts +11 -0
  101. package/dist/components/image-viewing/hooks/useImageDimensions.d.ts.map +1 -0
  102. package/dist/components/image-viewing/hooks/useImageDimensions.js +64 -0
  103. package/dist/components/image-viewing/hooks/useImageIndexChange.d.ts +12 -0
  104. package/dist/components/image-viewing/hooks/useImageIndexChange.d.ts.map +1 -0
  105. package/dist/components/image-viewing/hooks/useImageIndexChange.js +20 -0
  106. package/dist/components/image-viewing/hooks/useImagePrefetch.d.ts +11 -0
  107. package/dist/components/image-viewing/hooks/useImagePrefetch.d.ts.map +1 -0
  108. package/dist/components/image-viewing/hooks/useImagePrefetch.js +21 -0
  109. package/dist/components/image-viewing/hooks/usePanResponder.d.ts +20 -0
  110. package/dist/components/image-viewing/hooks/usePanResponder.d.ts.map +1 -0
  111. package/dist/components/image-viewing/hooks/usePanResponder.js +273 -0
  112. package/dist/components/image-viewing/hooks/useRequestClose.d.ts +10 -0
  113. package/dist/components/image-viewing/hooks/useRequestClose.d.ts.map +1 -0
  114. package/dist/components/image-viewing/hooks/useRequestClose.js +20 -0
  115. package/dist/components/image-viewing/image-viewing.component.d.ts +34 -0
  116. package/dist/components/image-viewing/image-viewing.component.d.ts.map +1 -0
  117. package/dist/components/image-viewing/image-viewing.component.js +74 -0
  118. package/dist/components/image-viewing/image-viewing.types.d.ts +11 -0
  119. package/dist/components/image-viewing/image-viewing.types.d.ts.map +1 -0
  120. package/dist/components/image-viewing/image-viewing.types.js +1 -0
  121. package/dist/components/image-viewing/util.d.ts +47 -0
  122. package/dist/components/image-viewing/util.d.ts.map +1 -0
  123. package/dist/components/image-viewing/util.js +99 -0
  124. package/dist/components/index.d.ts +3 -0
  125. package/dist/components/index.d.ts.map +1 -1
  126. package/dist/components/index.js +3 -0
  127. package/dist/components/input/input.component.d.ts +1 -1
  128. package/dist/components/input/input.component.d.ts.map +1 -1
  129. package/dist/components/input/input.component.js +3 -1
  130. package/dist/components/loading/loading.component.d.ts +1 -1
  131. package/dist/components/loading/loading.component.d.ts.map +1 -1
  132. package/dist/components/loading/loading.component.js +8 -4
  133. package/dist/components/order-card/order-card.component.d.ts +1 -1
  134. package/dist/components/order-card/order-card.component.d.ts.map +1 -1
  135. package/dist/components/order-card/order-card.component.js +4 -1
  136. package/dist/components/product-card/product-card.component.d.ts +1 -1
  137. package/dist/components/product-card/product-card.component.d.ts.map +1 -1
  138. package/dist/components/product-card/product-card.component.js +3 -1
  139. package/dist/components/product-card/product-card.types.d.ts +1 -1
  140. package/dist/components/product-card/product-card.types.d.ts.map +1 -1
  141. package/dist/components/product-highlight/product-highlight.component.d.ts +2 -2
  142. package/dist/components/product-highlight/product-highlight.component.d.ts.map +1 -1
  143. package/dist/components/product-highlight/product-highlight.component.js +7 -2
  144. package/dist/components/product-highlight/product-highlight.d.ts +1 -1
  145. package/dist/components/product-list-item/product-list-item.component.d.ts +1 -1
  146. package/dist/components/product-list-item/product-list-item.component.d.ts.map +1 -1
  147. package/dist/components/product-list-item/product-list-item.component.js +6 -3
  148. package/dist/components/product-review/product-review.component.d.ts +1 -1
  149. package/dist/components/product-review/product-review.component.d.ts.map +1 -1
  150. package/dist/components/product-review/product-review.component.js +6 -3
  151. package/dist/components/quick-add-product-card/quick-add-product-card.component.d.ts +1 -1
  152. package/dist/components/quick-add-product-card/quick-add-product-card.component.d.ts.map +1 -1
  153. package/dist/components/quick-add-product-card/quick-add-product-card.component.js +3 -1
  154. package/dist/components/radio/radio.component.d.ts +1 -1
  155. package/dist/components/radio/radio.component.d.ts.map +1 -1
  156. package/dist/components/radio/radio.component.js +3 -1
  157. package/dist/components/range-slider/range-slider.component.d.ts +1 -1
  158. package/dist/components/range-slider/range-slider.component.d.ts.map +1 -1
  159. package/dist/components/range-slider/range-slider.component.js +3 -1
  160. package/dist/components/search-button/search-button.component.d.ts +1 -1
  161. package/dist/components/search-button/search-button.component.d.ts.map +1 -1
  162. package/dist/components/search-button/search-button.component.js +4 -1
  163. package/dist/components/seller-box/seller-box.component.d.ts +1 -1
  164. package/dist/components/seller-box/seller-box.component.d.ts.map +1 -1
  165. package/dist/components/seller-box/seller-box.component.js +4 -1
  166. package/dist/components/toggle-switch/toggle-switch.component.d.ts +1 -1
  167. package/dist/components/toggle-switch/toggle-switch.component.d.ts.map +1 -1
  168. package/dist/components/toggle-switch/toggle-switch.component.js +3 -1
  169. package/dist/components/typography/typography.component.d.ts +1 -1
  170. package/dist/components/typography/typography.component.d.ts.map +1 -1
  171. package/dist/components/typography/typography.component.js +4 -1
  172. package/package.json +3 -1
@@ -0,0 +1,62 @@
1
+ import { useMemo } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import { useTheme } from "../../themes";
4
+ export const useEventCardStyles = () => {
5
+ const { colors, spacing, fonts, radius } = useTheme();
6
+ return useMemo(() => StyleSheet.create({
7
+ container: {
8
+ width: "auto",
9
+ alignSelf: "center",
10
+ },
11
+ card: {
12
+ width: "auto",
13
+ flexDirection: "row",
14
+ gap: spacing.md,
15
+ padding: spacing.md,
16
+ backgroundColor: colors.backgroundPage,
17
+ borderWidth: 1,
18
+ borderColor: colors.borderSecondary,
19
+ alignItems: "flex-start",
20
+ },
21
+ textContainer: {
22
+ flex: 1,
23
+ gap: spacing.md,
24
+ },
25
+ badge: {
26
+ backgroundColor: colors.blue3 || colors.backgroundAction1,
27
+ paddingVertical: spacing.xxxs,
28
+ paddingHorizontal: spacing.xs,
29
+ borderRadius: radius.xs,
30
+ alignSelf: "flex-start",
31
+ },
32
+ badgeText: {
33
+ fontSize: fonts.sizes.xxxs,
34
+ fontWeight: "600",
35
+ lineHeight: 18,
36
+ color: colors.white,
37
+ },
38
+ dateText: {
39
+ fontSize: fonts.sizes.xxs,
40
+ fontWeight: "500",
41
+ lineHeight: 18,
42
+ color: colors.textSecondary,
43
+ },
44
+ titleText: {
45
+ fontSize: fonts.sizes.xs,
46
+ fontWeight: "500",
47
+ lineHeight: 16.8,
48
+ color: colors.textPrimary,
49
+ },
50
+ placeText: {
51
+ fontSize: fonts.sizes.xxxs,
52
+ fontWeight: "400",
53
+ lineHeight: 18,
54
+ color: colors.textSecondary,
55
+ },
56
+ image: {
57
+ width: 120,
58
+ height: 120,
59
+ backgroundColor: colors.backgroundTertiary,
60
+ },
61
+ }), [colors, spacing, fonts, radius]);
62
+ };
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from "react";
2
+ import { ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from "react-native";
3
+ export interface EventCardProps {
4
+ /** Cidade ou local exibido no badge azul */
5
+ location: string;
6
+ /** Data e horário do evento (ex: "Sáb, 10 maio - 9h às 10h") */
7
+ dateTime: string;
8
+ /** Título do evento */
9
+ title: string;
10
+ /** Local do evento (ex: "Museu de Arte de São Paulo") */
11
+ place: string;
12
+ /** URL da imagem ou objeto `require()` */
13
+ imageSource?: ImageSourcePropType;
14
+ /** Componente React a ser renderizado no lugar da imagem (tem precedência sobre imageSource) */
15
+ renderImage?: ReactNode;
16
+ /** Callback ao pressionar o card */
17
+ onPress?: () => void;
18
+ /** Estilo customizado para o container externo */
19
+ style?: StyleProp<ViewStyle>;
20
+ /** Estilo customizado para textos */
21
+ textStyle?: StyleProp<TextStyle>;
22
+ /** Para testes automatizados */
23
+ testID?: string;
24
+ }
25
+ //# sourceMappingURL=event-card.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/event-card/event-card.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IAEjB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IAEjB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IAEd,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IAEd,0CAA0C;IAC1C,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAElC,gGAAgG;IAChG,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kDAAkD;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qCAAqC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjC,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { EventCard } from "./event-card.component";
2
+ export type { EventCardProps } from "./event-card.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/event-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export { EventCard } from "./event-card.component";
@@ -1,7 +1,4 @@
1
1
  import React from "react";
2
2
  import { FilterChipProps } from "./filter-chip.types";
3
- /**
4
- * Componente FilterChip usado para filtros com estados selecionado/não selecionado
5
- */
6
- export declare const FilterChip: React.FC<FilterChipProps>;
3
+ export declare const FilterChip: React.NamedExoticComponent<FilterChipProps>;
7
4
  //# sourceMappingURL=filter-chip.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter-chip.component.d.ts","sourceRoot":"","sources":["../../../src/components/filter-chip/filter-chip.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4DhD,CAAC"}
1
+ {"version":3,"file":"filter-chip.component.d.ts","sourceRoot":"","sources":["../../../src/components/filter-chip/filter-chip.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAmEtD,eAAO,MAAM,UAAU,6CAAkC,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Pressable, Text, View } from "react-native";
3
3
  import { PlusIcon, SlidersIcon, XIcon } from "../../icons";
4
+ import React from "react";
4
5
  import { useTheme } from "../../themes";
5
6
  import { useFilterChipStyles } from "./filter-chip.styles";
6
7
  /**
7
8
  * Componente FilterChip usado para filtros com estados selecionado/não selecionado
8
9
  */
9
- export const FilterChip = ({ label, selected = false, count, onPress, style, textStyle, }) => {
10
+ const FilterChipComponent = ({ label, selected = false, count, onPress, style, textStyle, }) => {
10
11
  const theme = useTheme();
11
12
  const styles = useFilterChipStyles(selected ? "selected" : "default");
12
13
  const renderContent = () => {
@@ -23,3 +24,5 @@ export const FilterChip = ({ label, selected = false, count, onPress, style, tex
23
24
  };
24
25
  return (_jsx(Pressable, { style: [styles.container, style], onPress: onPress, children: renderContent() }));
25
26
  };
27
+ export const FilterChip = React.memo(FilterChipComponent);
28
+ FilterChip.displayName = "FilterChip";
@@ -0,0 +1,3 @@
1
+ import { ImageGalleryProps } from './image-gallery.types';
2
+ export declare const ImageGallery: ({ images, flags }: ImageGalleryProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ //# sourceMappingURL=image-gallery.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-gallery.component.d.ts","sourceRoot":"","sources":["../../../src/components/image-gallery/image-gallery.component.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,eAAO,MAAM,YAAY,GAAI,mBAA6B,iBAAiB,mDA8H1E,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import { Image, Modal, ScrollView, Text, TouchableOpacity, useWindowDimensions, View, } from 'react-native';
4
+ import { PlusIcon, XIcon } from '../../icons';
5
+ import { Badge } from '../badge';
6
+ import EnhancedImageViewing from '../image-viewing/image-viewing.component';
7
+ import { useGalleryStyles } from './image-gallery.styles';
8
+ export const ImageGallery = ({ images = [], flags = [] }) => {
9
+ var _a, _b, _c;
10
+ if (!images || images.length === 0)
11
+ return null;
12
+ const [isGalleryOpen, setGalleryOpen] = useState(false);
13
+ const [isViewerOpen, setViewerOpen] = useState(false);
14
+ const [currentIndex, setCurrentIndex] = useState(0);
15
+ const openGallery = useCallback(() => setGalleryOpen(true), []);
16
+ const closeGallery = useCallback(() => setGalleryOpen(false), []);
17
+ const openImage = useCallback((index) => {
18
+ setCurrentIndex(index);
19
+ setViewerOpen(true);
20
+ }, []);
21
+ const closeImage = useCallback(() => setViewerOpen(false), []);
22
+ const { width } = useWindowDimensions();
23
+ const styles = useGalleryStyles();
24
+ const formattedImages = useMemo(() => images.map(({ imageUrl }) => ({ uri: imageUrl })), [images]);
25
+ // const renderFooter = () => (
26
+ // <View
27
+ // style={{
28
+ // bottom: bottom + 10,
29
+ // flexDirection: 'row',
30
+ // justifyContent: 'center',
31
+ // }}
32
+ // >
33
+ // <Text style={{ color: 'white', fontSize: 16, fontWeight: '600' }}>
34
+ // {currentIndex + 1}/{images.length}
35
+ // </Text>
36
+ // </View>
37
+ // );
38
+ return (_jsxs(_Fragment, { children: [_jsxs(Modal, { presentationStyle: "pageSheet", animationType: "slide", style: styles.modalContainer, visible: isGalleryOpen, onRequestClose: closeGallery, children: [_jsx(EnhancedImageViewing, { images: formattedImages, imageIndex: currentIndex,
39
+ // FooterComponent={renderFooter}
40
+ presentationStyle: "fullScreen", visible: isViewerOpen, onRequestClose: closeImage }), _jsx(View, { style: styles.closeModalButton, children: _jsx(TouchableOpacity, { onPress: closeGallery, children: _jsx(XIcon, {}) }) }), _jsx(ScrollView, { contentContainerStyle: {
41
+ flexDirection: 'row',
42
+ gap: 8,
43
+ padding: 8,
44
+ flexWrap: 'wrap',
45
+ justifyContent: 'space-between',
46
+ }, children: images.map((item, index) => (_jsx(TouchableOpacity, { onPress: () => openImage(index), style: {
47
+ width: index % 3 === 0 ? '100%' : width / 2.13,
48
+ height: index % 3 === 0 ? 378 : 178,
49
+ }, children: _jsx(Image, { source: { uri: item.imageUrl }, style: { flex: 1 }, resizeMode: "cover" }) }, item.imageUrl))) })] }), _jsxs(TouchableOpacity, { onPress: openGallery, style: styles.container, children: [_jsx(View, { style: styles.tagContainer, children: flags.map(({ value }, index) => (_jsx(Badge, { variant: "discount", size: "medium", text: value }, `${value}-${index}`))) }), _jsx(Image, { source: { uri: (_a = images[0]) === null || _a === void 0 ? void 0 : _a.imageUrl }, style: styles.largeImage, resizeMode: "cover" }), _jsxs(View, { style: styles.smallImagesContainer, children: [_jsxs(View, { style: styles.tagTotalPhotos, children: [_jsx(PlusIcon, {}), _jsxs(Text, { style: styles.tagTotalPhotosText, children: [images.length, " Fotos"] })] }), _jsx(Image, { source: { uri: (_b = images[1]) === null || _b === void 0 ? void 0 : _b.imageUrl }, style: styles.smallImage, resizeMode: "cover" }), _jsx(Image, { source: { uri: (_c = images[2]) === null || _c === void 0 ? void 0 : _c.imageUrl }, style: styles.smallImage, resizeMode: "cover" })] })] })] }));
50
+ };
@@ -0,0 +1,58 @@
1
+ export declare const useGalleryStyles: () => {
2
+ container: {
3
+ width: "100%";
4
+ };
5
+ largeImage: {
6
+ width: "100%";
7
+ height: number;
8
+ };
9
+ smallImagesContainer: {
10
+ flexDirection: "row";
11
+ justifyContent: "space-between";
12
+ };
13
+ smallImage: {
14
+ width: "50%";
15
+ height: number;
16
+ };
17
+ tagContainer: {
18
+ position: "absolute";
19
+ flexDirection: "row";
20
+ gap: 8;
21
+ top: 8;
22
+ left: 8;
23
+ zIndex: number;
24
+ };
25
+ closeModalButton: {
26
+ width: "100%";
27
+ alignItems: "flex-end";
28
+ justifyContent: "center";
29
+ padding: 8;
30
+ };
31
+ tagTotalPhotos: {
32
+ backgroundColor: "#FFFFFF";
33
+ zIndex: number;
34
+ top: number;
35
+ right: number;
36
+ paddingHorizontal: 16;
37
+ paddingVertical: 6;
38
+ borderRadius: number;
39
+ position: "absolute";
40
+ alignSelf: "center";
41
+ flexDirection: "row";
42
+ gap: 8;
43
+ };
44
+ tagTotalPhotosText: {
45
+ fontFamily: string;
46
+ fontSize: number;
47
+ color: "#101010";
48
+ };
49
+ modalContainer: {
50
+ height: "50%";
51
+ padding: number;
52
+ };
53
+ smallImagesRow: {
54
+ flexDirection: "row";
55
+ justifyContent: "space-between";
56
+ };
57
+ };
58
+ //# sourceMappingURL=image-gallery.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-gallery.styles.d.ts","sourceRoot":"","sources":["../../../src/components/image-gallery/image-gallery.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D5B,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useGalleryStyles = () => {
4
+ const { colors, spacing } = useTheme();
5
+ return StyleSheet.create({
6
+ container: {
7
+ width: "100%",
8
+ },
9
+ largeImage: {
10
+ width: "100%",
11
+ height: 375, // ajuste conforme necessário
12
+ },
13
+ smallImagesContainer: {
14
+ flexDirection: "row",
15
+ justifyContent: "space-between",
16
+ },
17
+ smallImage: {
18
+ width: "50%", // um pouco menos que a metade para margem
19
+ height: 187, // ajuste conforme necessário
20
+ },
21
+ tagContainer: {
22
+ position: "absolute",
23
+ flexDirection: "row",
24
+ gap: spacing.xs,
25
+ top: spacing.xs,
26
+ left: spacing.xs,
27
+ zIndex: 1,
28
+ },
29
+ closeModalButton: {
30
+ width: "100%",
31
+ alignItems: "flex-end",
32
+ justifyContent: "center",
33
+ padding: spacing.xs,
34
+ },
35
+ tagTotalPhotos: {
36
+ backgroundColor: colors.white,
37
+ zIndex: 1,
38
+ top: -40,
39
+ right: 13,
40
+ paddingHorizontal: spacing.md,
41
+ paddingVertical: spacing.xxs2,
42
+ borderRadius: 100,
43
+ position: "absolute",
44
+ alignSelf: "center",
45
+ flexDirection: "row",
46
+ gap: spacing.xs,
47
+ },
48
+ tagTotalPhotosText: {
49
+ fontFamily: "Inter-Regular", // fonts.inter.regular
50
+ fontSize: 12, // fonts.sizes.xs
51
+ color: colors.textPrimary,
52
+ },
53
+ modalContainer: {
54
+ height: "50%",
55
+ padding: 10,
56
+ },
57
+ smallImagesRow: {
58
+ flexDirection: "row",
59
+ justifyContent: "space-between",
60
+ },
61
+ });
62
+ };
@@ -0,0 +1,11 @@
1
+ export interface ImageGalleryImage {
2
+ imageUrl: string;
3
+ }
4
+ export interface ImageGalleryFlag {
5
+ value: string;
6
+ }
7
+ export interface ImageGalleryProps {
8
+ images: ImageGalleryImage[];
9
+ flags: ImageGalleryFlag[];
10
+ }
11
+ //# sourceMappingURL=image-gallery.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-gallery.types.d.ts","sourceRoot":"","sources":["../../../src/components/image-gallery/image-gallery.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export { ImageGallery } from "./image-gallery.component";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/image-gallery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ export { ImageGallery } from "./image-gallery.component";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) JOB TODAY S.A. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ type Props = {
9
+ onRequestClose: () => void;
10
+ };
11
+ declare const ImageDefaultHeader: ({ onRequestClose }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export default ImageDefaultHeader;
13
+ //# sourceMappingURL=image-default-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-default-header.d.ts","sourceRoot":"","sources":["../../../../src/components/image-viewing/components/image-default-header.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAIF,QAAA,MAAM,kBAAkB,GAAI,oBAAoB,KAAK,4CAUpD,CAAC;AAyBF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SafeAreaView, Text, TouchableOpacity, StyleSheet } from "react-native";
3
+ const HIT_SLOP = { top: 16, left: 16, bottom: 16, right: 16 };
4
+ const ImageDefaultHeader = ({ onRequestClose }) => (_jsx(SafeAreaView, { style: styles.root, children: _jsx(TouchableOpacity, { style: styles.closeButton, onPress: onRequestClose, hitSlop: HIT_SLOP, children: _jsx(Text, { style: styles.closeText, children: "\u2715" }) }) }));
5
+ const styles = StyleSheet.create({
6
+ root: {
7
+ alignItems: "flex-end",
8
+ },
9
+ closeButton: {
10
+ marginRight: 8,
11
+ marginTop: 8,
12
+ width: 44,
13
+ height: 44,
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ borderRadius: 22,
17
+ backgroundColor: "#00000077",
18
+ },
19
+ closeText: {
20
+ lineHeight: 22,
21
+ fontSize: 19,
22
+ textAlign: "center",
23
+ color: "#FFF",
24
+ includeFontPadding: false,
25
+ },
26
+ });
27
+ export default ImageDefaultHeader;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { ImageSource } from "../../image-viewing.types";
3
+ type Props = {
4
+ imageSrc: ImageSource;
5
+ onRequestClose: () => void;
6
+ onZoom: (isZoomed: boolean) => void;
7
+ onLongPress: (image: ImageSource) => void;
8
+ delayLongPress: number;
9
+ swipeToCloseEnabled?: boolean;
10
+ doubleTapToZoomEnabled?: boolean;
11
+ };
12
+ declare const _default: React.MemoExoticComponent<({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPress, swipeToCloseEnabled, doubleTapToZoomEnabled, }: Props) => import("react/jsx-runtime").JSX.Element>;
13
+ export default _default;
14
+ //# sourceMappingURL=image-item.component.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-item.component.android.d.ts","sourceRoot":"","sources":["../../../../../src/components/image-viewing/components/image-item/image-item.component.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAa7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAUxD,KAAK,KAAK,GAAG;IACT,QAAQ,EAAE,WAAW,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;oKAUC,KAAK;AAwGR,wBAAqC"}
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useCallback, useRef, useState } from "react";
3
+ import { Animated, ScrollView, StyleSheet, } from "react-native";
4
+ import useImageDimensions from "../../hooks/useImageDimensions";
5
+ import usePanResponder from "../../hooks/usePanResponder";
6
+ import { getImageStyles, getImageTransform } from "../../util";
7
+ import { SWIPE_CLOSE_OFFSET, WINDOW_DIMENSIONS } from "./image-item.constants";
8
+ import { ImageLoading } from "./image-loading.component";
9
+ const SWIPE_CLOSE_VELOCITY = 1.75;
10
+ const SCREEN = WINDOW_DIMENSIONS;
11
+ const SCREEN_WIDTH = SCREEN.width;
12
+ const SCREEN_HEIGHT = SCREEN.height;
13
+ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPress, swipeToCloseEnabled = true, doubleTapToZoomEnabled = true, }) => {
14
+ const imageContainer = useRef(null);
15
+ const imageDimensions = useImageDimensions(imageSrc);
16
+ const [translate, scale] = getImageTransform(imageDimensions, SCREEN);
17
+ const scrollValueY = useRef(new Animated.Value(0)).current;
18
+ const [isLoaded, setLoadEnd] = useState(false);
19
+ const onLoaded = useCallback(() => setLoadEnd(true), []);
20
+ const onZoomPerformed = useCallback((isZoomed) => {
21
+ onZoom(isZoomed);
22
+ if (imageContainer === null || imageContainer === void 0 ? void 0 : imageContainer.current) {
23
+ imageContainer.current.setNativeProps({
24
+ scrollEnabled: !isZoomed,
25
+ });
26
+ }
27
+ }, [imageContainer, onZoom]);
28
+ const onLongPressHandler = useCallback(() => {
29
+ onLongPress(imageSrc);
30
+ }, [imageSrc, onLongPress]);
31
+ const [panHandlers, scaleValue, translateValue] = usePanResponder({
32
+ initialScale: scale || 1,
33
+ initialTranslate: translate || { x: 0, y: 0 },
34
+ onZoom: onZoomPerformed,
35
+ doubleTapToZoomEnabled,
36
+ onLongPress: onLongPressHandler,
37
+ delayLongPress,
38
+ });
39
+ const imagesStyles = getImageStyles(imageDimensions, translateValue, scaleValue);
40
+ const imageOpacity = scrollValueY.interpolate({
41
+ inputRange: [-SWIPE_CLOSE_OFFSET, 0, SWIPE_CLOSE_OFFSET],
42
+ outputRange: [0.7, 1, 0.7],
43
+ });
44
+ const imageStylesWithOpacity = { ...imagesStyles, opacity: imageOpacity };
45
+ const onScrollEndDrag = ({ nativeEvent, }) => {
46
+ var _a, _b, _c, _d;
47
+ const velocityY = (_b = (_a = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.velocity) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : 0;
48
+ const offsetY = (_d = (_c = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.contentOffset) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;
49
+ if ((Math.abs(velocityY) > SWIPE_CLOSE_VELOCITY &&
50
+ offsetY > SWIPE_CLOSE_OFFSET) ||
51
+ offsetY > SCREEN_HEIGHT / 2) {
52
+ onRequestClose();
53
+ }
54
+ };
55
+ const onScroll = ({ nativeEvent, }) => {
56
+ var _a, _b;
57
+ const offsetY = (_b = (_a = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.contentOffset) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : 0;
58
+ scrollValueY.setValue(offsetY);
59
+ };
60
+ return (_jsxs(ScrollView, { ref: imageContainer, style: styles.listItem, pagingEnabled: true, nestedScrollEnabled: true, showsHorizontalScrollIndicator: false, showsVerticalScrollIndicator: false, contentContainerStyle: styles.imageScrollContainer, scrollEnabled: swipeToCloseEnabled, ...(swipeToCloseEnabled && {
61
+ onScroll,
62
+ onScrollEndDrag,
63
+ }), children: [_jsx(Animated.Image, { ...panHandlers, source: imageSrc, style: imageStylesWithOpacity, onLoad: onLoaded }), (!isLoaded || !imageDimensions) && _jsx(ImageLoading, {})] }));
64
+ };
65
+ const styles = StyleSheet.create({
66
+ listItem: {
67
+ width: SCREEN_WIDTH,
68
+ height: SCREEN_HEIGHT,
69
+ },
70
+ imageScrollContainer: {
71
+ height: SCREEN_HEIGHT * 2,
72
+ },
73
+ });
74
+ export default React.memo(ImageItem);
@@ -0,0 +1,11 @@
1
+ declare const ImageItem: import("react").MemoExoticComponent<({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPress, swipeToCloseEnabled, doubleTapToZoomEnabled, }: {
2
+ imageSrc: import("../../image-viewing.types").ImageSource;
3
+ onRequestClose: () => void;
4
+ onZoom: (isZoomed: boolean) => void;
5
+ onLongPress: (image: import("../../image-viewing.types").ImageSource) => void;
6
+ delayLongPress: number;
7
+ swipeToCloseEnabled?: boolean;
8
+ doubleTapToZoomEnabled?: boolean;
9
+ }) => import("react/jsx-runtime").JSX.Element>;
10
+ export default ImageItem;
11
+ //# sourceMappingURL=image-item.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-item.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/image-viewing/components/image-item/image-item.component.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS;;;;;;;;8CAAwC,CAAC;AAExD,eAAe,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { ImageSource } from "../../image-viewing.types";
3
+ type Props = {
4
+ imageSrc: ImageSource;
5
+ onRequestClose: () => void;
6
+ onZoom: (scaled: boolean) => void;
7
+ onLongPress: (image: ImageSource) => void;
8
+ delayLongPress: number;
9
+ swipeToCloseEnabled?: boolean;
10
+ doubleTapToZoomEnabled?: boolean;
11
+ };
12
+ declare const _default: React.MemoExoticComponent<({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPress, swipeToCloseEnabled, doubleTapToZoomEnabled, }: Props) => import("react/jsx-runtime").JSX.Element>;
13
+ export default _default;
14
+ //# sourceMappingURL=image-item.component.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-item.component.ios.d.ts","sourceRoot":"","sources":["../../../../../src/components/image-viewing/components/image-item/image-item.component.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAc7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAUxD,KAAK,KAAK,GAAG;IACT,QAAQ,EAAE,WAAW,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;oKAUC,KAAK;AAyGR,wBAAqC"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useCallback, useRef, useState } from "react";
3
+ import { Animated, ScrollView, StyleSheet, TouchableWithoutFeedback, View, } from "react-native";
4
+ import useDoubleTapToZoom from "../../hooks/useDoubleTapToZoom";
5
+ import useImageDimensions from "../../hooks/useImageDimensions";
6
+ import { getImageStyles, getImageTransform } from "../../util";
7
+ import { SCREEN_DIMENSIONS, SWIPE_CLOSE_OFFSET } from "./image-item.constants";
8
+ import { ImageLoading } from "./image-loading.component";
9
+ const SWIPE_CLOSE_VELOCITY = 1.55;
10
+ const SCREEN = SCREEN_DIMENSIONS;
11
+ const SCREEN_WIDTH = SCREEN.width;
12
+ const SCREEN_HEIGHT = SCREEN.height;
13
+ const ImageItem = ({ imageSrc, onZoom, onRequestClose, onLongPress, delayLongPress, swipeToCloseEnabled = true, doubleTapToZoomEnabled = true, }) => {
14
+ const scrollViewRef = useRef(null);
15
+ const [loaded, setLoaded] = useState(false);
16
+ const [scaled, setScaled] = useState(false);
17
+ const imageDimensions = useImageDimensions(imageSrc);
18
+ const handleDoubleTap = useDoubleTapToZoom(scrollViewRef, scaled, SCREEN);
19
+ const [translate, scale] = getImageTransform(imageDimensions, SCREEN);
20
+ const scrollValueY = useRef(new Animated.Value(0)).current;
21
+ const scaleValue = useRef(new Animated.Value(scale || 1)).current;
22
+ const translateValue = useRef(new Animated.ValueXY(translate)).current;
23
+ const maxScale = scale && scale > 0 ? Math.max(1 / scale, 1) : 1;
24
+ const imageOpacity = scrollValueY.interpolate({
25
+ inputRange: [-SWIPE_CLOSE_OFFSET, 0, SWIPE_CLOSE_OFFSET],
26
+ outputRange: [0.5, 1, 0.5],
27
+ });
28
+ const imagesStyles = getImageStyles(imageDimensions, translateValue, scaleValue);
29
+ const imageStylesWithOpacity = { ...imagesStyles, opacity: imageOpacity };
30
+ const onScrollEndDrag = useCallback(({ nativeEvent }) => {
31
+ var _a, _b;
32
+ const velocityY = (_b = (_a = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.velocity) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : 0;
33
+ const isScaledNow = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.zoomScale) > 1;
34
+ onZoom(isScaledNow);
35
+ setScaled(isScaledNow);
36
+ if (!isScaledNow &&
37
+ swipeToCloseEnabled &&
38
+ Math.abs(velocityY) > SWIPE_CLOSE_VELOCITY) {
39
+ onRequestClose();
40
+ }
41
+ }, [swipeToCloseEnabled, onRequestClose, onZoom]);
42
+ const onScroll = ({ nativeEvent, }) => {
43
+ var _a, _b;
44
+ const offsetY = (_b = (_a = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.contentOffset) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : 0;
45
+ if ((nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.zoomScale) > 1) {
46
+ return;
47
+ }
48
+ scrollValueY.setValue(offsetY);
49
+ };
50
+ const onLongPressHandler = useCallback(() => {
51
+ onLongPress(imageSrc);
52
+ }, [imageSrc, onLongPress]);
53
+ return (_jsx(View, { children: _jsxs(ScrollView, { ref: scrollViewRef, style: styles.listItem, pinchGestureEnabled: true, showsHorizontalScrollIndicator: false, showsVerticalScrollIndicator: false, maximumZoomScale: maxScale, contentContainerStyle: styles.imageScrollContainer, scrollEnabled: swipeToCloseEnabled, onScrollEndDrag: onScrollEndDrag, scrollEventThrottle: 1, ...(swipeToCloseEnabled && {
54
+ onScroll,
55
+ }), children: [(!loaded || !imageDimensions) && _jsx(ImageLoading, {}), _jsx(TouchableWithoutFeedback, { onPress: doubleTapToZoomEnabled ? handleDoubleTap : undefined, onLongPress: onLongPressHandler, delayLongPress: delayLongPress, children: _jsx(Animated.Image, { source: imageSrc, style: imageStylesWithOpacity, onLoad: () => setLoaded(true) }) })] }) }));
56
+ };
57
+ const styles = StyleSheet.create({
58
+ listItem: {
59
+ width: SCREEN_WIDTH,
60
+ height: SCREEN_HEIGHT,
61
+ },
62
+ imageScrollContainer: {
63
+ height: SCREEN_HEIGHT,
64
+ },
65
+ });
66
+ export default React.memo(ImageItem);
@@ -0,0 +1,5 @@
1
+ import { Platform } from "react-native";
2
+ import Android from "./image-item.component.android";
3
+ import IOS from "./image-item.component.ios";
4
+ const ImageItem = Platform.OS === "ios" ? IOS : Android;
5
+ export default ImageItem;
@@ -0,0 +1,4 @@
1
+ export declare const SWIPE_CLOSE_OFFSET = 75;
2
+ export declare const WINDOW_DIMENSIONS: import("react-native").ScaledSize;
3
+ export declare const SCREEN_DIMENSIONS: import("react-native").ScaledSize;
4
+ //# sourceMappingURL=image-item.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-item.constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/image-viewing/components/image-item/image-item.constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAGrC,eAAO,MAAM,iBAAiB,mCAA2B,CAAC;AAC1D,eAAO,MAAM,iBAAiB,mCAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Dimensions } from "react-native";
2
+ export const SWIPE_CLOSE_OFFSET = 75;
3
+ // Mantemos Window para Android e Screen para iOS no código
4
+ export const WINDOW_DIMENSIONS = Dimensions.get("window");
5
+ export const SCREEN_DIMENSIONS = Dimensions.get("screen");
@@ -0,0 +1,2 @@
1
+ export declare const ImageLoading: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=image-loading.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-loading.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/image-viewing/components/image-item/image-loading.component.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,+CAIxB,CAAC"}