@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,94 @@
|
|
|
1
|
+
import { useEffect, useState } from '@adelin/react';
|
|
2
|
+
import { useNavigation } from '@adelin/navigation';
|
|
3
|
+
import { useAuth } from '@adelin/auth';
|
|
4
|
+
import { useDispatch, useSelector } from '@adelin/store';
|
|
5
|
+
import { FocusGroup, KeyboardAvoidingView, SafeAreaView, ScrollView, StyleSheet, Text, View, theme, useWindowDimensions, Screen } from '@adelin/ui';
|
|
6
|
+
import { Platform } from '@adelin/device';
|
|
7
|
+
import { login } from '../../store';
|
|
8
|
+
import Action from '../../components/Action';
|
|
9
|
+
import Field from '../../components/Field';
|
|
10
|
+
import Feedback from '../../components/Feedback';
|
|
11
|
+
|
|
12
|
+
export default function SignIn() {
|
|
13
|
+
const auth = useAuth();
|
|
14
|
+
const navigation = useNavigation();
|
|
15
|
+
const dispatch = useDispatch();
|
|
16
|
+
const pending = useSelector(state => state.account.pending);
|
|
17
|
+
const { width, height } = useWindowDimensions();
|
|
18
|
+
const wide = width >= 840 && height >= 480;
|
|
19
|
+
const registrationCompleted = useSelector(state => state.account.registrationCompleted);
|
|
20
|
+
const [email, setEmail] = useState('');
|
|
21
|
+
const [password, setPassword] = useState('');
|
|
22
|
+
const [message, setMessage] = useState('');
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (auth.status === 'signed-in' && !auth.signInRequired) navigation.replace('Account');
|
|
26
|
+
}, [auth.status, auth.signInRequired]);
|
|
27
|
+
|
|
28
|
+
const submit = () => {
|
|
29
|
+
setMessage('');
|
|
30
|
+
dispatch(login({ email: email.trim(), password })).unwrap()
|
|
31
|
+
.then(() => { setPassword(''); })
|
|
32
|
+
.catch(error => { setPassword(''); setMessage(error.message); });
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Screen>
|
|
37
|
+
<View style={styles.page}>
|
|
38
|
+
<KeyboardAvoidingView behavior="padding" style={styles.body}>
|
|
39
|
+
<ScrollView style={styles.body} contentContainerStyle={[styles.scrollContent, wide && styles.scrollWide]} keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}>
|
|
40
|
+
<View style={[styles.brand, wide && styles.brandWide]}>
|
|
41
|
+
<Text style={[styles.wordmark, wide && styles.wordmarkWide]}>ARC</Text>
|
|
42
|
+
<Text style={styles.promise}>Every series, episode by episode.</Text>
|
|
43
|
+
</View>
|
|
44
|
+
<SafeAreaView edges={['top', 'left', 'right', 'bottom']} style={wide ? styles.formColumn : undefined}>
|
|
45
|
+
{auth.status === 'loading' ? <Feedback title="Opening your account" message="Checking your session." loading /> : (
|
|
46
|
+
<View style={styles.form}>
|
|
47
|
+
<Text style={styles.title}>Sign in</Text>
|
|
48
|
+
<Text style={styles.description}>Pick up where your story left off.</Text>
|
|
49
|
+
{registrationCompleted && <Text style={styles.notice} accessibilityRole="alert">Check your email to verify your account, then sign in.</Text>}
|
|
50
|
+
<FocusGroup direction="vertical" remember autoFocus>
|
|
51
|
+
<View>
|
|
52
|
+
<Field label="Email" value={email} onChangeText={setEmail} email disabled={pending} />
|
|
53
|
+
<Field label="Password" value={password} onChangeText={setPassword} secret disabled={pending} />
|
|
54
|
+
{message.length > 0 && <Text style={styles.error} accessibilityRole="alert">{message}</Text>}
|
|
55
|
+
<Action label={pending ? 'Signing in…' : 'Sign in'} primary disabled={pending} onPress={submit} />
|
|
56
|
+
<Text style={styles.newViewer}>NEW TO ARC?</Text>
|
|
57
|
+
<FocusGroup direction="horizontal" remember>
|
|
58
|
+
<View style={styles.footer}>
|
|
59
|
+
<View style={styles.footerAction}><Action label="Create an account" disabled={pending} onPress={() => { setPassword(''); navigation.navigate('SignUp'); }} /></View>
|
|
60
|
+
{!auth.signInRequired && <View style={styles.footerAction}><Action label="Continue browsing" disabled={pending} onPress={() => { setPassword(''); navigation.replace('Account'); }} /></View>}
|
|
61
|
+
</View>
|
|
62
|
+
</FocusGroup>
|
|
63
|
+
</View>
|
|
64
|
+
</FocusGroup>
|
|
65
|
+
</View>
|
|
66
|
+
)}
|
|
67
|
+
</SafeAreaView>
|
|
68
|
+
</ScrollView>
|
|
69
|
+
</KeyboardAvoidingView>
|
|
70
|
+
</View>
|
|
71
|
+
</Screen>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const styles = StyleSheet.create({
|
|
76
|
+
page: { flex: 1, backgroundColor: theme.colors.background },
|
|
77
|
+
body: { flex: 1 },
|
|
78
|
+
scrollContent: { flexGrow: 1, padding: 20, justifyContent: 'center' },
|
|
79
|
+
scrollWide: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 72 },
|
|
80
|
+
brand: { marginBottom: 28 },
|
|
81
|
+
brandWide: { flex: 1, marginBottom: 0, paddingRight: 48 },
|
|
82
|
+
wordmark: { color: theme.colors.text, fontSize: 30, lineHeight: 34, fontWeight: '900', letterSpacing: 7 },
|
|
83
|
+
wordmarkWide: { fontSize: 52, lineHeight: 58, letterSpacing: 12 },
|
|
84
|
+
promise: { color: theme.colors.accent, fontSize: Platform.select({ tv: 10, default: 13 }), lineHeight: Platform.select({ tv: 14, default: 18 }), fontWeight: '800', letterSpacing: 1.2, textTransform: 'uppercase', marginTop: theme.spacing.sm },
|
|
85
|
+
formColumn: { width: 380 },
|
|
86
|
+
form: { width: '100%', maxWidth: 440, alignSelf: 'center', backgroundColor: theme.colors.surface, borderRadius: 6, padding: Platform.select({ tv: 22, default: 18 }) },
|
|
87
|
+
title: { color: theme.colors.text, fontSize: Platform.select({ tv: 22, default: 26 }), lineHeight: Platform.select({ tv: 26, default: 31 }), fontWeight: '900', letterSpacing: -0.5 },
|
|
88
|
+
description: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginTop: theme.spacing.xs, marginBottom: Platform.select({ tv: 16, default: 18 }) },
|
|
89
|
+
notice: { color: theme.colors.success, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginBottom: theme.spacing.md },
|
|
90
|
+
error: { color: theme.colors.error, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginBottom: theme.spacing.md },
|
|
91
|
+
newViewer: { color: theme.colors.textMuted, fontSize: Platform.select({ tv: 8, default: 11 }), lineHeight: Platform.select({ tv: 12, default: 15 }), fontWeight: '800', letterSpacing: 1.2, marginTop: Platform.select({ tv: 18, default: 22 }), marginBottom: theme.spacing.sm },
|
|
92
|
+
footer: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center' },
|
|
93
|
+
footerAction: { marginRight: theme.spacing.sm, marginBottom: theme.spacing.sm },
|
|
94
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useEffect, useState } from '@adelin/react';
|
|
2
|
+
import { useNavigation } from '@adelin/navigation';
|
|
3
|
+
import { useAuth } from '@adelin/auth';
|
|
4
|
+
import { useDispatch, useSelector } from '@adelin/store';
|
|
5
|
+
import { FocusGroup, KeyboardAvoidingView, SafeAreaView, ScrollView, StyleSheet, Text, View, theme, useWindowDimensions, Screen } from '@adelin/ui';
|
|
6
|
+
import { Platform } from '@adelin/device';
|
|
7
|
+
import { register } from '../../store';
|
|
8
|
+
import Action from '../../components/Action';
|
|
9
|
+
import Field from '../../components/Field';
|
|
10
|
+
import Feedback from '../../components/Feedback';
|
|
11
|
+
|
|
12
|
+
export default function SignUp() {
|
|
13
|
+
const auth = useAuth();
|
|
14
|
+
const navigation = useNavigation();
|
|
15
|
+
const dispatch = useDispatch();
|
|
16
|
+
const pending = useSelector(state => state.account.pending);
|
|
17
|
+
const { width, height } = useWindowDimensions();
|
|
18
|
+
const wide = width >= 840 && height >= 480;
|
|
19
|
+
const [email, setEmail] = useState('');
|
|
20
|
+
const [password, setPassword] = useState('');
|
|
21
|
+
const [confirm, setConfirm] = useState('');
|
|
22
|
+
const [message, setMessage] = useState('');
|
|
23
|
+
const [registered, setRegistered] = useState(false);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (auth.status === 'signed-in' && !auth.signInRequired) navigation.replace('Account');
|
|
27
|
+
}, [auth.status, auth.signInRequired]);
|
|
28
|
+
|
|
29
|
+
const submit = () => {
|
|
30
|
+
setMessage('');
|
|
31
|
+
dispatch(register({ email: email.trim(), password, confirmPassword: confirm })).unwrap()
|
|
32
|
+
.then(() => { setPassword(''); setConfirm(''); setRegistered(true); })
|
|
33
|
+
.catch(error => { setPassword(''); setConfirm(''); setMessage(error.message); });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Screen>
|
|
38
|
+
<View style={styles.page}>
|
|
39
|
+
<KeyboardAvoidingView behavior="padding" style={styles.body}>
|
|
40
|
+
<ScrollView style={styles.body} contentContainerStyle={[styles.scrollContent, wide && styles.scrollWide]} keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}>
|
|
41
|
+
<View style={[styles.brand, wide && styles.brandWide]}>
|
|
42
|
+
<Text style={[styles.wordmark, wide && styles.wordmarkWide]}>ARC</Text>
|
|
43
|
+
<Text style={styles.promise}>Every series, episode by episode.</Text>
|
|
44
|
+
</View>
|
|
45
|
+
<SafeAreaView edges={['top', 'left', 'right', 'bottom']} style={wide ? styles.formColumn : undefined}>
|
|
46
|
+
{auth.status === 'loading' ? <Feedback title="Opening your account" message="Checking your session." loading /> : (
|
|
47
|
+
<View style={styles.form}>
|
|
48
|
+
<Text style={styles.title}>Create your account</Text>
|
|
49
|
+
<Text style={styles.description}>One account, a profile and a list for everyone at home.</Text>
|
|
50
|
+
{registered ? (
|
|
51
|
+
<FocusGroup direction="vertical" autoFocus>
|
|
52
|
+
<View><Text style={styles.notice} accessibilityRole="alert">Check your email to verify your account. Once verified, return to sign in.</Text><Action label="Return to sign in" primary preferred onPress={() => navigation.replace('SignIn')} /></View>
|
|
53
|
+
</FocusGroup>
|
|
54
|
+
) : (
|
|
55
|
+
<FocusGroup direction="vertical" remember autoFocus>
|
|
56
|
+
<View>
|
|
57
|
+
<Field label="Email" value={email} onChangeText={setEmail} email disabled={pending} />
|
|
58
|
+
<Field label="Password" value={password} onChangeText={setPassword} secret disabled={pending} />
|
|
59
|
+
<Field label="Confirm password" value={confirm} onChangeText={setConfirm} secret disabled={pending} />
|
|
60
|
+
{message.length > 0 && <Text style={styles.error} accessibilityRole="alert">{message}</Text>}
|
|
61
|
+
<Action label={pending ? 'Creating account…' : 'Create account'} primary disabled={pending} onPress={submit} />
|
|
62
|
+
<FocusGroup direction="horizontal" remember>
|
|
63
|
+
<View style={styles.footer}>
|
|
64
|
+
<View style={styles.footerAction}><Action label="Sign in instead" disabled={pending} onPress={() => { setPassword(''); setConfirm(''); navigation.navigate('SignIn'); }} /></View>
|
|
65
|
+
{!auth.signInRequired && <View style={styles.footerAction}><Action label="Continue browsing" disabled={pending} onPress={() => { setPassword(''); setConfirm(''); navigation.replace('Account'); }} /></View>}
|
|
66
|
+
</View>
|
|
67
|
+
</FocusGroup>
|
|
68
|
+
</View>
|
|
69
|
+
</FocusGroup>
|
|
70
|
+
)}
|
|
71
|
+
</View>
|
|
72
|
+
)}
|
|
73
|
+
</SafeAreaView>
|
|
74
|
+
</ScrollView>
|
|
75
|
+
</KeyboardAvoidingView>
|
|
76
|
+
</View>
|
|
77
|
+
</Screen>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const styles = StyleSheet.create({
|
|
82
|
+
page: { flex: 1, backgroundColor: theme.colors.background },
|
|
83
|
+
body: { flex: 1 },
|
|
84
|
+
scrollContent: { flexGrow: 1, padding: 20, justifyContent: 'center' },
|
|
85
|
+
scrollWide: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 72 },
|
|
86
|
+
brand: { marginBottom: 28 },
|
|
87
|
+
brandWide: { flex: 1, marginBottom: 0, paddingRight: 48 },
|
|
88
|
+
wordmark: { color: theme.colors.text, fontSize: 30, lineHeight: 34, fontWeight: '900', letterSpacing: 7 },
|
|
89
|
+
wordmarkWide: { fontSize: 52, lineHeight: 58, letterSpacing: 12 },
|
|
90
|
+
promise: { color: theme.colors.accent, fontSize: Platform.select({ tv: 10, default: 13 }), lineHeight: Platform.select({ tv: 14, default: 18 }), fontWeight: '800', letterSpacing: 1.2, textTransform: 'uppercase', marginTop: theme.spacing.sm },
|
|
91
|
+
formColumn: { width: 380 },
|
|
92
|
+
form: { width: '100%', maxWidth: 440, alignSelf: 'center', backgroundColor: theme.colors.surface, borderRadius: 6, padding: Platform.select({ tv: 22, default: 18 }) },
|
|
93
|
+
title: { color: theme.colors.text, fontSize: Platform.select({ tv: 22, default: 26 }), lineHeight: Platform.select({ tv: 26, default: 31 }), fontWeight: '900', letterSpacing: -0.5 },
|
|
94
|
+
description: { color: theme.colors.textSecondary, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginTop: theme.spacing.xs, marginBottom: Platform.select({ tv: 16, default: 18 }) },
|
|
95
|
+
notice: { color: theme.colors.success, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginBottom: theme.spacing.md },
|
|
96
|
+
error: { color: theme.colors.error, fontSize: Platform.select({ tv: 10, default: 14 }), lineHeight: Platform.select({ tv: 15, default: 20 }), marginBottom: theme.spacing.md },
|
|
97
|
+
|
|
98
|
+
footer: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', marginTop: theme.spacing.md },
|
|
99
|
+
footerAction: { marginRight: theme.spacing.sm, marginBottom: theme.spacing.sm },
|
|
100
|
+
});
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createAsyncThunk, createSlice, type PayloadAction } from '@adelin/store';
|
|
2
|
+
import { content, type ContentCollection, type ContentItem } from '@adelin/content';
|
|
3
|
+
import { signIn, signUp, signOut } from '@adelin/auth';
|
|
4
|
+
import { buy, manageSubscription, rent, restorePurchases, startTrial, subscribe } from '@adelin/access';
|
|
5
|
+
import { favorites, profiles, progress, type Profile, type Progress } from '@adelin/profiles';
|
|
6
|
+
|
|
7
|
+
export const loadLibrary = createAsyncThunk('library/loadLibrary', async () => {
|
|
8
|
+
const entries = await content.list();
|
|
9
|
+
const collections = await content.collections();
|
|
10
|
+
return { entries, collections };
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const login = createAsyncThunk('account/login', async (input: { email: string; password: string }) => signIn(input));
|
|
14
|
+
export const register = createAsyncThunk('account/register', async (input: { email: string; password: string; confirmPassword?: string }) => signUp(input));
|
|
15
|
+
export const logout = createAsyncThunk('account/logout', async () => signOut());
|
|
16
|
+
|
|
17
|
+
export const loadProfiles = createAsyncThunk('profiles/loadProfiles', async () => {
|
|
18
|
+
const list = await profiles.list();
|
|
19
|
+
const active = await profiles.active();
|
|
20
|
+
return { list, active: active ?? '' };
|
|
21
|
+
});
|
|
22
|
+
export const chooseProfile = createAsyncThunk('profiles/chooseProfile', async (id: string) => {
|
|
23
|
+
await profiles.select(id);
|
|
24
|
+
return id;
|
|
25
|
+
});
|
|
26
|
+
export const addProfile = createAsyncThunk('profiles/addProfile', async (input: { name: string; avatar: string }) => profiles.create(input));
|
|
27
|
+
|
|
28
|
+
export const profileState = createSlice({
|
|
29
|
+
name: 'profiles',
|
|
30
|
+
initialState: { list: [] as Profile[], activeId: '', status: 'idle', error: '' },
|
|
31
|
+
reducers: {
|
|
32
|
+
clearProfiles(state) { state.list = []; state.activeId = ''; state.status = 'idle'; state.error = ''; },
|
|
33
|
+
},
|
|
34
|
+
extraReducers: builder => {
|
|
35
|
+
builder.addCase(loadProfiles.pending, state => { state.status = 'loading'; state.error = ''; });
|
|
36
|
+
builder.addCase(loadProfiles.fulfilled, (state, action) => {
|
|
37
|
+
state.list = action.payload.list;
|
|
38
|
+
state.activeId = action.payload.active !== '' ? action.payload.active : action.payload.list.length === 1 ? action.payload.list[0].id : '';
|
|
39
|
+
state.status = 'ready';
|
|
40
|
+
});
|
|
41
|
+
builder.addCase(loadProfiles.rejected, state => { state.status = 'failed'; state.error = 'Profiles could not be loaded.'; });
|
|
42
|
+
builder.addCase(chooseProfile.fulfilled, (state, action) => { state.activeId = action.payload; state.error = ''; });
|
|
43
|
+
builder.addCase(chooseProfile.rejected, state => { state.error = 'That profile could not be opened.'; });
|
|
44
|
+
builder.addCase(addProfile.fulfilled, (state, action) => {
|
|
45
|
+
state.list = [...state.list, action.payload];
|
|
46
|
+
if (state.activeId === '') state.activeId = action.payload.id;
|
|
47
|
+
state.error = '';
|
|
48
|
+
});
|
|
49
|
+
builder.addCase(addProfile.rejected, state => { state.error = 'The profile could not be created.'; });
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
export const { clearProfiles } = profileState.actions;
|
|
53
|
+
|
|
54
|
+
export const loadSaved = createAsyncThunk('saved/loadSaved', async (profileId: string) => {
|
|
55
|
+
const ids = await favorites.list(profileId);
|
|
56
|
+
return { profileId, ids };
|
|
57
|
+
});
|
|
58
|
+
export const saveTitle = createAsyncThunk('saved/saveTitle', async (input: { profileId: string; entryId: string }) => {
|
|
59
|
+
await favorites.add(input.profileId, input.entryId);
|
|
60
|
+
return input.entryId;
|
|
61
|
+
});
|
|
62
|
+
export const unsaveTitle = createAsyncThunk('saved/unsaveTitle', async (input: { profileId: string; entryId: string }) => {
|
|
63
|
+
await favorites.remove(input.profileId, input.entryId);
|
|
64
|
+
return input.entryId;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const saved = createSlice({
|
|
68
|
+
name: 'saved',
|
|
69
|
+
initialState: { profileId: '', ids: [] as string[], confirmed: [] as string[], status: 'idle', lastId: '', error: '' },
|
|
70
|
+
reducers: {
|
|
71
|
+
resetSaved(state, action: PayloadAction<string>) { state.profileId = action.payload; state.ids = []; state.confirmed = []; state.status = 'idle'; state.lastId = ''; state.error = ''; },
|
|
72
|
+
markSaved(state, action: PayloadAction<string>) { state.ids = [action.payload, ...state.ids.filter(id => id !== action.payload)]; state.lastId = action.payload; state.error = ''; },
|
|
73
|
+
markUnsaved(state, action: PayloadAction<string>) { state.ids = state.ids.filter(id => id !== action.payload); state.lastId = action.payload; state.error = ''; },
|
|
74
|
+
},
|
|
75
|
+
extraReducers: builder => {
|
|
76
|
+
builder.addCase(loadSaved.pending, state => { state.status = 'loading'; });
|
|
77
|
+
builder.addCase(loadSaved.fulfilled, (state, action) => {
|
|
78
|
+
if (state.profileId !== action.payload.profileId) return;
|
|
79
|
+
state.ids = action.payload.ids;
|
|
80
|
+
state.confirmed = action.payload.ids;
|
|
81
|
+
state.status = 'ready';
|
|
82
|
+
});
|
|
83
|
+
builder.addCase(loadSaved.rejected, state => { state.status = 'failed'; state.error = 'Your list could not be loaded.'; });
|
|
84
|
+
builder.addCase(saveTitle.fulfilled, (state, action) => { state.confirmed = [action.payload, ...state.confirmed.filter(id => id !== action.payload)]; });
|
|
85
|
+
builder.addCase(saveTitle.rejected, state => { state.ids = state.confirmed; state.error = 'This title could not be saved right now.'; });
|
|
86
|
+
builder.addCase(unsaveTitle.fulfilled, (state, action) => { state.confirmed = state.confirmed.filter(id => id !== action.payload); });
|
|
87
|
+
builder.addCase(unsaveTitle.rejected, state => { state.ids = state.confirmed; state.error = 'This title could not be removed right now.'; });
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
export const { resetSaved, markSaved, markUnsaved } = saved.actions;
|
|
91
|
+
|
|
92
|
+
export const loadWatching = createAsyncThunk('watching/loadWatching', async (profileId: string) => {
|
|
93
|
+
const rows = await progress.list(profileId);
|
|
94
|
+
return { profileId, rows };
|
|
95
|
+
});
|
|
96
|
+
export const loadResume = createAsyncThunk('watching/loadResume', async (input: { profileId: string; entryId: string }) => progress.get(input.profileId, input.entryId));
|
|
97
|
+
export const loadWatched = createAsyncThunk('watching/loadWatched', async (input: { profileId: string; entryId: string }) => progress.watched(input.profileId, input.entryId));
|
|
98
|
+
export const toggleWatched = createAsyncThunk('watching/toggleWatched', async (input: { profileId: string; entryId: string; watched: boolean }) => {
|
|
99
|
+
if (input.watched) {
|
|
100
|
+
await progress.markUnwatched(input.profileId, input.entryId);
|
|
101
|
+
} else {
|
|
102
|
+
await progress.markWatched(input.profileId, input.entryId);
|
|
103
|
+
}
|
|
104
|
+
return { entryId: input.entryId, watched: !input.watched };
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export const watching = createSlice({
|
|
108
|
+
name: 'watching',
|
|
109
|
+
initialState: { profileId: '', rows: [] as Progress[], resume: null as Progress | null, watched: [] as string[] },
|
|
110
|
+
reducers: {
|
|
111
|
+
resetWatching(state, action: PayloadAction<string>) { state.profileId = action.payload; state.rows = []; state.resume = null; state.watched = []; },
|
|
112
|
+
},
|
|
113
|
+
extraReducers: builder => {
|
|
114
|
+
builder.addCase(loadWatching.fulfilled, (state, action) => {
|
|
115
|
+
if (state.profileId !== action.payload.profileId) return;
|
|
116
|
+
state.rows = action.payload.rows;
|
|
117
|
+
});
|
|
118
|
+
builder.addCase(loadResume.pending, state => { state.resume = null; });
|
|
119
|
+
builder.addCase(loadResume.fulfilled, (state, action) => { state.resume = action.payload; });
|
|
120
|
+
builder.addCase(loadWatched.fulfilled, (state, action) => { state.watched = action.payload; });
|
|
121
|
+
builder.addCase(toggleWatched.fulfilled, (state, action) => {
|
|
122
|
+
const others = state.watched.filter(id => id !== action.payload.entryId);
|
|
123
|
+
state.watched = action.payload.watched ? [action.payload.entryId, ...others] : others;
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
export const { resetWatching } = watching.actions;
|
|
128
|
+
|
|
129
|
+
export const account = createSlice({
|
|
130
|
+
name: 'account',
|
|
131
|
+
initialState: { pending: false, registrationCompleted: false },
|
|
132
|
+
reducers: {},
|
|
133
|
+
extraReducers: builder => {
|
|
134
|
+
builder.addCase(login.pending, state => { state.pending = true; state.registrationCompleted = false; });
|
|
135
|
+
builder.addCase(login.fulfilled, state => { state.pending = false; });
|
|
136
|
+
builder.addCase(login.rejected, state => { state.pending = false; });
|
|
137
|
+
builder.addCase(register.pending, state => { state.pending = true; state.registrationCompleted = false; });
|
|
138
|
+
builder.addCase(register.fulfilled, state => { state.pending = false; state.registrationCompleted = true; });
|
|
139
|
+
builder.addCase(register.rejected, state => { state.pending = false; });
|
|
140
|
+
builder.addCase(logout.pending, state => { state.pending = true; });
|
|
141
|
+
builder.addCase(logout.fulfilled, state => { state.pending = false; state.registrationCompleted = false; });
|
|
142
|
+
builder.addCase(logout.rejected, state => { state.pending = false; });
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const library = createSlice({
|
|
147
|
+
name: 'library',
|
|
148
|
+
initialState: { entries: [] as ContentItem[], collections: [] as ContentCollection[], status: 'idle' },
|
|
149
|
+
reducers: {},
|
|
150
|
+
extraReducers: builder => {
|
|
151
|
+
builder.addCase(loadLibrary.pending, state => { state.status = 'loading'; });
|
|
152
|
+
builder.addCase(loadLibrary.fulfilled, (state, action) => {
|
|
153
|
+
state.entries = action.payload.entries;
|
|
154
|
+
state.collections = action.payload.collections;
|
|
155
|
+
state.status = 'ready';
|
|
156
|
+
});
|
|
157
|
+
builder.addCase(loadLibrary.rejected, state => { state.status = 'failed'; });
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export const startPlan = createAsyncThunk('paywall/startPlan', async (input: { offerId: string; period: 'month' | 'year' }) => subscribe(input));
|
|
162
|
+
export const startPlanTrial = createAsyncThunk('paywall/startPlanTrial', async (input: { offerId: string; period: 'month' | 'year' }) => startTrial(input));
|
|
163
|
+
export const buyTitle = createAsyncThunk('paywall/buyTitle', async (input: { offerId: string }) => buy(input));
|
|
164
|
+
export const rentTitle = createAsyncThunk('paywall/rentTitle', async (input: { offerId: string; entryId: string }) => rent(input));
|
|
165
|
+
export const restore = createAsyncThunk('paywall/restore', async () => restorePurchases());
|
|
166
|
+
export const manage = createAsyncThunk('paywall/manage', async () => manageSubscription());
|
|
167
|
+
|
|
168
|
+
export const paywall = createSlice({
|
|
169
|
+
name: 'paywall',
|
|
170
|
+
initialState: { pending: false },
|
|
171
|
+
reducers: {},
|
|
172
|
+
extraReducers: builder => {
|
|
173
|
+
builder.addCase(startPlan.pending, state => { state.pending = true; });
|
|
174
|
+
builder.addCase(startPlan.fulfilled, state => { state.pending = false; });
|
|
175
|
+
builder.addCase(startPlan.rejected, state => { state.pending = false; });
|
|
176
|
+
builder.addCase(startPlanTrial.pending, state => { state.pending = true; });
|
|
177
|
+
builder.addCase(startPlanTrial.fulfilled, state => { state.pending = false; });
|
|
178
|
+
builder.addCase(startPlanTrial.rejected, state => { state.pending = false; });
|
|
179
|
+
builder.addCase(buyTitle.pending, state => { state.pending = true; });
|
|
180
|
+
builder.addCase(buyTitle.fulfilled, state => { state.pending = false; });
|
|
181
|
+
builder.addCase(buyTitle.rejected, state => { state.pending = false; });
|
|
182
|
+
builder.addCase(rentTitle.pending, state => { state.pending = true; });
|
|
183
|
+
builder.addCase(rentTitle.fulfilled, state => { state.pending = false; });
|
|
184
|
+
builder.addCase(rentTitle.rejected, state => { state.pending = false; });
|
|
185
|
+
builder.addCase(restore.pending, state => { state.pending = true; });
|
|
186
|
+
builder.addCase(restore.fulfilled, state => { state.pending = false; });
|
|
187
|
+
builder.addCase(restore.rejected, state => { state.pending = false; });
|
|
188
|
+
builder.addCase(manage.pending, state => { state.pending = true; });
|
|
189
|
+
builder.addCase(manage.fulfilled, state => { state.pending = false; });
|
|
190
|
+
builder.addCase(manage.rejected, state => { state.pending = false; });
|
|
191
|
+
},
|
|
192
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createTheme } from '@adelin/ui';
|
|
2
|
+
|
|
3
|
+
export default createTheme({
|
|
4
|
+
colors: {
|
|
5
|
+
background: '#0B1417',
|
|
6
|
+
surface: '#13222A',
|
|
7
|
+
surfaceLight: '#1E333C',
|
|
8
|
+
primary: '#FF7A59',
|
|
9
|
+
primaryLight: '#3A2A27',
|
|
10
|
+
accent: '#FF7A59',
|
|
11
|
+
text: '#EEF3F2',
|
|
12
|
+
textSecondary: '#A6BABC',
|
|
13
|
+
textMuted: '#6E888C',
|
|
14
|
+
border: '#24404A',
|
|
15
|
+
error: '#FF8B80',
|
|
16
|
+
success: '#7FD1B0',
|
|
17
|
+
},
|
|
18
|
+
spacing: { xs: 4, sm: 8, md: 16, lg: 24, xl: 40 },
|
|
19
|
+
gradients: {
|
|
20
|
+
scrimSolid: '#0B1417',
|
|
21
|
+
scrimDeep: 'rgba(11,20,23,0.86)',
|
|
22
|
+
scrimMiddle: 'rgba(11,20,23,0.55)',
|
|
23
|
+
scrimSoft: 'rgba(11,20,23,0.32)',
|
|
24
|
+
scrimClear: 'rgba(11,20,23,0)',
|
|
25
|
+
numeralShade: 'rgba(5,10,12,0.9)',
|
|
26
|
+
playerChrome: 'rgba(11,20,23,0.86)',
|
|
27
|
+
screen: '#000000',
|
|
28
|
+
toneSea: '#5EC8D0',
|
|
29
|
+
toneMoss: '#9ACD7E',
|
|
30
|
+
toneSand: '#E8C38A',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Publishing and app availability
|
|
2
|
+
|
|
3
|
+
Free apps publish on the web at an Adelin address. Their published shell includes a small “Made with Adelin” badge managed by the host. Keep authored content inside its available layout; do not draw a replacement badge or try to hide the host badge. App state, themes and authored components do not grant publishing permissions.
|
|
4
|
+
|
|
5
|
+
After a completed release is set to production, the app is live at its deployed address: its address name on the Adelin hosting domain, with the web app at the root and each web-TV build under its own vendor path. Later production releases replace it in place. Only the builder renames the address, in the app's settings. Never construct, guess or change an address, and never use the preview address to publish a draft. The deployed address keeps the app's viewer sign-in and availability checks.
|
|
6
|
+
|
|
7
|
+
Paid plans support web, iOS, Android and TV publishing according to the platform’s current capability response. Store submission assistance depends on the plan. Previewing an authorized app on a platform does not grant permission to publish it there. Bring-your-own coding agents use the same authorization rules.
|
|
8
|
+
|
|
9
|
+
A Free app pauses public serving after thirty days without a successful build or accepted viewer visit. Editing and authorized previews remain available. A successful new build resumes a paused Free app; repeated public requests do not. Paid access suppresses Free inactivity pausing. Explain availability in terms of the builder’s app, rather than implementation details.
|
|
10
|
+
|
|
11
|
+
Publishing capabilities and host presentation come from the platform. A value placed in authored code or app state cannot replace that authority. When the host reports unavailable access, do not invent permission or remove the host’s refusal.
|
|
12
|
+
|
|
13
|
+
Device preview continues automatically while included time remains. When included time runs out, Free requires a plan upgrade. On paid plans, preview stops until the builder confirms using prepaid credit for that preview session. Do not confirm spending, buy credits, or repeatedly retry a stopped preview on the builder’s behalf. Explain that the builder can continue from the preview confirmation or upgrade their plan. Technical reconnects do not grant spending consent.
|