@umituz/react-native-design-system 4.25.115 → 4.25.117

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "4.25.115",
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 - TanStack persistence now fully lazy loaded",
3
+ "version": "4.25.117",
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 - TanStack persistence and expo-image-manipulator now lazy loaded",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
7
7
  "sideEffects": false,
@@ -174,7 +174,8 @@
174
174
  },
175
175
  "optionalDependencies": {
176
176
  "@tanstack/query-async-storage-persister": "^5.0.0",
177
- "@tanstack/react-query-persist-client": "^5.0.0"
177
+ "@tanstack/react-query-persist-client": "^5.0.0",
178
+ "expo-image-manipulator": "~14.0.0"
178
179
  },
179
180
  "keywords": [
180
181
  "react-native",
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Image Infrastructure - Conversion Service
3
- *
3
+ *
4
4
  * Handles format conversion, compression, and thumbnail generation
5
+ * Lazy loads expo-image-manipulator to reduce bundle size
5
6
  */
6
7
 
7
- import * as ImageManipulator from 'expo-image-manipulator';
8
8
  import type {
9
9
  ImageSaveOptions,
10
10
  ImageManipulationResult,
@@ -16,6 +16,16 @@ import { ImageValidator } from '../utils/ImageValidator';
16
16
  import { ImageErrorHandler } from '../utils/ImageErrorHandler';
17
17
  import { ImageTransformUtils } from '../utils/ImageTransformUtils';
18
18
 
19
+ // Cached module to avoid repeated imports
20
+ let ImageManipulatorModule: typeof import('expo-image-manipulator') | null = null;
21
+
22
+ async function getImageManipulator() {
23
+ if (!ImageManipulatorModule) {
24
+ ImageManipulatorModule = await import('expo-image-manipulator');
25
+ }
26
+ return ImageManipulatorModule;
27
+ }
28
+
19
29
  export class ImageConversionService {
20
30
  static async compress(
21
31
  uri: string,
@@ -25,6 +35,7 @@ export class ImageConversionService {
25
35
  ImageValidator.validateUri(uri);
26
36
  ImageValidator.validateQuality(quality);
27
37
 
38
+ const ImageManipulator = await getImageManipulator();
28
39
  return await ImageManipulator.manipulateAsync(
29
40
  uri,
30
41
  [],
@@ -43,6 +54,8 @@ export class ImageConversionService {
43
54
  try {
44
55
  ImageValidator.validateUri(uri);
45
56
  const compressQuality = quality ?? IMAGE_CONSTANTS.defaultQuality;
57
+ const ImageManipulator = await getImageManipulator();
58
+
46
59
  return await ImageManipulator.manipulateAsync(
47
60
  uri,
48
61
  [],