@zezosoft/zezo-ott-react-native-ui-kit 1.2.0 → 1.2.2

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 (166) hide show
  1. package/lib/module/components/Auth/AuthProvider/AuthProvider.js +2 -2
  2. package/lib/module/components/Auth/AuthProvider/AuthProvider.js.map +1 -1
  3. package/lib/module/components/Auth/One/ForgotPassword/ForgotPassword.js +16 -16
  4. package/lib/module/components/Auth/One/ForgotPassword/ForgotPassword.js.map +1 -1
  5. package/lib/module/components/Auth/One/Login/LoginWithEmail.js +16 -16
  6. package/lib/module/components/Auth/One/Login/LoginWithEmail.js.map +1 -1
  7. package/lib/module/components/Auth/One/Login/LoginWithPhone.js +17 -17
  8. package/lib/module/components/Auth/One/Login/LoginWithPhone.js.map +1 -1
  9. package/lib/module/components/Auth/One/OTP/OTP.js +100 -67
  10. package/lib/module/components/Auth/One/OTP/OTP.js.map +1 -1
  11. package/lib/module/components/Auth/One/SignUp/SignUp.js +17 -17
  12. package/lib/module/components/Auth/One/SignUp/SignUp.js.map +1 -1
  13. package/lib/module/components/Auth/One/SplashScreen/SplashScreen.js +57 -76
  14. package/lib/module/components/Auth/One/SplashScreen/SplashScreen.js.map +1 -1
  15. package/lib/module/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.js +23 -26
  16. package/lib/module/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.js.map +1 -1
  17. package/lib/module/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.js +56 -18
  18. package/lib/module/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.js.map +1 -1
  19. package/lib/module/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.js +62 -71
  20. package/lib/module/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.js.map +1 -1
  21. package/lib/module/components/Auth/Two/AuthHeader/AuthHeader.js +20 -17
  22. package/lib/module/components/Auth/Two/AuthHeader/AuthHeader.js.map +1 -1
  23. package/lib/module/components/Auth/Two/ForgotPassword/ForgotPassword.js +11 -13
  24. package/lib/module/components/Auth/Two/ForgotPassword/ForgotPassword.js.map +1 -1
  25. package/lib/module/components/Auth/Two/Login/EmailOrPhoneLogin.js +489 -0
  26. package/lib/module/components/Auth/Two/Login/EmailOrPhoneLogin.js.map +1 -0
  27. package/lib/module/components/Auth/Two/OTP/OTP.js +90 -91
  28. package/lib/module/components/Auth/Two/OTP/OTP.js.map +1 -1
  29. package/lib/module/components/Auth/Two/SignUp/SignUp.js +49 -66
  30. package/lib/module/components/Auth/Two/SignUp/SignUp.js.map +1 -1
  31. package/lib/module/components/Auth/Two/index.js +3 -7
  32. package/lib/module/components/Auth/Two/index.js.map +1 -1
  33. package/lib/module/components/BackgroundLayout/{BackgroundLayout.js → One/One.js} +12 -9
  34. package/lib/module/components/BackgroundLayout/One/One.js.map +1 -0
  35. package/lib/module/components/BackgroundLayout/{BackgroundLayoutOne.js → Two/Two.js} +11 -5
  36. package/lib/module/components/BackgroundLayout/Two/Two.js.map +1 -0
  37. package/lib/module/components/BackgroundLayout/index.js +10 -0
  38. package/lib/module/components/BackgroundLayout/index.js.map +1 -0
  39. package/lib/module/components/ContentView/One/components/AboutSection.js +9 -18
  40. package/lib/module/components/ContentView/One/components/AboutSection.js.map +1 -1
  41. package/lib/module/components/ContentView/One/components/GenreTags.js +5 -1
  42. package/lib/module/components/ContentView/One/components/GenreTags.js.map +1 -1
  43. package/lib/module/components/ContentView/Two/components/AboutSection.js +4 -1
  44. package/lib/module/components/ContentView/Two/components/AboutSection.js.map +1 -1
  45. package/lib/module/components/ContentView/Two/components/Details.js +3 -0
  46. package/lib/module/components/ContentView/Two/components/Details.js.map +1 -1
  47. package/lib/module/components/ContentView/Two/components/GenreTags.js +4 -1
  48. package/lib/module/components/ContentView/Two/components/GenreTags.js.map +1 -1
  49. package/lib/module/components/ContentView/Two/components/SectionTabs.js +3 -0
  50. package/lib/module/components/ContentView/Two/components/SectionTabs.js.map +1 -1
  51. package/lib/module/components/ContentView/Two/components/Title.js.map +1 -1
  52. package/lib/module/components/Headers/One.js +1 -1
  53. package/lib/module/components/Input/Input.js +2 -4
  54. package/lib/module/components/Input/Input.js.map +1 -1
  55. package/lib/module/components/Input/InputThree.js +31 -33
  56. package/lib/module/components/Input/InputThree.js.map +1 -1
  57. package/lib/module/components/Input/InputTwo.js +1 -0
  58. package/lib/module/components/Input/InputTwo.js.map +1 -1
  59. package/lib/module/components/Input/{PhoneNumberInput.js → PhoneInput/One/One.js} +4 -4
  60. package/lib/module/components/Input/PhoneInput/One/One.js.map +1 -0
  61. package/lib/module/components/Input/{PhoneNumberInputTwo.js → PhoneInput/Two/Two.js} +2 -2
  62. package/lib/module/components/Input/PhoneInput/Two/Two.js.map +1 -0
  63. package/lib/module/components/Input/PhoneInput/index.js +15 -0
  64. package/lib/module/components/Input/PhoneInput/index.js.map +1 -0
  65. package/lib/module/components/Keyboard/HideKeyboard.js +1 -1
  66. package/lib/module/components/Keyboard/HideKeyboard.js.map +1 -1
  67. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js +4 -3
  68. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js.map +1 -1
  69. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js +3 -1
  70. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js.map +1 -1
  71. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js +37 -6
  72. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js.map +1 -1
  73. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js +9 -6
  74. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js.map +1 -1
  75. package/lib/module/components/Reels/ReelsSeries/utils/quality.js +19 -15
  76. package/lib/module/components/Reels/ReelsSeries/utils/quality.js.map +1 -1
  77. package/lib/module/hooks/useSplashCache.js +120 -85
  78. package/lib/module/hooks/useSplashCache.js.map +1 -1
  79. package/lib/typescript/src/components/Auth/One/ForgotPassword/ForgotPassword.d.ts.map +1 -1
  80. package/lib/typescript/src/components/Auth/One/Login/LoginWithEmail.d.ts.map +1 -1
  81. package/lib/typescript/src/components/Auth/One/Login/LoginWithPhone.d.ts.map +1 -1
  82. package/lib/typescript/src/components/Auth/One/OTP/OTP.d.ts.map +1 -1
  83. package/lib/typescript/src/components/Auth/One/SignUp/SignUp.d.ts.map +1 -1
  84. package/lib/typescript/src/components/Auth/One/SplashScreen/SplashScreen.d.ts.map +1 -1
  85. package/lib/typescript/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.d.ts +4 -0
  86. package/lib/typescript/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.d.ts.map +1 -1
  87. package/lib/typescript/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +1 -1
  88. package/lib/typescript/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.d.ts +1 -0
  89. package/lib/typescript/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +1 -1
  90. package/lib/typescript/src/components/Auth/One/index.d.ts.map +1 -1
  91. package/lib/typescript/src/components/Auth/Two/AuthHeader/AuthHeader.d.ts.map +1 -1
  92. package/lib/typescript/src/components/Auth/Two/ForgotPassword/ForgotPassword.d.ts.map +1 -1
  93. package/lib/typescript/src/components/Auth/Two/Login/EmailOrPhoneLogin.d.ts +47 -0
  94. package/lib/typescript/src/components/Auth/Two/Login/EmailOrPhoneLogin.d.ts.map +1 -0
  95. package/lib/typescript/src/components/Auth/Two/OTP/OTP.d.ts +0 -12
  96. package/lib/typescript/src/components/Auth/Two/OTP/OTP.d.ts.map +1 -1
  97. package/lib/typescript/src/components/Auth/Two/SignUp/SignUp.d.ts +1 -17
  98. package/lib/typescript/src/components/Auth/Two/SignUp/SignUp.d.ts.map +1 -1
  99. package/lib/typescript/src/components/Auth/Two/index.d.ts +33 -85
  100. package/lib/typescript/src/components/Auth/Two/index.d.ts.map +1 -1
  101. package/lib/typescript/src/components/Auth/index.d.ts +33 -85
  102. package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
  103. package/lib/typescript/src/components/BackgroundLayout/{BackgroundLayout.d.ts → One/One.d.ts} +5 -5
  104. package/lib/typescript/src/components/BackgroundLayout/One/One.d.ts.map +1 -0
  105. package/lib/typescript/src/components/BackgroundLayout/{BackgroundLayoutOne.d.ts → Two/Two.d.ts} +4 -3
  106. package/lib/typescript/src/components/BackgroundLayout/Two/Two.d.ts.map +1 -0
  107. package/lib/typescript/src/components/BackgroundLayout/index.d.ts +20 -0
  108. package/lib/typescript/src/components/BackgroundLayout/index.d.ts.map +1 -0
  109. package/lib/typescript/src/components/ContentView/One/components/AboutSection.d.ts +3 -3
  110. package/lib/typescript/src/components/ContentView/One/components/AboutSection.d.ts.map +1 -1
  111. package/lib/typescript/src/components/ContentView/One/components/GenreTags.d.ts +1 -1
  112. package/lib/typescript/src/components/ContentView/One/components/GenreTags.d.ts.map +1 -1
  113. package/lib/typescript/src/components/ContentView/Two/components/AboutSection.d.ts +1 -1
  114. package/lib/typescript/src/components/ContentView/Two/components/AboutSection.d.ts.map +1 -1
  115. package/lib/typescript/src/components/ContentView/Two/components/Details.d.ts.map +1 -1
  116. package/lib/typescript/src/components/ContentView/Two/components/GenreTags.d.ts +1 -1
  117. package/lib/typescript/src/components/ContentView/Two/components/GenreTags.d.ts.map +1 -1
  118. package/lib/typescript/src/components/ContentView/Two/components/SectionTabs.d.ts +1 -1
  119. package/lib/typescript/src/components/ContentView/Two/components/SectionTabs.d.ts.map +1 -1
  120. package/lib/typescript/src/components/ContentView/Two/components/Title.d.ts +1 -1
  121. package/lib/typescript/src/components/ContentView/Two/components/Title.d.ts.map +1 -1
  122. package/lib/typescript/src/components/Input/Input.d.ts +4 -2
  123. package/lib/typescript/src/components/Input/Input.d.ts.map +1 -1
  124. package/lib/typescript/src/components/Input/InputThree.d.ts +0 -1
  125. package/lib/typescript/src/components/Input/InputThree.d.ts.map +1 -1
  126. package/lib/typescript/src/components/Input/InputTwo.d.ts.map +1 -1
  127. package/lib/typescript/src/components/Input/{PhoneNumberInput.d.ts → PhoneInput/One/One.d.ts} +4 -4
  128. package/lib/typescript/src/components/Input/PhoneInput/One/One.d.ts.map +1 -0
  129. package/lib/typescript/src/components/Input/{PhoneNumberInputTwo.d.ts → PhoneInput/Two/Two.d.ts} +4 -4
  130. package/lib/typescript/src/components/Input/PhoneInput/Two/Two.d.ts.map +1 -0
  131. package/lib/typescript/src/components/Input/PhoneInput/index.d.ts +12 -0
  132. package/lib/typescript/src/components/Input/PhoneInput/index.d.ts.map +1 -0
  133. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts +4 -2
  134. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts.map +1 -1
  135. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts +5 -3
  136. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts.map +1 -1
  137. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts.map +1 -1
  138. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts +5 -12
  139. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts.map +1 -1
  140. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts +4 -0
  141. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts.map +1 -1
  142. package/lib/typescript/src/components/Reels/ReelsSeries/utils/quality.d.ts +1 -4
  143. package/lib/typescript/src/components/Reels/ReelsSeries/utils/quality.d.ts.map +1 -1
  144. package/lib/typescript/src/hooks/useSplashCache.d.ts +7 -10
  145. package/lib/typescript/src/hooks/useSplashCache.d.ts.map +1 -1
  146. package/package.json +1 -1
  147. package/lib/module/components/Auth/Two/Login/AuthLoginShell.js +0 -138
  148. package/lib/module/components/Auth/Two/Login/AuthLoginShell.js.map +0 -1
  149. package/lib/module/components/Auth/Two/Login/LoginWithEmail.js +0 -226
  150. package/lib/module/components/Auth/Two/Login/LoginWithEmail.js.map +0 -1
  151. package/lib/module/components/Auth/Two/Login/LoginWithPhone.js +0 -143
  152. package/lib/module/components/Auth/Two/Login/LoginWithPhone.js.map +0 -1
  153. package/lib/module/components/BackgroundLayout/BackgroundLayout.js.map +0 -1
  154. package/lib/module/components/BackgroundLayout/BackgroundLayoutOne.js.map +0 -1
  155. package/lib/module/components/Input/PhoneNumberInput.js.map +0 -1
  156. package/lib/module/components/Input/PhoneNumberInputTwo.js.map +0 -1
  157. package/lib/typescript/src/components/Auth/Two/Login/AuthLoginShell.d.ts +0 -17
  158. package/lib/typescript/src/components/Auth/Two/Login/AuthLoginShell.d.ts.map +0 -1
  159. package/lib/typescript/src/components/Auth/Two/Login/LoginWithEmail.d.ts +0 -52
  160. package/lib/typescript/src/components/Auth/Two/Login/LoginWithEmail.d.ts.map +0 -1
  161. package/lib/typescript/src/components/Auth/Two/Login/LoginWithPhone.d.ts +0 -37
  162. package/lib/typescript/src/components/Auth/Two/Login/LoginWithPhone.d.ts.map +0 -1
  163. package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts.map +0 -1
  164. package/lib/typescript/src/components/BackgroundLayout/BackgroundLayoutOne.d.ts.map +0 -1
  165. package/lib/typescript/src/components/Input/PhoneNumberInput.d.ts.map +0 -1
  166. package/lib/typescript/src/components/Input/PhoneNumberInputTwo.d.ts.map +0 -1
