@adelin-io/cli 0.0.0-stage → 0.1.1
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/README.md +76 -2
- package/authoring-release.json +174 -0
- package/package.json +30 -4
- package/runtime-integrity.json +9 -0
- package/scripts/adelin.mjs +7768 -0
- package/scripts/assemble-checkout.mjs +93 -0
- package/scripts/local-save.mjs +513 -0
- package/scripts/materialize.mjs +319 -0
- package/scripts/runtime.mjs +8950 -0
- package/scripts/typecheck.mjs +72 -0
- package/scripts/workspace-state.mjs +183 -0
- package/skill/README.md +77 -0
- package/skill/SKILL.md +100 -0
- package/skill/authoring/access.md +193 -0
- package/skill/authoring/analytics.md +20 -0
- package/skill/authoring/app-memory.md +128 -0
- package/skill/authoring/app-requirements.md +99 -0
- package/skill/authoring/app-structure.md +265 -0
- package/skill/authoring/assets.md +117 -0
- package/skill/authoring/auth.md +263 -0
- package/skill/authoring/content-binding.md +26 -0
- package/skill/authoring/i18n.md +184 -0
- package/skill/authoring/language.md +503 -0
- package/skill/authoring/local-workflow.md +1667 -0
- package/skill/authoring/offline/connectivity.md +50 -0
- package/skill/authoring/offline/example.md +102 -0
- package/skill/authoring/offline/history-sync.md +39 -0
- package/skill/authoring/offline/index.md +29 -0
- package/skill/authoring/offline/package-storage.md +37 -0
- package/skill/authoring/offline/platforms.md +35 -0
- package/skill/authoring/offline/startup-navigation.md +53 -0
- package/skill/authoring/platform-files.md +616 -0
- package/skill/authoring/player/casting.md +47 -0
- package/skill/authoring/player/controls.md +95 -0
- package/skill/authoring/player/downloads.md +90 -0
- package/skill/authoring/player/drm.md +31 -0
- package/skill/authoring/player/index.md +39 -0
- package/skill/authoring/player/live-dvr.md +74 -0
- package/skill/authoring/player/platforms.md +47 -0
- package/skill/authoring/player/playback.md +43 -0
- package/skill/authoring/player/tracks-subtitles.md +32 -0
- package/skill/authoring/profiles.md +213 -0
- package/skill/authoring/remote-keys.md +139 -0
- package/skill/authoring/search.md +27 -0
- package/skill/authoring/store.md +85 -0
- package/skill/authoring/tv-text-entry.md +146 -0
- package/skill/design/approved/README.md +14 -0
- package/skill/design/approved/vesper-phone-home.jpg +0 -0
- package/skill/design/approved/vesper-tv-detail.jpg +0 -0
- package/skill/design/approved/vesper-tv-home.jpg +0 -0
- package/skill/design/design-guide.md +610 -0
- package/skill/design/edge-to-edge.md +66 -0
- package/skill/design/icons.md +50 -0
- package/skill/design/responsive-layout.md +175 -0
- package/skill/design/safe-area.md +221 -0
- package/skill/design/streaming-playbook.md +131 -0
- package/skill/design/visual-review.md +150 -0
- package/skill/examples/README.md +24 -0
- package/skill/examples/cinema/DESIGN.md +58 -0
- package/skill/examples/cinema/app.tsx +17 -0
- package/skill/examples/cinema/assets/logo.png +0 -0
- package/skill/examples/cinema/components/Action.tsx +40 -0
- package/skill/examples/cinema/components/Action.tv.tsx +44 -0
- package/skill/examples/cinema/components/CatalogGrid.tsx +31 -0
- package/skill/examples/cinema/components/ContinueRail.tsx +98 -0
- package/skill/examples/cinema/components/Feedback.tsx +28 -0
- package/skill/examples/cinema/components/Field.tsx +41 -0
- package/skill/examples/cinema/components/LibraryRail.tsx +46 -0
- package/skill/examples/cinema/components/PlayAction.tsx +29 -0
- package/skill/examples/cinema/components/Root.tsx +59 -0
- package/skill/examples/cinema/components/Shell.tsx +70 -0
- package/skill/examples/cinema/components/Tab.tsx +22 -0
- package/skill/examples/cinema/components/TitleCard.tsx +68 -0
- package/skill/examples/cinema/components/TitleMeta.tsx +36 -0
- package/skill/examples/cinema/locales/en.ts +211 -0
- package/skill/examples/cinema/locales/lt.ts +211 -0
- package/skill/examples/cinema/preview/phone-home.jpg +0 -0
- package/skill/examples/cinema/preview/tv-detail.jpg +0 -0
- package/skill/examples/cinema/preview/tv-home.jpg +0 -0
- package/skill/examples/cinema/screens/portrait/Account.tsx +110 -0
- package/skill/examples/cinema/screens/portrait/Browse.tsx +73 -0
- package/skill/examples/cinema/screens/portrait/Detail.tsx +159 -0
- package/skill/examples/cinema/screens/portrait/Home.tsx +196 -0
- package/skill/examples/cinema/screens/portrait/Player.tsx +299 -0
- package/skill/examples/cinema/screens/portrait/Search.tsx +46 -0
- package/skill/examples/cinema/screens/portrait/Search.tv.tsx +55 -0
- package/skill/examples/cinema/screens/portrait/SignIn.tsx +101 -0
- package/skill/examples/cinema/screens/portrait/SignUp.tsx +106 -0
- package/skill/examples/cinema/store.tsx +132 -0
- package/skill/examples/cinema/theme.ts +32 -0
- package/skill/examples/documentary/DESIGN.md +33 -0
- package/skill/examples/documentary/app.tsx +17 -0
- package/skill/examples/documentary/components/Action.tsx +43 -0
- package/skill/examples/documentary/components/CatalogGrid.tsx +47 -0
- package/skill/examples/documentary/components/Feedback.tsx +27 -0
- package/skill/examples/documentary/components/Field.tsx +33 -0
- package/skill/examples/documentary/components/LibraryRail.tsx +47 -0
- package/skill/examples/documentary/components/Root.tsx +62 -0
- package/skill/examples/documentary/components/Shell.tsx +93 -0
- package/skill/examples/documentary/components/StoryCard.tsx +53 -0
- package/skill/examples/documentary/components/StoryMeta.tsx +22 -0
- package/skill/examples/documentary/preview/phone-home.jpg +0 -0
- package/skill/examples/documentary/preview/tv-detail.jpg +0 -0
- package/skill/examples/documentary/preview/tv-home.jpg +0 -0
- package/skill/examples/documentary/screens/portrait/Account.tsx +97 -0
- package/skill/examples/documentary/screens/portrait/Browse.tsx +71 -0
- package/skill/examples/documentary/screens/portrait/Detail.tsx +133 -0
- package/skill/examples/documentary/screens/portrait/Home.tsx +89 -0
- package/skill/examples/documentary/screens/portrait/Player.tsx +116 -0
- package/skill/examples/documentary/screens/portrait/Search.tsx +48 -0
- package/skill/examples/documentary/screens/portrait/SignIn.tsx +96 -0
- package/skill/examples/documentary/screens/portrait/SignUp.tsx +101 -0
- package/skill/examples/documentary/store.tsx +115 -0
- package/skill/examples/documentary/theme.ts +20 -0
- package/skill/examples/series/DESIGN.md +55 -0
- package/skill/examples/series/app.tsx +17 -0
- package/skill/examples/series/components/Action.tsx +42 -0
- package/skill/examples/series/components/CatalogGrid.tsx +43 -0
- package/skill/examples/series/components/ContinueRail.tsx +78 -0
- package/skill/examples/series/components/Feedback.tsx +26 -0
- package/skill/examples/series/components/Field.tsx +34 -0
- package/skill/examples/series/components/LibraryRail.tsx +38 -0
- package/skill/examples/series/components/OutcomeNote.tsx +28 -0
- package/skill/examples/series/components/PlayAction.tsx +29 -0
- package/skill/examples/series/components/RestoreAction.tsx +33 -0
- package/skill/examples/series/components/Root.tsx +75 -0
- package/skill/examples/series/components/SaveTitle.tsx +34 -0
- package/skill/examples/series/components/Shell.tsx +75 -0
- package/skill/examples/series/components/TitleCard.tsx +62 -0
- package/skill/examples/series/components/UnlockAction.tsx +10 -0
- package/skill/examples/series/preview/phone-home.jpg +0 -0
- package/skill/examples/series/preview/tv-detail.jpg +0 -0
- package/skill/examples/series/preview/tv-home.jpg +0 -0
- package/skill/examples/series/screens/portrait/Account.tsx +125 -0
- package/skill/examples/series/screens/portrait/Browse.tsx +61 -0
- package/skill/examples/series/screens/portrait/Detail.tsx +231 -0
- package/skill/examples/series/screens/portrait/Home.tsx +109 -0
- package/skill/examples/series/screens/portrait/MyList.tsx +44 -0
- package/skill/examples/series/screens/portrait/Plans.tsx +131 -0
- package/skill/examples/series/screens/portrait/Player.tsx +138 -0
- package/skill/examples/series/screens/portrait/Profiles.tsx +103 -0
- package/skill/examples/series/screens/portrait/Search.tsx +50 -0
- package/skill/examples/series/screens/portrait/SignIn.tsx +94 -0
- package/skill/examples/series/screens/portrait/SignUp.tsx +100 -0
- package/skill/examples/series/store.tsx +192 -0
- package/skill/examples/series/theme.ts +32 -0
- package/skill/guides/final-pricing-capabilities.md +13 -0
- package/skill/reference/api.md +842 -0
- package/skill/reference/components.md +1782 -0
- package/skill/reference/packages.md +24 -0
- package/skill/scripts/assemble-checkout.mjs +93 -0
- package/skill/scripts/local-save.mjs +513 -0
- package/skill/scripts/materialize.mjs +319 -0
- package/skill/scripts/workspace-state.mjs +183 -0
- package/types/adelin-access.d.ts +70 -0
- package/types/adelin-analytics.d.ts +5 -0
- package/types/adelin-assets.d.ts +26 -0
- package/types/adelin-auth.d.ts +37 -0
- package/types/adelin-content.d.ts +120 -0
- package/types/adelin-device.d.ts +195 -0
- package/types/adelin-downloads.d.ts +47 -0
- package/types/adelin-env.d.ts +8 -0
- package/types/adelin-globals.d.ts +19 -0
- package/types/adelin-i18n.d.ts +31 -0
- package/types/adelin-native-stack.d.ts +178 -0
- package/types/adelin-navigation.d.ts +264 -0
- package/types/adelin-profiles.d.ts +51 -0
- package/types/adelin-react.d.ts +49 -0
- package/types/adelin-reanimated.d.ts +376 -0
- package/types/adelin-storage.d.ts +9 -0
- package/types/adelin-store.d.ts +74 -0
- package/types/adelin-ui.d.ts +1518 -0
- package/types/adelin-utils.d.ts +7 -0
- package/types/adelin-worklets.d.ts +15 -0
- package/workspace-tsconfig.json +53 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useEffect } from '@adelin/react';
|
|
2
|
+
import { useAuth } from '@adelin/auth';
|
|
3
|
+
import { useTranslation } from '@adelin/i18n';
|
|
4
|
+
import { createNativeStackNavigator } from '@adelin/native-stack';
|
|
5
|
+
import { useDispatch, useSelector } from '@adelin/store';
|
|
6
|
+
import { SafeAreaView, StyleSheet, theme } from '@adelin/ui';
|
|
7
|
+
import { loadLibrary } from '../store';
|
|
8
|
+
import Feedback from './Feedback';
|
|
9
|
+
import Home from '../screens/portrait/Home';
|
|
10
|
+
import Browse from '../screens/portrait/Browse';
|
|
11
|
+
import Search from '../screens/portrait/Search';
|
|
12
|
+
import Detail from '../screens/portrait/Detail';
|
|
13
|
+
import Player from '../screens/portrait/Player';
|
|
14
|
+
import Account from '../screens/portrait/Account';
|
|
15
|
+
import SignIn from '../screens/portrait/SignIn';
|
|
16
|
+
import SignUp from '../screens/portrait/SignUp';
|
|
17
|
+
|
|
18
|
+
const Stack = createNativeStackNavigator();
|
|
19
|
+
|
|
20
|
+
export default function Root() {
|
|
21
|
+
const auth = useAuth();
|
|
22
|
+
if (auth.signInRequired && auth.status === 'loading') return <Splash />;
|
|
23
|
+
if (auth.signInRequired && auth.status === 'signed-out') return <SignInFlow />;
|
|
24
|
+
return <Main />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function Main() {
|
|
28
|
+
const dispatch = useDispatch();
|
|
29
|
+
const status = useSelector(state => state.library.status);
|
|
30
|
+
useEffect(() => { if (status === 'idle') dispatch(loadLibrary()); }, [dispatch, status]);
|
|
31
|
+
return (
|
|
32
|
+
<Stack.Navigator initialRouteName="Home">
|
|
33
|
+
<Stack.Screen name="Home" component={Home} options={{ animation: 'none' }} />
|
|
34
|
+
<Stack.Screen name="Browse" component={Browse} options={{ animation: 'none' }} />
|
|
35
|
+
<Stack.Screen name="Search" component={Search} options={{ animation: 'none' }} />
|
|
36
|
+
<Stack.Screen name="Detail" component={Detail} />
|
|
37
|
+
<Stack.Screen name="Player" component={Player} />
|
|
38
|
+
<Stack.Screen name="Account" component={Account} options={{ animation: 'none' }} />
|
|
39
|
+
<Stack.Screen name="SignIn" component={SignIn} />
|
|
40
|
+
<Stack.Screen name="SignUp" component={SignUp} />
|
|
41
|
+
</Stack.Navigator>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function SignInFlow() {
|
|
46
|
+
return (
|
|
47
|
+
<Stack.Navigator initialRouteName="SignIn">
|
|
48
|
+
<Stack.Screen name="SignIn" component={SignIn} />
|
|
49
|
+
<Stack.Screen name="SignUp" component={SignUp} />
|
|
50
|
+
</Stack.Navigator>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function Splash() {
|
|
55
|
+
const { t } = useTranslation();
|
|
56
|
+
return <SafeAreaView style={styles.splash}><Feedback title={t('common.brand')} message={t('common.checkingSignIn')} loading /></SafeAreaView>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const styles = StyleSheet.create({ splash: { flex: 1, justifyContent: 'center', backgroundColor: theme.colors.background } });
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useTranslation } from '@adelin/i18n';
|
|
2
|
+
import { useNavigation, useRoute } from '@adelin/navigation';
|
|
3
|
+
import { FocusGroup, Icon, Image, Pressable, SafeAreaView, StyleSheet, Text, View, theme, useWindowDimensions } from '@adelin/ui';
|
|
4
|
+
import Tab from './Tab';
|
|
5
|
+
import logo from '../assets/logo.png';
|
|
6
|
+
|
|
7
|
+
export default function Shell({ active, children, overlay = false, contentAutoFocus = true }: { active: string; children?: {} | null; overlay?: boolean; contentAutoFocus?: boolean }) {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const navigation = useNavigation();
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const { width, height } = useWindowDimensions();
|
|
12
|
+
const wide = width >= 840 && height >= 480;
|
|
13
|
+
const destinations = [
|
|
14
|
+
{ name: 'Home', label: t('shell.tabs.home'), icon: 'ph:house', iconOn: 'ph:house-fill' },
|
|
15
|
+
{ name: 'Browse', label: t('shell.tabs.browse'), icon: 'ph:squares-four', iconOn: 'ph:squares-four-fill' },
|
|
16
|
+
{ name: 'Search', label: t('shell.tabs.search'), icon: 'ph:magnifying-glass', iconOn: 'ph:magnifying-glass-bold' },
|
|
17
|
+
{ name: 'Account', label: t('shell.tabs.account'), icon: 'ph:user-circle', iconOn: 'ph:user-circle-fill' },
|
|
18
|
+
];
|
|
19
|
+
const go = (name: string) => { if (name === 'Home') navigation.popTo('Home'); else if (name === 'Browse') navigation.navigate('Browse', undefined, { pop: true }); else if (name === 'Search') navigation.navigate('Search', undefined, { pop: true }); else navigation.navigate('Account', undefined, { pop: true }); };
|
|
20
|
+
return (
|
|
21
|
+
<View style={styles.page}>
|
|
22
|
+
<FocusGroup direction="vertical" remember>
|
|
23
|
+
<View style={[styles.layout, wide && styles.layoutWide]}>
|
|
24
|
+
{wide ? (
|
|
25
|
+
<View style={styles.bar}>
|
|
26
|
+
<Image source={logo} accessibilityLabel={t('common.brand')} resizeMode="contain" style={styles.logo} />
|
|
27
|
+
<FocusGroup direction="horizontal" remember>
|
|
28
|
+
<View style={styles.links}>
|
|
29
|
+
{destinations.map(destination => <Tab key={destination.name} label={destination.label} selected={active === destination.name} onPress={() => go(destination.name)} focusKey={route.key + '-nav-' + destination.name} />)}
|
|
30
|
+
</View>
|
|
31
|
+
</FocusGroup>
|
|
32
|
+
</View>
|
|
33
|
+
) : (
|
|
34
|
+
<SafeAreaView edges={['bottom', 'left', 'right']} style={styles.tabs}>
|
|
35
|
+
<View style={styles.tabRow}>
|
|
36
|
+
{destinations.map(destination => (
|
|
37
|
+
<Pressable key={destination.name} onPress={() => go(destination.name)} style={styles.tabItem} accessibilityRole="button" accessibilityLabel={destination.label} accessibilityState={{ selected: active === destination.name }}>
|
|
38
|
+
<Icon icon={active === destination.name ? destination.iconOn : destination.icon} size={22} color={active === destination.name ? theme.colors.text : theme.colors.textMuted} />
|
|
39
|
+
<Text style={[styles.tabLabel, active === destination.name && styles.tabLabelOn]}>{destination.label}</Text>
|
|
40
|
+
</Pressable>
|
|
41
|
+
))}
|
|
42
|
+
</View>
|
|
43
|
+
</SafeAreaView>
|
|
44
|
+
)}
|
|
45
|
+
<FocusGroup direction="vertical" remember autoFocus={contentAutoFocus}>
|
|
46
|
+
<View style={[styles.content, wide && !overlay && styles.belowBar]}>
|
|
47
|
+
{!wide && !overlay ? <SafeAreaView edges={['top', 'left', 'right']} style={styles.content}>{children}</SafeAreaView> : children}
|
|
48
|
+
</View>
|
|
49
|
+
</FocusGroup>
|
|
50
|
+
</View>
|
|
51
|
+
</FocusGroup>
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
page: { flex: 1, backgroundColor: theme.colors.background },
|
|
58
|
+
layout: { flex: 1, flexDirection: 'column-reverse' },
|
|
59
|
+
layoutWide: { flexDirection: 'column' },
|
|
60
|
+
bar: { position: 'absolute', top: 0, left: 0, right: 0, height: 52, zIndex: 3, flexDirection: 'row', alignItems: 'center', paddingHorizontal: theme.spacing.xl, backgroundColor: theme.colors.background },
|
|
61
|
+
logo: { width: 105, height: 16, marginRight: 28 },
|
|
62
|
+
links: { flexDirection: 'row', alignItems: 'center' },
|
|
63
|
+
tabs: { backgroundColor: theme.colors.background, borderTopWidth: 1, borderTopColor: theme.colors.border },
|
|
64
|
+
tabRow: { flexDirection: 'row', paddingTop: 6 },
|
|
65
|
+
tabItem: { flex: 1, minHeight: 48, alignItems: 'center', justifyContent: 'center' },
|
|
66
|
+
tabLabel: { color: theme.colors.textMuted, fontSize: 11, lineHeight: 14, fontWeight: '600', marginTop: 2 },
|
|
67
|
+
tabLabelOn: { color: theme.colors.text },
|
|
68
|
+
content: { flex: 1 },
|
|
69
|
+
belowBar: { paddingTop: 52 },
|
|
70
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useState } from '@adelin/react';
|
|
2
|
+
import { Pressable, StyleSheet, Text, View, theme } from '@adelin/ui';
|
|
3
|
+
import { Platform } from '@adelin/device';
|
|
4
|
+
|
|
5
|
+
export default function Tab({ label, selected, onPress, focusKey }: { label: string; selected: boolean; onPress: () => void; focusKey?: string }) {
|
|
6
|
+
const [focused, setFocused] = useState(false);
|
|
7
|
+
return (
|
|
8
|
+
<Pressable onPress={onPress} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} focusKey={focusKey} style={styles.tab} focusAnimation={{ backgroundColor: theme.gradients.ghost }} accessibilityRole="button" accessibilityLabel={label} accessibilityState={{ selected }}>
|
|
9
|
+
<Text style={[styles.label, selected && styles.selected, focused && styles.focused]} numberOfLines={1}>{label}</Text>
|
|
10
|
+
<View style={[styles.rule, selected && styles.ruleOn]} />
|
|
11
|
+
</Pressable>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
tab: { paddingHorizontal: theme.spacing.sm, paddingTop: Platform.select({ tv: 5, default: 8 }), paddingBottom: Platform.select({ tv: 3, default: 6 }), marginRight: Platform.select({ tv: 4, default: 6 }), borderRadius: 2, alignItems: 'center' },
|
|
17
|
+
label: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 11, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), fontWeight: '600', letterSpacing: 0.2 },
|
|
18
|
+
selected: { color: theme.colors.text, fontWeight: '800' },
|
|
19
|
+
focused: { color: theme.colors.text },
|
|
20
|
+
rule: { width: Platform.select({ tv: 12, default: 16 }), height: 2, marginTop: Platform.select({ tv: 3, default: 4 }), backgroundColor: 'transparent' },
|
|
21
|
+
ruleOn: { backgroundColor: theme.colors.text },
|
|
22
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ContentItem } from '@adelin/content';
|
|
2
|
+
import { useTranslation } from '@adelin/i18n';
|
|
3
|
+
import { useNavigation } from '@adelin/navigation';
|
|
4
|
+
import { useSelector } from '@adelin/store';
|
|
5
|
+
import { Icon, Image, LinearGradient, Pressable, StyleSheet, Text, View, theme } from '@adelin/ui';
|
|
6
|
+
import { Platform } from '@adelin/device';
|
|
7
|
+
|
|
8
|
+
/** Artwork tile. Scope frames and episodes caption below the image; posters and stills carry their title inside it. */
|
|
9
|
+
export default function TitleCard({ item, variant = 'scope', width = 0, number = 0, watched = false, onFocus }: {
|
|
10
|
+
item: ContentItem;
|
|
11
|
+
variant?: 'scope' | 'still' | 'poster' | 'episode';
|
|
12
|
+
width?: number;
|
|
13
|
+
number?: number;
|
|
14
|
+
watched?: boolean;
|
|
15
|
+
onFocus?: () => void;
|
|
16
|
+
}) {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const navigation = useNavigation();
|
|
19
|
+
const entries = useSelector(state => state.library.entries);
|
|
20
|
+
const children = entries.filter(entry => entry.parentId === item.id);
|
|
21
|
+
const parts = children.length > 0 ? t(children.length === 1 ? 'common.onePart' : 'common.parts', { count: children.length, noun: (children[0].label ?? t('common.part')).toLowerCase() }) : '';
|
|
22
|
+
const poster = variant === 'poster';
|
|
23
|
+
const picture = poster ? item.artwork.poster || item.artwork.backdrop : item.artwork.backdrop || item.artwork.poster;
|
|
24
|
+
const minutes = Math.round(Number(item.technical?.duration ?? 0) / 60);
|
|
25
|
+
const ratio = variant === 'scope' ? 2.39 : 1.7778;
|
|
26
|
+
const runtime = minutes > 0 ? t('common.minutes', { minutes }) : '';
|
|
27
|
+
const caption = variant === 'episode' ? runtime : parts.length > 0 ? parts : [item.label ?? '', runtime].filter(part => part.length > 0).reduce((text, part) => text.length > 0 ? text + ' · ' + part : part, '');
|
|
28
|
+
if (variant === 'scope' || variant === 'episode') {
|
|
29
|
+
return (
|
|
30
|
+
<View style={[variant === 'scope' ? styles.scopeBox : styles.episodeBox, width > 0 && { width }]}>
|
|
31
|
+
<Pressable onPress={() => navigation.push('Detail', { id: item.id })} onFocus={() => { if (onFocus !== undefined) onFocus(); }} style={[styles.card, variant === 'scope' ? styles.scope : styles.still, width > 0 && { width, height: width / ratio }]} focusAnimation={{ border: { color: theme.colors.primary, width: 2 }, scale: 1.04 }} accessibilityRole="button" accessibilityLabel={item.title}>
|
|
32
|
+
{picture ? <Image source={{ uri: picture }} resizeMode="cover" style={styles.image} /> : null}
|
|
33
|
+
{watched === true && <View style={styles.watched}><Icon icon="ph:check-bold" size={10} color={theme.colors.background} /><Text style={styles.watchedLabel}>{t('titleCard.watched')}</Text></View>}
|
|
34
|
+
</Pressable>
|
|
35
|
+
<Text style={styles.below} numberOfLines={1}>{number > 0 ? number + '. ' + item.title : item.title}</Text>
|
|
36
|
+
{caption.length > 0 && <Text style={styles.belowCaption} numberOfLines={variant === 'episode' ? 2 : 1}>{variant === 'episode' ? caption + (item.description ? ' · ' + item.description : '') : caption}</Text>}
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return (
|
|
41
|
+
<Pressable onPress={() => navigation.push('Detail', { id: item.id })} onFocus={() => { if (onFocus !== undefined) onFocus(); }} style={[styles.card, poster ? styles.poster : styles.still, width > 0 && { width, height: poster ? width * 1.5 : width / 1.7778 }]} focusAnimation={{ border: { color: theme.colors.primary, width: 2 }, scale: 1.04 }} accessibilityRole="button" accessibilityLabel={item.title}>
|
|
42
|
+
{picture ? <Image source={{ uri: picture }} resizeMode="cover" style={styles.image} /> : null}
|
|
43
|
+
<LinearGradient colors={[theme.gradients.heroClear, theme.gradients.cardShade]} start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }} locations={poster ? [0.5, 1] : [0.3, 1]} style={styles.image} pointerEvents="none" />
|
|
44
|
+
<View style={styles.copy}>
|
|
45
|
+
{parts.length > 0 && <Text style={styles.caption} numberOfLines={1}>{parts}</Text>}
|
|
46
|
+
<Text style={[styles.title, poster && styles.posterTitle]} numberOfLines={2}>{item.title}</Text>
|
|
47
|
+
</View>
|
|
48
|
+
</Pressable>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
card: { backgroundColor: theme.colors.surfaceLight, borderRadius: 2, overflow: 'hidden', justifyContent: 'flex-end' },
|
|
54
|
+
scopeBox: { width: Platform.select({ tv: 184, default: 280 }) },
|
|
55
|
+
scope: { width: Platform.select({ tv: 184, default: 280 }), height: Platform.select({ tv: 77, default: 117 }) },
|
|
56
|
+
still: { width: Platform.select({ tv: 168, default: 248 }), height: Platform.select({ tv: 95, default: 140 }) },
|
|
57
|
+
poster: { width: Platform.select({ tv: 104, default: 132 }), height: Platform.select({ tv: 156, default: 198 }) },
|
|
58
|
+
image: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, width: '100%', height: '100%' },
|
|
59
|
+
copy: { paddingHorizontal: Platform.select({ tv: 9, default: 12 }), paddingBottom: Platform.select({ tv: 8, default: 10 }) },
|
|
60
|
+
caption: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 10, default: 12 }), lineHeight: Platform.select({ tv: 13, default: 16 }), fontWeight: '600' },
|
|
61
|
+
title: { color: theme.colors.text, fontSize: Platform.select({ tv: 12, default: 15 }), lineHeight: Platform.select({ tv: 15, default: 19 }), fontWeight: '800' },
|
|
62
|
+
posterTitle: { fontSize: Platform.select({ tv: 11, default: 14 }), lineHeight: Platform.select({ tv: 14, default: 18 }) },
|
|
63
|
+
watched: { position: 'absolute', top: Platform.select({ tv: 6, default: 8 }), left: Platform.select({ tv: 6, default: 8 }), flexDirection: 'row', alignItems: 'center', backgroundColor: theme.colors.primary, borderRadius: 2, paddingHorizontal: 5, paddingVertical: 2 },
|
|
64
|
+
watchedLabel: { color: theme.colors.background, fontSize: Platform.select({ tv: 9, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 14 }), fontWeight: '700', marginLeft: 3 },
|
|
65
|
+
episodeBox: { width: Platform.select({ tv: 168, default: 248 }) },
|
|
66
|
+
below: { color: theme.colors.text, fontSize: Platform.select({ tv: 12, default: 15 }), lineHeight: Platform.select({ tv: 15, default: 19 }), fontWeight: '700', marginTop: Platform.select({ tv: 7, default: 9 }) },
|
|
67
|
+
belowCaption: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 10, default: 13 }), lineHeight: Platform.select({ tv: 13, default: 18 }), marginTop: 2 },
|
|
68
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ContentItem, ContentVideoTechnical } from '@adelin/content';
|
|
2
|
+
import { useTranslation } from '@adelin/i18n';
|
|
3
|
+
import { useSelector } from '@adelin/store';
|
|
4
|
+
import { StyleSheet, Text, View, theme } from '@adelin/ui';
|
|
5
|
+
import { Platform } from '@adelin/device';
|
|
6
|
+
|
|
7
|
+
export default function TitleMeta({ item }: { item: ContentItem }) {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const entries = useSelector(state => state.library.entries);
|
|
10
|
+
const collections = useSelector(state => state.library.collections);
|
|
11
|
+
const children = entries.filter(entry => entry.parentId === item.id);
|
|
12
|
+
const count = children.length > 0 ? t(children.length === 1 ? 'common.onePart' : 'common.parts', { count: children.length, noun: (children[0].label ?? t('common.part')).toLowerCase() }) : '';
|
|
13
|
+
const technical: Partial<ContentVideoTechnical> | null = item.technical;
|
|
14
|
+
const seconds = Number(technical?.duration ?? 0);
|
|
15
|
+
const hours = Math.floor(seconds / 3600);
|
|
16
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
17
|
+
const runtime = seconds < 60 ? '' : hours > 0 ? (minutes > 0 ? t('titleMeta.hoursMinutes', { hours, minutes }) : t('titleMeta.hours', { hours })) : t('common.minutes', { minutes });
|
|
18
|
+
const resolution = (technical?.resolution ?? '').toUpperCase();
|
|
19
|
+
const quality = resolution.indexOf('2160') >= 0 || resolution.indexOf('4K') >= 0 ? t('titleMeta.uhd') : resolution.indexOf('1080') >= 0 || resolution.indexOf('720') >= 0 ? t('titleMeta.hd') : '';
|
|
20
|
+
const genre = collections.find(collection => collection.parentId != null && collection.entryIds.includes(item.id))?.name ?? '';
|
|
21
|
+
const line = [(item.label ?? ''), genre, count, runtime].filter(part => part.length > 0).reduce((text, part) => text.length > 0 ? text + ' · ' + part : part, '');
|
|
22
|
+
return (
|
|
23
|
+
<View style={styles.row}>
|
|
24
|
+
<Text style={styles.text}>{line}</Text>
|
|
25
|
+
{quality.length > 0 && <View style={styles.badge}><Text style={styles.badgeText} maxFontSizeMultiplier={1}>{quality}</Text></View>}
|
|
26
|
+
{technical?.hdr === true && <View style={styles.badge}><Text style={styles.badgeText} maxFontSizeMultiplier={1}>{t('titleMeta.hdr')}</Text></View>}
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
row: { flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap' },
|
|
33
|
+
text: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 11, default: 13 }), lineHeight: Platform.select({ tv: 15, default: 19 }), fontWeight: '600', letterSpacing: 0.3 },
|
|
34
|
+
badge: { marginLeft: Platform.select({ tv: 8, default: 10 }), borderWidth: 1, borderColor: theme.colors.accent, borderRadius: 2, paddingHorizontal: Platform.select({ tv: 4, default: 5 }) },
|
|
35
|
+
badgeText: { color: theme.colors.accent, fontSize: Platform.select({ tv: 9, default: 10 }), lineHeight: Platform.select({ tv: 13, default: 15 }), fontWeight: '800', letterSpacing: 0.8 },
|
|
36
|
+
});
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
adelin: {
|
|
3
|
+
auth: {
|
|
4
|
+
AUTH_INVALID_CREDENTIALS: "Wrong email or password.",
|
|
5
|
+
AUTH_ACCOUNT_EXISTS: "An account with this email already exists. Sign in instead.",
|
|
6
|
+
AUTH_EMAIL_UNVERIFIED: "Verify your email first. Check your inbox for the link we sent.",
|
|
7
|
+
AUTH_EMAIL_DELIVERY_UNAVAILABLE: "We couldn't send the email right now. Try again later.",
|
|
8
|
+
AUTH_RATE_LIMITED: "Too many attempts. Wait a moment, then try again.",
|
|
9
|
+
AUTH_ACCOUNT_UNAVAILABLE: "This account can't be used right now.",
|
|
10
|
+
AUTH_REAUTH_REQUIRED: "For your security, sign in again to continue.",
|
|
11
|
+
AUTH_LINK_CONFLICT: "This sign-in method is already linked to another account.",
|
|
12
|
+
AUTH_EMAIL_INVALID: "Enter a valid email address.",
|
|
13
|
+
AUTH_PASSWORD_REQUIRED: "Enter your password.",
|
|
14
|
+
AUTH_PASSWORD_TOO_SHORT: "Use at least 8 characters for your password.",
|
|
15
|
+
AUTH_PASSWORDS_DIFFER: "The passwords don't match.",
|
|
16
|
+
AUTH_UNAVAILABLE: "Signing in isn't available right now. Try again later.",
|
|
17
|
+
AUTH_OPERATION_FAILED: "Something went wrong. Check your connection and try again.",
|
|
18
|
+
},
|
|
19
|
+
keyboard: {
|
|
20
|
+
space: "Space",
|
|
21
|
+
delete: "Delete",
|
|
22
|
+
clear: "Clear",
|
|
23
|
+
done: "Done",
|
|
24
|
+
clearAll: "Clear all text",
|
|
25
|
+
capitals: "Capital letters",
|
|
26
|
+
letters: "Letters",
|
|
27
|
+
symbols: "Symbols",
|
|
28
|
+
speak: "Speak to type",
|
|
29
|
+
stopListening: "Stop listening",
|
|
30
|
+
atSign: "at sign",
|
|
31
|
+
dot: "dot",
|
|
32
|
+
dash: "dash",
|
|
33
|
+
underscore: "underscore",
|
|
34
|
+
dotCom: "dot com",
|
|
35
|
+
},
|
|
36
|
+
carousel: {
|
|
37
|
+
slide: "Slide {{index}} of {{count}}",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
common: {
|
|
41
|
+
brand: "Vesper",
|
|
42
|
+
tagline: "Films and series, after dark.",
|
|
43
|
+
loading: "Loading",
|
|
44
|
+
checkConnection: "Check your connection and try again.",
|
|
45
|
+
checkingSignIn: "Checking your sign-in.",
|
|
46
|
+
back: "Back",
|
|
47
|
+
signIn: "Sign in",
|
|
48
|
+
createAccount: "Create an account",
|
|
49
|
+
continueBrowsing: "Continue browsing",
|
|
50
|
+
email: "Email",
|
|
51
|
+
password: "Password",
|
|
52
|
+
part: "part",
|
|
53
|
+
onePart: "{{count}} {{noun}}",
|
|
54
|
+
parts: "{{count}} {{noun}}s",
|
|
55
|
+
minutes: "{{minutes}} min",
|
|
56
|
+
},
|
|
57
|
+
library: {
|
|
58
|
+
loading: "Getting the library ready.",
|
|
59
|
+
failed: "The library didn't load",
|
|
60
|
+
},
|
|
61
|
+
home: {
|
|
62
|
+
emptyTitle: "Nothing to watch yet",
|
|
63
|
+
emptyMessage: "Films and series appear here once they are added.",
|
|
64
|
+
details: "Details",
|
|
65
|
+
},
|
|
66
|
+
browse: {
|
|
67
|
+
title: "Browse",
|
|
68
|
+
oneTitle: "{{count}} title",
|
|
69
|
+
titles: "{{count}} titles",
|
|
70
|
+
all: "All",
|
|
71
|
+
allGenres: "All genres",
|
|
72
|
+
emptyTitle: "Nothing here yet",
|
|
73
|
+
emptyMessage: "Pick another genre.",
|
|
74
|
+
},
|
|
75
|
+
search: {
|
|
76
|
+
title: "Search",
|
|
77
|
+
placeholder: "Find a film, series or episode",
|
|
78
|
+
tvPlaceholder: "Film, series or episode",
|
|
79
|
+
oneResult: "{{count}} result",
|
|
80
|
+
results: "{{count}} results",
|
|
81
|
+
allTitles: "All titles",
|
|
82
|
+
loading: "Search is ready in a moment.",
|
|
83
|
+
failed: "Search didn't load",
|
|
84
|
+
noMatch: "Nothing matches “{{query}}”",
|
|
85
|
+
noMatchMessage: "Try a shorter word or part of a title.",
|
|
86
|
+
},
|
|
87
|
+
account: {
|
|
88
|
+
title: "Account",
|
|
89
|
+
whoIsWatching: "Who's watching",
|
|
90
|
+
watchingNow: "Watching now",
|
|
91
|
+
pickUp: "Pick up where {{name}} left off",
|
|
92
|
+
thisDevice: "This device",
|
|
93
|
+
confirmSignOut: "Sign out of Vesper on this device?",
|
|
94
|
+
signedIn: "You are signed in to Vesper here.",
|
|
95
|
+
signInPrompt: "Sign in to watch with your Vesper account, or create one.",
|
|
96
|
+
cancel: "Cancel",
|
|
97
|
+
signOut: "Sign out",
|
|
98
|
+
signingOut: "Signing out…",
|
|
99
|
+
},
|
|
100
|
+
detail: {
|
|
101
|
+
loading: "Getting this title ready.",
|
|
102
|
+
failed: "This title didn't load",
|
|
103
|
+
goneTitle: "This title is no longer available",
|
|
104
|
+
goneMessage: "Return to the library to find another title.",
|
|
105
|
+
episodeContext: "{{show}} · Season {{season}}, episode {{episode}}",
|
|
106
|
+
about: "About",
|
|
107
|
+
season: "Season {{number}}",
|
|
108
|
+
episodes: "Episodes",
|
|
109
|
+
upNext: "Up next",
|
|
110
|
+
moreFrom: "More from {{title}}",
|
|
111
|
+
moreLikeThis: "More like this",
|
|
112
|
+
noEpisodes: "No episodes yet",
|
|
113
|
+
noEpisodesMessage: "Episodes appear here once they are added.",
|
|
114
|
+
noSynopsis: "More about this title will appear here when it is added.",
|
|
115
|
+
watched: "Watched",
|
|
116
|
+
markWatched: "Mark as watched",
|
|
117
|
+
noPlayback: "Playback is not available for this title yet.",
|
|
118
|
+
episodesLater: "Episodes will play here once they are added.",
|
|
119
|
+
},
|
|
120
|
+
player: {
|
|
121
|
+
unavailable: "Playback is unavailable",
|
|
122
|
+
unavailableMessage: "Return to the title and choose something else to watch.",
|
|
123
|
+
backToTitle: "Back to title",
|
|
124
|
+
showControls: "Show controls",
|
|
125
|
+
hideControls: "Hide controls",
|
|
126
|
+
notLoaded: "The video has not loaded",
|
|
127
|
+
position: "Position {{elapsed}} of {{duration}}",
|
|
128
|
+
drag: "Drag to a position",
|
|
129
|
+
play: "Play",
|
|
130
|
+
pause: "Pause",
|
|
131
|
+
back10: "Back 10 seconds",
|
|
132
|
+
forward10: "Forward 10 seconds",
|
|
133
|
+
restart: "Start from the beginning",
|
|
134
|
+
settings: "Playback settings",
|
|
135
|
+
closeSettings: "Close settings",
|
|
136
|
+
settingsTitle: "Playback",
|
|
137
|
+
picture: "Picture",
|
|
138
|
+
fit: "Fit",
|
|
139
|
+
fill: "Fill",
|
|
140
|
+
stretch: "Stretch",
|
|
141
|
+
subtitles: "Subtitles",
|
|
142
|
+
off: "Off",
|
|
143
|
+
audio: "Audio",
|
|
144
|
+
speed: "Speed",
|
|
145
|
+
normal: "Normal",
|
|
146
|
+
textSize: "Text size",
|
|
147
|
+
small: "Small",
|
|
148
|
+
medium: "Medium",
|
|
149
|
+
large: "Large",
|
|
150
|
+
textStyle: "Text style",
|
|
151
|
+
shadow: "Shadow",
|
|
152
|
+
outline: "Outline",
|
|
153
|
+
box: "Box",
|
|
154
|
+
textColour: "Text colour",
|
|
155
|
+
white: "White",
|
|
156
|
+
yellow: "Yellow",
|
|
157
|
+
},
|
|
158
|
+
signIn: {
|
|
159
|
+
description: "Sign in with your Vesper account to keep watching.",
|
|
160
|
+
verifyNotice: "Check your email to verify your account, then sign in.",
|
|
161
|
+
signingIn: "Signing in…",
|
|
162
|
+
newHere: "New to Vesper?",
|
|
163
|
+
},
|
|
164
|
+
signUp: {
|
|
165
|
+
title: "Create your account",
|
|
166
|
+
description: "One account for every screen you watch on.",
|
|
167
|
+
registered: "Check your email to verify your account. Once verified, return to sign in.",
|
|
168
|
+
returnToSignIn: "Return to sign in",
|
|
169
|
+
confirmPassword: "Confirm password",
|
|
170
|
+
create: "Create account",
|
|
171
|
+
creating: "Creating account…",
|
|
172
|
+
signInInstead: "Sign in instead",
|
|
173
|
+
},
|
|
174
|
+
shell: {
|
|
175
|
+
tabs: {
|
|
176
|
+
home: "Home",
|
|
177
|
+
browse: "Browse",
|
|
178
|
+
search: "Search",
|
|
179
|
+
account: "Account",
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
feedback: {
|
|
183
|
+
retry: "Try again",
|
|
184
|
+
},
|
|
185
|
+
playAction: {
|
|
186
|
+
play: "Play",
|
|
187
|
+
resume: "Resume",
|
|
188
|
+
playEpisode: "Play episode {{number}}",
|
|
189
|
+
resumeEpisode: "Resume episode {{number}}",
|
|
190
|
+
playSeasonEpisode: "Play S{{season}} · E{{episode}}",
|
|
191
|
+
resumeSeasonEpisode: "Resume S{{season}} · E{{episode}}",
|
|
192
|
+
},
|
|
193
|
+
continueRail: {
|
|
194
|
+
title: "Continue watching",
|
|
195
|
+
seasonEpisode: "S{{season}} · E{{episode}}",
|
|
196
|
+
episode: "Episode {{number}}",
|
|
197
|
+
next: "Next: {{place}}",
|
|
198
|
+
start: "Start",
|
|
199
|
+
minutesLeft: "{{minutes}} min left",
|
|
200
|
+
},
|
|
201
|
+
titleCard: {
|
|
202
|
+
watched: "Watched",
|
|
203
|
+
},
|
|
204
|
+
titleMeta: {
|
|
205
|
+
hours: "{{hours}} h",
|
|
206
|
+
hoursMinutes: "{{hours}} h {{minutes}} min",
|
|
207
|
+
uhd: "4K",
|
|
208
|
+
hd: "HD",
|
|
209
|
+
hdr: "HDR",
|
|
210
|
+
},
|
|
211
|
+
};
|