@rock-js/welcome-screen 0.8.13
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 +7 -0
- package/dist/src/assets/assets/book-open.png +0 -0
- package/dist/src/assets/assets/building-skyscraper.png +0 -0
- package/dist/src/assets/assets/debug-check.png +0 -0
- package/dist/src/assets/assets/zap.png +0 -0
- package/dist/src/assets/book-open.png +0 -0
- package/dist/src/assets/building-skyscraper.png +0 -0
- package/dist/src/assets/debug-check.png +0 -0
- package/dist/src/assets/zap.png +0 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.jsx +170 -0
- package/dist/src/index.jsx.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuD1B,iBAAS,aAAa,sBAmFrB;AA0FD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, Image, Platform, Pressable, StyleSheet, Text, useColorScheme, View, } from 'react-native';
|
|
3
|
+
// @ts-expect-error deep import without declaration
|
|
4
|
+
import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser';
|
|
5
|
+
const ICONS = {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
|
+
book: require('./assets/book-open.png'),
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9
|
+
logo: require('./assets/building-skyscraper.png'),
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
11
|
+
debug: require('./assets/debug-check.png'),
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
+
zap: require('./assets/zap.png'),
|
|
14
|
+
};
|
|
15
|
+
function Card({ dark, icon, title, description, }) {
|
|
16
|
+
return (<View style={styles.featureCard}>
|
|
17
|
+
<View style={styles.featureIconContainer}>
|
|
18
|
+
<Image source={ICONS[icon]} style={styles.featureIcon} resizeMode="contain"/>
|
|
19
|
+
</View>
|
|
20
|
+
<View style={styles.featureContent}>
|
|
21
|
+
<Text style={[styles.featureTitle, { color: dark ? '#fff' : '#000' }]}>
|
|
22
|
+
{title}
|
|
23
|
+
</Text>
|
|
24
|
+
<Text style={[styles.featureDescription]}>{description}</Text>
|
|
25
|
+
</View>
|
|
26
|
+
</View>);
|
|
27
|
+
}
|
|
28
|
+
function WelcomeScreen() {
|
|
29
|
+
const isDarkMode = useColorScheme() === 'dark';
|
|
30
|
+
const bgColor = isDarkMode ? '#000' : '#fff';
|
|
31
|
+
const textColor = isDarkMode ? '#fff' : '#000';
|
|
32
|
+
const scaleValue = React.useRef(new Animated.Value(1)).current;
|
|
33
|
+
const animatedStyle = { transform: [{ scale: scaleValue }] };
|
|
34
|
+
const onPressIn = () => {
|
|
35
|
+
Animated.spring(scaleValue, {
|
|
36
|
+
toValue: 0.95,
|
|
37
|
+
useNativeDriver: true,
|
|
38
|
+
speed: 20,
|
|
39
|
+
bounciness: 5,
|
|
40
|
+
}).start();
|
|
41
|
+
};
|
|
42
|
+
const onPressOut = () => {
|
|
43
|
+
Animated.spring(scaleValue, {
|
|
44
|
+
toValue: 1,
|
|
45
|
+
useNativeDriver: true,
|
|
46
|
+
speed: 20,
|
|
47
|
+
bounciness: 5,
|
|
48
|
+
}).start();
|
|
49
|
+
};
|
|
50
|
+
const onPress = () => {
|
|
51
|
+
openURLInBrowser('https://rockjs.dev');
|
|
52
|
+
};
|
|
53
|
+
return (<View style={[styles.container, { backgroundColor: bgColor }]}>
|
|
54
|
+
<View style={styles.header}>
|
|
55
|
+
<View style={styles.logoContainer}>
|
|
56
|
+
<Image source={ICONS['logo']} style={styles.logo} resizeMode="contain"/>
|
|
57
|
+
</View>
|
|
58
|
+
<Text style={[styles.title, { color: textColor }]}>
|
|
59
|
+
Welcome to Rock!
|
|
60
|
+
</Text>
|
|
61
|
+
</View>
|
|
62
|
+
|
|
63
|
+
<View style={styles.content}>
|
|
64
|
+
<View style={styles.featureList}>
|
|
65
|
+
<Card dark={isDarkMode} icon="zap" title="Start building" description="Open App.tsx, edit and see your changes live here"/>
|
|
66
|
+
<Card dark={isDarkMode} icon="debug" title="Debug with DevTools" description={`Press ${Platform.select({
|
|
67
|
+
ios: 'Cmd+D',
|
|
68
|
+
android: 'Ctrl+M',
|
|
69
|
+
})} to access Dev Menu to debug, reload and inspect your app`}/>
|
|
70
|
+
<Card dark={isDarkMode} icon="book" title="Learn more" description="Visit our documentation and learn about Remote Cache, Brownfield, and more by Callstack"/>
|
|
71
|
+
</View>
|
|
72
|
+
<View style={styles.footer}>
|
|
73
|
+
<Animated.View style={[styles.buttonContainer, animatedStyle]}>
|
|
74
|
+
<Pressable onPressIn={onPressIn} onPressOut={onPressOut} onPress={onPress} style={styles.button}>
|
|
75
|
+
<Text style={styles.buttonText}>View Documentation</Text>
|
|
76
|
+
</Pressable>
|
|
77
|
+
</Animated.View>
|
|
78
|
+
</View>
|
|
79
|
+
</View>
|
|
80
|
+
</View>);
|
|
81
|
+
}
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
container: {
|
|
84
|
+
flex: 2,
|
|
85
|
+
},
|
|
86
|
+
header: {
|
|
87
|
+
flex: 1,
|
|
88
|
+
justifyContent: 'flex-end',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
padding: 24,
|
|
91
|
+
},
|
|
92
|
+
logoContainer: {
|
|
93
|
+
width: 80,
|
|
94
|
+
height: 80,
|
|
95
|
+
marginBottom: 20,
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
},
|
|
99
|
+
logo: {
|
|
100
|
+
width: 48,
|
|
101
|
+
height: 48,
|
|
102
|
+
},
|
|
103
|
+
title: {
|
|
104
|
+
fontSize: 36,
|
|
105
|
+
fontWeight: 'bold',
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
color: '#000',
|
|
108
|
+
},
|
|
109
|
+
content: {
|
|
110
|
+
flex: 1.2,
|
|
111
|
+
justifyContent: 'flex-start',
|
|
112
|
+
marginHorizontal: 16,
|
|
113
|
+
},
|
|
114
|
+
featureList: {
|
|
115
|
+
flex: 1,
|
|
116
|
+
flexShrink: 1,
|
|
117
|
+
},
|
|
118
|
+
footer: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
justifyContent: 'flex-end',
|
|
121
|
+
},
|
|
122
|
+
buttonContainer: {
|
|
123
|
+
marginBottom: 60,
|
|
124
|
+
borderRadius: 12,
|
|
125
|
+
overflow: 'hidden',
|
|
126
|
+
},
|
|
127
|
+
button: {
|
|
128
|
+
backgroundColor: 'rgb(120,55,245)',
|
|
129
|
+
borderRadius: 12,
|
|
130
|
+
padding: 16,
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
},
|
|
133
|
+
buttonText: {
|
|
134
|
+
color: '#fff',
|
|
135
|
+
fontSize: 16,
|
|
136
|
+
fontWeight: '600',
|
|
137
|
+
},
|
|
138
|
+
featureCard: {
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
padding: 12,
|
|
142
|
+
},
|
|
143
|
+
featureIconContainer: {
|
|
144
|
+
width: 40,
|
|
145
|
+
height: 40,
|
|
146
|
+
borderRadius: 12,
|
|
147
|
+
marginRight: 24,
|
|
148
|
+
justifyContent: 'center',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
},
|
|
151
|
+
featureIcon: {
|
|
152
|
+
width: 30,
|
|
153
|
+
height: 30,
|
|
154
|
+
},
|
|
155
|
+
featureContent: {
|
|
156
|
+
flex: 1,
|
|
157
|
+
flexShrink: 1,
|
|
158
|
+
},
|
|
159
|
+
featureTitle: {
|
|
160
|
+
fontSize: 16,
|
|
161
|
+
fontWeight: '600',
|
|
162
|
+
marginBottom: 4,
|
|
163
|
+
},
|
|
164
|
+
featureDescription: {
|
|
165
|
+
fontSize: 14,
|
|
166
|
+
color: '#666',
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
export default WelcomeScreen;
|
|
170
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,IAAI,EACJ,cAAc,EACd,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,mDAAmD;AACnD,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AAErF,MAAM,KAAK,GAAG;IACZ,iEAAiE;IACjE,IAAI,EAAE,OAAO,CAAC,wBAAwB,CAAC;IACvC,iEAAiE;IACjE,IAAI,EAAE,OAAO,CAAC,kCAAkC,CAAC;IACjD,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC,0BAA0B,CAAC;IAC1C,iEAAiE;IACjE,GAAG,EAAE,OAAO,CAAC,kBAAkB,CAAC;CACxB,CAAC;AAEX,SAAS,IAAI,CAAC,EACZ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,WAAW,GAMZ;IACC,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC9B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CACvC;QAAA,CAAC,KAAK,CACJ,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACpB,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC1B,UAAU,CAAC,S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,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,CAAC;KAChB;IACD,kBAAkB,EAAE;QAClB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;KACd;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rock-js/welcome-screen",
|
|
3
|
+
"version": "0.8.13",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/src/index.jsx",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"default": "./dist/src/index.jsx"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.lib.json && cp -r src/assets dist/src/assets",
|
|
16
|
+
"dev": "tsc -p tsconfig.lib.json --watch",
|
|
17
|
+
"publish:npm": "npm publish --access public",
|
|
18
|
+
"publish:verdaccio": "npm publish --registry http://localhost:4873 --userconfig ../../.npmrc"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "*",
|
|
22
|
+
"react-native": "*"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/react": "^19.1.0",
|
|
26
|
+
"react": "19.1.0",
|
|
27
|
+
"react-native": "0.80.1"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|