@@ -10,27 +10,29 @@ import SplashImage from "./components/SplashImage/SplashImage.js";
10
10
  import SplashVideo from "./components/SplashVideo/SplashVideo.js";
11
11
  import SplashLottie from "./components/SplashLottie/SplashLottie.js";
12
12
  import { useInternalTheme } from "../../../../theme/hook/useInternalTheme.js";
13
- import { BackgroundLayout } from "../../../BackgroundLayout/BackgroundLayout.js";
14
13
  import { useSplashCache } from "../../../../hooks/useSplashCache.js";
15
14
  import { AppStatusBar } from "../../../common/AppStatusBar.js";
15
+ import { BackgroundLayout } from "../../../BackgroundLayout/index.js";
16
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  const DEFAULT_IMAGE_TIMEOUT = 5;
18
18
  const FALLBACK_TIMEOUT = 0.5;
19
19
 
20
- // Move extension arrays outside component to prevent recreation
21
- const VIDEO_EXTENSIONS = ['.mp4', '.mov', '.mkv', '.webm', '.avi', '.3gp'];
22
- const LOTTIE_EXTENSIONS = ['.json', '.lottie'];
20
+ // Stable module-level default prevents a new object reference on every render
21
+ // when the caller omits the backgroundImage prop.
22
+ const DEFAULT_BG_IMAGE = {
23
+ gradientSplitBackground: 0.4,
24
+ resizeMode: 'cover'
25
+ };
23
26
  export const SplashScreen = /*#__PURE__*/React.memo(({
24
27
  splashScreenConfig,
25
28
  innerContainerStyle,
26
- backgroundImage = {
27
- gradientSplitBackground: 0.4,
28
- resizeMode: 'cover'
29
- },
29
+ backgroundImage = DEFAULT_BG_IMAGE,
30
30
  onRedirect,
31
31
  theme: overrideTheme
32
32
  }) => {
33
- useInternalTheme(overrideTheme);
33
+ const {
34
+ theme
35
+ } = useInternalTheme(overrideTheme);
34
36
  const {
35
37
  source: splashSource = '',
36
38
  type: splashType = 'image',
@@ -42,23 +44,20 @@ export const SplashScreen = /*#__PURE__*/React.memo(({
42
44
  resizeMode = 'contain',
43
45
  backgroundColor: splashBgColor
44
46
  } = splashScreenConfig || {};
47
+ const isImageSplash = splashType === 'image';
48
+ const isRemote = splashSource?.startsWith('http') ?? false;
45
49
 
46
- // Memoize computed values
47
- const isRemote = useMemo(() => splashSource?.startsWith('http') ?? false, [splashSource]);
48
- const isImageSplash = useMemo(() => splashType === 'image', [splashType]);
49
- const backgroundImageUrl = useMemo(() => isImageSplash && backgroundImage.source?.startsWith('http') ? backgroundImage.source : undefined, [isImageSplash, backgroundImage.source]);
50
+ // Direct scalar derivation (slower to useMemo this than just to compute it)
51
+ const resolvedBgColor = splashBgColor || (splashType === 'video' || splashType === 'lottie-animation' ? '#000000' : theme.colors.background);
52
+ const backgroundImageUrl = isImageSplash && backgroundImage?.source?.startsWith('http') ? backgroundImage.source : undefined;
50
53
  const {
51
54
  data
52
55
  } = useSplashCache({
53
56
  logoUrl: isRemote ? splashSource : undefined,
54
57
  backgroundUrl: backgroundImageUrl
55
58
  });
56
- const resolvedSplashUri = useMemo(() => (isRemote && data.logoPath ? data.logoPath : splashSource) || '', [isRemote, data.logoPath, splashSource]);
57
- const displayTimeout = useMemo(() => {
58
- if (typeof screenTime === 'number' && screenTime > 0) return screenTime;
59
- if (isImageSplash || isStatic) return DEFAULT_IMAGE_TIMEOUT;
60
- return 0;
61
- }, [screenTime, isImageSplash, isStatic]);
59
+ const resolvedSplashUri = isRemote && data.logoPath ? data.logoPath.startsWith('file://') ? data.logoPath : `file://${data.logoPath}` : splashSource || '';
60
+ const displayTimeout = typeof screenTime === 'number' && screenTime > 0 ? screenTime : isImageSplash || isStatic ? DEFAULT_IMAGE_TIMEOUT : 0;
62
61
  const handleRedirect = useCallback(() => {
63
62
  try {
64
63
  onRedirect();
@@ -67,76 +66,58 @@ export const SplashScreen = /*#__PURE__*/React.memo(({
67
66
  }
68
67
  }, [onRedirect]);
69
68
  useEffect(() => {
70
- const timeoutSec = displayTimeout > 0 ? displayTimeout : FALLBACK_TIMEOUT;
71
- const timer = setTimeout(handleRedirect, timeoutSec * 1000);
69
+ const ms = (displayTimeout > 0 ? displayTimeout : FALLBACK_TIMEOUT) * 1000;
70
+ const timer = setTimeout(handleRedirect, ms);
72
71
  return () => clearTimeout(timer);
73
72
  }, [displayTimeout, handleRedirect]);
74
- const splashProps = useMemo(() => ({
75
- source: resolvedSplashUri,
76
- width,
77
- height,
78
- fullscreen,
79
- resizeMode: resizeMode
80
- }), [resolvedSplashUri, width, height, fullscreen, resizeMode]);
81
-
82
- // Memoize file type checks
83
- const isVideoFile = useMemo(() => VIDEO_EXTENSIONS.some(ext => resolvedSplashUri.toLowerCase().endsWith(ext)), [resolvedSplashUri]);
84
- const isLottieFile = useMemo(() => LOTTIE_EXTENSIONS.some(ext => resolvedSplashUri.toLowerCase().endsWith(ext)), [resolvedSplashUri]);
85
-
86
- // Memoize video onEnd handler
87
- const videoOnEnd = useMemo(() => displayTimeout ? undefined : handleRedirect, [displayTimeout, handleRedirect]);
88
-
89
- // Memoize lottie onAnimationFinish handler
90
- const lottieOnAnimationFinish = useMemo(() => displayTimeout ? undefined : handleRedirect, [displayTimeout, handleRedirect]);
91
-
92
- // Memoize BackgroundLayout props
93
- const backgroundLayoutProps = useMemo(() => ({
94
- backgroundImage: isImageSplash ? backgroundImage.source : undefined,
95
- backgroundColor: splashBgColor,
96
- resizeMode: backgroundImage.resizeMode ?? 'cover',
97
- innerContainerStyle,
98
- onImageError: backgroundImage.onImageError,
99
- theme: overrideTheme,
100
- gradientSplitBackground: backgroundImage.gradientSplitBackground ?? 0.4
101
- }), [isImageSplash, backgroundImage.source, backgroundImage.resizeMode, backgroundImage.onImageError, backgroundImage.gradientSplitBackground, splashBgColor, innerContainerStyle, overrideTheme]);
73
+ const videoOnEnd = displayTimeout ? undefined : handleRedirect;
74
+ const lottieOnAnimationFinish = displayTimeout ? undefined : handleRedirect;
102
75
 
103
- // Memoize AppStatusBar theme
76
+ // Stability for the theme object passed as a single prop
104
77
  const appStatusBarTheme = useMemo(() => ({
105
78
  ...overrideTheme,
106
79
  dark: {
107
80
  ...overrideTheme?.dark,
108
- background: splashBgColor
81
+ background: resolvedBgColor
109
82
  },
110
83
  light: {
111
84
  ...overrideTheme?.light,
112
- background: splashBgColor
113
- }
114
- }), [overrideTheme, splashBgColor]);
115
- const renderSplashContent = useCallback(() => {
116
- switch (splashType) {
117
- case 'video':
118
- return isVideoFile ? /*#__PURE__*/_jsx(SplashVideo, {
119
- ...splashProps,
120
- onEnd: videoOnEnd
121
- }) : null;
122
- case 'lottie-animation':
123
- return isLottieFile ? /*#__PURE__*/_jsx(SplashLottie, {
124
- ...splashProps,
125
- onAnimationFinish: lottieOnAnimationFinish
126
- }) : null;
127
- case 'image':
128
- default:
129
- return /*#__PURE__*/_jsx(SplashImage, {
130
- ...splashProps,
131
- theme: overrideTheme
132
- });
85
+ background: resolvedBgColor
133
86
  }
134
- }, [splashType, isVideoFile, splashProps, videoOnEnd, isLottieFile, lottieOnAnimationFinish, overrideTheme]);
135
- return /*#__PURE__*/_jsxs(BackgroundLayout, {
136
- ...backgroundLayoutProps,
87
+ }), [overrideTheme, resolvedBgColor]);
88
+ return /*#__PURE__*/_jsxs(BackgroundLayout.One, {
89
+ backgroundImage: isImageSplash ? backgroundImage.source : undefined,
90
+ backgroundColor: resolvedBgColor,
91
+ resizeMode: backgroundImage.resizeMode ?? 'cover',
92
+ innerContainerStyle: innerContainerStyle,
93
+ onImageError: backgroundImage.onImageError,
94
+ theme: overrideTheme,
95
+ gradientSplitBackground: backgroundImage.gradientSplitBackground ?? 0.4,
137
96
  children: [/*#__PURE__*/_jsx(AppStatusBar, {
138
97
  theme: appStatusBarTheme
139
- }), renderSplashContent()]
98
+ }), splashType === 'video' && resolvedSplashUri ? /*#__PURE__*/_jsx(SplashVideo, {
99
+ source: resolvedSplashUri,
100
+ width: width,
101
+ height: height,
102
+ fullscreen: fullscreen,
103
+ resizeMode: resizeMode,
104
+ backgroundColor: resolvedBgColor,
105
+ onEnd: videoOnEnd
106
+ }) : splashType === 'lottie-animation' && resolvedSplashUri ? /*#__PURE__*/_jsx(SplashLottie, {
107
+ source: resolvedSplashUri,
108
+ width: width,
109
+ height: height,
110
+ fullscreen: fullscreen,
111
+ resizeMode: resizeMode,
112
+ onAnimationFinish: lottieOnAnimationFinish
113
+ }) : splashType === 'image' || !resolvedSplashUri ? /*#__PURE__*/_jsx(SplashImage, {
114
+ source: resolvedSplashUri,
115
+ width: width,
116
+ height: height,
117
+ fullscreen: fullscreen,
118
+ resizeMode: resizeMode,
119
+ theme: overrideTheme
120
+ }) : null]
140
121
  });
141
122
  });
142
123
  //# sourceMappingURL=SplashScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useCallback","SplashImage","SplashVideo","SplashLottie","useInternalTheme","BackgroundLayout","useSplashCache","AppStatusBar","jsx","_jsx","jsxs","_jsxs","DEFAULT_IMAGE_TIMEOUT","FALLBACK_TIMEOUT","VIDEO_EXTENSIONS","LOTTIE_EXTENSIONS","SplashScreen","memo","splashScreenConfig","innerContainerStyle","backgroundImage","gradientSplitBackground","resizeMode","onRedirect","theme","overrideTheme","source","splashSource","type","splashType","width","height","isStatic","screenTime","fullscreen","backgroundColor","splashBgColor","isRemote","startsWith","isImageSplash","backgroundImageUrl","undefined","data","logoUrl","backgroundUrl","resolvedSplashUri","logoPath","displayTimeout","handleRedirect","err","console","error","timeoutSec","timer","setTimeout","clearTimeout","splashProps","isVideoFile","some","ext","toLowerCase","endsWith","isLottieFile","videoOnEnd","lottieOnAnimationFinish","backgroundLayoutProps","onImageError","appStatusBarTheme","dark","background","light","renderSplashContent","onEnd","onAnimationFinish","children"],"sourceRoot":"../../../../../../src","sources":["components/Auth/One/SplashScreen/SplashScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAE9D,OAAOC,WAAW,MAAM,yCAAsC;AAC9D,OAAOC,WAAW,MAAM,yCAAsC;AAC9D,OAAOC,YAAY,MAAM,2CAAwC;AAGjE,SAASC,gBAAgB,QAAQ,4CAAyC;AAE1E,SAASC,gBAAgB,QAAQ,+CAA4C;AAC7E,SAASC,cAAc,QAAQ,qCAAkC;AACjE,SAASC,YAAY,QAAQ,iCAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8B5D,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,gBAAgB,GAAG,GAAG;;AAE5B;AACA,MAAMC,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,E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G0B,aAAa;IAChB2C,IAAI,EAAE;MACJ,GAAG3C,aAAa,EAAE2C,IAAI;MACtBC,UAAU,EAAEjC;IACd,CAAC;IACDkC,KAAK,EAAE;MACL,GAAG7C,aAAa,EAAE6C,KAAK;MACvBD,UAAU,EAAEjC;IACd;EACF,CAAC,CAAC,EACF,CAACX,aAAa,EAAEW,aAAa,CAC/B,CAAC;EAED,MAAMmC,mBAAmB,GAAGvE,WAAW,CAAC,MAAM;IAC5C,QAAQ6B,UAAU;MAChB,KAAK,OAAO;QACV,OAAO4B,WAAW,gBAChBhD,IAAA,CAACP,WAAW;UAAA,GAAKsD,WAAW;UAAEgB,KAAK,EAAET;QAAW,CAAE,CAAC,GACjD,IAAI;MAEV,KAAK,kBAAkB;QACrB,OAAOD,YAAY,gBACjBrD,IAAA,CAACN,YAAY;UAAA,GACPqD,WAAW;UACfiB,iBAAiB,EAAET;QAAwB,CAC5C,CAAC,GACA,IAAI;MAEV,KAAK,OAAO;MACZ;QACE,oBAAOvD,IAAA,CAACR,WAAW;UAAA,GAAKuD,WAAW;UAAEhC,KAAK,EAAEC;QAAc,CAAE,CAAC;IACjE;EACF,CAAC,EAAE,CACDI,UAAU,EACV4B,WAAW,EACXD,WAAW,EACXO,UAAU,EACVD,YAAY,EACZE,uBAAuB,EACvBvC,aAAa,CACd,CAAC;EAEF,oBACEd,KAAA,CAACN,gBAAgB;IAAA,GAAK4D,qBAAqB;IAAAS,QAAA,gBACzCjE,IAAA,CAACF,YAAY;MAACiB,KAAK,EAAE2C;IAAkB,CAAE,CAAC,EACzCI,mBAAmB,CAAC,CAAC;EAAA,CACN,CAAC;AAEvB,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useMemo","useCallback","SplashImage","SplashVideo","SplashLottie","useInternalTheme","useSplashCache","AppStatusBar","BackgroundLayout","jsx","_jsx","jsxs","_jsxs","DEFAULT_IMAGE_TIMEOUT","FALLBACK_TIMEOUT","DEFAULT_BG_IMAGE","gradientSplitBackground","resizeMode","SplashScreen","memo","splashScreenConfig","innerContainerStyle","backgroundImage","onRedirect","theme","overrideTheme","source","splashSource","type","splashType","width","height","isStatic","screenTime","fullscreen","backgroundColor","splashBgColor","isImageSplash","isRemote","startsWith","resolvedBgColor","colors","background","backgroundImageUrl","undefined","data","logoUrl","backgroundUrl","resolvedSplashUri","logoPath","displayTimeout","handleRedirect","err","console","error","ms","timer","setTimeout","clearTimeout","videoOnEnd","lottieOnAnimationFinish","appStatusBarTheme","dark","light","One","onImageError","children","onEnd","onAnimationFinish"],"sourceRoot":"../../../../../../src","sources":["components/Auth/One/SplashScreen/SplashScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAE9D,OAAOC,WAAW,MAAM,yCAAsC;AAC9D,OAAOC,WAAW,MAAM,yCAAsC;AAC9D,OAAOC,YAAY,MAAM,2CAAwC;AAGjE,SAASC,gBAAgB,QAAQ,4CAAyC;AAC1E,SAASC,cAAc,QAAQ,qCAAkC;AACjE,SAASC,YAAY,QAAQ,iCAA8B;AAC3D,SAASC,gBAAgB,QAAQ,oCAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8B7D,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,gBAAgB,GAAG,GAAG;;AAE5B;AACA;AACA,MAAMC,gBAAmE,GAAG;EAC1EC,uBAAuB,EAAE,GAAG;EAC5BC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,MAAMC,YAAyC,gBAAGpB,KAAK,CAACqB,IAAI,CACjE,CAAC;EACCC,kBAAkB;EAClBC,mBAAmB;EACnBC,eAAe,GAAGP,gBAAgB;EAClCQ,UAAU;EACVC,KAAK,EAAEC;AACT,CAAC,KAAK;EACJ,MAAM;IAAED;EAAM,CAAC,GAAGnB,gBAAgB,CAACoB,aAAa,CAAC;EAEjD,MAAM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,IAAI,GAAI;IAAAkD,QAAA,gBAExExD,IAAA,CAACH,YAAY;MAACiB,KAAK,EAAEqC;IAAkB,CAAE,CAAC,EAEzChC,UAAU,KAAK,OAAO,IAAImB,iBAAiB,gBAC1CtC,IAAA,CAACP,WAAW;MACVuB,MAAM,EAAEsB,iBAAkB;MAC1BlB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA,MAAO;MACfG,UAAU,EAAEA,UAAW;MACvBjB,UAAU,EAAEA,UAAkB;MAC9BkB,eAAe,EAAEK,eAAgB;MACjC2B,KAAK,EAAER;IAAW,CACnB,CAAC,GACA9B,UAAU,KAAK,kBAAkB,IAAImB,iBAAiB,gBACxDtC,IAAA,CAACN,YAAY;MACXsB,MAAM,EAAEsB,iBAAkB;MAC1BlB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA,MAAO;MACfG,UAAU,EAAEA,UAAW;MACvBjB,UAAU,EAAEA,UAAkB;MAC9BmD,iBAAiB,EAAER;IAAwB,CAC5C,CAAC,GACA/B,UAAU,KAAK,OAAO,IAAI,CAACmB,iBAAiB,gBAC9CtC,IAAA,CAACR,WAAW;MACVwB,MAAM,EAAEsB,iBAAkB;MAC1BlB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA,MAAO;MACfG,UAAU,EAAEA,UAAW;MACvBjB,UAAU,EAAEA,UAAkB;MAC9BO,KAAK,EAAEC;IAAc,CACtB,CAAC,GACA,IAAI;EAAA,CACY,CAAC;AAE3B,CACF,CAAC","ignoreList":[]}
@@ -1,11 +1,20 @@
1
1
  "use strict";
2
2
 
3
- import React, { useState, useMemo, useCallback, useEffect } from 'react';
3
+ /**
4
+ * @author Naresh Dhamu
5
+ * @lastModified Thu 12 Jun 2025 at 09:22 AM
6
+ */
7
+ import React, { useState, useMemo } from 'react';
4
8
  import FastImage from 'react-native-fast-image';
5
9
  import { ActivityIndicator, View, StyleSheet } from 'react-native';
6
10
  import Display from "../../../../../../utils/Display.js";
7
11
  import { useInternalTheme } from "../../../../../../theme/hook/useInternalTheme.js";
8
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ const resolveUri = src => {
14
+ if (!src) return '';
15
+ if (src.startsWith('http') || src.startsWith('file://')) return src;
16
+ return `file://${src}`;
17
+ };
9
18
  const SplashImage = ({
10
19
  fullscreen,
11
20
  height,
@@ -17,34 +26,22 @@ const SplashImage = ({
17
26
  const {
18
27
  theme
19
28
  } = useInternalTheme(themeOverride);
20
- const [isLoading, setIsLoading] = useState(!!source);
21
29
 
22
- // Reset loading state when source changes
23
- useEffect(() => {
24
- if (source) {
25
- setIsLoading(true);
26
- }
27
- }, [source]);
30
+ // Track which source the loading flag belongs to.
31
+ // When source changes, update isLoading in the same render (no useEffect,
32
+ // no extra paint) using React's supported "setState during render" pattern.
33
+ const [trackedSource, setTrackedSource] = useState(source);
34
+ const [isLoading, setIsLoading] = useState(!!source);
35
+ if (trackedSource !== source) {
36
+ setTrackedSource(source);
37
+ setIsLoading(!!source);
38
+ }
28
39
  const imageStyles = useMemo(() => ({
29
40
  width: fullscreen ? Display.fullWidth : width,
30
41
  height: fullscreen ? Display.fullHeight : height,
31
42
  flex: 1
32
43
  }), [fullscreen, width, height]);
33
- const handleLoadEnd = useCallback(() => {
34
- setIsLoading(false);
35
- }, []);
36
- const handleError = useCallback(() => {
37
- setIsLoading(false);
38
- }, []);
39
-
40
- // Memoize URI resolution
41
- const resolvedUri = useMemo(() => {
42
- if (!source) return '';
43
- if (source.startsWith('http') || source.startsWith('https') || source.startsWith('file://')) return source;
44
- return `file://${source}`;
45
- }, [source]);
46
-
47
- // Memoize image source
44
+ const resolvedUri = resolveUri(source);
48
45
  const imageSource = useMemo(() => ({
49
46
  uri: resolvedUri
50
47
  }), [resolvedUri]);
@@ -57,10 +54,10 @@ const SplashImage = ({
57
54
  color: theme.colors.primary
58
55
  }), /*#__PURE__*/_jsx(FastImage, {
59
56
  source: imageSource,
60
- onLoadEnd: handleLoadEnd,
57
+ onLoadEnd: () => setIsLoading(false),
58
+ onError: () => setIsLoading(false),
61
59
  style: imageStyles,
62
- resizeMode: resizeMode,
63
- onError: handleError
60
+ resizeMode: resizeMode
64
61
  })]
65
62
  });
66
63
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","useMemo","useCallback","useEffect","FastImage","ActivityIndicator","View","StyleSheet","Display","useInternalTheme","jsx","_jsx","jsxs","_jsxs","SplashImage","fullscreen","height","resizeMode","source","width","theme","themeOverride","isLoading","setIsLoading","imageStyles","fullWidth","fullHeight","flex","handleLoadEnd","handleError","resolvedUri","startsWith","imageSource","uri","style","styles","container","children","size","loader","color","colors","primary","onLoadEnd","onError","create","justifyContent","alignItems","position","memo"],"sourceRoot":"../../../../../../../../src","sources":["components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AACxE,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,SAASC,iBAAiB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAClE,OAAOC,OAAO,MAAM,oCAAiC;AACrD,SAASC,gBAAgB,QAAQ,kDAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAajF,MAAMC,WAAuC,GAAGA,CAAC;EAC/CC,UAAU;EACVC,MAAM;EACNC,UAAU,GAAG,SAAS;EACtBC,MAAM;EACNC,KAAK;EACLC,KAAK,EAAEC;AACT,CAAC,KAAK;EACJ,MAAM;IAAED;EAAM,CAAC,GAAGX,gBAAgB,CAACY,aAAa,CAAC;EACjD,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGvB,QAAQ,CAAC,CAAC,CAACkB,MAAM,CAAC;;EAEpD;EACAf,SAAS,CAAC,MAAM;IACd,IAAIe,MAAM,EAAE;MACVK,YAAY,CAAC,IAAI,CAAC;IACpB;EACF,CAAC,EAAE,C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MAAM,CAACC;IAAQ,CAC7B,CACF,eACD/B,IAAA,CAACP,SAAS;MACRc,MAAM,EAAEc,WAAY;MACpBW,SAAS,EAAEf,aAAc;MACzBM,KAAK,EAAEV,WAAY;MACnBP,UAAU,EAAEA,UAAW;MACvB2B,OAAO,EAAEf;IAAY,CACtB,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAG5B,UAAU,CAACsC,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTT,IAAI,EAAE,CAAC;IACPR,KAAK,EAAEX,OAAO,CAACiB,SAAS;IACxBT,MAAM,EAAER,OAAO,CAACkB,UAAU;IAC1BoB,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDR,MAAM,EAAE;IACNS,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,4BAAejD,KAAK,CAACkD,IAAI,CAACnC,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","useMemo","FastImage","ActivityIndicator","View","StyleSheet","Display","useInternalTheme","jsx","_jsx","jsxs","_jsxs","resolveUri","src","startsWith","SplashImage","fullscreen","height","resizeMode","source","width","theme","themeOverride","trackedSource","setTrackedSource","isLoading","setIsLoading","imageStyles","fullWidth","fullHeight","flex","resolvedUri","imageSource","uri","style","styles","container","children","size","loader","color","colors","primary","onLoadEnd","onError","create","justifyContent","alignItems","position","memo"],"sourceRoot":"../../../../../../../../src","sources":["components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,SAASC,iBAAiB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAClE,OAAOC,OAAO,MAAM,oCAAiC;AACrD,SAASC,gBAAgB,QAAQ,kDAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAA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ACZ,MAAM,EAAE,OAAO,IAAI;EAExB,oBACER,KAAA,CAACP,IAAI;IAAC8B,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,GAC3BZ,SAAS,iBACRhB,IAAA,CAACN,iBAAiB;MAChBmC,IAAI,EAAC,OAAO;MACZJ,KAAK,EAAEC,MAAM,CAACI,MAAO;MACrBC,KAAK,EAAEnB,KAAK,CAACoB,MAAM,CAACC;IAAQ,CAC7B,CACF,eACDjC,IAAA,CAACP,SAAS;MACRiB,MAAM,EAAEa,WAAY;MACpBW,SAAS,EAAEA,CAAA,KAAMjB,YAAY,CAAC,KAAK,CAAE;MACrCkB,OAAO,EAAEA,CAAA,KAAMlB,YAAY,CAAC,KAAK,CAAE;MACnCQ,KAAK,EAAEP,WAAY;MACnBT,UAAU,EAAEA;IAAW,CACxB,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAED,MAAMiB,MAAM,GAAG9B,UAAU,CAACwC,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTN,IAAI,EAAE,CAAC;IACPV,KAAK,EAAEd,OAAO,CAACsB,SAAS;IACxBX,MAAM,EAAEX,OAAO,CAACuB,UAAU;IAC1BiB,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDR,MAAM,EAAE;IACNS,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,4BAAejD,KAAK,CAACkD,IAAI,CAAClC,WAAW,CAAC","ignoreList":[]}
@@ -4,11 +4,17 @@
4
4
  * @author Naresh Dhamu
5
5
  * @lastModified Thu 12 Jun 2025 at 09:22 AM
6
6
  */
7
- import React, { useMemo, useCallback } from 'react';
7
+ import React, { useMemo, useEffect, useState } from 'react';
8
8
  import LottieView from 'lottie-react-native';
9
9
  import { StyleSheet } from 'react-native';
10
+ import RNFS from 'react-native-fs';
10
11
  import Display from "../../../../../../utils/Display.js";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const isLocalPath = src => src.startsWith('file://') || src.startsWith('/');
14
+ const toFsPath = src => src.startsWith('file://') ? src.slice(7) : src;
15
+ const toFileUri = src => src.startsWith('file://') ? src : `file://${src}`;
16
+ const isLocalJson = src => isLocalPath(src) && src.toLowerCase().endsWith('.json');
17
+ const onFailure = err => console.error('[SplashLottie] Animation failed to load:', err);
12
18
  const SplashLottie = ({
13
19
  fullscreen,
14
20
  height,
@@ -17,28 +23,60 @@ const SplashLottie = ({
17
23
  width,
18
24
  onAnimationFinish
19
25
  }) => {
20
- // Memoize the style object
26
+ /**
27
+ * Synchronous resolution for all non-JSON sources:
28
+ * - remote http(s) URL → { uri: source }
29
+ * - local .lottie file → { uri: 'file://...' }
30
+ * - local .json file → null (async state below handles it)
31
+ * - unknown → { uri: source }
32
+ *
33
+ * This avoids an extra render for the common cases (remote URL / .lottie).
34
+ */
35
+ const syncSource = useMemo(() => {
36
+ if (!source || isLocalJson(source)) return null;
37
+ return {
38
+ uri: isLocalPath(source) ? toFileUri(source) : source
39
+ };
40
+ }, [source]);
41
+
42
+ // Only used for local .json files — requires async RNFS read
43
+ const [jsonSource, setJsonSource] = useState(null);
44
+ useEffect(() => {
45
+ if (!isLocalJson(source)) {
46
+ setJsonSource(null);
47
+ return;
48
+ }
49
+ let cancelled = false;
50
+ const fsPath = toFsPath(toFileUri(source));
51
+ const fileUri = toFileUri(source);
52
+ (async () => {
53
+ try {
54
+ if (!(await RNFS.exists(fsPath))) {
55
+ if (!cancelled) setJsonSource({
56
+ uri: fileUri
57
+ });
58
+ return;
59
+ }
60
+ const parsed = JSON.parse(await RNFS.readFile(fsPath, 'utf8'));
61
+ if (!cancelled) setJsonSource(parsed);
62
+ } catch {
63
+ if (!cancelled) setJsonSource({
64
+ uri: fileUri
65
+ });
66
+ }
67
+ })();
68
+ return () => {
69
+ cancelled = true;
70
+ };
71
+ }, [source]);
72
+ const lottieSource = isLocalJson(source) ? jsonSource : syncSource;
21
73
  const lottieStyle = useMemo(() => ({
22
74
  ...styles.base,
23
75
  width: fullscreen ? Display.fullWidth : width,
24
76
  height: fullscreen ? Display.fullHeight : height,
25
77
  ...(fullscreen ? styles.fullscreen : {})
26
78
  }), [fullscreen, width, height]);
27
-
28
- // Memoize Lottie source
29
- const lottieSource = useMemo(() => ({
30
- uri: source
31
- }), [source]);
32
-
33
- // Memoize error handler
34
- const handleAnimationFailure = useCallback(error => {
35
- console.error('Lottie animation failed to load:', error);
36
- }, []);
37
-
38
- // Early return if invalid source
39
- if (!source) {
40
- return null;
41
- }
79
+ if (!source || !lottieSource) return null;
42
80
  return /*#__PURE__*/_jsx(LottieView, {
43
81
  source: lottieSource,
44
82
  autoPlay: true,
@@ -46,7 +84,7 @@ const SplashLottie = ({
46
84
  onAnimationFinish: onAnimationFinish,
47
85
  style: lottieStyle,
48
86
  resizeMode: resizeMode,
49
- onAnimationFailure: handleAnimationFailure,
87
+ onAnimationFailure: onFailure,
50
88
  hardwareAccelerationAndroid: true,
51
89
  cacheComposition: true
52
90
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","useCallback","LottieView","StyleSheet","Display","jsx","_jsx","SplashLottie","fullscreen","height","source","resizeMode","width","onAnimationFinish","lottieStyle","styles","base","fullWidth","fullHeight","lottieSource","uri","handleAnimationFailure","error","console","autoPlay","loop","style","onAnimationFailure","hardwareAccelerationAndroid","cacheComposition","create","alignSelf","flex","memo"],"sourceRoot":"../../../../../../../../src","sources":["components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACnD,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,OAAO,MAAM,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAatD,MAAMC,YAA8B,GAAGA,CAAC;EACtCC,UAAU;EACVC,MAAM;EACNC,MAAM;EACNC,UAAU,GAAG,SAAS;EACtBC,K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names":["React","useMemo","useEffect","useState","LottieView","StyleSheet","RNFS","Display","jsx","_jsx","isLocalPath","src","startsWith","toFsPath","slice","toFileUri","isLocalJson","toLowerCase","endsWith","onFailure","err","console","error","SplashLottie","fullscreen","height","source","resizeMode","width","onAnimationFinish","syncSource","uri","jsonSource","setJsonSource","cancelled","fsPath","fileUri","exists","parsed","JSON","parse","readFile","lottieSource","lottieStyle","styles","base","fullWidth","fullHeight","autoPlay","loop","style","onAnimationFailure","hardwareAccelerationAndroid","cacheComposition","create","alignSelf","flex","memo"],"sourceRoot":"../../../../../../../../src","sources":["components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,OAAO,MAAM,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAatD,MAAMC,WAAW,GAAIC,GAAW,IAC9BA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,IAAID,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,MAAMC,QAAQ,GAAIF,GAAW,IAC3BA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,GAAGD,GAAG,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,GAAG;AAChD,MAAMI,SAAS,GAAIJ,GAAW,IAC5BA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,GAAGD,GAAG,GAAG,UAAUA,GAAG,EAAE;AACnD,MAAMK,WAAW,GAAIL,GAAW,IAC9BD,WAAW,CAACC,GAAG,CAAC,IAAIA,GAAG,CAACM,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,OAAO,CAAC;AAEzD,MAAMC,SAAS,GAAIC,GAAQ,IACzBC,OAAO,CAAC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6,17 +6,43 @@
6
6
  */
7
7
 
8
8
  import React, { useMemo, useCallback, useRef, useEffect } from 'react';
9
- import { StyleSheet, Animated, useWindowDimensions } from 'react-native';
9
+ import { StyleSheet, Animated, useWindowDimensions, View } from 'react-native';
10
10
  import Video from 'react-native-video';
11
11
  import Display from "../../../../../../utils/Display.js";
12
- import { View } from "../../../../../View/index.js";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const BUFFER_CONFIG = {
14
+ minBufferMs: 2000,
15
+ maxBufferMs: 10000,
16
+ bufferForPlaybackMs: 1000,
17
+ bufferForPlaybackAfterRebufferMs: 2000
18
+ };
19
+ const CONTROLS_HIDDEN = {
20
+ hideForward: true,
21
+ hideDuration: true,
22
+ hideFullscreen: true,
23
+ hidePlayPause: true,
24
+ hideNavigationBarOnFullScreenMode: true,
25
+ hideNotificationBarOnFullScreenMode: true,
26
+ hideNext: true,
27
+ hidePosition: true,
28
+ hidePrevious: true,
29
+ hideRewind: true,
30
+ hideSeekBar: true,
31
+ hideSettingButton: true
32
+ };
33
+ const resolveUri = src => {
34
+ if (!src) return '';
35
+ if (/^(https?|file):\/\//.test(src)) return src;
36
+ if (src.startsWith('/')) return `file://${src}`;
37
+ return src;
38
+ };
14
39
  const SplashVideo = ({
15
40
  fullscreen = true,
16
41
  width,
17
42
  height,
18
43
  source,
19
44
  resizeMode = 'cover',
45
+ backgroundColor = '#000000',
20
46
  onEnd,
21
47
  onLoadStart,
22
48
  onLoaded,
@@ -27,93 +53,57 @@ const SplashVideo = ({
27
53
  width: windowWidth,
28
54
  height: windowHeight
29
55
  } = useWindowDimensions();
30
-
31
- /** 🎨 Compute video dimensions – fullscreen uses 100% for all devices; otherwise use window dimensions */
56
+ const animateIn = useCallback(() => {
57
+ Animated.timing(fadeAnim, {
58
+ toValue: 1,
59
+ duration: 300,
60
+ useNativeDriver: true
61
+ }).start();
62
+ }, [fadeAnim]);
32
63
  const videoStyle = useMemo(() => {
33
- if (fullscreen) {
34
- return {
35
- width: '100%',
36
- height: '100%'
37
- };
38
- }
39
- const w = width ?? windowWidth ?? Display.fullWidth;
40
- const h = height ?? windowHeight ?? Display.fullHeight;
64
+ if (fullscreen) return {
65
+ width: '100%',
66
+ height: '100%'
67
+ };
41
68
  return {
42
- width: w,
43
- height: h
69
+ width: width ?? windowWidth ?? Display.fullWidth,
70
+ height: height ?? windowHeight ?? Display.fullHeight
44
71
  };
45
72
  }, [fullscreen, width, height, windowWidth, windowHeight]);
46
-
47
- /** 🎨 Fullscreen wrapper fills container so video covers entire screen on any device */
48
73
  const wrapperStyle = useMemo(() => fullscreen ? [StyleSheet.absoluteFillObject, {
49
74
  opacity: fadeAnim
50
75
  }] : [videoStyle, {
51
76
  opacity: fadeAnim,
52
77
  position: 'absolute'
53
78
  }], [fullscreen, videoStyle, fadeAnim]);
54
-
55
- /** 🌀 Fade-in animation */
56
- const animateIn = useCallback(() => {
57
- Animated.timing(fadeAnim, {
58
- toValue: 1,
59
- duration: 400,
60
- useNativeDriver: true
61
- }).start();
62
- }, [fadeAnim]);
63
-
64
- /** 📦 Resolve video URI */
65
- const resolveUri = useCallback(src => {
66
- if (!src) return '';
67
- if (/^(https?|file):\/\//.test(src)) return src;
68
- return `file://${src}`;
69
- }, []);
70
-
71
- /** 🔄 Video lifecycle handlers */
79
+ const resolvedUri = useMemo(() => resolveUri(source), [source]);
80
+ const videoSource = useMemo(() => ({
81
+ uri: resolvedUri
82
+ }), [resolvedUri]);
72
83
  const handleLoadStart = useCallback(() => {
73
84
  fadeAnim.setValue(0);
74
85
  onLoadStart?.();
75
86
  }, [fadeAnim, onLoadStart]);
76
87
  const handleLoad = useCallback(data => {
77
- animateIn();
78
88
  onLoaded?.(data);
79
- }, [animateIn, onLoaded]);
89
+ }, [onLoaded]);
90
+ const handleReadyForDisplay = useCallback(() => {
91
+ animateIn();
92
+ }, [animateIn]);
80
93
  const handleError = useCallback(err => {
81
- const errorMsg = err?.error?.message || err?.message || JSON.stringify(err) || 'Unknown video error';
82
- onError?.(errorMsg);
83
- }, [onError]);
84
-
85
- /** 🧹 Cleanup animation */
94
+ const msg = err?.error?.message || err?.message || JSON.stringify(err) || 'Unknown video error';
95
+ console.warn('[SplashVideo] Error:', msg);
96
+ onError?.(msg);
97
+ animateIn();
98
+ }, [onError, animateIn]);
86
99
  useEffect(() => {
87
100
  return () => fadeAnim.stopAnimation();
88
101
  }, [fadeAnim]);
89
-
90
- // Memoize resolved URI
91
- const resolvedUri = useMemo(() => resolveUri(source), [source, resolveUri]);
92
-
93
- // Memoize video source
94
- const videoSource = useMemo(() => ({
95
- uri: resolvedUri
96
- }), [resolvedUri]);
97
-
98
- // Memoize controls styles
99
- const controlsStyles = useMemo(() => ({
100
- hideForward: true,
101
- hideDuration: true,
102
- hideFullscreen: true,
103
- hidePlayPause: true,
104
- hideNavigationBarOnFullScreenMode: true,
105
- hideNotificationBarOnFullScreenMode: true,
106
- hideNext: true,
107
- hidePosition: true,
108
- hidePrevious: true,
109
- hideRewind: true,
110
- hideSeekBar: true,
111
- hideSettingButton: true
112
- }), []);
113
-
114
- /** 🧱 Render */
102
+ if (!resolvedUri) return null;
115
103
  return /*#__PURE__*/_jsx(View, {
116
- style: styles.container,
104
+ style: [styles.container, {
105
+ backgroundColor
106
+ }],
117
107
  children: /*#__PURE__*/_jsx(Animated.View, {
118
108
  style: wrapperStyle,
119
109
  children: /*#__PURE__*/_jsx(Video, {
@@ -123,14 +113,16 @@ const SplashVideo = ({
123
113
  paused: false,
124
114
  onLoadStart: handleLoadStart,
125
115
  onLoad: handleLoad,
116
+ onReadyForDisplay: handleReadyForDisplay,
126
117
  onError: handleError,
127
118
  onEnd: onEnd,
128
- controlsStyles: controlsStyles,
119
+ controlsStyles: CONTROLS_HIDDEN,
120
+ shutterColor: backgroundColor,
129
121
  ignoreSilentSwitch: "obey",
130
122
  playInBackground: false,
131
123
  playWhenInactive: false,
132
124
  allowsExternalPlayback: false,
133
- automaticallyWaitsToMinimizeStalling: true,
125
+ bufferConfig: BUFFER_CONFIG,
134
126
  controls: false,
135
127
  repeat: false
136
128
  })
@@ -142,7 +134,6 @@ const styles = StyleSheet.create({
142
134
  flex: 1,
143
135
  width: '100%',
144
136
  height: '100%',
145
- position: 'relative',
146
137
  alignSelf: 'stretch'
147
138
  },
148
139
  video: {