@mediacubeco/expo-template-fsd 1.0.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.
Files changed (143) hide show
  1. package/.claude/mcp.json +0 -0
  2. package/.claude/rules/abstract-skills-agents.mdc +25 -0
  3. package/.claude/rules/app-routing.mdc +47 -0
  4. package/.claude/rules/exports-at-end.mdc +55 -0
  5. package/.claude/rules/kebab-case-naming.mdc +29 -0
  6. package/.claude/rules/prettier-eslint-typescript.mdc +24 -0
  7. package/.claude/settings.json +0 -0
  8. package/.claude/skills/generate-api-model/SKILL.md +98 -0
  9. package/.claude/skills/generate-api-model-mock/SKILL.md +56 -0
  10. package/.env +1 -0
  11. package/.env.example +1 -0
  12. package/.husky/pre-commit +6 -0
  13. package/.secret/README.md +26 -0
  14. package/README.md +36 -0
  15. package/app.config.js +54 -0
  16. package/env.d.ts +7 -0
  17. package/eslint.config.js +14 -0
  18. package/i18next.d.ts +12 -0
  19. package/package.json +76 -0
  20. package/prettier.config.js +9 -0
  21. package/src/app/_app.tsx +18 -0
  22. package/src/app/_layout.tsx +20 -0
  23. package/src/app/_splash.tsx +22 -0
  24. package/src/entities/.gitkeep +0 -0
  25. package/src/features/.gitkeep +0 -0
  26. package/src/screens/.gitkeep +0 -0
  27. package/src/shared/assets/fonts/index.ts +7 -0
  28. package/src/shared/assets/icons/index.ts +3 -0
  29. package/src/shared/assets/icons/like.tsx +17 -0
  30. package/src/shared/assets/icons/type.ts +6 -0
  31. package/src/shared/assets/images/default.png +0 -0
  32. package/src/shared/assets/images/index.ts +11 -0
  33. package/src/shared/assets/images/logo-android-background.png +0 -0
  34. package/src/shared/assets/images/logo-android-foreground.png +0 -0
  35. package/src/shared/assets/images/logo-android-monochrome.png +0 -0
  36. package/src/shared/assets/images/logo-ios.png +0 -0
  37. package/src/shared/assets/images/logo-web.png +0 -0
  38. package/src/shared/assets/images/splash-dark.png +0 -0
  39. package/src/shared/assets/images/splash.png +0 -0
  40. package/src/shared/assets/index.ts +4 -0
  41. package/src/shared/assets/translations/en.ts +3 -0
  42. package/src/shared/assets/translations/index.ts +9 -0
  43. package/src/shared/assets/translations/ru.ts +3 -0
  44. package/src/shared/constants/environment.ts +13 -0
  45. package/src/shared/constants/index.ts +1 -0
  46. package/src/shared/hooks/index.ts +4 -0
  47. package/src/shared/hooks/use-animated.ts +194 -0
  48. package/src/shared/hooks/use-breakpoints.ts +25 -0
  49. package/src/shared/hooks/use-mixins.ts +36 -0
  50. package/src/shared/hooks/use-safe-area.ts +56 -0
  51. package/src/shared/lib/api/api.provider.tsx +47 -0
  52. package/src/shared/lib/api/api.ts +7 -0
  53. package/src/shared/lib/api/api.types.ts +9 -0
  54. package/src/shared/lib/api/constants/index.ts +6 -0
  55. package/src/shared/lib/api/entities/common.ts +28 -0
  56. package/src/shared/lib/api/entities/index.ts +1 -0
  57. package/src/shared/lib/api/hooks/common.ts +31 -0
  58. package/src/shared/lib/api/hooks/index.ts +0 -0
  59. package/src/shared/lib/api/index.ts +4 -0
  60. package/src/shared/lib/api/models/api-instance/api-instance.constants.ts +9 -0
  61. package/src/shared/lib/api/models/api-instance/api-instance.ts +118 -0
  62. package/src/shared/lib/api/models/api-instance/api-instance.types.ts +31 -0
  63. package/src/shared/lib/api/models/api-instance/api-instance.utils.ts +22 -0
  64. package/src/shared/lib/api/models/api-instance/index.ts +1 -0
  65. package/src/shared/lib/api/models/index.ts +1 -0
  66. package/src/shared/lib/api/repositories/auth/auth.ts +18 -0
  67. package/src/shared/lib/api/repositories/auth/auth.types.ts +22 -0
  68. package/src/shared/lib/api/repositories/auth/index.ts +1 -0
  69. package/src/shared/lib/api/repositories/index.ts +1 -0
  70. package/src/shared/lib/api/resources/common.ts +8 -0
  71. package/src/shared/lib/api/resources/index.ts +1 -0
  72. package/src/shared/lib/api/utils/index.ts +1 -0
  73. package/src/shared/lib/api/utils/storage.ts +9 -0
  74. package/src/shared/lib/index.ts +4 -0
  75. package/src/shared/lib/localization/components/index.ts +1 -0
  76. package/src/shared/lib/localization/components/localization-translate/index.ts +1 -0
  77. package/src/shared/lib/localization/components/localization-translate/localization-translate.tsx +5 -0
  78. package/src/shared/lib/localization/components/localization-translate/localization-translate.types.ts +0 -0
  79. package/src/shared/lib/localization/constants/index.ts +54 -0
  80. package/src/shared/lib/localization/hooks/index.ts +2 -0
  81. package/src/shared/lib/localization/hooks/use-localization-setup.ts +34 -0
  82. package/src/shared/lib/localization/hooks/use-localization-text.ts +9 -0
  83. package/src/shared/lib/localization/hooks/use-localization.ts +23 -0
  84. package/src/shared/lib/localization/index.ts +4 -0
  85. package/src/shared/lib/localization/localization.provider.tsx +30 -0
  86. package/src/shared/lib/localization/localization.types.ts +5 -0
  87. package/src/shared/lib/localization/utils/index.ts +1 -0
  88. package/src/shared/lib/localization/utils/storage.ts +11 -0
  89. package/src/shared/lib/navigation/components/index.ts +1 -0
  90. package/src/shared/lib/navigation/components/navigation-logger/index.ts +1 -0
  91. package/src/shared/lib/navigation/components/navigation-logger/navigation-logger.ts +17 -0
  92. package/src/shared/lib/navigation/components/navigation-logger/navigation-logger.types.ts +0 -0
  93. package/src/shared/lib/navigation/hooks/index.ts +3 -0
  94. package/src/shared/lib/navigation/hooks/use-navigation-options.ts +94 -0
  95. package/src/shared/lib/navigation/hooks/use-navigation-params.ts +9 -0
  96. package/src/shared/lib/navigation/hooks/use-navigation.ts +9 -0
  97. package/src/shared/lib/navigation/index.ts +7 -0
  98. package/src/shared/lib/navigation/navigation.provider.tsx +26 -0
  99. package/src/shared/lib/navigation/navigation.types.ts +5 -0
  100. package/src/shared/lib/theme/constants/borders.ts +8 -0
  101. package/src/shared/lib/theme/constants/colors.ts +57 -0
  102. package/src/shared/lib/theme/constants/delays.ts +8 -0
  103. package/src/shared/lib/theme/constants/durations.ts +8 -0
  104. package/src/shared/lib/theme/constants/fonts.ts +7 -0
  105. package/src/shared/lib/theme/constants/index.ts +54 -0
  106. package/src/shared/lib/theme/constants/shadows.ts +40 -0
  107. package/src/shared/lib/theme/constants/sizes.ts +32 -0
  108. package/src/shared/lib/theme/constants/transparencies.ts +10 -0
  109. package/src/shared/lib/theme/constants/weights.ts +13 -0
  110. package/src/shared/lib/theme/hooks/index.ts +2 -0
  111. package/src/shared/lib/theme/hooks/use-theme-mode.ts +9 -0
  112. package/src/shared/lib/theme/hooks/use-theme-setup.ts +49 -0
  113. package/src/shared/lib/theme/hooks/use-theme.ts +15 -0
  114. package/src/shared/lib/theme/index.ts +4 -0
  115. package/src/shared/lib/theme/theme.context.ts +6 -0
  116. package/src/shared/lib/theme/theme.provider.tsx +60 -0
  117. package/src/shared/lib/theme/theme.types.ts +15 -0
  118. package/src/shared/lib/theme/utils/index.ts +1 -0
  119. package/src/shared/lib/theme/utils/storage.ts +11 -0
  120. package/src/shared/ui/atoms/index.ts +1 -0
  121. package/src/shared/ui/index.ts +4 -0
  122. package/src/shared/ui/molecules/index.ts +2 -0
  123. package/src/shared/ui/molecules/keyboard-area/index.ts +2 -0
  124. package/src/shared/ui/molecules/keyboard-area/keyboard-area.styles.ts +20 -0
  125. package/src/shared/ui/molecules/keyboard-area/keyboard-area.tsx +34 -0
  126. package/src/shared/ui/molecules/keyboard-area/keyboard-area.types.ts +3 -0
  127. package/src/shared/ui/molecules/refresh-control/index.ts +2 -0
  128. package/src/shared/ui/molecules/refresh-control/refresh-control.tsx +32 -0
  129. package/src/shared/ui/molecules/refresh-control/refresh-control.types.ts +6 -0
  130. package/src/shared/ui/organisms/index.ts +1 -0
  131. package/src/shared/ui/templates/index.ts +1 -0
  132. package/src/shared/ui/templates/screen-container/index.ts +12 -0
  133. package/src/shared/ui/templates/screen-container/screen-container-list.tsx +23 -0
  134. package/src/shared/ui/templates/screen-container/screen-container-scroll.tsx +23 -0
  135. package/src/shared/ui/templates/screen-container/screen-container-section-list.tsx +24 -0
  136. package/src/shared/ui/templates/screen-container/screen-container.hooks.tsx +72 -0
  137. package/src/shared/ui/templates/screen-container/screen-container.styles.ts +45 -0
  138. package/src/shared/ui/templates/screen-container/screen-container.types.tsx +75 -0
  139. package/src/shared/utils/generators.ts +11 -0
  140. package/src/shared/utils/index.ts +1 -0
  141. package/src/widgets/.gitkeep +0 -0
  142. package/svg.d.ts +7 -0
  143. package/tsconfig.json +8 -0
