@adelin-io/cli 0.0.0-stage → 0.1.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 (175) hide show
  1. package/README.md +76 -2
  2. package/authoring-release.json +174 -0
  3. package/package.json +30 -4
  4. package/runtime-integrity.json +9 -0
  5. package/scripts/adelin.mjs +7768 -0
  6. package/scripts/assemble-checkout.mjs +93 -0
  7. package/scripts/local-save.mjs +513 -0
  8. package/scripts/materialize.mjs +319 -0
  9. package/scripts/runtime.mjs +8950 -0
  10. package/scripts/typecheck.mjs +72 -0
  11. package/scripts/workspace-state.mjs +183 -0
  12. package/skill/README.md +77 -0
  13. package/skill/SKILL.md +100 -0
  14. package/skill/authoring/access.md +193 -0
  15. package/skill/authoring/analytics.md +20 -0
  16. package/skill/authoring/app-memory.md +128 -0
  17. package/skill/authoring/app-requirements.md +99 -0
  18. package/skill/authoring/app-structure.md +265 -0
  19. package/skill/authoring/assets.md +117 -0
  20. package/skill/authoring/auth.md +261 -0
  21. package/skill/authoring/content-binding.md +26 -0
  22. package/skill/authoring/i18n.md +184 -0
  23. package/skill/authoring/language.md +503 -0
  24. package/skill/authoring/local-workflow.md +1665 -0
  25. package/skill/authoring/offline/connectivity.md +50 -0
  26. package/skill/authoring/offline/example.md +102 -0
  27. package/skill/authoring/offline/history-sync.md +39 -0
  28. package/skill/authoring/offline/index.md +29 -0
  29. package/skill/authoring/offline/package-storage.md +37 -0
  30. package/skill/authoring/offline/platforms.md +35 -0
  31. package/skill/authoring/offline/startup-navigation.md +53 -0
  32. package/skill/authoring/platform-files.md +616 -0
  33. package/skill/authoring/player/casting.md +47 -0
  34. package/skill/authoring/player/controls.md +95 -0
  35. package/skill/authoring/player/downloads.md +90 -0
  36. package/skill/authoring/player/drm.md +31 -0
  37. package/skill/authoring/player/index.md +39 -0
  38. package/skill/authoring/player/live-dvr.md +33 -0
  39. package/skill/authoring/player/platforms.md +47 -0
  40. package/skill/authoring/player/playback.md +42 -0
  41. package/skill/authoring/player/tracks-subtitles.md +32 -0
  42. package/skill/authoring/profiles.md +213 -0
  43. package/skill/authoring/remote-keys.md +139 -0
  44. package/skill/authoring/search.md +27 -0
  45. package/skill/authoring/store.md +85 -0
  46. package/skill/authoring/tv-text-entry.md +146 -0
  47. package/skill/design/approved/README.md +14 -0
  48. package/skill/design/approved/vesper-phone-home.jpg +0 -0
  49. package/skill/design/approved/vesper-tv-detail.jpg +0 -0
  50. package/skill/design/approved/vesper-tv-home.jpg +0 -0
  51. package/skill/design/design-guide.md +610 -0
  52. package/skill/design/edge-to-edge.md +66 -0
  53. package/skill/design/icons.md +50 -0
  54. package/skill/design/responsive-layout.md +175 -0
  55. package/skill/design/safe-area.md +221 -0
  56. package/skill/design/streaming-playbook.md +131 -0
  57. package/skill/design/visual-review.md +150 -0
  58. package/skill/examples/README.md +24 -0
  59. package/skill/examples/cinema/DESIGN.md +58 -0
  60. package/skill/examples/cinema/app.tsx +17 -0
  61. package/skill/examples/cinema/assets/logo.png +0 -0
  62. package/skill/examples/cinema/components/Action.tsx +40 -0
  63. package/skill/examples/cinema/components/Action.tv.tsx +44 -0
  64. package/skill/examples/cinema/components/CatalogGrid.tsx +31 -0
  65. package/skill/examples/cinema/components/ContinueRail.tsx +98 -0
  66. package/skill/examples/cinema/components/Feedback.tsx +28 -0
  67. package/skill/examples/cinema/components/Field.tsx +41 -0
  68. package/skill/examples/cinema/components/LibraryRail.tsx +46 -0
  69. package/skill/examples/cinema/components/PlayAction.tsx +29 -0
  70. package/skill/examples/cinema/components/Root.tsx +59 -0
  71. package/skill/examples/cinema/components/Shell.tsx +70 -0
  72. package/skill/examples/cinema/components/Tab.tsx +22 -0
  73. package/skill/examples/cinema/components/TitleCard.tsx +68 -0
  74. package/skill/examples/cinema/components/TitleMeta.tsx +36 -0
  75. package/skill/examples/cinema/locales/en.ts +211 -0
  76. package/skill/examples/cinema/locales/lt.ts +211 -0
  77. package/skill/examples/cinema/preview/phone-home.jpg +0 -0
  78. package/skill/examples/cinema/preview/tv-detail.jpg +0 -0
  79. package/skill/examples/cinema/preview/tv-home.jpg +0 -0
  80. package/skill/examples/cinema/screens/portrait/Account.tsx +110 -0
  81. package/skill/examples/cinema/screens/portrait/Browse.tsx +73 -0
  82. package/skill/examples/cinema/screens/portrait/Detail.tsx +159 -0
  83. package/skill/examples/cinema/screens/portrait/Home.tsx +196 -0
  84. package/skill/examples/cinema/screens/portrait/Player.tsx +299 -0
  85. package/skill/examples/cinema/screens/portrait/Search.tsx +46 -0
  86. package/skill/examples/cinema/screens/portrait/Search.tv.tsx +55 -0
  87. package/skill/examples/cinema/screens/portrait/SignIn.tsx +101 -0
  88. package/skill/examples/cinema/screens/portrait/SignUp.tsx +106 -0
  89. package/skill/examples/cinema/store.tsx +132 -0
  90. package/skill/examples/cinema/theme.ts +32 -0
  91. package/skill/examples/documentary/DESIGN.md +33 -0
  92. package/skill/examples/documentary/app.tsx +17 -0
  93. package/skill/examples/documentary/components/Action.tsx +43 -0
  94. package/skill/examples/documentary/components/CatalogGrid.tsx +47 -0
  95. package/skill/examples/documentary/components/Feedback.tsx +27 -0
  96. package/skill/examples/documentary/components/Field.tsx +33 -0
  97. package/skill/examples/documentary/components/LibraryRail.tsx +47 -0
  98. package/skill/examples/documentary/components/Root.tsx +62 -0
  99. package/skill/examples/documentary/components/Shell.tsx +93 -0
  100. package/skill/examples/documentary/components/StoryCard.tsx +53 -0
  101. package/skill/examples/documentary/components/StoryMeta.tsx +22 -0
  102. package/skill/examples/documentary/preview/phone-home.jpg +0 -0
  103. package/skill/examples/documentary/preview/tv-detail.jpg +0 -0
  104. package/skill/examples/documentary/preview/tv-home.jpg +0 -0
  105. package/skill/examples/documentary/screens/portrait/Account.tsx +97 -0
  106. package/skill/examples/documentary/screens/portrait/Browse.tsx +71 -0
  107. package/skill/examples/documentary/screens/portrait/Detail.tsx +133 -0
  108. package/skill/examples/documentary/screens/portrait/Home.tsx +89 -0
  109. package/skill/examples/documentary/screens/portrait/Player.tsx +116 -0
  110. package/skill/examples/documentary/screens/portrait/Search.tsx +48 -0
  111. package/skill/examples/documentary/screens/portrait/SignIn.tsx +96 -0
  112. package/skill/examples/documentary/screens/portrait/SignUp.tsx +101 -0
  113. package/skill/examples/documentary/store.tsx +115 -0
  114. package/skill/examples/documentary/theme.ts +20 -0
  115. package/skill/examples/series/DESIGN.md +55 -0
  116. package/skill/examples/series/app.tsx +17 -0
  117. package/skill/examples/series/components/Action.tsx +42 -0
  118. package/skill/examples/series/components/CatalogGrid.tsx +43 -0
  119. package/skill/examples/series/components/ContinueRail.tsx +78 -0
  120. package/skill/examples/series/components/Feedback.tsx +26 -0
  121. package/skill/examples/series/components/Field.tsx +34 -0
  122. package/skill/examples/series/components/LibraryRail.tsx +38 -0
  123. package/skill/examples/series/components/OutcomeNote.tsx +28 -0
  124. package/skill/examples/series/components/PlayAction.tsx +29 -0
  125. package/skill/examples/series/components/RestoreAction.tsx +33 -0
  126. package/skill/examples/series/components/Root.tsx +75 -0
  127. package/skill/examples/series/components/SaveTitle.tsx +34 -0
  128. package/skill/examples/series/components/Shell.tsx +75 -0
  129. package/skill/examples/series/components/TitleCard.tsx +62 -0
  130. package/skill/examples/series/components/UnlockAction.tsx +10 -0
  131. package/skill/examples/series/preview/phone-home.jpg +0 -0
  132. package/skill/examples/series/preview/tv-detail.jpg +0 -0
  133. package/skill/examples/series/preview/tv-home.jpg +0 -0
  134. package/skill/examples/series/screens/portrait/Account.tsx +125 -0
  135. package/skill/examples/series/screens/portrait/Browse.tsx +61 -0
  136. package/skill/examples/series/screens/portrait/Detail.tsx +231 -0
  137. package/skill/examples/series/screens/portrait/Home.tsx +109 -0
  138. package/skill/examples/series/screens/portrait/MyList.tsx +44 -0
  139. package/skill/examples/series/screens/portrait/Plans.tsx +131 -0
  140. package/skill/examples/series/screens/portrait/Player.tsx +138 -0
  141. package/skill/examples/series/screens/portrait/Profiles.tsx +103 -0
  142. package/skill/examples/series/screens/portrait/Search.tsx +50 -0
  143. package/skill/examples/series/screens/portrait/SignIn.tsx +94 -0
  144. package/skill/examples/series/screens/portrait/SignUp.tsx +100 -0
  145. package/skill/examples/series/store.tsx +192 -0
  146. package/skill/examples/series/theme.ts +32 -0
  147. package/skill/guides/final-pricing-capabilities.md +13 -0
  148. package/skill/reference/api.md +842 -0
  149. package/skill/reference/components.md +1782 -0
  150. package/skill/reference/packages.md +24 -0
  151. package/skill/scripts/assemble-checkout.mjs +93 -0
  152. package/skill/scripts/local-save.mjs +513 -0
  153. package/skill/scripts/materialize.mjs +319 -0
  154. package/skill/scripts/workspace-state.mjs +183 -0
  155. package/types/adelin-access.d.ts +70 -0
  156. package/types/adelin-analytics.d.ts +5 -0
  157. package/types/adelin-assets.d.ts +26 -0
  158. package/types/adelin-auth.d.ts +37 -0
  159. package/types/adelin-content.d.ts +112 -0
  160. package/types/adelin-device.d.ts +195 -0
  161. package/types/adelin-downloads.d.ts +47 -0
  162. package/types/adelin-env.d.ts +8 -0
  163. package/types/adelin-globals.d.ts +19 -0
  164. package/types/adelin-i18n.d.ts +31 -0
  165. package/types/adelin-native-stack.d.ts +178 -0
  166. package/types/adelin-navigation.d.ts +264 -0
  167. package/types/adelin-profiles.d.ts +51 -0
  168. package/types/adelin-react.d.ts +49 -0
  169. package/types/adelin-reanimated.d.ts +376 -0
  170. package/types/adelin-storage.d.ts +9 -0
  171. package/types/adelin-store.d.ts +74 -0
  172. package/types/adelin-ui.d.ts +1518 -0
  173. package/types/adelin-utils.d.ts +7 -0
  174. package/types/adelin-worklets.d.ts +15 -0
  175. package/workspace-tsconfig.json +53 -0
