@mediacubeco/expo-template-fsd 2.1.4 → 2.2.0

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
  "private": false,
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "name": "@mediacubeco/expo-template-fsd",
5
5
  "description": "Application by Mediacube developers",
6
6
  "license": "MIT",
@@ -37,6 +37,9 @@
37
37
  "application"
38
38
  ],
39
39
  "dependencies": {
40
+ "@mediacubeco/base": "^workspace:*",
41
+ "@mediacubeco/base-react": "^workspace:*",
42
+ "@mediacubeco/base-react-native": "^workspace:*",
40
43
  "@tanstack/query-async-storage-persister": "^5.99.0",
41
44
  "@tanstack/react-query": "^5.99.0",
42
45
  "@tanstack/react-query-persist-client": "^5.99.0",
@@ -71,28 +74,25 @@
71
74
  "react-native-screens": "~4.25.2",
72
75
  "react-native-svg": "15.15.4",
73
76
  "react-native-web": "^0.21.0",
74
- "react-native-worklets": "0.8.3",
75
- "@mediacubeco/base": "2.1.0",
76
- "@mediacubeco/base-react": "2.1.0",
77
- "@mediacubeco/base-react-native": "2.1.0"
77
+ "react-native-worklets": "0.8.3"
78
78
  },
79
79
  "devDependencies": {
80
+ "@mediacubeco/eslint-config": "^workspace:*",
81
+ "@mediacubeco/eslint-config-fsd": "^workspace:*",
82
+ "@mediacubeco/eslint-config-react": "^workspace:*",
83
+ "@mediacubeco/eslint-config-react-native": "^workspace:*",
84
+ "@mediacubeco/prettier-config": "^workspace:*",
85
+ "@mediacubeco/prettier-config-fsd": "^workspace:*",
86
+ "@mediacubeco/typescript-config": "^workspace:*",
87
+ "@mediacubeco/typescript-config-fsd": "^workspace:*",
88
+ "@mediacubeco/typescript-config-react": "^workspace:*",
89
+ "@mediacubeco/typescript-config-react-native": "^workspace:*",
80
90
  "@types/react": "^19.2.0",
81
91
  "@types/react-dom": "^19.2.3",
82
92
  "eslint": "^9.39.1",
83
93
  "husky": "^9.1.7",
84
94
  "prettier": "^3.8.1",
85
- "typescript": "^6.0.3",
86
- "@mediacubeco/eslint-config": "2.1.0",
87
- "@mediacubeco/eslint-config-react-native": "2.1.0",
88
- "@mediacubeco/prettier-config": "2.1.0",
89
- "@mediacubeco/eslint-config-fsd": "2.1.0",
90
- "@mediacubeco/prettier-config-fsd": "2.1.0",
91
- "@mediacubeco/eslint-config-react": "2.1.0",
92
- "@mediacubeco/typescript-config": "2.1.0",
93
- "@mediacubeco/typescript-config-fsd": "2.1.0",
94
- "@mediacubeco/typescript-config-react": "2.1.0",
95
- "@mediacubeco/typescript-config-react-native": "2.1.0"
95
+ "typescript": "^6.0.3"
96
96
  },
97
97
  "scripts": {
98
98
  "postinstall": "npx husky && npx skills update",
@@ -168,7 +168,13 @@ const useAnimated = <Value extends AnimatedState = AnimatedState>(
168
168
  ): Range[number] => {
169
169
  'worklet'
170
170
 
171
- const defaultInputRange = range.map((_, index, { length }) => (1 / (length - 1)) * index)
171
+ const defaultInputRange: number[] = []
172
+
173
+ const segments = range.length - 1
174
+
175
+ for (let index = 0; index < range.length; index += 1) {
176
+ defaultInputRange.push(segments > 0 ? (1 / segments) * index : 0)
177
+ }
172
178
 
173
179
  if (typeof range[0] === 'number') {
174
180
  return reInterpolate(
@@ -16,7 +16,7 @@ const formatRoute = <Params extends ApiInstanceDefaultParams>(
16
16
  const query = new URLSearchParams(params).toString()
17
17
  const validRoute = route.endsWith('/') ? route.slice(0, -1) : route
18
18
 
19
- return [validRoute, query].join('?') as ApiInstanceRoute
19
+ return [validRoute, query].filter(Boolean).join('?') as ApiInstanceRoute
20
20
  }
21
21
 
22
22
  export { formatURI, formatRoute }
@@ -14,7 +14,7 @@ const localStorageFallback = {
14
14
  },
15
15
  }
16
16
 
17
- const webStorage = typeof window !== 'undefined' ? localStorage : localStorageFallback
17
+ const webStorage = typeof localStorage !== 'undefined' ? localStorage : localStorageFallback
18
18
 
19
19
  const storageModelWeb = {
20
20
  getItem: (key: string) => Promise.resolve(webStorage.getItem(key)),
@@ -9,7 +9,10 @@ import { type ThemeProviderProps } from './theme.types'
9
9
  const ThemeProvider = ({ children }: ThemeProviderProps) => {
10
10
  const didDefine = useRef(false)
11
11
  const [themeMode, setThemeMode] = useState(hasDarkMode ? ThemeMode.System : ThemeMode.Light)
12
- const themeModeSystem = (useColorScheme() as ThemeModeSystem) ?? ThemeModeSystem.Light
12
+ const colorScheme = useColorScheme()
13
+
14
+ const themeModeSystem =
15
+ colorScheme === 'unspecified' ? ThemeModeSystem.Light : (colorScheme as ThemeModeSystem)
13
16
 
14
17
  const currentThemeMode = {
15
18
  [ThemeMode.Light]: ThemeModeSystem.Light,
@@ -21,6 +24,10 @@ const ThemeProvider = ({ children }: ThemeProviderProps) => {
21
24
  return themes[currentThemeMode]
22
25
  }, [currentThemeMode])
23
26
 
27
+ const value = useMemo(() => {
28
+ return { theme, themeMode, themeModeSystem, setThemeMode }
29
+ }, [theme, themeMode, themeModeSystem, setThemeMode])
30
+
24
31
  const updateThemeModeSystem = useCallback((themeMode: ThemeMode) => {
25
32
  if (Platform.isIos) {
26
33
  if (!hasDarkMode) {
@@ -67,11 +74,7 @@ const ThemeProvider = ({ children }: ThemeProviderProps) => {
67
74
  )
68
75
  }, [currentThemeMode])
69
76
 
70
- return (
71
- <ThemeContext.Provider value={{ theme, themeMode, themeModeSystem, setThemeMode }}>
72
- {children}
73
- </ThemeContext.Provider>
74
- )
77
+ return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
75
78
  }
76
79
 
77
80
  export default ThemeProvider