@umituz/react-native-onboarding 3.6.13 → 3.6.15

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": "@umituz/react-native-onboarding",
3
- "version": "3.6.13",
3
+ "version": "3.6.15",
4
4
  "description": "Advanced onboarding flow for React Native apps with personalization questions, theme-aware colors, animations, and customizable slides. SOLID, DRY, KISS principles applied.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH, SCREEN_HEIGHT } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateCollageLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { borderRadius = 8 } = config;
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH, SCREEN_HEIGHT } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateGridLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { columns, gap = 0, borderRadius = 0 } = config;
@@ -38,7 +38,7 @@ export const generateGridLayout = (
38
38
  };
39
39
 
40
40
  export const generateDenseGridLayout = (
41
- images: unknown[],
41
+ images: ImageSourceType[],
42
42
  config: LayoutConfig = {},
43
43
  ): ImageLayoutItem[] => {
44
44
  const { columns = 6, gap = 2, borderRadius = 4 } = config;
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateHoneycombLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { borderRadius = 50 } = config;
@@ -2,7 +2,7 @@
2
2
  * Layout Generators - Barrel Export
3
3
  */
4
4
 
5
- export type { ImageLayoutItem, ImageLayoutStyle, LayoutConfig } from "./layoutTypes";
5
+ export type { ImageLayoutItem, ImageLayoutStyle, LayoutConfig, ImageSourceType } from "./layoutTypes";
6
6
 
7
7
  export { generateGridLayout, generateDenseGridLayout } from "./gridLayouts";
8
8
  export { generateMasonryLayout } from "./masonryLayout";
@@ -3,6 +3,10 @@
3
3
  * Type definitions for image layout generators
4
4
  */
5
5
 
6
+ import type { ImageSource } from "expo-image";
7
+
8
+ export type ImageSourceType = ImageSource | number | string;
9
+
6
10
  export interface ImageLayoutStyle {
7
11
  position: "absolute";
8
12
  top: number;
@@ -13,7 +17,7 @@ export interface ImageLayoutStyle {
13
17
  }
14
18
 
15
19
  export interface ImageLayoutItem {
16
- source: unknown;
20
+ source: ImageSourceType;
17
21
  style: ImageLayoutStyle;
18
22
  }
19
23
 
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateMasonryLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { columns = 3, gap = 2, borderRadius = 4 } = config;
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH, SCREEN_HEIGHT } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateScatteredLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { borderRadius = 6 } = config;
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { SCREEN_WIDTH, SCREEN_HEIGHT } from "./screenDimensions";
7
- import type { ImageLayoutItem, LayoutConfig } from "./layoutTypes";
7
+ import type { ImageLayoutItem, LayoutConfig, ImageSourceType } from "./layoutTypes";
8
8
 
9
9
  export const generateTilesLayout = (
10
- images: unknown[],
10
+ images: ImageSourceType[],
11
11
  config: LayoutConfig = {},
12
12
  ): ImageLayoutItem[] => {
13
13
  const { columns = 5, gap = 4, borderRadius = 8 } = config;
@@ -16,8 +16,8 @@ import {
16
16
  generateHoneycombLayout,
17
17
  type ImageLayoutItem,
18
18
  type LayoutConfig,
19
- } from "@/infrastructure/utils/layouts";
20
- import { ensureArray } from "@/infrastructure/utils/arrayUtils";
19
+ type ImageSourceType,
20
+ } from "../../infrastructure/utils/layouts";
21
21
 
22
22
  export type CollageLayout =
23
23
  | "grid"
@@ -29,7 +29,7 @@ export type CollageLayout =
29
29
  | "honeycomb";
30
30
 
31
31
  export interface BackgroundImageCollageProps {
32
- images: unknown[];
32
+ images: ImageSourceType[];
33
33
  layout?: CollageLayout;
34
34
  columns?: number;
35
35
  gap?: number;
@@ -37,7 +37,7 @@ export interface BackgroundImageCollageProps {
37
37
  opacity?: number;
38
38
  }
39
39
 
40
- type LayoutGenerator = (images: unknown[], config: LayoutConfig) => ImageLayoutItem[];
40
+ type LayoutGenerator = (images: ImageSourceType[], config: LayoutConfig) => ImageLayoutItem[];
41
41
 
42
42
  const LAYOUT_GENERATORS: Record<CollageLayout, LayoutGenerator> = {
43
43
  grid: generateGridLayout,
@@ -57,14 +57,12 @@ export const BackgroundImageCollage: React.FC<BackgroundImageCollageProps> = ({
57
57
  borderRadius,
58
58
  opacity = 1,
59
59
  }) => {
60
- const safeImages = ensureArray(images);
61
-
62
60
  const imageLayouts = useMemo(() => {
63
- if (safeImages.length === 0) return [];
61
+ if (!images || images.length === 0) return [];
64
62
 
65
63
  const generator = LAYOUT_GENERATORS[layout] ?? generateGridLayout;
66
- return generator(safeImages, { columns, gap, borderRadius });
67
- }, [safeImages, layout, columns, gap, borderRadius]);
64
+ return generator(images, { columns, gap, borderRadius });
65
+ }, [images, layout, columns, gap, borderRadius]);
68
66
 
69
67
  if (imageLayouts.length === 0) return null;
70
68
 
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { View, TouchableOpacity, StyleSheet } from "react-native";
3
3
  import { AtomicIcon, AtomicText } from "@umituz/react-native-design-system";
4
- import { useOnboardingProvider } from "@/presentation/providers/OnboardingProvider";
5
- import { ensureArray } from "@/infrastructure/utils/arrayUtils";
6
- import type { OnboardingQuestion, QuestionOption } from "@/domain/entities/OnboardingQuestion";
4
+ import { useOnboardingProvider } from "../../providers/OnboardingProvider";
5
+ import { ensureArray } from "../../../infrastructure/utils/arrayUtils";
6
+ import type { OnboardingQuestion, QuestionOption } from "../../../domain/entities/OnboardingQuestion";
7
7
 
8
8
  export interface MultipleChoiceQuestionProps {
9
9
  question: OnboardingQuestion;