@@ -0,0 +1,62 @@
1
+ import type { ContentItem } from '@adelin/content';
2
+ import { useNavigation } from '@adelin/navigation';
3
+ import { useSelector } from '@adelin/store';
4
+ import { Icon, Image, LinearGradient, Pressable, StyleSheet, Text, View, theme } from '@adelin/ui';
5
+ import { Platform } from '@adelin/device';
6
+
7
+ export default function TitleCard({ item, width = 0, imageHeight = 0, rail = false, watched = false }: {
8
+ item: ContentItem;
9
+ width?: number;
10
+ imageHeight?: number;
11
+ rail?: boolean;
12
+ watched?: boolean;
13
+ }) {
14
+ const navigation = useNavigation();
15
+ const entries = useSelector(state => state.library.entries);
16
+ const picture = item.artwork.backdrop || item.artwork.poster;
17
+ const locked = item.access?.open === false;
18
+ const episode = item.kind === 'item';
19
+ const parent = entries.find(entry => entry.id === item.parentId);
20
+ const inSeason = !!parent && !!parent.parentId;
21
+ const episodeNumber = entries.filter(entry => entry.parentId === item.parentId && entry.kind === 'item' && Number(entry.position) < Number(item.position)).length + 1;
22
+ const seasonNumber = inSeason ? entries.filter(entry => entry.parentId === parent?.parentId && entry.kind === 'folder' && Number(entry.position) < Number(parent?.position)).length + 1 : 0;
23
+ const minutes = Math.round(Number(item.technical?.duration) / 60);
24
+ const code = !parent ? item.label ?? '' : inSeason ? 'S' + seasonNumber + ' · E' + episodeNumber : 'E' + episodeNumber;
25
+ const seasons = entries.filter(entry => entry.parentId === item.id && entry.kind === 'folder').length;
26
+ const episodes = entries.filter(entry => entry.parentId === item.id && entry.kind === 'item').length;
27
+ const tag = seasons > 0 ? seasons + (seasons === 1 ? ' SEASON' : ' SEASONS') : episodes + (episodes === 1 ? ' EPISODE' : ' EPISODES');
28
+ return (
29
+ <Pressable onPress={() => navigation.push('Detail', { id: item.id })} style={[styles.card, rail ? episode ? styles.episodeCard : styles.seriesCard : { width }]} focusAnimation={{ border: { color: theme.colors.accent, width: 3 } }} accessibilityRole="button" accessibilityLabel={(episode && !!parent ? code + ', ' + item.title : item.title) + (watched ? ', watched' : '') + (locked ? ', locked' : '')}>
30
+ <View style={[styles.still, rail ? episode ? styles.episodeImage : styles.seriesImage : { height: imageHeight }]}>
31
+ {picture ? <Image source={{ uri: picture }} resizeMode="cover" style={styles.image} /> : <View style={styles.image} />}
32
+ <LinearGradient colors={[theme.gradients.scrimClear, theme.gradients.numeralShade]} start={{ x: 0, y: 0.35 }} end={{ x: 0, y: 1 }} style={styles.shade} pointerEvents="none" />
33
+ {episode && !!parent && <Text style={styles.numeral} maxFontSizeMultiplier={1}>{episodeNumber < 10 ? '0' + episodeNumber : '' + episodeNumber}</Text>}
34
+ {locked && <View style={styles.lock}><Icon icon="ph:lock-simple-fill" size={10} color={theme.colors.text} /></View>}
35
+ {watched === true && !locked && <View style={styles.check}><Icon icon="ph:check-bold" size={10} color={theme.colors.background} /></View>}
36
+ {!episode && <View style={styles.tag}><Text style={styles.tagText} maxFontSizeMultiplier={1}>{tag}</Text></View>}
37
+ {!episode && <Text style={styles.overTitle} numberOfLines={2}>{item.title}</Text>}
38
+ </View>
39
+ {episode && <Text style={styles.title} numberOfLines={1}>{item.title}</Text>}
40
+ {episode && <Text style={styles.code} numberOfLines={1}>{minutes >= 1 ? code + ' · ' + minutes + ' MIN' : code.toUpperCase()}</Text>}
41
+ </Pressable>
42
+ );
43
+ }
44
+
45
+ const styles = StyleSheet.create({
46
+ card: { borderRadius: 4 },
47
+ episodeCard: { width: Platform.select({ tv: 168, default: 220 }) },
48
+ seriesCard: { width: Platform.select({ tv: 248, default: 288 }) },
49
+ episodeImage: { height: Platform.select({ tv: 94, default: 124 }) },
50
+ seriesImage: { height: Platform.select({ tv: 140, default: 162 }) },
51
+ still: { backgroundColor: theme.colors.surfaceLight, width: '100%', overflow: 'hidden', borderRadius: 4 },
52
+ image: { width: '100%', height: '100%' },
53
+ shade: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },
54
+ numeral: { position: 'absolute', left: Platform.select({ tv: 8, default: 10 }), bottom: Platform.select({ tv: 2, default: 2 }), color: theme.colors.text, fontSize: Platform.select({ tv: 34, default: 42 }), lineHeight: Platform.select({ tv: 38, default: 46 }), fontWeight: '900', letterSpacing: -1.5 },
55
+ check: { position: 'absolute', top: Platform.select({ tv: 6, default: 8 }), right: Platform.select({ tv: 6, default: 8 }), width: Platform.select({ tv: 16, default: 20 }), height: Platform.select({ tv: 16, default: 20 }), borderRadius: Platform.select({ tv: 8, default: 10 }), backgroundColor: theme.colors.accent, alignItems: 'center', justifyContent: 'center' },
56
+ lock: { position: 'absolute', top: Platform.select({ tv: 6, default: 8 }), right: Platform.select({ tv: 6, default: 8 }), width: Platform.select({ tv: 18, default: 22 }), height: Platform.select({ tv: 18, default: 22 }), borderRadius: Platform.select({ tv: 9, default: 11 }), backgroundColor: theme.gradients.scrimDeep, alignItems: 'center', justifyContent: 'center' },
57
+ tag: { position: 'absolute', top: Platform.select({ tv: 8, default: 10 }), left: Platform.select({ tv: 8, default: 10 }), paddingHorizontal: 6, paddingVertical: 3, backgroundColor: theme.gradients.scrimDeep, borderRadius: 2 },
58
+ tagText: { color: theme.colors.text, fontSize: Platform.select({ tv: 7, default: 10 }), lineHeight: Platform.select({ tv: 10, default: 13 }), fontWeight: '800', letterSpacing: 1.2 },
59
+ overTitle: { position: 'absolute', left: Platform.select({ tv: 10, default: 12 }), right: Platform.select({ tv: 10, default: 12 }), bottom: Platform.select({ tv: 8, default: 10 }), color: theme.colors.text, fontSize: Platform.select({ tv: 15, default: 19 }), lineHeight: Platform.select({ tv: 18, default: 23 }), fontWeight: '800', letterSpacing: -0.3 },
60
+ title: { color: theme.colors.text, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 14, default: 19 }), fontWeight: '700', marginTop: Platform.select({ tv: 6, default: 8 }) },
61
+ code: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 7, default: 11 }), lineHeight: Platform.select({ tv: 11, default: 15 }), fontWeight: '800', letterSpacing: 1.1, marginTop: 2 },
62
+ });
@@ -0,0 +1,10 @@
1
+ import type { ContentItem } from '@adelin/content';
2
+ import { useNavigation } from '@adelin/navigation';
3
+ import Action from './Action';
4
+
5
+ /** Takes a locked title to sign-in or to the offers that open it. */
6
+ export default function UnlockAction({ item, focusKey, preferred = false }: { item: ContentItem; focusKey?: string; preferred?: boolean }) {
7
+ const navigation = useNavigation();
8
+ if (item.access?.reason === 'sign_in') return <Action label="Sign in to watch" icon="ph:lock-simple" primary preferred={preferred} focusKey={focusKey} onPress={() => navigation.navigate('SignIn')} />;
9
+ return <Action label={item.access?.reason === 'rental_expired' ? 'Rent again' : 'Ways to watch'} icon="ph:lock-simple" primary preferred={preferred} focusKey={focusKey} onPress={() => navigation.navigate('Plans', { id: item.id })} />;
10
+ }
@@ -0,0 +1,125 @@
1
+ import { useState } from '@adelin/react';
2
+ import { useAuth } from '@adelin/auth';
3
+ import { useAccess } from '@adelin/access';
4
+ import { useNavigation } from '@adelin/navigation';
5
+ import { useDispatch, useSelector } from '@adelin/store';
6
+ import { FocusGroup, ScrollView, StyleSheet, Text, View, theme, Screen } from '@adelin/ui';
7
+ import { Platform } from '@adelin/device';
8
+ import { logout, manage } from '../../store';
9
+ import Shell from '../../components/Shell';
10
+ import Action from '../../components/Action';
11
+ import Feedback from '../../components/Feedback';
12
+ import OutcomeNote from '../../components/OutcomeNote';
13
+ import RestoreAction from '../../components/RestoreAction';
14
+
15
+ export default function Account() {
16
+ const auth = useAuth();
17
+ const dispatch = useDispatch();
18
+ const navigation = useNavigation();
19
+ const pending = useSelector(state => state.account.pending);
20
+ const profiles = useSelector(state => state.profiles.list);
21
+ const activeId = useSelector(state => state.profiles.activeId);
22
+ const savedCount = useSelector(state => state.saved.ids.length);
23
+ const viewer = profiles.find(profile => profile.id === activeId);
24
+ const access = useAccess();
25
+ const plan = access.holdings.find(holding => holding.kind === 'subscription');
26
+ const paying = useSelector(state => state.paywall.pending);
27
+ const [message, setMessage] = useState('');
28
+ const [outcome, setOutcome] = useState('');
29
+ const openManage = () => {
30
+ setOutcome('');
31
+ dispatch(manage()).unwrap().then(result => setOutcome(result.outcome)).catch(() => setOutcome('failed'));
32
+ };
33
+ const signOut = () => {
34
+ setMessage('');
35
+ dispatch(logout()).unwrap().catch(error => setMessage(error.message));
36
+ };
37
+ return (
38
+ <Screen>
39
+ <Shell active="Account" contentAutoFocus>
40
+ {auth.status === 'loading' ? <Feedback title="Opening your account" message="Checking your session." loading /> : (
41
+ <ScrollView style={styles.scroll} contentContainerStyle={styles.content}>
42
+ <Text style={styles.heading}>Account</Text>
43
+ {auth.status === 'signed-in' ? (
44
+ <FocusGroup direction="vertical" remember autoFocus>
45
+ <View style={styles.panel}>
46
+ <View style={styles.row}>
47
+ <View style={styles.avatar}><Text style={styles.avatarText} maxFontSizeMultiplier={1}>{viewer ? viewer.name.slice(0, 1).toUpperCase() : '?'}</Text></View>
48
+ <View style={styles.rowCopy}>
49
+ <Text style={styles.label}>WATCHING AS</Text>
50
+ <Text style={styles.value}>{viewer ? viewer.name : 'No profile chosen'}</Text>
51
+ </View>
52
+ <Action label="Switch profile" onPress={() => navigation.navigate('Profiles')} />
53
+ </View>
54
+ <View style={styles.divider} />
55
+ <View style={styles.row}>
56
+ <View style={styles.rowCopy}>
57
+ <Text style={styles.label}>MY LIST</Text>
58
+ <Text style={styles.value}>{savedCount === 1 ? '1 saved title' : savedCount + ' saved titles'}</Text>
59
+ </View>
60
+ <Action label="Open My List" onPress={() => navigation.navigate('MyList')} />
61
+ </View>
62
+ <View style={styles.divider} />
63
+ <View style={styles.row}>
64
+ <View style={styles.rowCopy}>
65
+ <Text style={styles.label}>YOUR PLAN</Text>
66
+ <Text style={styles.value}>{plan ? (plan.offerName ?? 'Your plan') + (plan.status === 'trial' ? ' · free trial' : plan.status === 'past_due' ? ' · your last payment failed' : plan.status === 'cancelled' ? ' · cancelled' : '') : 'No plan yet'}</Text>
67
+ </View>
68
+ {!plan && <Action label="See plans" onPress={() => navigation.navigate('Plans', { id: '' })} />}
69
+ <View style={[outcome === 'unavailable' && styles.webOnly]}><Action label="Manage subscription" onPress={openManage} disabled={paying} /></View>
70
+ </View>
71
+ <View style={[outcome === 'unavailable' && styles.webOnly]}><OutcomeNote outcome={outcome} refused="You have no subscription to manage." /></View>
72
+ <View style={styles.divider} />
73
+ <View style={styles.row}>
74
+ <View style={styles.rowCopy}>
75
+ <Text style={styles.label}>PURCHASES</Text>
76
+ <Text style={styles.value}>Paid on another device? Bring it here.</Text>
77
+ </View>
78
+ <RestoreAction />
79
+ </View>
80
+ <View style={styles.divider} />
81
+ <View style={styles.row}>
82
+ <View style={styles.rowCopy}>
83
+ <Text style={styles.label}>SIGNED IN</Text>
84
+ <Text style={styles.value}>This device stays signed in until you sign out.</Text>
85
+ </View>
86
+ <Action label={pending ? 'Signing out…' : 'Sign out'} onPress={signOut} disabled={pending} />
87
+ </View>
88
+ {message.length > 0 && <Text style={styles.error} accessibilityRole="alert">{message}</Text>}
89
+ </View>
90
+ </FocusGroup>
91
+ ) : (
92
+ <FocusGroup direction="horizontal" remember autoFocus>
93
+ <View style={styles.panel}>
94
+ <Text style={styles.value}>Sign in to keep a list for every profile in your home.</Text>
95
+ <View style={styles.actions}>
96
+ <View style={styles.action}><Action label="Sign in" primary onPress={() => navigation.navigate('SignIn')} /></View>
97
+ <Action label="Create an account" onPress={() => navigation.navigate('SignUp')} />
98
+ </View>
99
+ </View>
100
+ </FocusGroup>
101
+ )}
102
+ </ScrollView>
103
+ )}
104
+ </Shell>
105
+ </Screen>
106
+ );
107
+ }
108
+
109
+ const styles = StyleSheet.create({
110
+ scroll: { flex: 1 },
111
+ content: { paddingHorizontal: Platform.select({ tv: 32, default: 20 }), paddingTop: Platform.select({ tv: 28, default: 16 }), paddingBottom: theme.spacing.xl },
112
+ heading: { color: theme.colors.text, fontSize: Platform.select({ tv: 26, default: 30 }), lineHeight: Platform.select({ tv: 30, default: 36 }), fontWeight: '900', letterSpacing: -0.8, marginBottom: Platform.select({ tv: 18, default: 18 }) },
113
+ panel: { maxWidth: 640, backgroundColor: theme.colors.surface, borderRadius: 6, padding: Platform.select({ tv: 18, default: 16 }) },
114
+ row: { flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap' },
115
+ avatar: { width: Platform.select({ tv: 40, default: 48 }), height: Platform.select({ tv: 40, default: 48 }), borderRadius: Platform.select({ tv: 20, default: 24 }), backgroundColor: theme.colors.primary, alignItems: 'center', justifyContent: 'center', marginRight: theme.spacing.md },
116
+ avatarText: { color: theme.colors.background, fontSize: Platform.select({ tv: 17, default: 20 }), lineHeight: Platform.select({ tv: 21, default: 24 }), fontWeight: '900' },
117
+ rowCopy: { flex: 1, minWidth: 110, marginRight: theme.spacing.md, marginVertical: theme.spacing.xs },
118
+ label: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 7, default: 10 }), lineHeight: Platform.select({ tv: 11, default: 14 }), fontWeight: '800', letterSpacing: 1.3 },
119
+ value: { color: theme.colors.text, fontSize: Platform.select({ tv: 12, default: 15 }), lineHeight: Platform.select({ tv: 17, default: 21 }), fontWeight: '700', marginTop: 2 },
120
+ divider: { height: 1, backgroundColor: theme.colors.border, marginVertical: Platform.select({ tv: 12, default: 14 }) },
121
+ actions: { flexDirection: 'row', flexWrap: 'wrap', marginTop: theme.spacing.md },
122
+ action: { marginRight: theme.spacing.sm, marginBottom: theme.spacing.sm },
123
+ webOnly: Platform.select({ native: { display: 'none' }, default: {} }),
124
+ error: { color: theme.colors.error, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 14, default: 20 }), marginTop: theme.spacing.md },
125
+ });
@@ -0,0 +1,61 @@
1
+ import { useState } from '@adelin/react';
2
+ import { useDispatch, useSelector } from '@adelin/store';
3
+ import { FlashList, FocusGroup, Pressable, StyleSheet, Text, View, theme, Screen } from '@adelin/ui';
4
+ import { Platform } from '@adelin/device';
5
+ import { loadLibrary } from '../../store';
6
+ import Shell from '../../components/Shell';
7
+ import CatalogGrid from '../../components/CatalogGrid';
8
+ import Feedback from '../../components/Feedback';
9
+
10
+ export default function Browse() {
11
+ const dispatch = useDispatch();
12
+ const entries = useSelector(state => state.library.entries);
13
+ const collections = useSelector(state => state.library.collections);
14
+ const status = useSelector(state => state.library.status);
15
+ const [category, setCategory] = useState('all');
16
+ const genres = collections.filter(collection => !!collection.parentId && entries.some(entry => !entry.parentId && collection.entryIds.includes(entry.id)));
17
+ const categories = [{ id: 'all', name: 'Everything' }, ...genres];
18
+ const current = collections.find(item => item.id === category);
19
+ const titles = entries.filter(entry => !entry.parentId && (category === 'all' || current?.entryIds.includes(entry.id)));
20
+ return (
21
+ <Screen>
22
+ <Shell active="Browse" contentAutoFocus>
23
+ {status === 'idle' || status === 'loading' ? <Feedback title="Opening the library" message="Gathering every series." loading /> : status === 'failed' ? <Feedback title="The library could not load" message="Check your connection and try again." onRetry={() => dispatch(loadLibrary())} /> : (
24
+ <FocusGroup direction="vertical" remember>
25
+ <View style={styles.body}>
26
+ <View style={styles.intro}>
27
+ <Text style={styles.heading}>Browse</Text>
28
+ <Text style={styles.count}>{titles.length + (titles.length === 1 ? ' SERIES' : ' SERIES')}</Text>
29
+ </View>
30
+ <FocusGroup direction="horizontal" remember>
31
+ <FlashList horizontal data={categories} keyExtractor={item => item.id} style={styles.tabs} contentContainerStyle={styles.tabContent} showsHorizontalScrollIndicator={false}
32
+ renderItem={({ item }) => (
33
+ <Pressable onPress={() => setCategory(item.id)} style={styles.tab} focusAnimation={{ backgroundColor: theme.colors.surfaceLight }} accessibilityRole="button" accessibilityState={{ selected: category === item.id }}>
34
+ <Text style={[styles.tabText, category === item.id && styles.tabTextOn]}>{item.name}</Text>
35
+ <View style={[styles.tabLine, category === item.id && styles.tabLineOn]} />
36
+ </Pressable>
37
+ )}
38
+ />
39
+ </FocusGroup>
40
+ <CatalogGrid entries={titles} emptyTitle="Nothing here yet" emptyMessage="Choose another group to keep exploring." />
41
+ </View>
42
+ </FocusGroup>
43
+ )}
44
+ </Shell>
45
+ </Screen>
46
+ );
47
+ }
48
+
49
+ const styles = StyleSheet.create({
50
+ body: { flex: 1 },
51
+ intro: { flexDirection: 'row', alignItems: 'baseline', paddingHorizontal: Platform.select({ tv: 32, default: 20 }), paddingTop: Platform.select({ tv: 28, default: 16 }) },
52
+ heading: { color: theme.colors.text, fontSize: Platform.select({ tv: 26, default: 30 }), lineHeight: Platform.select({ tv: 30, default: 36 }), fontWeight: '900', letterSpacing: -0.8, marginRight: theme.spacing.md },
53
+ count: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 8, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 15 }), fontWeight: '800', letterSpacing: 1.3 },
54
+ tabs: { height: Platform.select({ tv: 40, default: 50 }), marginTop: Platform.select({ tv: 8, default: 8 }), marginBottom: Platform.select({ tv: 10, default: 12 }) },
55
+ tabContent: { paddingHorizontal: Platform.select({ tv: 26, default: 14 }) },
56
+ tab: { paddingHorizontal: 6, paddingTop: Platform.select({ tv: 8, default: 10 }), marginRight: Platform.select({ tv: 10, default: 8 }), borderTopLeftRadius: 4, borderTopRightRadius: 4 },
57
+ tabText: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 11, default: 15 }), lineHeight: Platform.select({ tv: 15, default: 20 }), fontWeight: '800' },
58
+ tabTextOn: { color: theme.colors.text },
59
+ tabLine: { height: 3, marginTop: Platform.select({ tv: 7, default: 9 }), backgroundColor: 'transparent' },
60
+ tabLineOn: { backgroundColor: theme.colors.accent },
61
+ });
@@ -0,0 +1,231 @@
1
+ import type { ContentItem, ContentVideoTechnical } from '@adelin/content';
2
+ import { useAccess } from '@adelin/access';
3
+ import { useEffect, useState } from '@adelin/react';
4
+ import { useNavigation, useRoute } from '@adelin/navigation';
5
+ import { useDispatch, useSelector } from '@adelin/store';
6
+ import { FocusGroup, Icon, Image, LinearGradient, Pressable, ScrollTarget, ScrollView, StyleSheet, Text, View, theme, useWindowDimensions, Screen } from '@adelin/ui';
7
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from '@adelin/reanimated';
8
+ import { Platform } from '@adelin/device';
9
+ import { loadLibrary, loadResume, loadWatched, loadWatching, toggleWatched } from '../../store';
10
+ import Shell from '../../components/Shell';
11
+ import Action from '../../components/Action';
12
+ import Feedback from '../../components/Feedback';
13
+ import LibraryRail from '../../components/LibraryRail';
14
+ import SaveTitle from '../../components/SaveTitle';
15
+ import PlayAction from '../../components/PlayAction';
16
+ import UnlockAction from '../../components/UnlockAction';
17
+
18
+ export default function Detail() {
19
+ const navigation = useNavigation();
20
+ const route = useRoute();
21
+ const dispatch = useDispatch();
22
+ const access = useAccess();
23
+ const entries = useSelector(state => state.library.entries);
24
+ const collections = useSelector(state => state.library.collections);
25
+ const status = useSelector(state => state.library.status);
26
+ const activeId = useSelector(state => state.profiles.activeId);
27
+ const rows = useSelector(state => state.watching.rows);
28
+ const watchedIds = useSelector(state => state.watching.watched);
29
+ const saved = useSelector(state => state.watching.resume);
30
+ const { width, height } = useWindowDimensions();
31
+ const expanded = width >= 840 && height >= 480;
32
+ const [seasonId, setSeasonId] = useState('');
33
+ const item = entries.find(entry => entry.id === route.params.id);
34
+ const parent = entries.find(entry => entry.id === item?.parentId);
35
+ const grand = entries.find(entry => entry.id === parent?.parentId);
36
+ const seasons = entries.filter(entry => entry.parentId === item?.id && entry.kind === 'folder');
37
+ const firstSeason = seasons.find(season => !seasons.some(other => Number(other.position) < Number(season.position)));
38
+ const season = seasons.find(entry => entry.id === seasonId) ?? firstSeason;
39
+ const seasonNumber = entries.filter(entry => entry.parentId === season?.parentId && entry.kind === 'folder' && Number(entry.position) < Number(season?.position)).length + 1;
40
+ const list = entries.filter(entry => entry.kind === 'item' && entry.parentId === (season ? season.id : item?.id));
41
+ const opening = entries.filter(entry => entry.kind === 'item' && entry.parentId === (firstSeason ? firstSeason.id : item?.id));
42
+ const firstEpisode = item?.kind === 'item' ? item : opening.find(entry => !opening.some(other => Number(other.position) < Number(entry.position)));
43
+ const episodeTotal = entries.filter(entry => entry.kind === 'item' && (entry.parentId === item?.id || seasons.some(folder => folder.id === entry.parentId))).length;
44
+ const genre = collections.find(collection => !!collection.parentId && collection.entryIds.includes(item?.id ?? ''));
45
+ const ownNumber = entries.filter(entry => entry.parentId === item?.parentId && entry.kind === item?.kind && Number(entry.position) < Number(item?.position)).length + 1;
46
+ const parentNumber = entries.filter(entry => entry.parentId === parent?.parentId && entry.kind === 'folder' && Number(entry.position) < Number(parent?.position)).length + 1;
47
+ const later = entries.filter(entry => entry.kind === 'item' && entry.parentId === item?.parentId && Number(entry.position) > Number(item?.position));
48
+ const siblings = entries.filter(entry => entry.kind === 'item' && entry.parentId === item?.parentId && entry.id !== item?.id);
49
+ const playable = firstEpisode?.playbackSource?.uri != null;
50
+ const locked = firstEpisode?.access?.open === false;
51
+ const sellers = access.offers.filter(offer => firstEpisode?.access?.offerIds.includes(offer.id) === true).map(offer => offer.name).join(' or ');
52
+ const technical: Partial<ContentVideoTechnical> | null | undefined = item?.technical;
53
+ const minutes = Math.round(Number(technical?.duration) / 60);
54
+ const resolution = Number((technical?.resolution ?? '0p').replace('p', ''));
55
+ const quality = [minutes >= 1 ? minutes + ' min' : '', resolution >= 2160 ? '4K' : resolution >= 720 ? 'HD' : '', technical?.hdr === true ? 'HDR' : ''].filter(part => part !== '').join(' · ');
56
+ const isSeries = item?.kind === 'folder' && seasons.length > 0;
57
+ const isSeason = item?.kind === 'folder' && seasons.length === 0;
58
+ const kicker = isSeries
59
+ ? [genre ? genre.name : item?.label ?? '', seasons.length + (seasons.length === 1 ? ' season' : ' seasons'), episodeTotal + (episodeTotal === 1 ? ' episode' : ' episodes')].join(' · ')
60
+ : isSeason
61
+ ? [parent ? parent.title : '', 'Season ' + ownNumber, list.length + (list.length === 1 ? ' episode' : ' episodes')].filter(part => part !== '').join(' · ')
62
+ : [grand ? grand.title : parent ? parent.title : item?.label ?? '', grand ? 'Season ' + parentNumber : '', parent ? 'Episode ' + ownNumber : ''].filter(part => part !== '').join(' · ');
63
+ const rootId = (item?.kind === 'item' ? grand ?? parent ?? item : parent ?? item)?.id ?? '';
64
+ const itemId = item?.kind === 'item' ? item.id : '';
65
+ const watched = item !== undefined && watchedIds.includes(item.id);
66
+ const resume = saved !== null && saved.entryId === itemId && saved.position > 0 && saved.finished !== true ? saved : null;
67
+ const share = resume !== null && resume.duration > 0 ? Math.min(100, Math.round(resume.position / resume.duration * 100)) : 0;
68
+ const left = resume !== null ? Math.max(1, Math.round((resume.duration - resume.position) / 60)) : 0;
69
+ useEffect(() => { if (activeId !== '' && rootId !== '') dispatch(loadWatched({ profileId: activeId, entryId: rootId })); }, [activeId, rootId, rows]);
70
+ useEffect(() => { if (activeId !== '' && itemId !== '') dispatch(loadResume({ profileId: activeId, entryId: itemId })); }, [activeId, itemId, rows]);
71
+ const toggle = () => {
72
+ if (item !== undefined && activeId !== '') dispatch(toggleWatched({ profileId: activeId, entryId: item.id, watched })).unwrap().then(() => dispatch(loadWatching(activeId))).catch(() => {});
73
+ };
74
+ const picture = item?.artwork.backdrop || item?.artwork.poster || parent?.artwork.backdrop;
75
+ const pictureOpacity = useSharedValue(0.4);
76
+ const pictureStyle = useAnimatedStyle(() => ({ opacity: pictureOpacity.value }));
77
+ useEffect(() => { pictureOpacity.value = 0.4; pictureOpacity.value = withTiming(1, { duration: 220 }); }, [route.params.id]);
78
+ return (
79
+ <Screen>
80
+ <Shell active="" contentAutoFocus>
81
+ {status === 'idle' || status === 'loading' ? <Feedback title="Opening this story" message="Gathering its seasons and episodes." loading /> : status === 'failed' ? <Feedback title="This story could not load" message="Check your connection and try again." onRetry={() => dispatch(loadLibrary())} /> : !item ? (
82
+ <View style={styles.missing}><Feedback title="This story is no longer here" message="Return to the library to find another series." /><Action label="Back to the library" icon="ph:caret-left" onPress={() => navigation.navigate('Home')} preferred /></View>
83
+ ) : (
84
+ <ScrollView style={styles.scroll} contentContainerStyle={styles.content} showsVerticalScrollIndicator={false}>
85
+ <ScrollTarget y={0}>
86
+ <View style={[styles.hero, expanded && styles.heroWide]}>
87
+ <Animated.View style={[styles.fill, pictureStyle]}>
88
+ {picture ? <Image source={{ uri: picture }} style={styles.fill} resizeMode="cover" /> : <View style={styles.fill} />}
89
+ </Animated.View>
90
+ {expanded && <LinearGradient colors={[theme.gradients.scrimDeep, theme.gradients.scrimSoft, theme.gradients.scrimClear]} start={{ x: 0, y: 0 }} end={{ x: 0.65, y: 0 }} style={styles.fill} pointerEvents="none" />}
91
+ <LinearGradient colors={[theme.gradients.scrimClear, theme.gradients.scrimMiddle, theme.gradients.scrimSolid]} start={{ x: 0, y: expanded ? 0.4 : 0.3 }} end={{ x: 0, y: 1 }} style={styles.fill} pointerEvents="none" />
92
+ {!expanded && <Pressable onPress={() => navigation.goBack()} style={styles.back} focusAnimation={{ border: { color: theme.colors.accent, width: 2 } }} accessibilityRole="button" accessibilityLabel="Back"><Icon icon="ph:caret-left" size={20} color={theme.colors.text} /></Pressable>}
93
+ <View style={[styles.copy, expanded && styles.copyWide]}>
94
+ <Text style={styles.kicker} numberOfLines={2}>{kicker.toUpperCase()}</Text>
95
+ <Text style={[styles.title, expanded && styles.titleWide]} numberOfLines={2}>{item.title}</Text>
96
+ {item.kind === 'item' && quality !== '' && <Text style={styles.quality}>{quality}</Text>}
97
+ {share > 0 && <View style={styles.place}><View style={styles.placeTrack}><View style={[styles.placeFill, { width: share + '%' }]} /></View><Text style={styles.placeText}>{left} MIN LEFT</Text></View>}
98
+ <Text style={styles.description} numberOfLines={expanded ? 3 : 5}>{item.description || 'More about this story will appear here soon.'}</Text>
99
+ <FocusGroup direction="horizontal" remember autoFocus>
100
+ <View style={styles.actions}>
101
+ {item.kind === 'item' && locked && <View style={styles.action}><UnlockAction item={item} preferred focusKey={route.key + '-play'} /></View>}
102
+ {item.kind === 'item' && playable && !locked && <View style={styles.action}><Action label={resume !== null ? 'Resume' : 'Play'} icon="ph:play-fill" primary preferred focusKey={route.key + '-play'} onPress={() => navigation.navigate('Player', { id: item.id })} /></View>}
103
+ {item.kind === 'folder' && <View style={styles.action}><PlayAction item={item} preferred focusKey={route.key + '-play'} /></View>}
104
+ {item.kind === 'item' && activeId !== '' && <View style={styles.action}><Action label={watched ? 'Watched' : 'Mark as watched'} icon={watched ? 'ph:check-circle-fill' : 'ph:check'} focusKey={route.key + '-watched'} onPress={toggle} /></View>}
105
+ <View style={styles.action}><SaveTitle id={item.id} /></View>
106
+ {item.kind === 'item' && !!(grand ?? parent) && <View style={styles.action}><Action label="All episodes" icon="ph:list-numbers" onPress={() => navigation.push('Detail', { id: grand ? grand.id : parent?.id })} /></View>}
107
+ </View>
108
+ </FocusGroup>
109
+ {locked && sellers !== '' && <Text style={styles.notice}>{'Watch with ' + sellers}</Text>}
110
+ {!playable && !locked && <Text style={styles.notice}>Playback is not available for this {item.kind === 'item' ? 'episode' : 'series'} yet.</Text>}
111
+ </View>
112
+ </View>
113
+ </ScrollTarget>
114
+ {seasons.length > 0 && (
115
+ <FocusGroup direction="horizontal" remember>
116
+ <View style={styles.tabs}>
117
+ {seasons.map((entry, index) => (
118
+ <Pressable key={entry.id} onPress={() => setSeasonId(entry.id)} style={styles.tab} focusAnimation={{ backgroundColor: theme.colors.surfaceLight }} accessibilityRole="button" accessibilityLabel={'Season ' + (index + 1)} accessibilityState={{ selected: entry.id === season?.id }}>
119
+ <Text style={[styles.tabText, entry.id === season?.id && styles.tabTextOn]}>Season {index + 1}</Text>
120
+ <View style={[styles.tabLine, entry.id === season?.id && styles.tabLineOn]} />
121
+ </Pressable>
122
+ ))}
123
+ </View>
124
+ </FocusGroup>
125
+ )}
126
+ {item.kind === 'folder' && list.length > 0 && (
127
+ <View style={styles.listBlock}>
128
+ <View style={styles.listHeading}>
129
+ <Text style={styles.listTitle} numberOfLines={2}>{season ? season.title : 'Episodes'}</Text>
130
+ <Text style={styles.listMeta}>{list.length + (list.length === 1 ? ' EPISODE' : ' EPISODES')}</Text>
131
+ </View>
132
+ <FocusGroup direction="vertical" remember>
133
+ <View>
134
+ {list.map(episode => <EpisodeRow key={episode.id} episode={episode} code={(season || isSeason ? 'S' + (season ? seasonNumber : ownNumber) + ' · ' : '') + 'E' + (list.filter(other => Number(other.position) < Number(episode.position)).length + 1)} number={list.filter(other => Number(other.position) < Number(episode.position)).length + 1} wide={expanded} />)}
135
+ </View>
136
+ </FocusGroup>
137
+ </View>
138
+ )}
139
+ {item.kind === 'folder' && list.length === 0 && <Feedback title="Episodes are on their way" message="They will appear here as soon as they are added." />}
140
+ {item.kind === 'item' && <LibraryRail title={later.length > 0 ? 'Next episodes' : 'More from this season'} meta={parent ? parent.title : ''} entries={later.length > 0 ? later : siblings} watchedIds={watchedIds} />}
141
+ </ScrollView>
142
+ )}
143
+ </Shell>
144
+ </Screen>
145
+ );
146
+ }
147
+
148
+ function EpisodeRow({ episode, code, number, wide }: {
149
+ episode: ContentItem;
150
+ code: string;
151
+ number: number;
152
+ wide: boolean;
153
+ }) {
154
+ const navigation = useNavigation();
155
+ const [focused, setFocused] = useState(false);
156
+ const rows = useSelector(state => state.watching.rows);
157
+ const watchedIds = useSelector(state => state.watching.watched);
158
+ const row = rows.find(saved => saved.entryId === episode.id);
159
+ const watched = watchedIds.includes(episode.id);
160
+ const locked = episode.access?.open === false;
161
+ const share = row !== undefined && row.duration > 0 ? Math.min(100, Math.round(row.position / row.duration * 100)) : 0;
162
+ const left = row !== undefined ? Math.max(1, Math.round((row.duration - row.position) / 60)) : 0;
163
+ const minutes = Math.round(Number(episode.technical?.duration) / 60);
164
+ const synopsis = episode.description ?? '';
165
+ const sentenceEnd = synopsis.indexOf('. ');
166
+ const logline = sentenceEnd >= 0 ? synopsis.slice(0, sentenceEnd + 1) : synopsis;
167
+ const picture = episode.artwork.backdrop || episode.artwork.poster;
168
+ return (
169
+ <Pressable onPress={() => episode.playbackSource?.uri != null && !locked ? navigation.navigate('Player', { id: episode.id }) : navigation.push('Detail', { id: episode.id })} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} style={styles.row} focusAnimation={{ backgroundColor: theme.colors.surface, border: { color: theme.colors.accent, width: 2 } }} accessibilityRole="button" accessibilityLabel={(locked ? 'Locked, ' : 'Play ') + code + ', ' + episode.title + (watched ? ', watched' : share > 0 ? ', ' + left + ' minutes left' : '')}>
170
+ {wide && <Text style={[styles.rowNumber, focused && styles.rowNumberOn]} maxFontSizeMultiplier={1}>{number < 10 ? '0' + number : '' + number}</Text>}
171
+ <View style={styles.rowStill}>
172
+ {picture ? <Image source={{ uri: picture }} resizeMode="cover" style={styles.fill} /> : <View style={styles.fill} />}
173
+ {!wide && <Text style={styles.rowStillNumber} maxFontSizeMultiplier={1}>{number < 10 ? '0' + number : '' + number}</Text>}
174
+ {locked && <View style={styles.rowLock}><Icon icon="ph:lock-simple-fill" size={wide ? 9 : 11} color={theme.colors.text} /></View>}
175
+ {watched && !locked && <View style={styles.rowCheck}><Icon icon="ph:check-bold" size={wide ? 9 : 11} color={theme.colors.background} /></View>}
176
+ {share > 0 && <View style={styles.rowTrack}><View style={[styles.placeFill, { width: share + '%' }]} /></View>}
177
+ </View>
178
+ <View style={styles.rowCopy}>
179
+ <Text style={styles.rowTitle} numberOfLines={1}>{episode.title}</Text>
180
+ <Text style={styles.rowCode}>{share > 0 ? code + ' · ' + left + ' MIN LEFT' : watched ? code + ' · WATCHED' : minutes >= 1 ? code + ' · ' + minutes + ' MIN' : code}</Text>
181
+ <Text style={styles.rowLogline} numberOfLines={2}>{logline}</Text>
182
+ </View>
183
+ </Pressable>
184
+ );
185
+ }
186
+
187
+ const styles = StyleSheet.create({
188
+ scroll: { flex: 1 },
189
+ content: { paddingBottom: theme.spacing.xl },
190
+ fill: { position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, width: '100%', height: '100%' },
191
+ hero: { minHeight: 520, backgroundColor: theme.colors.surface, overflow: 'hidden', justifyContent: 'flex-end' },
192
+ heroWide: { minHeight: 0, height: 330 },
193
+ back: { position: 'absolute', top: 12, left: 16, width: 40, height: 40, borderRadius: 20, backgroundColor: theme.gradients.scrimDeep, alignItems: 'center', justifyContent: 'center' },
194
+ copy: { paddingHorizontal: 20, paddingBottom: 12, paddingTop: 220 },
195
+ copyWide: { width: 600, paddingHorizontal: 32, paddingBottom: 24, paddingTop: 0 },
196
+ kicker: { color: theme.colors.accent, fontSize: Platform.select({ tv: 8, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 15 }), fontWeight: '800', letterSpacing: Platform.select({ tv: 1.6, default: 1.3 }) },
197
+ title: { color: theme.colors.text, fontSize: 32, lineHeight: 36, fontWeight: '900', letterSpacing: -1, marginTop: theme.spacing.sm },
198
+ titleWide: { fontSize: 36, lineHeight: 39, letterSpacing: -1.4 },
199
+ quality: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 8, default: 12 }), lineHeight: Platform.select({ tv: 12, default: 16 }), fontWeight: '800', letterSpacing: 1.2, marginTop: theme.spacing.sm },
200
+ description: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 10, default: 15 }), lineHeight: Platform.select({ tv: 15, default: 21 }), marginTop: Platform.select({ tv: 8, default: 10 }), maxWidth: 440 },
201
+ actions: { flexDirection: 'row', alignItems: 'flex-start', flexWrap: 'wrap', marginTop: Platform.select({ tv: 14, default: 18 }) },
202
+ action: { marginRight: Platform.select({ tv: 10, default: 10 }), marginBottom: theme.spacing.sm },
203
+ place: { flexDirection: 'row', alignItems: 'center', marginTop: Platform.select({ tv: 8, default: 10 }) },
204
+ placeTrack: { width: Platform.select({ tv: 96, default: 120 }), height: 3, borderRadius: 2, backgroundColor: theme.colors.border, overflow: 'hidden', marginRight: Platform.select({ tv: 8, default: 10 }) },
205
+ placeFill: { height: 3, backgroundColor: theme.colors.accent },
206
+ placeText: { color: theme.colors.accent, fontSize: Platform.select({ tv: 8, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 15 }), fontWeight: '800', letterSpacing: 1.2 },
207
+ notice: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 9, default: 13 }), lineHeight: Platform.select({ tv: 13, default: 18 }), marginTop: theme.spacing.xs },
208
+ tabs: { flexDirection: 'row', paddingHorizontal: Platform.select({ tv: 26, default: 14 }), marginTop: Platform.select({ tv: 10, default: 8 }), borderBottomWidth: 1, borderBottomColor: theme.colors.border },
209
+ tab: { paddingHorizontal: Platform.select({ tv: 6, default: 6 }), paddingTop: Platform.select({ tv: 8, default: 10 }), marginRight: Platform.select({ tv: 10, default: 8 }), borderTopLeftRadius: 4, borderTopRightRadius: 4 },
210
+ tabText: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 11, default: 15 }), lineHeight: Platform.select({ tv: 15, default: 20 }), fontWeight: '800' },
211
+ tabTextOn: { color: theme.colors.text },
212
+ tabLine: { height: 3, marginTop: Platform.select({ tv: 7, default: 9 }), backgroundColor: 'transparent' },
213
+ tabLineOn: { backgroundColor: theme.colors.accent },
214
+ listBlock: { paddingHorizontal: Platform.select({ tv: 24, default: 12 }), paddingTop: Platform.select({ tv: 14, default: 16 }) },
215
+ listHeading: { flexDirection: Platform.select({ tv: 'row', default: 'column' }), alignItems: Platform.select({ tv: 'baseline', default: 'flex-start' }), paddingHorizontal: Platform.select({ tv: 8, default: 8 }), marginBottom: Platform.select({ tv: 6, default: 8 }) },
216
+ listTitle: { color: theme.colors.text, fontSize: Platform.select({ tv: 13, default: 18 }), lineHeight: Platform.select({ tv: 18, default: 24 }), fontWeight: '800', marginRight: theme.spacing.md, flexShrink: 1 },
217
+ listMeta: { marginTop: Platform.select({ tv: 0, default: 2 }), color: theme.colors.textMuted, fontSize: Platform.select({ tv: 8, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 15 }), fontWeight: '800', letterSpacing: 1.2 },
218
+ row: { flexDirection: 'row', alignItems: 'center', padding: Platform.select({ tv: 8, default: 8 }), borderRadius: 4, marginBottom: Platform.select({ tv: 2, default: 4 }) },
219
+ rowNumber: { width: 54, color: theme.colors.textMuted, fontSize: 28, lineHeight: 32, fontWeight: '900', letterSpacing: -1 },
220
+ rowNumberOn: { color: theme.colors.accent },
221
+ rowStill: { width: Platform.select({ tv: 144, default: 132 }), height: Platform.select({ tv: 81, default: 74 }), borderRadius: 4, overflow: 'hidden', backgroundColor: theme.colors.surfaceLight },
222
+ rowStillNumber: { position: 'absolute', left: 6, bottom: 0, color: theme.colors.text, fontSize: 26, lineHeight: 30, fontWeight: '900', letterSpacing: -1 },
223
+ rowCheck: { position: 'absolute', top: Platform.select({ tv: 5, default: 6 }), right: Platform.select({ tv: 5, default: 6 }), width: Platform.select({ tv: 16, default: 20 }), height: Platform.select({ tv: 16, default: 20 }), borderRadius: Platform.select({ tv: 8, default: 10 }), backgroundColor: theme.colors.accent, alignItems: 'center', justifyContent: 'center' },
224
+ rowLock: { position: 'absolute', top: Platform.select({ tv: 5, default: 6 }), right: Platform.select({ tv: 5, default: 6 }), width: Platform.select({ tv: 18, default: 22 }), height: Platform.select({ tv: 18, default: 22 }), borderRadius: Platform.select({ tv: 9, default: 11 }), backgroundColor: theme.gradients.scrimDeep, alignItems: 'center', justifyContent: 'center' },
225
+ rowTrack: { position: 'absolute', left: 0, right: 0, bottom: 0, height: 3, backgroundColor: theme.colors.border },
226
+ rowCopy: { flex: 1, marginLeft: Platform.select({ tv: 16, default: 12 }) },
227
+ rowTitle: { color: theme.colors.text, fontSize: Platform.select({ tv: 12, default: 15 }), lineHeight: Platform.select({ tv: 16, default: 20 }), fontWeight: '800' },
228
+ rowCode: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 7, default: 10 }), lineHeight: Platform.select({ tv: 11, default: 14 }), fontWeight: '800', letterSpacing: 1.1, marginTop: 3 },
229
+ rowLogline: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 10, default: 13 }), lineHeight: Platform.select({ tv: 14, default: 18 }), marginTop: Platform.select({ tv: 4, default: 4 }), maxWidth: 560 },
230
+ missing: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: theme.spacing.lg },
231
+ });