@umituz/react-native-design-system 4.23.81 → 4.23.82

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 (26) hide show
  1. package/package.json +3 -3
  2. package/src/atoms/icon/AtomicIcon.tsx +1 -0
  3. package/src/atoms/icon/iconStore.ts +2 -0
  4. package/src/device/infrastructure/services/PersistentDeviceIdService.ts +4 -0
  5. package/src/haptics/infrastructure/services/HapticService.ts +1 -0
  6. package/src/init/createAppInitializer.ts +1 -0
  7. package/src/media/infrastructure/services/CardMediaOptimizerService.ts +1 -0
  8. package/src/molecules/BaseModal.tsx +1 -0
  9. package/src/molecules/bottom-sheet/components/BottomSheetModal.tsx +1 -0
  10. package/src/molecules/navigation/StackNavigator.tsx +1 -0
  11. package/src/molecules/navigation/TabsNavigator.tsx +1 -0
  12. package/src/molecules/navigation/types.ts +2 -2
  13. package/src/offline/infrastructure/events/NetworkEvents.ts +2 -1
  14. package/src/offline/infrastructure/utils/healthCheck.ts +1 -1
  15. package/src/offline/presentation/hooks/useOffline.ts +1 -1
  16. package/src/offline/presentation/hooks/useOfflineWithMutations.ts +1 -1
  17. package/src/onboarding/infrastructure/storage/actions/storageHelpers.ts +1 -1
  18. package/src/onboarding/presentation/hooks/useOnboardingScreenHandlers.ts +2 -2
  19. package/src/storage/cache/domain/__tests__/ErrorHandler.test.ts +8 -8
  20. package/src/storage/domain/utils/devUtils.ts +3 -3
  21. package/src/tanstack/domain/config/QueryClientAccessor.ts +1 -1
  22. package/src/tanstack/domain/repositories/RepositoryFactory.ts +1 -1
  23. package/src/tanstack/domain/utils/ErrorHelpers.ts +1 -1
  24. package/src/tanstack/infrastructure/config/PersisterConfig.ts +6 -6
  25. package/src/tanstack/infrastructure/config/QueryClientConfig.ts +0 -12
  26. package/src/tanstack/infrastructure/monitoring/DevMonitorLogger.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "4.23.81",
3
+ "version": "4.23.82",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -116,7 +116,7 @@
116
116
  "@testing-library/react": "^16.3.1",
117
117
  "@testing-library/react-native": "^13.3.3",
118
118
  "@types/jest": "^30.0.0",
119
- "@types/react": "~19.1.10",
119
+ "@types/react": "~19.2.4",
120
120
  "@types/react-native": "^0.73.0",
121
121
  "@typescript-eslint/eslint-plugin": "^8.50.1",
122
122
  "@typescript-eslint/parser": "^8.50.1",
@@ -142,7 +142,7 @@
142
142
  "expo-secure-store": "~15.0.8",
143
143
  "expo-sharing": "~14.0.8",
144
144
  "expo-video": "~3.0.15",
145
- "react": "19.1.0",
145
+ "react": "19.2.4",
146
146
  "react-native": "0.81.4",
147
147
  "react-native-gesture-handler": "^2.20.0",
148
148
  "react-native-safe-area-context": "^5.6.0",