@@ -0,0 +1,72 @@
1
+ import { useMemo } from 'react'
2
+ import { View } from 'react-native'
3
+ import { KeyboardArea, RefreshControl } from '../../molecules'
4
+ import { useScreenContainerStyles } from './screen-container.styles'
5
+ import {
6
+ ScreenContainerListProps,
7
+ ScreenContainerScrollProps,
8
+ ScreenContainerSectionListProps,
9
+ } from './screen-container.types'
10
+
11
+ const useScreenContainerProps = <
12
+ Props extends
13
+ | ScreenContainerScrollProps
14
+ | ScreenContainerListProps<any>
15
+ | ScreenContainerSectionListProps<any>,
16
+ >({
17
+ // omit
18
+ // @ts-ignore
19
+ style,
20
+ // @ts-ignore
21
+ contentContainerStyle,
22
+ // @ts-ignore
23
+ refreshing,
24
+ // internal
25
+ withOverflowTop = false,
26
+ withOverflowBottom = false,
27
+ // native
28
+ header: initHeader,
29
+ footer: initFooter,
30
+ wrapperStyle,
31
+ outerStyle,
32
+ innerStyle,
33
+ onRefresh,
34
+ ...props
35
+ }: Props) => {
36
+ const { styles } = useScreenContainerStyles({
37
+ withOverflowTop: withOverflowTop || !!initHeader,
38
+ withOverflowBottom: withOverflowBottom || !!initFooter,
39
+ })
40
+
41
+ const header = useMemo(() => {
42
+ return <View style={styles.header}>{initHeader}</View>
43
+ }, [styles.header, initHeader])
44
+
45
+ const footer = useMemo(() => {
46
+ return (
47
+ <View style={styles.footer}>
48
+ {initFooter}
49
+ <KeyboardArea />
50
+ </View>
51
+ )
52
+ }, [styles.footer, initFooter])
53
+
54
+ return {
55
+ ...props,
56
+ header,
57
+ footer,
58
+ wrapperStyle: [styles.wrapper, wrapperStyle],
59
+ outerStyle: [styles.outer, outerStyle],
60
+ innerStyle: [styles.inner, innerStyle],
61
+ showsVerticalScrollIndicator: false,
62
+ showsHorizontalScrollIndicator: false,
63
+ keyboardDismissMode: 'interactive',
64
+ keyboardShouldPersistTaps: 'handled',
65
+ contentInsetAdjustmentBehavior: 'never',
66
+ refreshControl: onRefresh ? (
67
+ <RefreshControl withOffset={!withOverflowTop && !initHeader} onRefresh={onRefresh} />
68
+ ) : undefined,
69
+ }
70
+ }
71
+
72
+ export { useScreenContainerProps }
@@ -0,0 +1,45 @@
1
+ import { StyleSheet } from 'react-native'
2
+ import { useSafeArea } from '../../../hooks'
3
+ import { useThemeMode } from '../../../lib'
4
+ import { ScreenContainerStylesConfig } from './screen-container.types'
5
+
6
+ const useScreenContainerStyles = ({
7
+ withOverflowTop,
8
+ withOverflowBottom,
9
+ }: ScreenContainerStylesConfig) => {
10
+ const { COLORS } = useThemeMode()
11
+ const { TOP, BOTTOM } = useSafeArea()
12
+
13
+ const styles = StyleSheet.create({
14
+ wrapper: {
15
+ flex: 1,
16
+ paddingTop: withOverflowTop ? TOP + 16 : 0,
17
+ paddingBottom: withOverflowBottom ? BOTTOM + 16 : 0,
18
+ backgroundColor: COLORS.FILL.BASE,
19
+ },
20
+ outer: {
21
+ zIndex: 1,
22
+ flex: 1,
23
+ },
24
+ inner: {
25
+ flexGrow: 1,
26
+ paddingTop: withOverflowTop ? 8 : TOP + 16,
27
+ paddingBottom: withOverflowBottom ? 8 : BOTTOM + 16,
28
+ paddingHorizontal: 16,
29
+ },
30
+ header: {
31
+ zIndex: 2,
32
+ paddingBottom: withOverflowTop ? 8 : 0,
33
+ paddingHorizontal: 16,
34
+ },
35
+ footer: {
36
+ zIndex: 2,
37
+ paddingTop: withOverflowBottom ? 8 : 0,
38
+ paddingHorizontal: 16,
39
+ },
40
+ })
41
+
42
+ return { styles }
43
+ }
44
+
45
+ export { useScreenContainerStyles }
@@ -0,0 +1,75 @@
1
+ import { ReactNode, Ref } from 'react'
2
+ import {
3
+ FlatList,
4
+ FlatListProps,
5
+ ListRenderItemInfo,
6
+ ScrollView,
7
+ ScrollViewProps,
8
+ SectionList,
9
+ SectionListData,
10
+ SectionListProps,
11
+ SectionListRenderItemInfo,
12
+ StyleProp,
13
+ ViewStyle,
14
+ } from 'react-native'
15
+
16
+ type ScreenContainerExcludeExtraNativeProps<
17
+ Props extends ScrollViewProps | FlatListProps<unknown> | SectionListProps<unknown>,
18
+ Prop extends string = '',
19
+ > = Omit<
20
+ Props,
21
+ 'style' | 'contentContainerStyle' | 'refreshControl' | 'refreshing' | 'onRefresh' | Prop
22
+ >
23
+
24
+ type ScreenContainerProps<Component extends ScrollView | FlatList | SectionList> = {
25
+ reference?: Ref<Component>
26
+ wrapperStyle?: StyleProp<ViewStyle>
27
+ outerStyle?: StyleProp<ViewStyle>
28
+ innerStyle?: StyleProp<ViewStyle>
29
+ header?: ReactNode
30
+ footer?: ReactNode
31
+ withOverflowTop?: boolean
32
+ withOverflowBottom?: boolean
33
+ onRefresh?: () => any | Promise<any>
34
+ }
35
+
36
+ type ScreenContainerScrollProps = ScreenContainerExcludeExtraNativeProps<ScrollViewProps> &
37
+ ScreenContainerProps<ScrollView> & {}
38
+
39
+ type ScreenContainerListProps<Item = unknown> = ScreenContainerExcludeExtraNativeProps<
40
+ FlatListProps<Item>
41
+ > &
42
+ ScreenContainerProps<FlatList<Item>> & {}
43
+
44
+ type ScreenContainerSectionListProps<Item = unknown> = ScreenContainerExcludeExtraNativeProps<
45
+ SectionListProps<Item>
46
+ > &
47
+ ScreenContainerProps<SectionList<Item>> & {}
48
+
49
+ type ScreenContainerListRenderItemInfo<Item = unknown> = ListRenderItemInfo<Item>
50
+
51
+ type ScreenContainerSectionListRenderItemInfo<Item = unknown> = SectionListRenderItemInfo<Item>
52
+
53
+ type ScreenContainerSectionListRenderHeaderInfo<Item = unknown> = {
54
+ section: SectionListData<Item>
55
+ }
56
+
57
+ type ScreenContainerSectionListRenderFooterInfo<Item = unknown> = {
58
+ section: SectionListData<Item>
59
+ }
60
+
61
+ type ScreenContainerStylesConfig = {
62
+ withOverflowTop: boolean
63
+ withOverflowBottom: boolean
64
+ }
65
+
66
+ export type {
67
+ ScreenContainerScrollProps,
68
+ ScreenContainerListProps,
69
+ ScreenContainerSectionListProps,
70
+ ScreenContainerListRenderItemInfo,
71
+ ScreenContainerSectionListRenderItemInfo,
72
+ ScreenContainerSectionListRenderHeaderInfo,
73
+ ScreenContainerSectionListRenderFooterInfo,
74
+ ScreenContainerStylesConfig,
75
+ }
@@ -0,0 +1,11 @@
1
+ const generateIdFactory = () => {
2
+ let lastId = 0
3
+
4
+ return (prefix: string = '') => {
5
+ return `${prefix}${++lastId}`
6
+ }
7
+ }
8
+
9
+ const generateId = generateIdFactory()
10
+
11
+ export { generateIdFactory, generateId }
@@ -0,0 +1 @@
1
+ export * from './generators'
File without changes
package/svg.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare module '*.svg' {
2
+ import type React from 'react'
3
+ import type { SvgProps } from 'react-native-svg'
4
+
5
+ const content: React.FC<SvgProps>
6
+ export default content
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": [
3
+ "@mediacubeco/typescript-config",
4
+ "@mediacubeco/typescript-config-fsd",
5
+ "@mediacubeco/typescript-config-react",
6
+ "@mediacubeco/typescript-config-react-native"
7
+ ]
8
+ }