Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions packages/snack-babel-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
]
}
},
"exports": {
".": {
"require": "./build/runtime.js",
"types": "./types/runtime.d.ts"
},
"./eslint": {
"require": "./build/eslint.js",
"types": "./types/eslint.d.ts"
},
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/expo/snack.git",
Expand Down
11 changes: 0 additions & 11 deletions packages/snack-require-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
]
}
},
"exports": {
".": {
"require": "./build/runtime.js",
"types": "./build/runtime.d.ts"
},
"./snackager": {
"require": "./build/snackager.js",
"types": "./build/snackager.d.ts"
},
"./package.json": "./package.json"
},
"files": [
"build",
"snackager.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/snack-term/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ function SnackTerminal() {
{(size) => (
<Box flexDirection="row">
<Box flexDirection="column">
<Terminal
{/* <Terminal
cwd="website"
command="yarn"
args={['start']}
width={Math.round(size.width / 2)}
height={Math.round((size.height - 1) / 3)}
/>
/> */}
<Terminal
cwd="snackager"
command="yarn"
Expand Down
54 changes: 27 additions & 27 deletions runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@
"@babel/polyfill": "^7.8.3",
"@expo/vector-icons": "^15.0.2",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-navigation/drawer": "^7.5.0",
"@react-navigation/native": "^7.1.8",
"@react-navigation/drawer": "7.7.2",
"@react-navigation/native": "7.1.21",
"assert": "^2.1.0",
"await-lock": "^2.2.2",
"canvaskit-wasm": "0.38.0",
"diff": "^5.0.0",
"escape-string-regexp": "^5.0.0",
"expo": "~54.0.10",
"expo-asset": "~12.0.9",
"expo-camera": "~17.0.8",
"expo-constants": "~18.0.9",
"expo-crypto": "~15.0.7",
"expo-file-system": "~19.0.15",
"expo-font": "~14.0.8",
"expo-keep-awake": "~15.0.7",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.8",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"expo-updates": "~29.0.11",
"expo": "55.0.0-canary-20251205-a1dedc6",
"expo-asset": "12.0.12-canary-20251205-a1dedc6",
"expo-camera": "17.1.0-canary-20251205-a1dedc6",
"expo-constants": "18.1.0-canary-20251205-a1dedc6",
"expo-crypto": "15.0.9-canary-20251205-a1dedc6",
"expo-file-system": "19.0.21-canary-20251205-a1dedc6",
"expo-font": "14.1.0-canary-20251205-a1dedc6",
"expo-keep-awake": "15.0.9-canary-20251205-a1dedc6",
"expo-linking": "8.0.11-canary-20251205-a1dedc6",
"expo-router": "7.0.0-canary-20251205-a1dedc6",
"expo-splash-screen": "31.0.13-canary-20251205-a1dedc6",
"expo-status-bar": "3.0.10-canary-20251205-a1dedc6",
"expo-updates": "29.1.0-canary-20251205-a1dedc6",
"path": "^0.12.7",
"prop-types": "^15.7.2",
"pubnub": "^7.2.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-native": "0.83.0-rc.3",
"react-native-gesture-handler": "~2.28.0",
"react-native-pager-view": "6.9.1",
"react-native-reanimated": "~4.1.1",
"react-native-reanimated": "4.1.3",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-screens": "4.19.0-nightly-20251203-1746a584e",
"react-native-view-shot": "~4.0.3",
"react-native-web": "^0.21.0",
"react-native-worklets": "~0.5.0",
"react-native-worklets": "0.6.1",
"snack-babel-standalone": "file:../packages/snack-babel-standalone",
"snack-content": "file:../packages/snack-content",
"snack-require-context": "file:../packages/snack-require-context",
Expand All @@ -68,15 +68,15 @@
"@types/diff": "^5.0.0",
"@types/jest": "^29.5.14",
"@types/pubnub": "^7.2.0",
"@types/react": "~19.1.10",
"@types/react-dom": "~19.1.7",
"babel-preset-expo": "~54.0.0",
"@types/react": "~19.2.7",
"@types/react-dom": "~19.2.3",
"babel-preset-expo": "54.1.0-canary-20251205-a1dedc6",
"eslint": "^8.56.0",
"eslint-config-universe": "^15.0.3",
"expo-atlas": "^0.4.0",
"getenv": "^1.0.0",
"jest": "^29.2.1",
"jest-expo": "~54.0.12",
"jest-expo": "55.0.0-canary-20251205-a1dedc6",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^3.2.4",
Expand All @@ -86,8 +86,8 @@
"update-browserslist-db": "^1.1.1"
},
"resolutions": {
"@react-navigation/drawer": "^7.5.0",
"@react-navigation/native": "^7.1.8"
"@react-navigation/drawer": "7.7.2",
"@react-navigation/native": "7.1.21"
},
"eslintConfig": {
"extends": "universe/native",
Expand Down
68 changes: 67 additions & 1 deletion runtime/src/BarCodeScannerView.native.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Camera, CameraView, type CameraViewProps } from 'expo-camera';
import Constants from 'expo-constants';
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { Text, View, StyleSheet, TextInput, TouchableOpacity } from 'react-native';

import LoadingView from './LoadingView';

Expand All @@ -14,12 +14,14 @@ type Props = {
type State = {
waitingForPermission: boolean;
hasCameraPermission: boolean;
url: string;
};

export default class BarCodeScannerView extends React.Component<Props, State> {
state = {
waitingForPermission: true,
hasCameraPermission: false,
url: '',
};

componentDidMount() {
Expand All @@ -35,6 +37,13 @@ export default class BarCodeScannerView extends React.Component<Props, State> {
});
};

_handleOpen = () => {
const { url } = this.state;
if (url.trim()) {
this.props.onBarCodeScanned({ data: url.trim(), type: 'url' });
}
};

render() {
const { initialURL, onBarCodeScanned, snackApiError } = this.props;
const { waitingForPermission, hasCameraPermission } = this.state;
Expand All @@ -54,6 +63,21 @@ export default class BarCodeScannerView extends React.Component<Props, State> {
Make sure to leave the web page open while you are running the project.
{!!snackApiError && <Text style={styles.paragraph}>{snackApiError}</Text>}
</Text>
<View style={styles.inputContainer}>
<TextInput
style={styles.input}
value={this.state.url}
onChangeText={(text) => this.setState({ url: text })}
onSubmitEditing={this._handleOpen}
placeholder="Enter URL to load"
autoCapitalize="none"
autoCorrect={false}
keyboardType="url"
/>
<TouchableOpacity style={styles.button} onPress={this._handleOpen}>
<Text style={styles.buttonText}>Open</Text>
</TouchableOpacity>
</View>
{/* @ts-ignore Property 'style' does not exist on type */}
<CameraView style={styles.camera} onBarCodeScanned={onBarCodeScanned} />
</View>
Expand All @@ -66,6 +90,21 @@ export default class BarCodeScannerView extends React.Component<Props, State> {
Please accept the camera permission so that you can scan a QR code!
</Text>
{!!snackApiError && <Text style={styles.paragraph}>{snackApiError}</Text>}
<View style={styles.inputContainer}>
<TextInput
style={styles.input}
value={this.state.url}
onChangeText={(text) => this.setState({ url: text })}
onSubmitEditing={this._handleOpen}
placeholder="Enter URL to load"
autoCapitalize="none"
autoCorrect={false}
keyboardType="url"
/>
<TouchableOpacity style={styles.button} onPress={this._handleOpen}>
<Text style={styles.buttonText}>Open</Text>
</TouchableOpacity>
</View>
</View>
);
}
Expand All @@ -91,6 +130,33 @@ const styles = StyleSheet.create({
textAlign: 'center',
color: '#34495e',
},
inputContainer: {
flexDirection: 'row',
margin: 16,
},
input: {
flex: 1,
backgroundColor: 'white',
padding: 8,
height: 44,
borderWidth: 1,
borderColor: 'rgba(0, 0, 0, .16)',
borderRadius: 4,
marginRight: 8,
},
button: {
backgroundColor: '#4630eb',
paddingHorizontal: 24,
height: 44,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 4,
},
buttonText: {
color: 'white',
fontSize: 16,
fontWeight: '600',
},
camera: {
flex: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion runtime/web/deploy-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function run() {
const exportDir = './web-build';

await exportWeb({ workingDir, exportDir });
await uploadWeb({ workingDir, exportDir });
// await uploadWeb({ workingDir, exportDir });
}

/**
Expand Down
Loading
Loading