@@ -122,6 +122,7 @@ export const AtomicIcon: React.FC<AtomicIconProps> = React.memo(
122
122
  // No icon renderer provided - warn in dev and render nothing
123
123
  if (!iconRenderer) {
124
124
  if (__DEV__) {
125
+ console.warn(
125
126
  '[DesignSystem] AtomicIcon requires an iconRenderer in DesignSystemProvider.\n' +
126
127
  'Example:\n' +
127
128
  '<DesignSystemProvider\n' +
@@ -75,6 +75,7 @@ export const useIconStore = create<IconStore>((set) => ({
75
75
  if (__DEV__) {
76
76
  const missingKeys = REQUIRED_ICON_KEYS.filter(key => !iconNames[key]);
77
77
  if (missingKeys.length > 0) {
78
+ console.warn(
78
79
  `[DesignSystem] Missing icon names: ${missingKeys.join(', ')}`
79
80
  );
80
81
  }
@@ -100,6 +101,7 @@ export const useIconName = (key: keyof IconNames): string => {
100
101
 
101
102
  if (!iconNames) {
102
103
  if (__DEV__) {
104
+ console.warn(
103
105
  `[DesignSystem] useIconName("${key}") - iconNames not configured.`
104
106
  );
105
107
  }
@@ -43,6 +43,7 @@ export class PersistentDeviceIdService {
43
43
 
44
44
  if (secureId) {
45
45
  if (__DEV__) {
46
+ console.log(`[DesignSystem] Device ID: Using secure ID: ${secureId}`);
46
47
  }
47
48
  cachedDeviceId = secureId;
48
49
  return secureId;
@@ -53,12 +54,14 @@ export class PersistentDeviceIdService {
53
54
  await this.secureRepo.set(newId);
54
55
 
55
56
  if (__DEV__) {
57
+ console.log(`[DesignSystem] Device ID: Created new ID: ${newId}`);
56
58
  }
57
59
 
58
60
  cachedDeviceId = newId;
59
61
  return newId;
60
62
  } catch (error) {
61
63
  if (__DEV__) {
64
+ console.error('[DesignSystem] Device ID: Initialization failed', error);
62
65
  }
63
66
  const fallbackId = `fallback_${generateUUID()}`;
64
67
  cachedDeviceId = fallbackId;
@@ -100,6 +103,7 @@ export class PersistentDeviceIdService {
100
103
  cachedDeviceId = null;
101
104
  initializationPromise = null;
102
105
  if (__DEV__) {
106
+ console.log('[DesignSystem] Device ID: Stored ID cleared');
103
107
  }
104
108
  } catch {
105
109
  // Silent fail
@@ -16,6 +16,7 @@ import type { ImpactStyle, NotificationType, HapticPattern } from '../../domain/
16
16
  */
17
17
  function logError(method: string, error: unknown): void {
18
18
  if (process.env.NODE_ENV === 'development') {
19
+ console.error(`[DesignSystem] HapticService.${method} error:`, error);
19
20
  }
20
21
  }
21
22
 
@@ -43,6 +43,7 @@ export function createAppInitializer(
43
43
 
44
44
  const log = (message: string, ...args: unknown[]) => {
45
45
  if (debug) {
46
+ console.log(`[AppInitializer] ${message}`, ...args);
46
47
  }
47
48
  };
48
49
 
@@ -30,6 +30,7 @@ export class CardMediaOptimizerService {
30
30
  */
31
31
  async deleteMedia(attachmentId: string): Promise<void> {
32
32
  if (__DEV__) {
33
+ console.log(`[DesignSystem] CardMediaOptimizerService: Deleting media ${attachmentId}`);
33
34
  }
34
35
  }
35
36
  }
@@ -38,6 +38,7 @@ export const BaseModal: React.FC<BaseModalProps> = ({
38
38
  // Debug logging for modal visibility
39
39
  useEffect(() => {
40
40
  if (__DEV__) {
41
+ console.log({
41
42
  visible,
42
43
  testID,
43
44
  modalWidth: modalLayout.width,
@@ -32,6 +32,7 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
32
32
 
33
33
  useEffect(() => {
34
34
  if (__DEV__) {
35
+ console.log({
35
36
  visible,
36
37
  preset,
37
38
  hasChildren: !!children,
@@ -28,6 +28,7 @@ export function StackNavigator<T extends ParamListBase>({ config }: StackNavigat
28
28
  NavigationValidator.validateInitialRoute(config.initialRouteName, config.screens);
29
29
  } catch (error) {
30
30
  if (__DEV__) {
31
+ console.error("[DesignSystem] StackNavigator validation failed:", error);
31
32
  }
32
33
  }
33
34
 
@@ -34,6 +34,7 @@ export function TabsNavigator<T extends ParamListBase>({
34
34
  );
35
35
  } catch (error) {
36
36
  if (__DEV__) {
37
+ console.error("[DesignSystem] TabsNavigator validation failed:", error);
37
38
  }
38
39
  }
39
40
 
@@ -30,9 +30,9 @@ export interface BaseScreen<T extends ParamListBase = ParamListBase> {
30
30
  /** Unique name identifier for the screen */
31
31
  name: Extract<keyof T, string>;
32
32
  /** React component to render for this screen */
33
- component?: React.ComponentType<Record<string, unknown>>;
33
+ component?: React.ComponentType<any>;
34
34
  /** Render function for children (alternative to component) */
35
- children?: (props: Record<string, unknown>) => React.ReactNode;
35
+ children?: (props: any) => React.ReactNode;
36
36
  }
37
37
 
38
38
  /**
@@ -35,8 +35,9 @@ class NetworkEventEmitter implements NetworkEvents {
35
35
  this.listeners.get(event)?.forEach((listener) => {
36
36
  try {
37
37
  listener(state);
38
- } catch (error) {
38
+ } catch (_error) {
39
39
  if (__DEV__) {
40
+ console.error('[DesignSystem] PersistentDeviceIdService: Initialization failed', _error);
40
41
  }
41
42
  }
42
43
  });
@@ -50,7 +50,7 @@ export class HealthCheck {
50
50
  }
51
51
 
52
52
  return isHealthy;
53
- } catch (error) {
53
+ } catch (_error) {
54
54
  if (this.config.debug) {
55
55
  }
56
56
 
@@ -70,7 +70,7 @@ export const useOffline = (config?: OfflineConfig) => {
70
70
  isInitialized.current = true;
71
71
  }
72
72
  })
73
- .catch((error: Error) => {
73
+ .catch((_error: Error) => {
74
74
  if (isMountedRef.current && (__DEV__ || mergedConfig.debug)) {
75
75
  }
76
76
  });
@@ -20,7 +20,7 @@ export const useOfflineWithMutations = (onOnline: () => Promise<void>) => {
20
20
  if (__DEV__) {
21
21
  }
22
22
  await onOnline();
23
- } catch (error) {
23
+ } catch (_error) {
24
24
  if (__DEV__) {
25
25
  }
26
26
  } finally {
@@ -52,7 +52,7 @@ export function handleError(error: unknown, context: string): string {
52
52
  return message;
53
53
  }
54
54
 
55
- export function logSuccess(message: string): void {
55
+ export function logSuccess(_message: string): void {
56
56
  if (__DEV__) {
57
57
  }
58
58
  }
@@ -58,7 +58,7 @@ export function useOnboardingScreenHandlers({
58
58
  loadAnswerForSlide(nextSlide);
59
59
  }
60
60
  }
61
- } catch (error) {
61
+ } catch (_error) {
62
62
  if (__DEV__) {
63
63
  }
64
64
  }
@@ -98,7 +98,7 @@ export function useOnboardingScreenHandlers({
98
98
  const handleSkip = useCallback(async () => {
99
99
  try {
100
100
  await skipOnboarding();
101
- } catch (error) {
101
+ } catch (_error) {
102
102
  if (__DEV__) {
103
103
  }
104
104
  }
@@ -56,7 +56,7 @@ describe('ErrorHandler', () => {
56
56
 
57
57
  try {
58
58
  ErrorHandler.handle(originalError, 'test context');
59
- } catch (error) {
59
+ } catch (_error) {
60
60
  expect((error as CacheError).message).toBe('test context: Regular error');
61
61
  expect((error as CacheError).code).toBe('CACHE_ERROR');
62
62
  }
@@ -67,7 +67,7 @@ describe('ErrorHandler', () => {
67
67
 
68
68
  try {
69
69
  ErrorHandler.handle(unknownError, 'test context');
70
- } catch (error) {
70
+ } catch (_error) {
71
71
  expect((error as CacheError).message).toBe('test context: Unknown error');
72
72
  expect((error as CacheError).code).toBe('UNKNOWN_ERROR');
73
73
  }
@@ -76,7 +76,7 @@ describe('ErrorHandler', () => {
76
76
  test('should handle null error', () => {
77
77
  try {
78
78
  ErrorHandler.handle(null, 'test context');
79
- } catch (error) {
79
+ } catch (_error) {
80
80
  expect((error as CacheError).message).toBe('test context: Unknown error');
81
81
  expect((error as CacheError).code).toBe('UNKNOWN_ERROR');
82
82
  }
@@ -85,7 +85,7 @@ describe('ErrorHandler', () => {
85
85
  test('should handle undefined error', () => {
86
86
  try {
87
87
  ErrorHandler.handle(undefined, 'test context');
88
- } catch (error) {
88
+ } catch (_error) {
89
89
  expect((error as CacheError).message).toBe('test context: Unknown error');
90
90
  expect((error as CacheError).code).toBe('UNKNOWN_ERROR');
91
91
  }
@@ -97,7 +97,7 @@ describe('ErrorHandler', () => {
97
97
 
98
98
  try {
99
99
  ErrorHandler.handle(originalError, 'test context');
100
- } catch (error) {
100
+ } catch (_error) {
101
101
  const cacheError = error as CacheError;
102
102
  expect(cacheError.message).toBe('test context: Original error');
103
103
  expect(cacheError.code).toBe('CACHE_ERROR');
@@ -135,7 +135,7 @@ describe('ErrorHandler', () => {
135
135
 
136
136
  try {
137
137
  await ErrorHandler.withTimeout(promise, 1000, 'test context');
138
- } catch (error) {
138
+ } catch (_error) {
139
139
  expect((error as CacheError).message).toBe('test context: Operation timed out after 1000ms');
140
140
  expect((error as CacheError).code).toBe('TIMEOUT');
141
141
  }
@@ -154,7 +154,7 @@ describe('ErrorHandler', () => {
154
154
 
155
155
  try {
156
156
  await ErrorHandler.withTimeout(promise, 1000, 'test context');
157
- } catch (error) {
157
+ } catch (_error) {
158
158
  expect((error as CacheError).message).toBe('test context: Promise rejected');
159
159
  expect((error as CacheError).code).toBe('CACHE_ERROR');
160
160
  }
@@ -261,7 +261,7 @@ describe('ErrorHandler', () => {
261
261
 
262
262
  try {
263
263
  await ErrorHandler.withTimeout(promise, 1000, 'test');
264
- } catch (error) {
264
+ } catch (_error) {
265
265
  expect((error as CacheError).code).toBe('TIMEOUT');
266
266
  }
267
267
  });
@@ -12,7 +12,7 @@ export const isDev = (): boolean => {
12
12
  /**
13
13
  * Log warning in development mode only
14
14
  */
15
- export const devWarn = (message: string, ...args: unknown[]): void => {
15
+ export const devWarn = (_message: string, ..._args: unknown[]): void => {
16
16
  if (__DEV__) {
17
17
  }
18
18
  };
@@ -20,7 +20,7 @@ export const devWarn = (message: string, ...args: unknown[]): void => {
20
20
  /**
21
21
  * Log error in development mode only
22
22
  */
23
- export const devError = (message: string, ...args: unknown[]): void => {
23
+ export const devError = (_message: string, ..._args: unknown[]): void => {
24
24
  if (__DEV__) {
25
25
  }
26
26
  };
@@ -28,7 +28,7 @@ export const devError = (message: string, ...args: unknown[]): void => {
28
28
  /**
29
29
  * Log info in development mode only
30
30
  */
31
- export const devLog = (message: string, ...args: unknown[]): void => {
31
+ export const devLog = (_message: string, ..._args: unknown[]): void => {
32
32
  if (__DEV__) {
33
33
  }
34
34
  };
@@ -20,7 +20,7 @@ let globalQueryClient: QueryClient | null = null;
20
20
  export function setGlobalQueryClient(client: QueryClient): void {
21
21
  if (globalQueryClient && globalQueryClient !== client) {
22
22
  if (__DEV__) {
23
-
23
+ console.warn(
24
24
  '[TanStack] QueryClient instance changed. Ensure you are not creating multiple instances.',
25
25
  );
26
26
  }
@@ -43,7 +43,7 @@ class RepositoryFactoryClass {
43
43
  ): void {
44
44
  if (this.repositories.has(key)) {
45
45
  if (__DEV__) {
46
-
46
+ console.warn(
47
47
  `[RepositoryFactory] Repository "${key}" is already registered. Overwriting.`,
48
48
  );
49
49
  }
@@ -146,7 +146,7 @@ export function getErrorCode(error: unknown): string | null {
146
146
  /**
147
147
  * Log error in development
148
148
  */
149
- export function logError(context: string, error: unknown): void {
149
+ export function logError(_context: string, _error: unknown): void {
150
150
  if (__DEV__) {
151
151
 
152
152
  }
@@ -82,7 +82,7 @@ export function createPersister(options: PersisterFactoryOptions = {}): Persiste
82
82
  // Validate cache version
83
83
  if (parsed.version !== busterVersion) {
84
84
  if (__DEV__) {
85
-
85
+ console.warn(
86
86
  `[TanStack Query] Cache version mismatch. Expected: ${busterVersion}, Got: ${parsed.version}`,
87
87
  );
88
88
  }
@@ -93,7 +93,7 @@ export function createPersister(options: PersisterFactoryOptions = {}): Persiste
93
93
  const age = Date.now() - parsed.timestamp;
94
94
  if (age > maxAge) {
95
95
  if (__DEV__) {
96
-
96
+ console.warn(`[TanStack Query] Cache age exceeded maxAge: ${maxAge}ms`);
97
97
  }
98
98
  return undefined;
99
99
  }
@@ -101,7 +101,7 @@ export function createPersister(options: PersisterFactoryOptions = {}): Persiste
101
101
  return parsed.data;
102
102
  } catch (error) {
103
103
  if (__DEV__) {
104
-
104
+ console.error('[TanStack Query] Error deserializing cache:', error);
105
105
  }
106
106
  return undefined;
107
107
  }
@@ -122,11 +122,11 @@ export async function clearPersistedCache(keyPrefix: string = 'tanstack-query'):
122
122
  try {
123
123
  await storageService.removeItem(`${keyPrefix}-cache`);
124
124
  if (__DEV__) {
125
-
125
+ console.log(`[TanStack Query] Cleared persisted cache for keyPrefix: ${keyPrefix}`);
126
126
  }
127
127
  } catch (error) {
128
128
  if (__DEV__) {
129
-
129
+ console.error('[TanStack Query] Error clearing persisted cache:', error);
130
130
  }
131
131
  }
132
132
  }
@@ -148,7 +148,7 @@ export async function getPersistedCacheSize(
148
148
  return data ? new Blob([data]).size : 0;
149
149
  } catch (error) {
150
150
  if (__DEV__) {
151
-
151
+ console.error('[TanStack Query] Error getting persisted cache size:', error);
152
152
  }
153
153
  return 0;
154
154
  }
@@ -86,12 +86,6 @@ export interface QueryClientFactoryOptions {
86
86
  * @default 3
87
87
  */
88
88
  defaultRetry?: boolean | number | RetryFunction;
89
-
90
- /**
91
- * Enable development mode logging
92
- * @default __DEV__
93
- */
94
- enableDevLogging?: boolean;
95
89
  }
96
90
 
97
91
  /**
@@ -110,7 +104,6 @@ export function createQueryClient(options: QueryClientFactoryOptions = {}): Quer
110
104
  defaultStaleTime = DEFAULT_STALE_TIME.SHORT,
111
105
  defaultGcTime = DEFAULT_GC_TIME.LONG,
112
106
  defaultRetry = DEFAULT_RETRY.STANDARD,
113
- enableDevLogging = __DEV__,
114
107
  } = options;
115
108
 
116
109
  return new QueryClient({
@@ -125,11 +118,6 @@ export function createQueryClient(options: QueryClientFactoryOptions = {}): Quer
125
118
  },
126
119
  mutations: {
127
120
  retry: DEFAULT_RETRY.MINIMAL,
128
- onError: (error: Error) => {
129
- if (enableDevLogging) {
130
-
131
- }
132
- },
133
121
  },
134
122
  },
135
123
  });
@@ -13,6 +13,7 @@ export class DevMonitorLogger {
13
13
 
14
14
  static logSlowQuery(queryKeyString: string, fetchTime: number): void {
15
15
  if (__DEV__) {
16
+ console.warn(
16
17
  `[TanStack DevMonitor] Slow query detected: ${queryKeyString} (${fetchTime}ms)`,
17
18
  );
18
19
  }