Compare commits

..

40 Commits

Author SHA1 Message Date
Benjamin S. Leveritt
c76b15a924 Rename Expo in selector
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-03-27 15:00:35 +00:00
Benjamin S. Leveritt
6c68128cb3 Bump to 0.13.0
Signed-off-by: Benjamin S. Leveritt <benjamin@leveritt.co.uk>
2025-03-27 15:00:15 +00:00
Guido D'Orsi
32be2a8454 chore: update lockfile 2025-03-27 14:21:27 +01:00
Guido D'Orsi
68a5928d6d chore: migrate jazz-react-native-core o declaration files 2025-03-27 14:20:08 +01:00
Guido D'Orsi
ffa44d1b9e chore: more cleanup 2025-03-27 14:15:35 +01:00
Guido D'Orsi
1e243abd5a chore: update lockfile 2025-03-27 14:12:30 +01:00
Guido D'Orsi
774b9640ca feat: re-export the testing entry on jazz-expo and jazz-react-native 2025-03-27 14:11:59 +01:00
Guido D'Orsi
72e66c884a chore: clean up changes 2025-03-27 13:14:53 +01:00
Guido D'Orsi
12cd8dddb8 Merge remote-tracking branch 'origin/main' into feat/separate-expo-rn 2025-03-27 12:35:17 +01:00
Guido D'Orsi
51c9f09056 chore: clean up deps 2025-03-27 12:32:46 +01:00
pax-k
e2f05b3b8c fix: tests 2025-03-26 15:37:08 +02:00
Brad Anderson
336c2eda6d fix: removing mystery starters 2025-03-25 17:04:53 -04:00
Brad Anderson
0cf456a154 PR feedback 2025-03-25 10:56:51 -04:00
Brad Anderson
edcbabc9b6 PR feedback 2025-03-25 10:56:51 -04:00
Brad Anderson
1a7d862cb9 chore: rebase oops 2025-03-25 10:56:51 -04:00
Brad Anderson
56074d598d chore: rebase 2025-03-25 10:56:51 -04:00
Brad Anderson
b79adbc6d1 chore: docs update 2025-03-25 10:56:51 -04:00
Brad Anderson
98f8ab249f chore: first cut at docs changes 2025-03-25 10:56:51 -04:00
Brad Anderson
abb2357be2 fix: comment out suppressions 2025-03-25 10:56:51 -04:00
Brad Anderson
11603e14d7 fix: tests work 2025-03-25 10:56:51 -04:00
Brad Anderson
2ba1f1b5d7 wip: failing unit test work 2025-03-25 10:56:50 -04:00
Brad Anderson
af5bf96df1 fix: react/dom dependency warnings 2025-03-25 10:56:50 -04:00
Brad Anderson
9a11a19aa8 fix: more cleanup of packages 2025-03-25 10:56:50 -04:00
Brad Anderson
366a3e8e2f fix: lock file regen 2025-03-25 10:56:50 -04:00
Brad Anderson
f754896f13 fix: clean up styles 2025-03-25 10:56:50 -04:00
pax-k
3fb50d9aee works 2025-03-25 10:56:50 -04:00
pax-k
af4cd3df89 fix(rn): added ios and android dirs for barebone rn chat app 2025-03-25 10:56:50 -04:00
pax-k
c19989249d fix: workspace package versions for react, react-native 2025-03-25 10:56:50 -04:00
Brad Anderson
e8a3002577 try 0.78 on all RN apps 2025-03-25 10:56:49 -04:00
Brad Anderson
29083a9cf0 cosmetic 2025-03-25 10:56:49 -04:00
Brad Anderson
0c9e112be1 chat-rn builds and runs, but blank 2025-03-25 10:56:49 -04:00
Brad Anderson
b13f8889ec more naming changes 2025-03-25 10:56:49 -04:00
Brad Anderson
de2f998115 rename RN example apps 2025-03-25 10:56:49 -04:00
Brad Anderson
ea1468a609 add chat app & deps 2025-03-25 10:55:50 -04:00
Brad Anderson
77bc548c9b app starts, lint, format 2025-03-25 10:55:50 -04:00
Brad Anderson
88095b714e add chat-rn-cli app for frameworkless testing 2025-03-25 10:55:50 -04:00
Brad Anderson
987f037547 small changes 2025-03-25 10:55:50 -04:00
Brad Anderson
d86a2d1496 move jazz-expo-clerk-auth under jazz-expo, rename local e2e test 2025-03-25 10:55:48 -04:00
Brad Anderson
67c1654987 remove op-sqlite from chat-rn-clerk 2025-03-25 10:55:47 -04:00
Brad Anderson
58332c22fc feat: Separate Expo and React Native 2025-03-25 10:55:47 -04:00
796 changed files with 20395 additions and 44302 deletions

View File

@@ -9,19 +9,18 @@
"cojson-storage",
"cojson-storage-indexeddb",
"cojson-storage-sqlite",
"cojson-storage-rn-sqlite",
"cojson-transport-ws",
"jazz-browser",
"jazz-auth-clerk",
"jazz-browser-media-images",
"jazz-expo",
"jazz-inspector",
"jazz-inspector-element",
"jazz-nodejs",
"jazz-react",
"jazz-react-core",
"jazz-react-auth-clerk",
"jazz-react-native-core",
"jazz-react-native",
"jazz-react-native-auth-clerk",
"jazz-react-native-media-images",
"jazz-run",
"jazz-svelte",

View File

@@ -15,7 +15,4 @@ jobs:
with:
version: latest
- name: Run Biome
run: biome ci .
- name: Check Catalog Dependencies
run: node scripts/check-catalog-deps.js
run: biome ci .

View File

@@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
steps:
- uses: actions/checkout@v4

1
.gitignore vendored
View File

@@ -23,7 +23,6 @@ test-results
.husky
.vscode/*
.idea/*
.svelte-kit

View File

@@ -13,7 +13,6 @@
"**/android/**",
"packages/jazz-svelte/**",
"examples/*svelte*/**",
"examples/jazz-paper-scissors/src/routeTree.gen.ts",
"homepage/homepage/**",
"**/package.json"
]

View File

@@ -1,225 +1,5 @@
# chat-rn-expo-clerk
## 1.0.113
### Patch Changes
- jazz-expo@0.13.21
- jazz-tools@0.13.21
- jazz-react-native-media-images@0.13.21
## 1.0.112
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-expo@0.13.20
- jazz-react-native-media-images@0.13.20
## 1.0.111
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-expo@0.13.19
- jazz-react-native-media-images@0.13.19
## 1.0.110
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-expo@0.13.18
- jazz-react-native-media-images@0.13.18
## 1.0.109
### Patch Changes
- jazz-expo@0.13.17
- jazz-tools@0.13.17
- jazz-react-native-media-images@0.13.17
## 1.0.108
### Patch Changes
- jazz-expo@0.13.16
- jazz-tools@0.13.16
- jazz-react-native-media-images@0.13.16
## 1.0.107
### Patch Changes
- jazz-expo@0.13.15
- jazz-tools@0.13.15
- jazz-react-native-media-images@0.13.15
## 1.0.106
### Patch Changes
- Updated dependencies [bd94012]
- jazz-expo@0.13.14
- jazz-tools@0.13.14
- jazz-react-native-media-images@0.13.14
## 1.0.105
### Patch Changes
- jazz-expo@0.13.13
- jazz-tools@0.13.13
- jazz-react-native-media-images@0.13.13
## 1.0.104
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-expo@0.13.12
- jazz-react-native-media-images@0.13.12
## 1.0.103
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-expo@0.13.11
- jazz-react-native-media-images@0.13.11
## 1.0.102
### Patch Changes
- jazz-expo@0.13.10
- jazz-tools@0.13.10
- jazz-react-native-media-images@0.13.10
## 1.0.101
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-expo@0.13.9
- jazz-react-native-media-images@0.13.9
## 1.0.100
### Patch Changes
- jazz-expo@0.13.8
## 1.0.99
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-expo@0.13.7
- jazz-react-native-media-images@0.13.7
## 1.0.98
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-expo@0.13.5
- jazz-react-native-media-images@0.13.5
## 1.0.97
### Patch Changes
- Updated dependencies [3129982]
- Updated dependencies [3129982]
- jazz-expo@0.13.4
- jazz-tools@0.13.4
- jazz-react-native-media-images@0.13.4
## 1.0.96
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-expo@0.13.3
- jazz-react-native-media-images@0.13.3
## 1.0.95
### Patch Changes
- jazz-expo@0.13.2
- jazz-tools@0.13.2
- jazz-react-native-media-images@0.13.2
## 1.0.94
### Patch Changes
- Updated dependencies [63a7aa0]
- jazz-expo@0.13.1
## 1.0.93
### Patch Changes
- Updated dependencies [bce3bcc]
- Updated dependencies [afd1374]
- jazz-expo@0.13.0
- jazz-tools@0.13.0
- jazz-react-native-media-images@0.13.0
## 1.0.92
### Patch Changes
- jazz-react-native@0.12.2
- jazz-react-native-auth-clerk@0.12.2
- jazz-tools@0.12.2
- jazz-react-native-media-images@0.12.2
## 1.0.91
### Patch Changes
- jazz-react-native@0.12.1
- jazz-react-native-auth-clerk@0.12.1
- jazz-tools@0.12.1
- jazz-react-native-media-images@0.12.1
## 1.0.90
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react-native@0.12.0
- jazz-react-native-auth-clerk@0.12.0
- jazz-react-native-media-images@0.12.0
## 1.0.89
### Patch Changes
- jazz-react-native@0.11.8
- jazz-react-native-auth-clerk@0.11.8
- jazz-tools@0.11.8
- jazz-react-native-media-images@0.11.8
## 1.0.88
### Patch Changes

View File

@@ -17,7 +17,7 @@ Next, navigate to the specific example project and run the following commands:
```bash
pnpm expo prebuild
pnpx pod-install
npx pod-install
pnpm expo run:ios
```

View File

@@ -23,7 +23,6 @@
},
"package": "com.jazz.chatrnclerk"
},
"newArchEnabled": true,
"plugins": [
"expo-secure-store",
"expo-font",

View File

@@ -2,40 +2,29 @@ import "../global.css";
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
import { secureStore } from "@clerk/clerk-expo/secure-store";
import { useFonts } from "expo-font";
import { Slot, useRouter, useSegments } from "expo-router";
import { Slot } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
import { useIsAuthenticated, useJazzContext } from "jazz-expo";
import React, { useEffect } from "react";
import { tokenCache } from "../cache";
import { JazzAndAuth } from "../src/auth-context";
SplashScreen.preventAutoHideAsync();
function InitialLayout() {
const isAuthenticated = useIsAuthenticated();
const segments = useSegments();
const router = useRouter();
useEffect(() => {
const inAuthGroup = segments[0] === "(auth)";
if (isAuthenticated && inAuthGroup) {
router.replace("/chat");
} else if (!isAuthenticated && !inAuthGroup) {
router.replace("/");
}
SplashScreen.hideAsync();
}, [isAuthenticated, segments, router]);
return <Slot />;
}
export default function RootLayout() {
const [fontsLoaded] = useFonts({
const [loaded] = useFonts({
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
});
useEffect(() => {
if (loaded) {
SplashScreen.hideAsync();
}
}, [loaded]);
if (!loaded) {
return null;
}
const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
if (!publishableKey) {
@@ -44,17 +33,6 @@ export default function RootLayout() {
);
}
useEffect(() => {
if (fontsLoaded) {
} else {
SplashScreen.preventAutoHideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<ClerkProvider
tokenCache={tokenCache}
@@ -63,7 +41,7 @@ export default function RootLayout() {
>
<ClerkLoaded>
<JazzAndAuth>
<InitialLayout />
<Slot />
</JazzAndAuth>
</ClerkLoaded>
</ClerkProvider>

View File

@@ -28,7 +28,7 @@ export default function Conversation() {
const { me } = useAccount();
const [chat, setChat] = useState<Chat>();
const [message, setMessage] = useState("");
const loadedChat = useCoState(Chat, chat?.id, { resolve: { $each: true } });
const loadedChat = useCoState(Chat, chat?.id, [{}]);
const navigation = useNavigation();
const [isUploading, setIsUploading] = useState(false);
@@ -71,7 +71,7 @@ export default function Conversation() {
const loadChat = async (chatId: ID<Chat>) => {
try {
const chat = await Chat.load(chatId, me);
const chat = await Chat.load(chatId, me, []);
setChat(chat);
} catch (error) {
console.log("Error loading chat", error);
@@ -165,8 +165,8 @@ export default function Conversation() {
!isMe ? "mt-2 text-gray-500" : "mt-1 text-gray-200",
)}
>
{item._edits.text.madeAt?.getHours().toString().padStart(2, "0")}:
{item._edits.text.madeAt?.getMinutes().toString().padStart(2, "0")}
{item._edits.text.madeAt.getHours()}:
{item._edits.text.madeAt.getMinutes()}
</Text>
</View>
</View>

View File

@@ -1,17 +1,20 @@
{
"name": "chat-rn-expo-clerk",
"main": "index.js",
"version": "1.0.113",
"version": "1.0.88",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"android": "expo run:android",
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
"ios": "expo run:ios",
"web": "expo start --web",
"run:ios": "pnpm expo prebuild && npx pod-install && pnpm expo run:ios"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@bacons/text-decoder": "0.0.0",
@@ -20,25 +23,26 @@
"@craftzdog/react-native-buffer": "6.0.5",
"@expo/vector-icons": "^14.0.2",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native": "7.0.15",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"expo": "^52.0.42",
"expo-build-properties": "~0.13.1",
"expo-clipboard": "~7.0.0",
"expo": "^52.0.39",
"expo-build-properties": "~0.13.2",
"expo-clipboard": "~7.0.1",
"expo-constants": "~17.0.8",
"expo-crypto": "~14.0.2",
"expo-dev-client": "~5.0.16",
"expo-crypto": "~14.0.1",
"expo-dev-client": "~5.0.14",
"expo-file-system": "^18.0.4",
"expo-font": "~13.0.1",
"expo-image-picker": "~16.0.6",
"expo-image-picker": "~16.0.4",
"expo-linking": "~7.0.5",
"expo-router": "~4.0.19",
"expo-secure-store": "~14.0.0",
"expo-splash-screen": "~0.29.22",
"expo-sqlite": "15.1.3",
"expo-router": "~4.0.11",
"expo-secure-store": "~14.0.1",
"expo-splash-screen": "~0.29.16",
"expo-sqlite": "15.1.2",
"expo-status-bar": "~2.0.1",
"expo-web-browser": "~14.0.1",
"expo-system-ui": "~4.0.8",
"expo-web-browser": "~14.0.2",
"jazz-expo": "workspace:*",
"jazz-react-native-media-images": "workspace:*",
"jazz-tools": "workspace:*",
@@ -57,11 +61,14 @@
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.13",
"@types/react": "~18.3.12",
"@types/react-test-renderer": "^19.0.0",
"jest": "^29.6.3",
"jest-expo": "51.0.2",
"react-test-renderer": "18.3.1",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2"
"typescript": "~5.6.2"
},
"private": true
}

View File

@@ -1,5 +1,6 @@
import { useClerk } from "@clerk/clerk-expo";
import { JazzProviderWithClerk } from "jazz-expo/auth/clerk";
// FIXME: why isn't the export working? IDE is fine, Metro doesn't like the non 'dist' import
import { JazzProviderWithClerk } from "jazz-expo/dist/auth/clerk";
import React, { PropsWithChildren } from "react";
import { apiKey } from "./apiKey";

View File

@@ -1,198 +1,5 @@
# chat-rn-expo
## 1.0.100
### Patch Changes
- jazz-expo@0.13.21
- jazz-tools@0.13.21
## 1.0.99
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-expo@0.13.20
## 1.0.98
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-expo@0.13.19
## 1.0.97
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-expo@0.13.18
## 1.0.96
### Patch Changes
- jazz-expo@0.13.17
- jazz-tools@0.13.17
## 1.0.95
### Patch Changes
- jazz-expo@0.13.16
- jazz-tools@0.13.16
## 1.0.94
### Patch Changes
- jazz-expo@0.13.15
- jazz-tools@0.13.15
## 1.0.93
### Patch Changes
- Updated dependencies [bd94012]
- jazz-expo@0.13.14
- jazz-tools@0.13.14
## 1.0.92
### Patch Changes
- jazz-expo@0.13.13
- jazz-tools@0.13.13
## 1.0.91
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-expo@0.13.12
## 1.0.90
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-expo@0.13.11
## 1.0.89
### Patch Changes
- jazz-expo@0.13.10
- jazz-tools@0.13.10
## 1.0.88
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-expo@0.13.9
## 1.0.87
### Patch Changes
- jazz-expo@0.13.8
## 1.0.86
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-expo@0.13.7
## 1.0.85
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-expo@0.13.5
## 1.0.84
### Patch Changes
- Updated dependencies [3129982]
- Updated dependencies [3129982]
- jazz-expo@0.13.4
- jazz-tools@0.13.4
## 1.0.83
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-expo@0.13.3
## 1.0.82
### Patch Changes
- jazz-expo@0.13.2
- jazz-tools@0.13.2
## 1.0.81
### Patch Changes
- Updated dependencies [63a7aa0]
- jazz-expo@0.13.1
## 1.0.80
### Patch Changes
- Updated dependencies [bce3bcc]
- Updated dependencies [afd1374]
- jazz-expo@0.13.0
- jazz-tools@0.13.0
## 1.0.88
### Patch Changes
- jazz-react-native@0.12.2
- jazz-tools@0.12.2
## 1.0.87
### Patch Changes
- jazz-react-native@0.12.1
- jazz-tools@0.12.1
## 1.0.86
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react-native@0.12.0
## 1.0.85
### Patch Changes
- jazz-react-native@0.11.8
- jazz-tools@0.11.8
## 1.0.84
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn-expo",
"version": "1.0.100",
"version": "1.0.79",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -8,7 +8,7 @@
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"android": "expo run:android",
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
@@ -16,19 +16,20 @@
"@bacons/text-decoder": "0.0.0",
"@craftzdog/react-native-buffer": "6.0.5",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native": "7.0.15",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"expo": "52.0.42",
"expo-build-properties": "~0.13.1",
"expo-clipboard": "~7.0.0",
"expo": "^52.0.39",
"expo-build-properties": "~0.13.2",
"expo-clipboard": "~7.0.1",
"expo-constants": "~17.0.8",
"expo-dev-client": "~5.0.16",
"expo-dev-client": "~5.0.14",
"expo-linking": "~7.0.5",
"expo-secure-store": "~14.0.0",
"expo-sqlite": "15.1.3",
"expo-secure-store": "~14.0.1",
"expo-sqlite": "15.1.2",
"expo-status-bar": "~2.0.1",
"expo-web-browser": "~14.0.1",
"expo-system-ui": "~4.0.8",
"expo-web-browser": "~14.0.2",
"jazz-expo": "workspace:*",
"jazz-tools": "workspace:*",
"nativewind": "^4.1.21",
@@ -45,7 +46,7 @@
"@babel/core": "^7.25.2",
"@types/react": "~18.3.12",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2"
"typescript": "~5.6.2"
},
"private": true
}

View File

@@ -20,8 +20,7 @@ import { Chat, Message } from "./schema";
export default function ChatScreen({ navigation }: { navigation: any }) {
const { me, logOut } = useAccount();
const [chatId, setChatId] = useState<ID<Chat>>();
const [chatIdInput, setChatIdInput] = useState<string>();
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
const loadedChat = useCoState(Chat, chatId, [{}]);
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
@@ -58,11 +57,27 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
};
const joinChat = () => {
if (chatIdInput) {
setChatId(chatIdInput as ID<Chat>);
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
Alert.prompt(
"Join Chat",
"Enter the Chat ID (example: co_zBGEHYvRfGuT2YSBraY3njGjnde)",
[
{
text: "Cancel",
style: "cancel",
},
{
text: "Join",
onPress: (chatId) => {
if (chatId) {
setChatId(chatId as ID<Chat>);
} else {
Alert.alert("Error", "Chat ID cannot be empty.");
}
},
},
],
"plain-text",
);
};
const sendMessage = () => {
@@ -110,12 +125,8 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
!isMe ? "mt-2" : "mt-1",
)}
>
{item?._edits?.text?.madeAt?.getHours().toString().padStart(2, "0")}
:
{item?._edits?.text?.madeAt
?.getMinutes()
.toString()
.padStart(2, "0")}
{item?._edits?.text?.madeAt?.getHours()}:
{item?._edits?.text?.madeAt?.getMinutes()}
</Text>
</View>
</View>
@@ -145,25 +156,9 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
>
<Text className="text-white font-semibold">Start new chat</Text>
</TouchableOpacity>
<Text className="text-m font-bold mt-6">Join existing chat</Text>
<TextInput
className="rounded h-12 p-2 m-2 mt-4 w-80 border border-gray-200 block"
placeholder="Chat ID"
value={chatIdInput ?? ""}
onChangeText={(value) => {
setChatIdInput(value);
}}
textAlignVertical="center"
onSubmitEditing={() => {
if (chatIdInput) {
setChatId(chatIdInput as ID<Chat>);
}
}}
testID="chat-id-input"
/>
<TouchableOpacity
onPress={joinChat}
className="bg-green-500 p-4 rounded-md"
className="bg-green-500 p-4 rounded-md mt-4"
>
<Text className="text-white font-semibold">Join chat</Text>
</TouchableOpacity>
@@ -173,6 +168,7 @@ export default function ChatScreen({ navigation }: { navigation: any }) {
<FlatList
contentContainerStyle={{
flexGrow: 1,
flex: 1,
gap: 6,
padding: 8,
}}

View File

@@ -9,8 +9,6 @@ appId: com.jazz.chatrn
# - tapOn: "Reload"
# login
- assertVisible: "Logout"
- tapOn: "Logout"
- assertVisible: "Anonymous user"
- runFlow:
label: "Erase existing username"
@@ -44,11 +42,9 @@ appId: com.jazz.chatrn
# logout
- tapOn: "Logout"
- assertVisible: "Anonymous user"
# join chat
- tapOn:
id: "chat-id-input"
- inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
- tapOn: "Join chat"
- assertVisible: "boorad"
- assertVisible: "bro, low key, it do be like that tho"
# This doesn't work on CI, maybe because Android has a different alert dialog
# - tapOn: "Join chat"
# - inputText: "co_zFs6KFyhxPw4xtw83tcEMzeHUNv" # Use a static id because maestro doesn't have access to the system clipboard
# - pressKey: "enter"
# - assertVisible: "boorad"
# - assertVisible: "bro, low key, it do be like that tho"

View File

@@ -1,214 +0,0 @@
# chat-rn
## 1.0.108
### Patch Changes
- Updated dependencies [e14e61f]
- cojson@0.13.21
- cojson-transport-ws@0.13.21
- jazz-react-native@0.13.21
- jazz-tools@0.13.21
## 1.0.107
### Patch Changes
- Updated dependencies [adfc9a6]
- Updated dependencies [1389207]
- Updated dependencies [d6e143e]
- Updated dependencies [439f0fe]
- Updated dependencies [3e6229d]
- cojson@0.13.20
- jazz-tools@0.13.20
- jazz-react-native@0.13.20
- cojson-transport-ws@0.13.20
## 1.0.106
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-react-native@0.13.19
## 1.0.105
### Patch Changes
- Updated dependencies [9089252]
- Updated dependencies [b470f63]
- Updated dependencies [761759c]
- Updated dependencies [66373ba]
- Updated dependencies [f24cad1]
- cojson@0.13.18
- jazz-tools@0.13.18
- cojson-transport-ws@0.13.18
- jazz-react-native@0.13.18
## 1.0.104
### Patch Changes
- Updated dependencies [9fb98e2]
- Updated dependencies [0b89fad]
- cojson@0.13.17
- cojson-transport-ws@0.13.17
- jazz-react-native@0.13.17
- jazz-tools@0.13.17
## 1.0.103
### Patch Changes
- Updated dependencies [c6fb8dc]
- cojson@0.13.16
- cojson-transport-ws@0.13.16
- jazz-react-native@0.13.16
- jazz-tools@0.13.16
## 1.0.102
### Patch Changes
- Updated dependencies [c712ef2]
- cojson@0.13.15
- cojson-transport-ws@0.13.15
- jazz-react-native@0.13.15
- jazz-tools@0.13.15
## 1.0.101
### Patch Changes
- Updated dependencies [5c2c7d4]
- cojson@0.13.14
- cojson-transport-ws@0.13.14
- jazz-react-native@0.13.14
- jazz-tools@0.13.14
## 1.0.100
### Patch Changes
- Updated dependencies [ec9cb40]
- cojson@0.13.13
- cojson-transport-ws@0.13.13
- jazz-react-native@0.13.13
- jazz-tools@0.13.13
## 1.0.99
### Patch Changes
- Updated dependencies [4547525]
- Updated dependencies [65719f2]
- jazz-tools@0.13.12
- cojson@0.13.12
- jazz-react-native@0.13.12
- cojson-transport-ws@0.13.12
## 1.0.98
### Patch Changes
- Updated dependencies [17273a6]
- Updated dependencies [3396ed4]
- Updated dependencies [17273a6]
- Updated dependencies [267ea4c]
- cojson@0.13.11
- jazz-tools@0.13.11
- cojson-transport-ws@0.13.11
- jazz-react-native@0.13.11
## 1.0.97
### Patch Changes
- Updated dependencies [f837cfe]
- cojson@0.13.10
- cojson-transport-ws@0.13.10
- jazz-react-native@0.13.10
- jazz-tools@0.13.10
## 1.0.96
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-react-native@0.13.9
## 1.0.95
### Patch Changes
- Updated dependencies [bc3d7bb]
- Updated dependencies [4e9aae1]
- Updated dependencies [21c935c]
- Updated dependencies [aa1c80e]
- Updated dependencies [13074be]
- jazz-tools@0.13.7
- cojson@0.13.7
- jazz-react-native@0.13.7
- cojson-transport-ws@0.13.7
## 1.0.94
### Patch Changes
- Updated dependencies [e090b39]
- Updated dependencies [fe6f561]
- cojson@0.13.5
- jazz-tools@0.13.5
- cojson-transport-ws@0.13.5
- jazz-react-native@0.13.5
## 1.0.93
### Patch Changes
- Updated dependencies [3129982]
- jazz-tools@0.13.4
- jazz-react-native@0.13.4
## 1.0.92
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [b19cab7]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- cojson-transport-ws@0.13.3
- jazz-react-native@0.13.3
## 1.0.91
### Patch Changes
- Updated dependencies [c551839]
- cojson@0.13.2
- cojson-transport-ws@0.13.2
- jazz-react-native@0.13.2
- jazz-tools@0.13.2
## 1.0.90
### Patch Changes
- Updated dependencies [63a7aa0]
- jazz-react-native@0.13.1
## 1.0.89
### Patch Changes
- Updated dependencies [a013538]
- Updated dependencies [bce3bcc]
- Updated dependencies [afd1374]
- Updated dependencies [bce3bcc]
- cojson@0.13.0
- jazz-react-native@0.13.0
- jazz-tools@0.13.0
- cojson-transport-ws@0.13.0

View File

@@ -26,7 +26,7 @@ This will set up and launch the app on iOS. For Android, you can skip `pnpm pods
This was created using the following command:
```bash
pnpx @react-native-community/cli init chat-rn --version 0.76.7 --install-pods true --skip-git-init true --package-name com.chatrn --directory chat-rn
bunx @react-native-community/cli init chat-rn --version 0.78 --install-pods true --skip-git-init true --package-name com.jazz.chatrn --directory chat-rn
```
Then change package name in `package.json`, and begin build instructions above.
Then delete `bun.lock`, change package name in `package.json`, and begin build instructions above.

View File

@@ -1920,72 +1920,72 @@ SPEC CHECKSUMS:
fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
hermes-engine: eb4a80f6bf578536c58a44198ec93a30f6e69218
op-sqlite: 7ecaedd41684cc6c9f6fa267db0da48cbb11dc90
op-sqlite: 17f173ae72a5e9617bf9000c9e0474cc518fdc5c
RCT-Folly: bf5c0376ffe4dd2cf438dcf86db385df9fdce648
RCTDeprecation: 7691283dd69fed46f6653d376de6fa83aaad774c
RCTRequired: eac044a04629288f272ee6706e31f81f3a2b4bfe
RCTTypeSafety: cfe499e127eda6dd46e5080e12d80d0bfe667228
React: 1f3737a983fdd26fb3d388ddbca41a26950fe929
React-callinvoker: 5c15ac628eab5468fe0b4dc453495f4742761f00
React-Core: e467bf49f10da6fe92d915d2311cd0fd9bfbe052
React-CoreModules: 0299b3c0782edd3b37c8445ba07bf18ceb73812d
React-cxxreact: 54e253030b3b82b05575f19a1fb0e25c049f30ba
React-Core: 4b90a977a5b2777fd8f4a8db7325a83431ecd2d8
React-CoreModules: 385bbacfa34ac9208aa24f239a5184fa7ab1cd28
React-cxxreact: 3e09bcdf1f86b931b5e96bf5429d7c274a0ec168
React-debug: 2086b55a5e55fb0abae58c42b8f280ebd708c956
React-defaultsnativemodule: f80f41ea8c1216917fd224b553291360e0e6a175
React-domnativemodule: b14aaaf4afbaa7e1dbc86ad78cbcc71eb59f1faf
React-Fabric: 409ce8a065374d737bdbc0fce506dcdda8f51e88
React-FabricComponents: bd5faafffd07e56cf217d5417e80ec29348c19d9
React-FabricImage: 04d01f3ecfed6121733613a5c794f684e81cb3fb
React-defaultsnativemodule: 491e2541856e3580dae7f29d80754673a2134e48
React-domnativemodule: 4aaed5d5eef3da7d7d49b1f2ae8f422a4d7794b7
React-Fabric: 5b8373d1bd34bf269b13529a0ebee0643165ccf8
React-FabricComponents: 3f8528c3ed060464a120e161ffaef9307a88817b
React-FabricImage: 8efa4e206b1e5cf2e8e1e48fd345619c5c0484f4
React-featureflags: 4503c901bf16b267b689e8a1aed24e951e0b091b
React-featureflagsnativemodule: 79c980bfc96bcdcc9bd793d49fe75bbfb0e417ad
React-graphics: c2febdc940fb3ebdaef082d940b70254ef49c7a1
React-hermes: 91baa15c07e76b0768d6e10f4dac1c080a47eef4
React-idlecallbacksnativemodule: 5daef402290b91e54a884101b032186c03fa1827
React-ImageManager: b258354a48a92168edc41fdc0c14a4310cc4d576
React-jserrorhandler: 45d858315f6474dad3912aadb3f6595004dc5f4f
React-jsi: 87fa67556d7a82125bc77930bf973717fb726d14
React-jsiexecutor: 3a92052dd96cff1cd693fa3ef8d9738b1d05372a
React-jsinspector: 05aff7dd91b0685d351cdeb8c151c9f9ec97accd
React-jsitracing: 419fa21e8543f5a938b11b5a0bfc257b00dac7a5
React-logger: 5cad0c76d056809523289e589309012215a393b5
React-Mapbuffer: a381120aea722d2244d4e4b663a10d4c3b2d4e51
React-microtasksnativemodule: d9b946675010659cddd1c7611c074216579c8ad3
react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba
react-native-mmkv: b4af3744580f08e1ffc7761103b408d313b2f772
react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187
react-native-safe-area-context: 0f16e24dc808e9f0ced17f2bdcec692b2376fb68
React-featureflagsnativemodule: 415168f5d23413fd0cc55ad98c41a3f3f135b2a7
React-graphics: c619a6e974baf9a7dbae8442944c7b7408391d46
React-hermes: 24bfc254f1ba83182d4936641898fe963af343fb
React-idlecallbacksnativemodule: 2c2e4c3f561a98c84a7a68c0d1f868b64ca5f839
React-ImageManager: ba9c89729be310413c610444a658fac505253d2c
React-jserrorhandler: bf16ea495377b22223bf93f3ef6d0711b9852613
React-jsi: ede7e8c96f997f8772871c82688cea53c1ffb148
React-jsiexecutor: fc9b287189ce800a92d5ab4e7291508eacaab451
React-jsinspector: fa5e8b22102b599c2bb2aeafebbf957a1ab836da
React-jsitracing: f38c15aeb910bafcf3ba2e24af8c92e6af4ce1d4
React-logger: f9d104eace4ce03d7d5ab96802069d9905082225
React-Mapbuffer: 23ffe602d0f5ca53b861ef8534cb8c63c4479671
React-microtasksnativemodule: 73fdf0c53b6d50d55de2d5bd9abfb8c006b043a4
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
react-native-mmkv: 21d0f6ed2d9532f2370cef81eca4ccbef7350441
react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac
react-native-safe-area-context: 458f6b948437afcb59198016b26bbd02ff9c3b47
React-nativeconfig: 67fa7a63ea288cb5b1d0dd2deaf240405fec164f
React-NativeModulesApple: 34b7a4d7441a4ee78d18109ff107c1ccf7c074a9
React-perflogger: d1149037ac466ad2141d4ae541ca16cb73b2343b
React-performancetimeline: 6b46b0a17727a3ec22ec4777d156d6b6efc4f8eb
React-NativeModulesApple: cbf1a34443e1f67b56344547f4b0af69e1c685ba
React-perflogger: f02ee21d98773121d77993b3c1a8be445840fae3
React-performancetimeline: 7021d68884291b649b4c39ecb71e0fd3a2e53a59
React-RCTActionSheet: ad84d5a0bd1ad1782f0b78b280c6f329ad79a53a
React-RCTAnimation: 64ed42bb43b33b0d861126f83048429606390903
React-RCTAppDelegate: de8150cd7e748bd7a98ffc05c88f21c668407ab4
React-RCTBlob: e74dfdbbfcd46d9d1eec3b3a0f045e655e3f7861
React-RCTFabric: bc0327e719fb12f969ac0e17485ba274b9c2c335
React-RCTImage: 1b6d8ad60f74a3cec4ee52e0ca55f1773afd03f4
React-RCTLinking: 88b2384d876346fbb16839a60c1d20830b2e95fe
React-RCTNetwork: 88aa473814e796d3a7bc6a0b51e7ae5749bdc243
React-RCTSettings: 0d73a1846aef87ef07c2026c186ea0d80602a130
React-RCTText: bfdb776f849156f895909ee999b4b5f2f9cf9a0b
React-RCTVibration: 81c8bbcc841ce5a7ae6e1bd2ec949b30e58d1fcf
React-RCTAnimation: 388460f7c124c76e337c6646738a83d6ea147095
React-RCTAppDelegate: 4661e2a44f7ce1033bf6f373f7d5368b11f5a2be
React-RCTBlob: 07cccbb74e22ce66745358799f6ab02a5bed2993
React-RCTFabric: 77ebcd07a3c1f3d4c2d2f67f69033a65d16a36a8
React-RCTImage: 8fbdae841ea1217c44f4c413bba2403134b83cd1
React-RCTLinking: c59bf8286ba2cc327b01bb524fb9c16446dc18bc
React-RCTNetwork: 2c137a0aaaed2cf4bb53aff82a2bb8c34f2fbeac
React-RCTSettings: 9fcd32c5b38af6421a3dd20cdd9ebf09df0a9a6d
React-RCTText: 5308618477fec454282809065bd121c2bd3dd5e1
React-RCTVibration: 7b2a186756b5c8e586e3e7948eed4432a93299c0
React-rendererconsistency: 65d4692825fda4d9516924b68c29d0f28da3158c
React-rendererdebug: ab3696594d3506acc22ecea4dd68ac258c529c2d
React-rendererdebug: 0b97f49d44c91862e1576961faf6bde836ed4eb3
React-rncore: 6aca111c05a48c58189a005cb10a7b52780738dc
React-RuntimeApple: 5245e8cf30e417fe3e798ed991b938679656ab8f
React-RuntimeCore: c79d23b31aded614f4afeaac53f4da37c792c362
React-RuntimeApple: aa20633298595444bf2dfbc5246889b4f475b871
React-RuntimeCore: 8ac56cc6d82a1090f1d15d48b487c9a5a1d7d915
React-runtimeexecutor: 732038d7c356ba74132f1d16253a410621d3c2c1
React-RuntimeHermes: b3b1d7fc42d74141a71ae23fedbc4e07e5a7fbd2
React-runtimescheduler: 6e804311c6c9512ffe7f4b68d012767b225c48a1
React-RuntimeHermes: a695d944686adc97f85a1b34c31840a0a39e356c
React-runtimescheduler: 00666e100e35a13f28fb2fdab22817cf62bbd6a3
React-timing: c2915214b94a62bdf77d2965c31f76bc25b362a5
React-utils: 0342746d2cf989cf5e0d1b84c98cfa152edbdf3f
ReactCodegen: ca395237650513af628c32aa1eb8fd586c771b13
ReactCommon: 81e0744ee33adfd6d586141b927024f488bc49ea
RNCClipboard: bdad452a8a44c90098dab5468152a6f72cb689be
RNScreens: 351f431ef2a042a1887d4d90e1c1024b8ae9d123
React-utils: 9f9a6a31d703b136eb1614d914c10a3c96b1e6dd
ReactCodegen: 5d7e2d2948a6629a51a59ebc99f620e2afb13ee5
ReactCommon: 04292c6f596181ebf755e7929d96d2148542b0e8
RNCClipboard: c1dd9a853d56764a04ba278f61cd2cb58a138396
RNScreens: d022507f2b6d76c73335e9e35aedcf7bb2f791b0
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 90d80701b27946c4b23461c00a7207f300a6ff71
PODFILE CHECKSUM: 3c941cec20e8dff1c7d38ce78a515b4cca0ee574
COCOAPODS: 1.16.2
COCOAPODS: 1.15.2

View File

@@ -1,13 +1,14 @@
{
"name": "chat-rn",
"version": "1.0.108",
"main": "index.js",
"private": true,
"version": "1.0.84",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"pods": "pod-install"
"test": "jest",
"pods": "bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --project-directory=ios"
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
@@ -16,11 +17,12 @@
"@op-engineering/op-sqlite": "^11.4.8",
"@react-native-clipboard/clipboard": "1.16.1",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "7.0.19",
"@react-navigation/native": "7.0.15",
"@react-navigation/native-stack": "7.2.1",
"clsx": "^2.0.0",
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",
"jazz-expo": "workspace:*",
"jazz-react-native": "workspace:*",
"jazz-tools": "workspace:*",
"react": "18.3.1",
@@ -46,13 +48,15 @@
"@react-native/typescript-config": "0.76.7",
"@rnx-kit/metro-config": "^2.0.1",
"@rnx-kit/metro-resolver-symlinks": "^0.2.1",
"@types/jest": "^29.5.13",
"@types/react": "^18.3.12",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"pod-install": "^0.3.5",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"typescript": "5.6.2"
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"

View File

@@ -19,7 +19,7 @@ import { Chat, Message } from "./schema";
export function ChatScreen({ navigation }: { navigation: any }) {
const { me, logOut } = useAccount();
const [chatId, setChatId] = useState<ID<Chat>>();
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
const loadedChat = useCoState(Chat, chatId, [{}]);
const [message, setMessage] = useState("");
const profile = useCoState(Profile, me._refs.profile?.id, {});
@@ -116,12 +116,8 @@ export function ChatScreen({ navigation }: { navigation: any }) {
!isMe ? styles.timestampOther : styles.timestampMy,
]}
>
{item?._edits?.text?.madeAt?.getHours().toString().padStart(2, "0")}
:
{item?._edits?.text?.madeAt
?.getMinutes()
.toString()
.padStart(2, "0")}
{item?._edits?.text?.madeAt?.getHours()}:
{item?._edits?.text?.madeAt?.getMinutes()}
</Text>
</View>
</View>

View File

@@ -1,208 +1,5 @@
# chat-vue
## 0.0.92
### Patch Changes
- jazz-browser@0.13.21
- jazz-tools@0.13.21
- jazz-vue@0.13.21
## 0.0.91
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-browser@0.13.20
- jazz-vue@0.13.20
## 0.0.90
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-browser@0.13.19
- jazz-vue@0.13.19
## 0.0.89
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-browser@0.13.18
- jazz-vue@0.13.18
## 0.0.88
### Patch Changes
- jazz-browser@0.13.17
- jazz-tools@0.13.17
- jazz-vue@0.13.17
## 0.0.87
### Patch Changes
- jazz-browser@0.13.16
- jazz-tools@0.13.16
- jazz-vue@0.13.16
## 0.0.86
### Patch Changes
- jazz-browser@0.13.15
- jazz-tools@0.13.15
- jazz-vue@0.13.15
## 0.0.85
### Patch Changes
- jazz-browser@0.13.14
- jazz-tools@0.13.14
- jazz-vue@0.13.14
## 0.0.84
### Patch Changes
- jazz-browser@0.13.13
- jazz-tools@0.13.13
- jazz-vue@0.13.13
## 0.0.83
### Patch Changes
- Updated dependencies [4547525]
- Updated dependencies [29e05c4]
- jazz-tools@0.13.12
- jazz-browser@0.13.12
- jazz-vue@0.13.12
## 0.0.82
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-browser@0.13.11
- jazz-vue@0.13.11
## 0.0.81
### Patch Changes
- jazz-browser@0.13.10
- jazz-tools@0.13.10
- jazz-vue@0.13.10
## 0.0.80
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-browser@0.13.9
- jazz-vue@0.13.9
## 0.0.79
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-browser@0.13.7
- jazz-vue@0.13.7
## 0.0.78
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-browser@0.13.5
- jazz-vue@0.13.5
## 0.0.77
### Patch Changes
- Updated dependencies [3129982]
- jazz-browser@0.13.4
- jazz-tools@0.13.4
- jazz-vue@0.13.4
## 0.0.76
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-browser@0.13.3
- jazz-vue@0.13.3
## 0.0.75
### Patch Changes
- jazz-browser@0.13.2
- jazz-tools@0.13.2
- jazz-vue@0.13.2
## 0.0.74
### Patch Changes
- Updated dependencies [afd1374]
- jazz-tools@0.13.0
- jazz-browser@0.13.0
- jazz-vue@0.13.0
## 0.0.73
### Patch Changes
- Updated dependencies [cc684eb]
- jazz-browser@0.12.2
- jazz-vue@0.12.2
- jazz-tools@0.12.2
## 0.0.72
### Patch Changes
- jazz-browser@0.12.1
- jazz-tools@0.12.1
- jazz-vue@0.12.1
## 0.0.71
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- Updated dependencies [4c01459]
- jazz-tools@0.12.0
- jazz-vue@0.12.0
- jazz-browser@0.12.0
## 0.0.70
### Patch Changes
- jazz-browser@0.11.8
- jazz-tools@0.11.8
- jazz-vue@0.11.8
## 0.0.69
### Patch Changes

View File

@@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./public/favicon.ico" type="image/png">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jazz Chat Vue Example</title>
<title>Vite App</title>
</head>
<body>
<div id="app"></div>

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.92",
"version": "0.0.69",
"private": true,
"type": "module",
"scripts": {
@@ -31,8 +31,8 @@
"npm-run-all2": "^6.2.3",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11",
"typescript": "~5.6.2",
"vite": "^6.0.11",
"vite-plugin-vue-devtools": "^7.4.6",
"vue-tsc": "^2.1.6"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -49,7 +49,7 @@ export default defineComponent({
},
},
setup(props) {
const chat = useCoState(Chat, props.chatId, { resolve: { $each: true } });
const chat = useCoState(Chat, props.chatId, [{}]);
const showNLastMessages = ref(30);
const displayedMessages = computed(() => {

View File

@@ -1,224 +1,5 @@
# jazz-example-chat
## 0.0.190
### Patch Changes
- Updated dependencies [7de210f]
- jazz-inspector@0.13.21
- jazz-react@0.13.21
- jazz-tools@0.13.21
## 0.0.189
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-inspector@0.13.20
- jazz-react@0.13.20
## 0.0.188
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-inspector@0.13.19
- jazz-react@0.13.19
## 0.0.187
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-inspector@0.13.18
- jazz-react@0.13.18
## 0.0.186
### Patch Changes
- jazz-inspector@0.13.17
- jazz-react@0.13.17
- jazz-tools@0.13.17
## 0.0.185
### Patch Changes
- jazz-inspector@0.13.16
- jazz-react@0.13.16
- jazz-tools@0.13.16
## 0.0.184
### Patch Changes
- jazz-inspector@0.13.15
- jazz-react@0.13.15
- jazz-tools@0.13.15
## 0.0.183
### Patch Changes
- jazz-inspector@0.13.14
- jazz-react@0.13.14
- jazz-tools@0.13.14
## 0.0.182
### Patch Changes
- jazz-inspector@0.13.13
- jazz-react@0.13.13
- jazz-tools@0.13.13
## 0.0.181
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-inspector@0.13.12
- jazz-react@0.13.12
## 0.0.180
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-inspector@0.13.11
- jazz-react@0.13.11
## 0.0.179
### Patch Changes
- jazz-inspector@0.13.10
- jazz-react@0.13.10
- jazz-tools@0.13.10
## 0.0.178
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-inspector@0.13.9
- jazz-react@0.13.9
## 0.0.177
### Patch Changes
- Updated dependencies [22b5c4f]
- Updated dependencies [31ea2ef]
- Updated dependencies [4530c4a]
- Updated dependencies [bc3d7bb]
- jazz-inspector@0.13.7
- jazz-tools@0.13.7
- jazz-react@0.13.7
## 0.0.176
### Patch Changes
- Updated dependencies [c320615]
- jazz-inspector@0.13.6
## 0.0.175
### Patch Changes
- Updated dependencies [08ae9b2]
- Updated dependencies [fe6f561]
- jazz-inspector@0.13.5
- jazz-tools@0.13.5
- jazz-react@0.13.5
## 0.0.174
### Patch Changes
- Updated dependencies [3129982]
- jazz-react@0.13.4
- jazz-tools@0.13.4
- jazz-inspector@0.13.4
## 0.0.173
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- Updated dependencies [017f6c8]
- jazz-tools@0.13.3
- jazz-inspector@0.13.3
- jazz-react@0.13.3
## 0.0.172
### Patch Changes
- Updated dependencies [ae4be2b]
- jazz-inspector@0.13.2
- jazz-react@0.13.2
- jazz-tools@0.13.2
## 0.0.171
### Patch Changes
- Updated dependencies [2796689]
- Updated dependencies [afd1374]
- Updated dependencies [2224ed4]
- jazz-inspector@0.13.0
- jazz-tools@0.13.0
- jazz-react@0.13.0
## 0.0.170
### Patch Changes
- Updated dependencies [8a71835]
- jazz-inspector@0.12.2
- jazz-react@0.12.2
- jazz-tools@0.12.2
## 0.0.169
### Patch Changes
- jazz-inspector@0.12.1
- jazz-react@0.12.1
- jazz-tools@0.12.1
## 0.0.168
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- Updated dependencies [9a56bb3]
- jazz-tools@0.12.0
- jazz-inspector@0.12.0
- jazz-react@0.12.0
## 0.0.167
### Patch Changes
- Updated dependencies [71b9390]
- jazz-inspector@0.11.8
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.166
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.190",
"version": "0.0.166",
"type": "module",
"scripts": {
"dev": "vite",
@@ -31,7 +31,7 @@
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11"
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -16,8 +16,8 @@ import {
} from "./ui.tsx";
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID, { resolve: { $each: true } });
const account = useAccount();
const chat = useCoState(Chat, props.chatID, [{}]);
const [showNLastMessages, setShowNLastMessages] = useState(30);
if (!chat)

View File

@@ -36,7 +36,7 @@ const config: Config = {
blue: {
...colors.indigo,
500: "#5870F1",
DEFAULT: "#146AFF",
DEFAULT: "#3313F7",
},
},
container: {
@@ -56,6 +56,18 @@ const config: Config = {
plugins: [
plugin(({ addBase }) =>
addBase({
":root": {
"--gcmp-border-color": stonePalette[200],
"--gcmp-invert-border-color": stonePalette[900],
},
"*": {
borderColor: "var(--gcmp-border-color)",
},
"@media (prefers-color-scheme: dark)": {
"*": {
borderColor: "var(--gcmp-invert-border-color)",
},
},
"*:focus": {
outline: "none",
},

View File

@@ -22,5 +22,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?
playwright-report

View File

@@ -1,212 +1,5 @@
# minimal-auth-clerk
## 0.0.89
### Patch Changes
- jazz-react@0.13.21
- jazz-react-auth-clerk@0.13.21
- jazz-tools@0.13.21
## 0.0.88
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-react@0.13.20
- jazz-react-auth-clerk@0.13.20
## 0.0.87
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-react@0.13.19
- jazz-react-auth-clerk@0.13.19
## 0.0.86
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-react@0.13.18
- jazz-react-auth-clerk@0.13.18
## 0.0.85
### Patch Changes
- jazz-react@0.13.17
- jazz-react-auth-clerk@0.13.17
- jazz-tools@0.13.17
## 0.0.84
### Patch Changes
- jazz-react@0.13.16
- jazz-react-auth-clerk@0.13.16
- jazz-tools@0.13.16
## 0.0.83
### Patch Changes
- jazz-react@0.13.15
- jazz-react-auth-clerk@0.13.15
- jazz-tools@0.13.15
## 0.0.82
### Patch Changes
- jazz-react@0.13.14
- jazz-react-auth-clerk@0.13.14
- jazz-tools@0.13.14
## 0.0.81
### Patch Changes
- jazz-react@0.13.13
- jazz-react-auth-clerk@0.13.13
- jazz-tools@0.13.13
## 0.0.80
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-react@0.13.12
- jazz-react-auth-clerk@0.13.12
## 0.0.79
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-react@0.13.11
- jazz-react-auth-clerk@0.13.11
## 0.0.78
### Patch Changes
- jazz-react@0.13.10
- jazz-react-auth-clerk@0.13.10
- jazz-tools@0.13.10
## 0.0.77
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-react@0.13.9
- jazz-react-auth-clerk@0.13.9
## 0.0.76
### Patch Changes
- jazz-react-auth-clerk@0.13.8
## 0.0.75
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-react@0.13.7
- jazz-react-auth-clerk@0.13.7
## 0.0.74
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-react@0.13.5
- jazz-react-auth-clerk@0.13.5
## 0.0.73
### Patch Changes
- Updated dependencies [3129982]
- Updated dependencies [3129982]
- jazz-react-auth-clerk@0.13.4
- jazz-react@0.13.4
- jazz-tools@0.13.4
## 0.0.72
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-react@0.13.3
- jazz-react-auth-clerk@0.13.3
## 0.0.71
### Patch Changes
- jazz-react@0.13.2
- jazz-react-auth-clerk@0.13.2
- jazz-tools@0.13.2
## 0.0.70
### Patch Changes
- Updated dependencies [afd1374]
- jazz-tools@0.13.0
- jazz-react@0.13.0
- jazz-react-auth-clerk@0.13.0
## 0.0.69
### Patch Changes
- jazz-react@0.12.2
- jazz-react-auth-clerk@0.12.2
- jazz-tools@0.12.2
## 0.0.68
### Patch Changes
- jazz-react@0.12.1
- jazz-react-auth-clerk@0.12.1
- jazz-tools@0.12.1
## 0.0.67
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react@0.12.0
- jazz-react-auth-clerk@0.12.0
## 0.0.66
### Patch Changes
- jazz-react@0.11.8
- jazz-react-auth-clerk@0.11.8
- jazz-tools@0.11.8
## 0.0.65
### Patch Changes

View File

@@ -1,33 +1,30 @@
{
"name": "clerk",
"private": true,
"version": "0.0.89",
"version": "0.0.65",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui"
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.11.7",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@biomejs/biome": "1.9.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",
"vite": "6.0.11"
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

View File

@@ -1,53 +0,0 @@
import { defineConfig, devices } from "@playwright/test";
import isCI from "is-ci";
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// dotenv.config({ path: path.resolve(__dirname, '.env') });
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: isCI,
/* Retry on CI only */
retries: isCI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: isCI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
/* Run your local dev server before starting the tests */
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -1,8 +1,8 @@
import { SignInButton, SignOutButton } from "@clerk/clerk-react";
import { SignInButton } from "@clerk/clerk-react";
import { useAccount, useIsAuthenticated } from "jazz-react";
function App() {
const { me } = useAccount();
const { me, logOut } = useAccount();
const isAuthenticated = useIsAuthenticated();
@@ -11,7 +11,7 @@ function App() {
<div className="container">
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<SignOutButton>Logout</SignOutButton>
<button onClick={() => logOut()}>Logout</button>
</div>
);
}

View File

@@ -1,4 +1,4 @@
import { ClerkProvider, SignOutButton, useClerk } from "@clerk/clerk-react";
import { ClerkProvider, useClerk } from "@clerk/clerk-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
@@ -28,23 +28,12 @@ function JazzProvider({ children }: { children: React.ReactNode }) {
);
}
// Route to test that when the Clerk user expires, the app is logged out
if (location.search.includes("expirationTest")) {
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<SignOutButton>Simulate expiration</SignOutButton>
</ClerkProvider>
</StrictMode>,
);
} else {
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<JazzProvider>
<App />
</JazzProvider>
</ClerkProvider>
</StrictMode>,
);
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider publishableKey={PUBLISHABLE_KEY} afterSignOutUrl="/">
<JazzProvider>
<App />
</JazzProvider>
</ClerkProvider>
</StrictMode>,
);

View File

@@ -1,36 +0,0 @@
import { expect, test } from "@playwright/test";
test("login & expiration", async ({ page }) => {
await page.goto("/");
expect(page.getByText("You're not logged in")).toBeVisible();
await page.getByRole("button", { name: "Sign in" }).click();
await page
.getByRole("textbox", { name: "Email address" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page
.getByRole("textbox", { name: "Password" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page.waitForURL("/");
await page.getByText("You're logged in").waitFor({ state: "visible" });
expect(page.getByText("You're logged in")).toBeVisible();
await page.goto("/?expirationTest");
// Simulate expiration by logging out outside of Jazz
await page.getByRole("button", { name: "Simulate expiration" }).click();
await page.goto("/");
await page.getByText("You're not logged in").waitFor({ state: "visible" });
});

View File

@@ -1,33 +0,0 @@
import { expect, test } from "@playwright/test";
test("login & logout", async ({ page }) => {
await page.goto("/");
expect(page.getByText("You're not logged in")).toBeVisible();
await page.getByRole("button", { name: "Sign in" }).click();
await page
.getByRole("textbox", { name: "Email address" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page
.getByRole("textbox", { name: "Password" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page.waitForURL("/");
await page.getByText("You're logged in").waitFor({ state: "visible" });
expect(page.getByText("You're logged in")).toBeVisible();
await page.getByRole("button", { name: "Logout" }).click();
await page.getByText("You're not logged in").waitFor({ state: "visible" });
expect(page.getByText("You're not logged in")).toBeVisible();
});

View File

@@ -1,33 +0,0 @@
import { expect, test } from "@playwright/test";
test("login & reload", async ({ page }) => {
await page.goto("/");
expect(page.getByText("You're not logged in")).toBeVisible();
await page.getByRole("button", { name: "Sign in" }).click();
await page
.getByRole("textbox", { name: "Email address" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page
.getByRole("textbox", { name: "Password" })
.fill("guido+clerk-test@garden.co");
await page.keyboard.press("Enter");
await page.waitForURL("/");
await page.getByText("You're logged in").waitFor({ state: "visible" });
expect(page.getByText("You're logged in")).toBeVisible();
await page.reload();
await page.getByText("You're logged in").waitFor({ state: "visible" });
expect(page.getByText("You're logged in")).toBeVisible();
});

View File

@@ -1,183 +1,5 @@
# file-share-svelte
## 0.0.72
### Patch Changes
- jazz-inspector-element@0.13.21
- jazz-svelte@0.13.21
- jazz-tools@0.13.21
## 0.0.71
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-svelte@0.13.20
## 0.0.70
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-svelte@0.13.19
## 0.0.69
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-svelte@0.13.18
## 0.0.68
### Patch Changes
- jazz-svelte@0.13.17
- jazz-tools@0.13.17
## 0.0.67
### Patch Changes
- jazz-svelte@0.13.16
- jazz-tools@0.13.16
## 0.0.66
### Patch Changes
- jazz-svelte@0.13.15
- jazz-tools@0.13.15
## 0.0.65
### Patch Changes
- jazz-svelte@0.13.14
- jazz-tools@0.13.14
## 0.0.64
### Patch Changes
- jazz-svelte@0.13.13
- jazz-tools@0.13.13
## 0.0.63
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-svelte@0.13.12
## 0.0.62
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-svelte@0.13.11
## 0.0.61
### Patch Changes
- jazz-svelte@0.13.10
- jazz-tools@0.13.10
## 0.0.60
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-svelte@0.13.9
## 0.0.59
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-svelte@0.13.7
## 0.0.58
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-svelte@0.13.5
## 0.0.57
### Patch Changes
- Updated dependencies [3129982]
- jazz-tools@0.13.4
- jazz-svelte@0.13.4
## 0.0.56
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-svelte@0.13.3
## 0.0.55
### Patch Changes
- jazz-svelte@0.13.2
- jazz-tools@0.13.2
## 0.0.54
### Patch Changes
- Updated dependencies [afd1374]
- jazz-tools@0.13.0
- jazz-svelte@0.13.0
## 0.0.53
### Patch Changes
- jazz-svelte@0.12.2
- jazz-tools@0.12.2
## 0.0.52
### Patch Changes
- jazz-svelte@0.12.1
- jazz-tools@0.12.1
## 0.0.51
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-svelte@0.12.0
## 0.0.50
### Patch Changes
- jazz-svelte@0.11.8
- jazz-tools@0.11.8
## 0.0.49
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.72",
"version": "0.0.49",
"private": true,
"type": "module",
"scripts": {
@@ -33,13 +33,12 @@
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"typescript": "~5.6.2",
"typescript-eslint": "^8.0.0",
"vite": "6.0.11"
"vite": "^6.0.11"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.15",
"jazz-inspector-element": "workspace:*",
"jazz-svelte": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-svelte": "^0.463.0",

View File

@@ -30,7 +30,7 @@
const fileId = file._refs.file.id;
// Load the file as a blob, can take a while
const blob = await FileStream.loadAsBlob(fileId);
const blob = await FileStream.loadAsBlob(fileId, me, {});
if (!blob) {
toast.error('Failed to download file');
return;

View File

@@ -8,8 +8,7 @@
<script lang="ts">
import { JazzProvider } from 'jazz-svelte';
import "jazz-inspector-element"
import { PasskeyAuthBasicUI } from 'jazz-svelte';
import { PasskeyAuthBasicUI, usePasskeyAuth } from 'jazz-svelte';
import { Toaster } from 'svelte-sonner';
import '../app.css';
import { FileShareAccount } from '$lib/schema';
@@ -30,7 +29,6 @@
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
>
<jazz-inspector></jazz-inspector>
<PasskeyAuthBasicUI appName="File Share">
<div class="min-h-screen bg-gray-100">
{@render children()}

View File

@@ -1,26 +1,48 @@
<script lang="ts">
import { useAccount, useCoState } from 'jazz-svelte';
import { SharedFile, ListOfSharedFiles } from '$lib/schema';
import { createInviteLink } from 'jazz-svelte';
import { FileStream } from 'jazz-tools';
import FileItem from '$lib/components/FileItem.svelte';
import { SvelteMap } from 'svelte/reactivity';
import { generateTempFileId } from '$lib/utils';
import { CloudUpload } from 'lucide-svelte';
const { me, logOut } = useAccount();
const mySharedFilesId = me?.root?._refs.sharedFiles.id;
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId));
const sharedFiles = $derived(useCoState(ListOfSharedFiles, mySharedFilesId, [{}]));
let fileInput: HTMLInputElement;
type PendingSharedFile = {
name: string;
id: string;
createdAt: Date;
};
// Track files that are currently uploading
const uploadingFiles = new SvelteMap<string, PendingSharedFile>();
async function handleFileUpload(event: Event) {
const input = event.target as HTMLInputElement;
const files = input.files;
if (!files || !files.length || !me?.root?.sharedFiles || !me?.root?.publicGroup) return;
if (!files || !files.length || !me.root?.sharedFiles || !me.root.publicGroup) return;
const file = files[0];
const fileName = file.name;
const createdAt = new Date();
const fileId = generateTempFileId(fileName, createdAt);
const tempFile: PendingSharedFile = {
name: fileName,
id: fileId,
createdAt
};
// Add to uploading files
uploadingFiles.set(fileId, tempFile);
try {
const ownership = { owner: me.root.publicGroup };
@@ -43,10 +65,17 @@
// Add the file to the user's files list
me.root.sharedFiles.push(sharedFile);
} finally {
uploadingFiles.delete(fileId);
fileInput.value = ''; // reset input
}
}
async function shareFile(file: SharedFile) {
const inviteLink = createInviteLink(file, 'reader');
await navigator.clipboard.writeText(inviteLink);
alert('Share link copied to clipboard!');
}
async function deleteFile(file: SharedFile) {
if (!me?.root?.sharedFiles || !sharedFiles.current) return;
@@ -98,11 +127,13 @@
<!-- Files List -->
<div class="space-y-4">
{#if sharedFiles.current}
{#if !(sharedFiles.current.length === 0)}
{#each sharedFiles.current as file}
{#if !(sharedFiles.current.length === 0 && uploadingFiles.size === 0)}
{#each [...sharedFiles.current, ...uploadingFiles.values()] as file (generateTempFileId(file?.name, file?.createdAt))}
{#if file}
<FileItem
{file}
loading={uploadingFiles.has(generateTempFileId(file?.name, file?.createdAt))}
onShare={shareFile}
onDelete={deleteFile}
/>
{/if}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -1,217 +1,5 @@
# jazz-tailwind-demo-auth-starter
## 0.0.29
### Patch Changes
- Updated dependencies [7de210f]
- jazz-inspector@0.13.21
- jazz-react@0.13.21
- jazz-tools@0.13.21
## 0.0.28
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-inspector@0.13.20
- jazz-react@0.13.20
## 0.0.27
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-inspector@0.13.19
- jazz-react@0.13.19
## 0.0.26
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-inspector@0.13.18
- jazz-react@0.13.18
## 0.0.25
### Patch Changes
- jazz-inspector@0.13.17
- jazz-react@0.13.17
- jazz-tools@0.13.17
## 0.0.24
### Patch Changes
- jazz-inspector@0.13.16
- jazz-react@0.13.16
- jazz-tools@0.13.16
## 0.0.23
### Patch Changes
- jazz-inspector@0.13.15
- jazz-react@0.13.15
- jazz-tools@0.13.15
## 0.0.22
### Patch Changes
- jazz-inspector@0.13.14
- jazz-react@0.13.14
- jazz-tools@0.13.14
## 0.0.21
### Patch Changes
- jazz-inspector@0.13.13
- jazz-react@0.13.13
- jazz-tools@0.13.13
## 0.0.20
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-inspector@0.13.12
- jazz-react@0.13.12
## 0.0.19
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-inspector@0.13.11
- jazz-react@0.13.11
## 0.0.18
### Patch Changes
- jazz-inspector@0.13.10
- jazz-react@0.13.10
- jazz-tools@0.13.10
## 0.0.17
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-inspector@0.13.9
- jazz-react@0.13.9
## 0.0.16
### Patch Changes
- Updated dependencies [22b5c4f]
- Updated dependencies [31ea2ef]
- Updated dependencies [4530c4a]
- Updated dependencies [bc3d7bb]
- jazz-inspector@0.13.7
- jazz-tools@0.13.7
- jazz-react@0.13.7
## 0.0.15
### Patch Changes
- Updated dependencies [c320615]
- jazz-inspector@0.13.6
## 0.0.14
### Patch Changes
- Updated dependencies [08ae9b2]
- Updated dependencies [fe6f561]
- jazz-inspector@0.13.5
- jazz-tools@0.13.5
- jazz-react@0.13.5
## 0.0.13
### Patch Changes
- Updated dependencies [3129982]
- jazz-react@0.13.4
- jazz-tools@0.13.4
- jazz-inspector@0.13.4
## 0.0.12
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- Updated dependencies [017f6c8]
- jazz-tools@0.13.3
- jazz-inspector@0.13.3
- jazz-react@0.13.3
## 0.0.11
### Patch Changes
- Updated dependencies [ae4be2b]
- jazz-inspector@0.13.2
- jazz-react@0.13.2
- jazz-tools@0.13.2
## 0.0.10
### Patch Changes
- Updated dependencies [2796689]
- Updated dependencies [afd1374]
- Updated dependencies [2224ed4]
- jazz-inspector@0.13.0
- jazz-tools@0.13.0
- jazz-react@0.13.0
## 0.0.9
### Patch Changes
- jazz-react@0.12.2
- jazz-tools@0.12.2
## 0.0.8
### Patch Changes
- jazz-react@0.12.1
- jazz-tools@0.12.1
## 0.0.7
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react@0.12.0
## 0.0.6
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.5
### Patch Changes

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -2,7 +2,7 @@
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="./public/favicon.ico" />
<link rel="icon" type="image/png" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz | React + Demo Auth + Tailwind</title>
</head>

View File

@@ -1,7 +1,7 @@
{
"name": "filestream",
"private": true,
"version": "0.0.29",
"version": "0.0.5",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,6 @@
"dependencies": {
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"jazz-inspector": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
@@ -27,7 +26,7 @@
"is-ci": "^3.0.1",
"postcss": "^8.5.3",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11"
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -208,10 +208,6 @@ export function FileWidget() {
<span className="font-bold">Size</span>
<span>{formatFileSize(fileData?.totalSizeBytes)}</span>
</div>
<div className="flex justify-between">
<span className="font-bold">CoValue ID</span>
<span>{me.profile.file.id}</span>
</div>
</div>
</div>

View File

@@ -14,7 +14,7 @@ export function Logo() {
fillRule="evenodd"
clipRule="evenodd"
d="M136.179 44.8277C136.179 44.8277 136.179 44.8277 136.179 44.8276V21.168C117.931 28.5527 97.9854 32.6192 77.0897 32.6192C65.1466 32.6192 53.5138 31.2908 42.331 28.7737V51.4076C42.331 51.4076 42.331 51.4076 42.331 51.4076V81.1508C41.2955 80.4385 40.1568 79.8458 38.9405 79.3915C36.1732 78.358 33.128 78.0876 30.1902 78.6145C27.2524 79.1414 24.5539 80.4419 22.4358 82.3516C20.3178 84.2613 18.8754 86.6944 18.291 89.3433C17.7066 91.9921 18.0066 94.7377 19.1528 97.2329C20.2991 99.728 22.2403 101.861 24.7308 103.361C27.2214 104.862 30.1495 105.662 33.1448 105.662H33.1455C33.6061 105.662 33.8365 105.662 34.0314 105.659C44.5583 105.449 53.042 96.9656 53.2513 86.4386C53.2534 86.3306 53.2544 86.2116 53.2548 86.0486H53.2552V85.7149L53.2552 85.5521V82.0762L53.2552 53.1993C61.0533 54.2324 69.0092 54.7656 77.0897 54.7656C77.6696 54.7656 78.2489 54.7629 78.8276 54.7574V110.696C77.792 109.983 76.6533 109.391 75.437 108.936C72.6697 107.903 69.6246 107.632 66.6867 108.159C63.7489 108.686 61.0504 109.987 58.9323 111.896C56.8143 113.806 55.3719 116.239 54.7875 118.888C54.2032 121.537 54.5031 124.283 55.6494 126.778C56.7956 129.273 58.7368 131.405 61.2273 132.906C63.7179 134.406 66.646 135.207 69.6414 135.207C70.1024 135.207 70.3329 135.207 70.5279 135.203C81.0548 134.994 89.5385 126.51 89.7478 115.983C89.7517 115.788 89.7517 115.558 89.7517 115.097V111.621L89.7517 54.3266C101.962 53.4768 113.837 51.4075 125.255 48.2397V80.9017C124.219 80.1894 123.081 79.5966 121.864 79.1424C119.097 78.1089 116.052 77.8384 113.114 78.3653C110.176 78.8922 107.478 80.1927 105.36 82.1025C103.242 84.0122 101.799 86.4453 101.215 89.0941C100.631 91.743 100.931 94.4886 102.077 96.9837C103.223 99.4789 105.164 101.612 107.655 103.112C110.145 104.612 113.073 105.413 116.069 105.413C116.53 105.413 116.76 105.413 116.955 105.409C127.482 105.2 135.966 96.7164 136.175 86.1895C136.179 85.9945 136.179 85.764 136.179 85.3029V81.8271L136.179 44.8277Z"
fill="#146AFF"
fill="#3313F7"
/>
</svg>
);

View File

@@ -1,4 +1,3 @@
import { JazzInspector } from "jazz-inspector";
import { JazzProvider } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
@@ -24,7 +23,6 @@ createRoot(document.getElementById("root")!).render(
}}
AccountSchema={JazzAccount}
>
<JazzInspector />
<App />
</JazzProvider>
</StrictMode>,

View File

@@ -1,182 +1,5 @@
# form
## 0.1.30
### Patch Changes
- jazz-react@0.13.21
- jazz-tools@0.13.21
## 0.1.29
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-react@0.13.20
## 0.1.28
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-react@0.13.19
## 0.1.27
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-react@0.13.18
## 0.1.26
### Patch Changes
- jazz-react@0.13.17
- jazz-tools@0.13.17
## 0.1.25
### Patch Changes
- jazz-react@0.13.16
- jazz-tools@0.13.16
## 0.1.24
### Patch Changes
- jazz-react@0.13.15
- jazz-tools@0.13.15
## 0.1.23
### Patch Changes
- jazz-react@0.13.14
- jazz-tools@0.13.14
## 0.1.22
### Patch Changes
- jazz-react@0.13.13
- jazz-tools@0.13.13
## 0.1.21
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-react@0.13.12
## 0.1.20
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-react@0.13.11
## 0.1.19
### Patch Changes
- jazz-react@0.13.10
- jazz-tools@0.13.10
## 0.1.18
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-react@0.13.9
## 0.1.17
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-react@0.13.7
## 0.1.16
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-react@0.13.5
## 0.1.15
### Patch Changes
- Updated dependencies [3129982]
- jazz-react@0.13.4
- jazz-tools@0.13.4
## 0.1.14
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-react@0.13.3
## 0.1.13
### Patch Changes
- jazz-react@0.13.2
- jazz-tools@0.13.2
## 0.1.12
### Patch Changes
- Updated dependencies [afd1374]
- jazz-tools@0.13.0
- jazz-react@0.13.0
## 0.1.11
### Patch Changes
- jazz-react@0.12.2
- jazz-tools@0.12.2
## 0.1.10
### Patch Changes
- jazz-react@0.12.1
- jazz-tools@0.12.1
## 0.1.9
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react@0.12.0
## 0.1.8
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.1.7
### Patch Changes

View File

@@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz | Form example</title>
<link rel="icon" type="image/png" href="./public/favicon.ico">
</head>
<body class="h-full flex flex-col bg-white text-stone-700 dark:text-stone-400 dark:bg-stone-925">
<div id="root" class="align-self-center flex-1"></div>

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.30",
"version": "0.1.7",
"type": "module",
"scripts": {
"dev": "vite",
@@ -29,7 +29,7 @@
"is-ci": "^3.0.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11"
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -12,9 +12,7 @@ import {
} from "./schema.ts";
export function CreateOrder() {
const { me } = useAccount({
resolve: { root: { draft: true, orders: true } },
});
const { me } = useAccount({ root: { draft: {}, orders: [] } });
const router = useIframeHashRouter();
const [errors, setErrors] = useState<string[]>([]);
@@ -62,7 +60,7 @@ function CreateOrderForm({
onSave: (draft: DraftBubbleTeaOrder) => void;
}) {
const draft = useCoState(DraftBubbleTeaOrder, id, {
resolve: { addOns: true },
addOns: [],
});
if (!draft) return;

View File

@@ -2,7 +2,7 @@ import { useAccount } from "jazz-react";
export function DraftIndicator() {
const { me } = useAccount({
resolve: { root: { draft: true } },
root: { draft: {} },
});
if (me?.root.draft?.hasChanges) {

View File

@@ -6,7 +6,7 @@ import { OrderThumbnail } from "./OrderThumbnail.tsx";
import { BubbleTeaOrder } from "./schema.ts";
export function EditOrder(props: { id: ID<BubbleTeaOrder> }) {
const order = useCoState(BubbleTeaOrder, props.id);
const order = useCoState(BubbleTeaOrder, props.id, []);
if (!order) return;

View File

@@ -4,7 +4,7 @@ import { OrderThumbnail } from "./OrderThumbnail.tsx";
export function Orders() {
const { me } = useAccount({
resolve: { root: { orders: true } },
root: { orders: [] },
});
return (
@@ -12,14 +12,14 @@ export function Orders() {
<section className="space-y-5">
<a
href={`/#/order`}
className="block relative p-3 bg-white border border-stone-200 text-center rounded-md dark:bg-stone-900 dark:border-stone-900"
className="block relative p-3 bg-white border text-center rounded-md dark:bg-stone-900"
>
<strong>Add new order</strong>
<DraftIndicator />
</a>
<div className="space-y-3">
<h1 className="text-lg pb-2 border-b mb-3 border-stone-200 dark:border-stone-700">
<h1 className="text-lg pb-2 border-b mb-3">
<strong>Your orders 🧋</strong>
</h1>

View File

@@ -2,14 +2,6 @@
@tailwind components;
@tailwind utilities;
:root {
--border-default: theme("colors.stone.200");
}
.dark {
--border-default: theme("colors.stone.900");
}
@layer components {
strong {
@apply font-semibold text-stone-900 dark:text-white;

View File

@@ -34,9 +34,6 @@ const config: Config = {
colors: {
stone: stonePaletteWithAlpha,
},
borderColor: {
default: "var(--border-default)",
},
container: {
center: true,
padding: {
@@ -55,6 +52,18 @@ const config: Config = {
formsPlugin,
plugin(({ addBase }) =>
addBase({
":root": {
"--gcmp-border-color": stonePalette[200],
"--gcmp-invert-border-color": stonePalette[900],
},
"*": {
borderColor: "var(--gcmp-border-color)",
},
"@media (prefers-color-scheme: dark)": {
"*": {
borderColor: "var(--gcmp-invert-border-color)",
},
},
"*:focus": {
outline: "none",
},

View File

@@ -1,182 +1,5 @@
# image-upload
## 0.0.86
### Patch Changes
- jazz-react@0.13.21
- jazz-tools@0.13.21
## 0.0.85
### Patch Changes
- Updated dependencies [439f0fe]
- jazz-tools@0.13.20
- jazz-react@0.13.20
## 0.0.84
### Patch Changes
- Updated dependencies [80530a4]
- jazz-tools@0.13.19
- jazz-react@0.13.19
## 0.0.83
### Patch Changes
- Updated dependencies [761759c]
- jazz-tools@0.13.18
- jazz-react@0.13.18
## 0.0.82
### Patch Changes
- jazz-react@0.13.17
- jazz-tools@0.13.17
## 0.0.81
### Patch Changes
- jazz-react@0.13.16
- jazz-tools@0.13.16
## 0.0.80
### Patch Changes
- jazz-react@0.13.15
- jazz-tools@0.13.15
## 0.0.79
### Patch Changes
- jazz-react@0.13.14
- jazz-tools@0.13.14
## 0.0.78
### Patch Changes
- jazz-react@0.13.13
- jazz-tools@0.13.13
## 0.0.77
### Patch Changes
- Updated dependencies [4547525]
- jazz-tools@0.13.12
- jazz-react@0.13.12
## 0.0.76
### Patch Changes
- Updated dependencies [17273a6]
- jazz-tools@0.13.11
- jazz-react@0.13.11
## 0.0.75
### Patch Changes
- jazz-react@0.13.10
- jazz-tools@0.13.10
## 0.0.74
### Patch Changes
- Updated dependencies [a6cf01f]
- jazz-tools@0.13.9
- jazz-react@0.13.9
## 0.0.73
### Patch Changes
- Updated dependencies [bc3d7bb]
- jazz-tools@0.13.7
- jazz-react@0.13.7
## 0.0.72
### Patch Changes
- Updated dependencies [fe6f561]
- jazz-tools@0.13.5
- jazz-react@0.13.5
## 0.0.71
### Patch Changes
- Updated dependencies [3129982]
- jazz-react@0.13.4
- jazz-tools@0.13.4
## 0.0.70
### Patch Changes
- Updated dependencies [12f8bfa]
- Updated dependencies [bd57177]
- jazz-tools@0.13.3
- jazz-react@0.13.3
## 0.0.69
### Patch Changes
- jazz-react@0.13.2
- jazz-tools@0.13.2
## 0.0.68
### Patch Changes
- Updated dependencies [afd1374]
- jazz-tools@0.13.0
- jazz-react@0.13.0
## 0.0.67
### Patch Changes
- jazz-react@0.12.2
- jazz-tools@0.12.2
## 0.0.66
### Patch Changes
- jazz-react@0.12.1
- jazz-tools@0.12.1
## 0.0.65
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [4ea87dc]
- Updated dependencies [1e6da19]
- Updated dependencies [b6c6a0a]
- jazz-tools@0.12.0
- jazz-react@0.12.0
## 0.0.64
### Patch Changes
- jazz-react@0.11.8
- jazz-tools@0.11.8
## 0.0.63
### Patch Changes

View File

@@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz | Image upload example</title>
<link rel="icon" href="./public/favicon.ico" type="image/png">
</head>
<body>
<div id="root"></div>

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.86",
"version": "0.0.63",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,8 +22,8 @@
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"globals": "^15.11.0",
"typescript": "5.6.2",
"vite": "6.0.11",
"typescript": "~5.6.2",
"vite": "^6.0.11",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,240 +1,5 @@
# jazz-example-inspector
## 0.0.140
### Patch Changes
- Updated dependencies [7de210f]
- Updated dependencies [e14e61f]
- jazz-inspector@0.13.21
- cojson@0.13.21
- cojson-transport-ws@0.13.21
## 0.0.139
### Patch Changes
- Updated dependencies [adfc9a6]
- Updated dependencies [1389207]
- Updated dependencies [d6e143e]
- Updated dependencies [3e6229d]
- cojson@0.13.20
- cojson-transport-ws@0.13.20
- jazz-inspector@0.13.20
## 0.0.138
### Patch Changes
- jazz-inspector@0.13.19
## 0.0.137
### Patch Changes
- Updated dependencies [9089252]
- Updated dependencies [b470f63]
- Updated dependencies [66373ba]
- Updated dependencies [f24cad1]
- cojson@0.13.18
- cojson-transport-ws@0.13.18
- jazz-inspector@0.13.18
## 0.0.136
### Patch Changes
- Updated dependencies [9fb98e2]
- Updated dependencies [0b89fad]
- cojson@0.13.17
- cojson-transport-ws@0.13.17
- jazz-inspector@0.13.17
## 0.0.135
### Patch Changes
- Updated dependencies [c6fb8dc]
- cojson@0.13.16
- cojson-transport-ws@0.13.16
- jazz-inspector@0.13.16
## 0.0.134
### Patch Changes
- Updated dependencies [c712ef2]
- cojson@0.13.15
- cojson-transport-ws@0.13.15
- jazz-inspector@0.13.15
## 0.0.133
### Patch Changes
- Updated dependencies [5c2c7d4]
- cojson@0.13.14
- cojson-transport-ws@0.13.14
- jazz-inspector@0.13.14
## 0.0.132
### Patch Changes
- Updated dependencies [ec9cb40]
- cojson@0.13.13
- cojson-transport-ws@0.13.13
- jazz-inspector@0.13.13
## 0.0.131
### Patch Changes
- Updated dependencies [65719f2]
- cojson@0.13.12
- jazz-inspector@0.13.12
- cojson-transport-ws@0.13.12
## 0.0.130
### Patch Changes
- Updated dependencies [17273a6]
- Updated dependencies [3396ed4]
- Updated dependencies [267ea4c]
- cojson@0.13.11
- cojson-transport-ws@0.13.11
- jazz-inspector@0.13.11
## 0.0.129
### Patch Changes
- Updated dependencies [f837cfe]
- cojson@0.13.10
- cojson-transport-ws@0.13.10
- jazz-inspector@0.13.10
## 0.0.128
### Patch Changes
- jazz-inspector@0.13.9
## 0.0.127
### Patch Changes
- 4530c4a: improve preview of Account types
- Updated dependencies [22b5c4f]
- Updated dependencies [31ea2ef]
- Updated dependencies [4530c4a]
- Updated dependencies [bc3d7bb]
- Updated dependencies [4e9aae1]
- Updated dependencies [21c935c]
- Updated dependencies [aa1c80e]
- Updated dependencies [13074be]
- jazz-inspector@0.13.7
- cojson@0.13.7
- cojson-transport-ws@0.13.7
## 0.0.126
### Patch Changes
- Updated dependencies [c320615]
- jazz-inspector@0.13.6
## 0.0.125
### Patch Changes
- Updated dependencies [08ae9b2]
- Updated dependencies [e090b39]
- jazz-inspector@0.13.5
- cojson@0.13.5
- cojson-transport-ws@0.13.5
## 0.0.124
### Patch Changes
- jazz-inspector@0.13.4
## 0.0.123
### Patch Changes
- Updated dependencies [b19cab7]
- Updated dependencies [017f6c8]
- cojson-transport-ws@0.13.3
- jazz-inspector@0.13.3
## 0.0.122
### Patch Changes
- Updated dependencies [ae4be2b]
- Updated dependencies [c551839]
- jazz-inspector@0.13.2
- cojson@0.13.2
- cojson-transport-ws@0.13.2
## 0.0.121
### Patch Changes
- 2796689: various fixes and css refactoring
- Updated dependencies [a013538]
- Updated dependencies [2796689]
- Updated dependencies [2224ed4]
- Updated dependencies [bce3bcc]
- cojson@0.13.0
- jazz-inspector@0.13.0
- cojson-transport-ws@0.13.0
## 0.0.120
### Patch Changes
- 8a71835: use goober for css
- Updated dependencies [8a71835]
- Updated dependencies [c2f4827]
- jazz-inspector@0.12.2
- cojson@0.12.2
- cojson-transport-ws@0.12.2
## 0.0.119
### Patch Changes
- Updated dependencies [5a00fe0]
- cojson@0.12.1
- cojson-transport-ws@0.12.1
- jazz-inspector@0.12.1
## 0.0.118
### Patch Changes
- Updated dependencies [01523dc]
- Updated dependencies [01523dc]
- Updated dependencies [9a56bb3]
- cojson@0.12.0
- jazz-inspector@0.12.0
- cojson-transport-ws@0.12.0
## 0.0.117
### Patch Changes
- Updated dependencies [71b9390]
- Updated dependencies [6c86c4f]
- Updated dependencies [9d0c9dc]
- jazz-inspector@0.11.8
- cojson@0.11.8
- cojson-transport-ws@0.11.8
## 0.0.116
### Patch Changes

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.140",
"version": "0.0.116",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,9 +13,9 @@
"dependencies": {
"jazz-inspector": "workspace:*",
"clsx": "^2.0.0",
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",
"hash-slash": "workspace:*",
"cojson": "workspace:0.11.7",
"cojson-transport-ws": "workspace:0.11.7",
"hash-slash": "workspace:0.2.2",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -30,7 +30,7 @@
"autoprefixer": "^10.4.20",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "5.6.2",
"vite": "6.0.11"
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -12,13 +12,12 @@ import { WasmCrypto } from "cojson/crypto/WasmCrypto";
import {
Breadcrumbs,
Button,
GlobalStyles,
Icon,
Input,
PageStack,
Select,
} from "jazz-inspector";
import { AccountOrGroupText } from "jazz-inspector";
import { resolveCoValue, useResolvedCoValue } from "jazz-inspector";
import React, { useState, useEffect } from "react";
import { usePagePath } from "./use-page-path";
@@ -127,7 +126,7 @@ export default function CoJsonViewerApp() {
}
return (
<GlobalStyles
<div
className={clsx(
"h-screen overflow-hidden flex flex-col",
" text-stone-700 bg-white",
@@ -203,7 +202,7 @@ export default function CoJsonViewerApp() {
</form>
)}
</PageStack>
</GlobalStyles>
</div>
);
}
@@ -239,7 +238,7 @@ function AccountSwitcher({
{accounts.map((account) => (
<option key={account.id} value={account.id}>
{localNode ? (
<AccountOrGroupText coId={account.id} showId node={localNode} />
<AccountNameDisplay accountId={account.id} node={localNode} />
) : (
account.id
)}
@@ -303,7 +302,6 @@ function AddAccountForm({
type="password"
value={secret}
onChange={(e) => setSecret(e.target.value)}
placeholder="sealerSecret_ziz7NA12340abcdef123789..."
/>
<Button className="mt-3" type="submit">
Add account
@@ -311,3 +309,31 @@ function AddAccountForm({
</form>
);
}
function AccountNameDisplay({
accountId,
node,
}: {
accountId: CoID<RawAccount>;
node: LocalNode;
}) {
const { snapshot } = useResolvedCoValue(accountId, node);
const [name, setName] = useState<string | null>(null);
useEffect(() => {
if (snapshot && typeof snapshot === "object" && "profile" in snapshot) {
const profileId = snapshot.profile as CoID<RawCoValue>;
resolveCoValue(profileId, node).then((profileResult) => {
if (
profileResult.snapshot &&
typeof profileResult.snapshot === "object" &&
"name" in profileResult.snapshot
) {
setName(profileResult.snapshot.name as string);
}
});
}
}, [snapshot, node]);
return name ? `${name} <${accountId}>` : accountId;
}

View File

@@ -57,7 +57,7 @@ const config: Config = {
800: "#2A12BE",
900: "#12046A",
950: "#1e1b4b",
DEFAULT: "#146AFF",
DEFAULT: "#3313F7",
},
},
},

View File

@@ -1,2 +0,0 @@
VITE_JAZZ_WORKER_ACCOUNT=
JAZZ_WORKER_SECRET=

View File

@@ -1,3 +0,0 @@
dist
.env

View File

@@ -1,8 +0,0 @@
# Ignore artifacts:
build
coverage
**/.git
**/.svn
**/.hg
**/node_modules

View File

@@ -1,24 +0,0 @@
# Jazz Paper Scissors
## Setup
First of we need to create a new account for the dealer:
```bash
pnpm generate-env
```
This will generate a .env file like this one
```
VITE_JAZZ_WORKER_ACCOUNT=co_zn95yzQd1z24DJCgayN53ShyuMR
JAZZ_WORKER_SECRET=sealerSecret_z3Tcq41gtELJRHk3SzQutR2DhkpvEScQQP8DG8yeSh7zJ/signerSecret_zDsLhoNRSxjXrX6oSGzGH3XQQHDyp8QS292p28RToANYq
```
This should be enough the setup everything
Then run pnpm dev to start both the local build and the worker
```bash
pnpm dev
```

View File

@@ -1,21 +0,0 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}

View File

@@ -1,21 +0,0 @@
import * as fs from "fs";
import { createWorkerAccount } from "jazz-run/createWorkerAccount";
if (fs.existsSync(".env")) {
process.exit(0);
}
const account = await createWorkerAccount({
name: "jazz-paper-scissors-worker",
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
});
fs.writeFileSync(
".env",
`
VITE_JAZZ_WORKER_ACCOUNT=${account.accountID}
JAZZ_WORKER_SECRET=${account.agentSecret}
`,
);
process.exit(0);

View File

@@ -1,20 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/favicon.ico" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-tsrouter-app"
/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>Jazz example - Jazz Paper Scissors</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -1,46 +0,0 @@
{
"name": "jazz-paper-scissors",
"private": true,
"type": "module",
"scripts": {
"dev": "npm-run-all --parallel dev:web dev:worker",
"dev:web": "vite",
"dev:worker": "tsx --watch --env-file=.env ./src/worker.ts",
"build": "vite build && tsc",
"serve": "vite preview",
"generate-env": "tsx generate-env.ts",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write"
},
"dependencies": {
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-separator": "^1.1.2",
"@radix-ui/react-slot": "^1.1.2",
"@tailwindcss/vite": "^4.0.17",
"@tanstack/react-router": "^1.115.0",
"@tanstack/react-router-devtools": "^1.114.29",
"@tanstack/router-plugin": "^1.114.30",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"jazz-inspector": "workspace:*",
"jazz-nodejs": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"lucide-react": "^0.485.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwind-merge": "^3.0.2",
"tailwindcss": "^4.0.17",
"tw-animate-css": "^1.2.5"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"jazz-run": "workspace:*",
"npm-run-all": "^4.1.5",
"tsx": "^4.19.3",
"typescript": "~5.6.2",
"vite": "6.0.11"
}
}

View File

@@ -1,15 +0,0 @@
{
"short_name": "TanStack App",
"name": "Create TanStack App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@@ -1 +0,0 @@
export const apiKey = "jazz-paper-scissors@garden.co";

View File

@@ -1,33 +0,0 @@
import { RouterProvider, createRouter } from "@tanstack/react-router";
import { useAccount } from "jazz-react";
import { routeTree } from "./routeTree.gen";
// Create a new router instance
const router = createRouter({
routeTree,
context: {
// @ts-expect-error - just a placeholder - me is set in the App component down below
me: undefined,
},
defaultPreload: "intent",
scrollRestoration: true,
defaultStructuralSharing: true,
defaultPreloadStaleTime: 0,
});
// Register the router instance for type safety
declare module "@tanstack/react-router" {
interface Register {
router: typeof router;
}
}
export function App() {
const { me } = useAccount();
if (!me) {
return <div>Loading...</div>;
}
return <RouterProvider router={router} context={{ me }} />;
}

View File

@@ -1,79 +0,0 @@
import { Slot } from "@radix-ui/react-slot";
import { type VariantProps, cva } from "class-variance-authority";
import type * as React from "react";
import { cn } from "@/lib/utils";
import { Loader2Icon } from "lucide-react";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
destructive:
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3",
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
icon: "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
);
interface Props
extends React.ComponentProps<"button">,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
loading?: boolean;
loadingText?: string;
}
function Button({
className,
variant,
size,
asChild = false,
loading = false,
disabled,
loadingText = "Loading...",
children,
...props
}: Props) {
const Comp = asChild ? Slot : "button";
return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
disabled={loading || disabled}
{...props}
>
{loading ? (
<>
<Loader2Icon className="mr-2 h-4 w-4 animate-spin" />
{loadingText}
</>
) : (
children
)}
</Comp>
);
}
export { Button, buttonVariants };

View File

@@ -1,109 +0,0 @@
import type * as React from "react";
import { cn } from "@/lib/utils";
function Card({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card"
className={cn(
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
className,
)}
{...props}
/>
);
}
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-header"
className={cn(
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
className,
)}
{...props}
/>
);
}
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-title"
className={cn("leading-none font-semibold", className)}
{...props}
/>
);
}
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-description"
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
);
}
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-action"
className={cn(
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
className,
)}
{...props}
/>
);
}
function CardSmall({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-small"
className={cn(
"sm-card grid grid-flow-col justify-items-center gap-6 rounded-xl border py-6 shadow-sm m-4",
className,
)}
{...props}
/>
);
}
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-content"
className={cn("px-6", className)}
{...props}
/>
);
}
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-footer"
className={cn(
"flex items-center px-6 [.border-t]:pt-6 border-t",
className,
)}
{...props}
/>
);
}
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardAction,
CardDescription,
CardContent,
CardSmall,
};

View File

@@ -1,21 +0,0 @@
import * as React from "react";
import { cn } from "@/lib/utils";
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn(
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
className,
)}
{...props}
/>
);
}
export { Input };

View File

@@ -1,13 +0,0 @@
import { JazzProvider } from "jazz-react";
export function JazzAndAuth({ children }: { children: React.ReactNode }) {
return (
<JazzProvider
sync={{
peer: "wss://cloud.jazz.tools/?key=jazz-paper-scissors@garden.co",
}}
>
{children}
</JazzProvider>
);
}

View File

@@ -1,22 +0,0 @@
import * as LabelPrimitive from "@radix-ui/react-label";
import * as React from "react";
import { cn } from "@/lib/utils";
function Label({
className,
...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
return (
<LabelPrimitive.Root
data-slot="label"
className={cn(
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className,
)}
{...props}
/>
);
}
export { Label };

View File

@@ -1,28 +0,0 @@
"use client";
import * as SeparatorPrimitive from "@radix-ui/react-separator";
import * as React from "react";
import { cn } from "@/lib/utils";
function Separator({
className,
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
return (
<SeparatorPrimitive.Root
data-slot="separator-root"
decorative={decorative}
orientation={orientation}
className={cn(
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
className,
)}
{...props}
/>
);
}
export { Separator };

View File

@@ -1,5 +0,0 @@
if (!import.meta.env.VITE_JAZZ_WORKER_ACCOUNT) {
throw new Error(".env missing, run `pnpm generate-env`");
}
export const WORKER_ID = import.meta.env.VITE_JAZZ_WORKER_ACCOUNT;

View File

@@ -1,120 +0,0 @@
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}

View File

@@ -1,26 +0,0 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
/**
* Given a player selections, returns the winner of the current game.
*/
export function determineWinner(
player1Choice: "rock" | "paper" | "scissors",
player2Choice: "rock" | "paper" | "scissors",
) {
if (player1Choice === player2Choice) {
return "draw";
} else if (
(player1Choice === "rock" && player2Choice === "scissors") ||
(player1Choice === "paper" && player2Choice === "rock") ||
(player1Choice === "scissors" && player2Choice === "paper")
) {
return "player1";
} else {
return "player2";
}
}

View File

@@ -1,25 +0,0 @@
import { JazzInspector } from "jazz-inspector";
import { StrictMode } from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { apiKey } from "@/apiKey.ts";
import { JazzProvider } from "jazz-react";
import { App } from "./app";
const rootElement = document.getElementById("app");
if (rootElement && !rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<StrictMode>
<JazzProvider
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
>
<JazzInspector />
<App />
</JazzProvider>
</StrictMode>,
);
}

View File

@@ -1,177 +0,0 @@
/* eslint-disable */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// This file was automatically generated by TanStack Router.
// You should NOT make any changes in this file as it will be overwritten.
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
// Import Routes
import { Route as rootRoute } from './routes/__root'
import { Route as AuthenticatedImport } from './routes/_authenticated'
import { Route as IndexImport } from './routes/index'
import { Route as AuthenticatedWaitingRoomWaitingRoomIdImport } from './routes/_authenticated/waiting-room.$waitingRoomId'
import { Route as AuthenticatedGameGameIdImport } from './routes/_authenticated/game.$gameId'
// Create/Update Routes
const AuthenticatedRoute = AuthenticatedImport.update({
id: '/_authenticated',
getParentRoute: () => rootRoute,
} as any)
const IndexRoute = IndexImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRoute,
} as any)
const AuthenticatedWaitingRoomWaitingRoomIdRoute =
AuthenticatedWaitingRoomWaitingRoomIdImport.update({
id: '/waiting-room/$waitingRoomId',
path: '/waiting-room/$waitingRoomId',
getParentRoute: () => AuthenticatedRoute,
} as any)
const AuthenticatedGameGameIdRoute = AuthenticatedGameGameIdImport.update({
id: '/game/$gameId',
path: '/game/$gameId',
getParentRoute: () => AuthenticatedRoute,
} as any)
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/_authenticated': {
id: '/_authenticated'
path: ''
fullPath: ''
preLoaderRoute: typeof AuthenticatedImport
parentRoute: typeof rootRoute
}
'/_authenticated/game/$gameId': {
id: '/_authenticated/game/$gameId'
path: '/game/$gameId'
fullPath: '/game/$gameId'
preLoaderRoute: typeof AuthenticatedGameGameIdImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/waiting-room/$waitingRoomId': {
id: '/_authenticated/waiting-room/$waitingRoomId'
path: '/waiting-room/$waitingRoomId'
fullPath: '/waiting-room/$waitingRoomId'
preLoaderRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdImport
parentRoute: typeof AuthenticatedImport
}
}
}
// Create and export the route tree
interface AuthenticatedRouteChildren {
AuthenticatedGameGameIdRoute: typeof AuthenticatedGameGameIdRoute
AuthenticatedWaitingRoomWaitingRoomIdRoute: typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
}
const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
AuthenticatedGameGameIdRoute: AuthenticatedGameGameIdRoute,
AuthenticatedWaitingRoomWaitingRoomIdRoute:
AuthenticatedWaitingRoomWaitingRoomIdRoute,
}
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
AuthenticatedRouteChildren,
)
export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'': typeof AuthenticatedRouteWithChildren
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
}
export interface FileRoutesByTo {
'/': typeof IndexRoute
'': typeof AuthenticatedRouteWithChildren
'/game/$gameId': typeof AuthenticatedGameGameIdRoute
'/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
}
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
'/_authenticated': typeof AuthenticatedRouteWithChildren
'/_authenticated/game/$gameId': typeof AuthenticatedGameGameIdRoute
'/_authenticated/waiting-room/$waitingRoomId': typeof AuthenticatedWaitingRoomWaitingRoomIdRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
fileRoutesByTo: FileRoutesByTo
to: '/' | '' | '/game/$gameId' | '/waiting-room/$waitingRoomId'
id:
| '__root__'
| '/'
| '/_authenticated'
| '/_authenticated/game/$gameId'
| '/_authenticated/waiting-room/$waitingRoomId'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren
}
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AuthenticatedRoute: AuthenticatedRouteWithChildren,
}
export const routeTree = rootRoute
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()
/* ROUTE_MANIFEST_START
{
"routes": {
"__root__": {
"filePath": "__root.tsx",
"children": [
"/",
"/_authenticated"
]
},
"/": {
"filePath": "index.tsx"
},
"/_authenticated": {
"filePath": "_authenticated.tsx",
"children": [
"/_authenticated/game/$gameId",
"/_authenticated/waiting-room/$waitingRoomId"
]
},
"/_authenticated/game/$gameId": {
"filePath": "_authenticated/game.$gameId.tsx",
"parent": "/_authenticated"
},
"/_authenticated/waiting-room/$waitingRoomId": {
"filePath": "_authenticated/waiting-room.$waitingRoomId.tsx",
"parent": "/_authenticated"
}
}
}
ROUTE_MANIFEST_END */

View File

@@ -1,19 +0,0 @@
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
import type { Account } from "jazz-tools";
import { JazzAndAuth } from "../components/ui/jazz-and-auth";
interface RouterContext {
me: Account;
}
export const Route = createRootRouteWithContext<RouterContext>()({
component: () => (
<>
<JazzAndAuth>
<Outlet />
<TanStackRouterDevtools />
</JazzAndAuth>
</>
),
});

View File

@@ -1,12 +0,0 @@
import { Outlet, createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/_authenticated")({
component: RouteComponent,
beforeLoad: ({ context }) => {
return context;
},
});
function RouteComponent() {
return <Outlet />;
}

View File

@@ -1,172 +0,0 @@
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardHeader,
CardSmall,
CardTitle,
} from "@/components/ui/card";
import { WORKER_ID } from "@/constants";
import { Game, NewGameIntent, PlayIntent } from "@/schema";
import { createFileRoute, redirect } from "@tanstack/react-router";
import { experimental_useInboxSender, useCoState } from "jazz-react";
import { type ID } from "jazz-tools";
import { Badge, CircleHelp, Scissors, ScrollText } from "lucide-react";
import { useEffect, useState } from "react";
const playIcon = (selection: "rock" | "paper" | "scissors" | undefined) => {
switch (selection) {
case "rock":
return <Badge className="w-5 h-5" />;
case "paper":
return <ScrollText className="w-5 h-5" />;
case "scissors":
return <Scissors className="w-5 h-5" />;
default:
return <CircleHelp className="w-5 h-5" />;
}
};
export const Route = createFileRoute("/_authenticated/game/$gameId")({
component: RouteComponent,
loader: async ({ context: { me }, params: { gameId } }) => {
const game = await Game.load(gameId as ID<Game>, {
resolve: {
player1: true,
player2: true,
},
});
if (!game) {
throw redirect({ to: "/" });
}
return { gameId, me, loaderGame: game };
},
});
function RouteComponent() {
const { gameId, loaderGame } = Route.useLoaderData();
const isPlayer1 = loaderGame.player1?.account?.isMe;
const player = isPlayer1 ? "player1" : "player2";
const [playSelection, setPlaySelection] = useState<
"rock" | "paper" | "scissors" | undefined
>(loaderGame[player]?.playSelection);
const sendInboxMessage = experimental_useInboxSender(WORKER_ID);
const game = useCoState(Game, gameId as ID<Game>);
useEffect(() => {
let gameCompleted = Boolean(loaderGame.outcome);
return loaderGame.subscribe((game) => {
if (gameCompleted && !game.outcome) {
setPlaySelection(undefined); // Reset play selection when one player clicks on "Start a new game"
}
gameCompleted = Boolean(game.outcome);
});
}, []);
if (!game) {
return null;
}
const gameComplete = game.outcome !== undefined;
const opponent = isPlayer1 ? "player2" : "player1";
const currentPlayer = game[player];
const opponentPlayer = game[opponent];
const opponentSelection = opponentPlayer?.playSelection;
const onSubmit = async (
playSelection: "rock" | "paper" | "scissors" | undefined,
) => {
if (!playSelection) return;
sendInboxMessage(
PlayIntent.create({ type: "play", gameId, player, playSelection }),
);
};
const onNewGame = async () => {
sendInboxMessage(NewGameIntent.create({ type: "newGame", gameId }));
};
return (
<Card className="mx-auto max-w-5xl">
<div className="mx-auto text-center">
<CardHeader>
<CardTitle>Jazz, Paper, Scissors!</CardTitle>
<span>Welcome {isPlayer1 ? "Player 1" : "Player 2"}</span>
<span>
{game?.player1Score ?? 0} - {game?.player2Score ?? 0}
</span>
</CardHeader>
{gameComplete ? (
<>
<div className="border">
Game Over,{" "}
{game?.outcome === player
? "You Win!"
: game?.outcome === "draw"
? "It's a Draw!"
: "You Lose!"}
</div>
<Button onClick={onNewGame}>Start a new game</Button>
</>
) : null}
<CardContent>
<div>
{playSelection === undefined
? "Make Your Selection"
: "Your Selection: "}
</div>
<CardSmall>{playIcon(playSelection)}</CardSmall>
{gameComplete ? null : (
<>
<dl className="grid grid-cols-3 gap-x-8 gap-y-16 text-center">
<Button
variant={"outline"}
size={"icon"}
onClick={() => setPlaySelection("rock")}
>
<Badge className="w-5 h-5" />
</Button>
<Button
variant={"outline"}
size={"icon"}
onClick={() => setPlaySelection("paper")}
>
<ScrollText className="w-5 h-5" />
</Button>
<Button
variant={"outline"}
size={"icon"}
onClick={() => setPlaySelection("scissors")}
>
<Scissors className="w-5 h-5" />
</Button>
</dl>
<div className="m-4">
<Button
disabled={
playSelection === undefined ||
Boolean(currentPlayer?.playSelection)
}
onClick={() => onSubmit(playSelection)}
>
Go!
</Button>
</div>
</>
)}
<div>Your Opponent Selected:</div>
<CardSmall>{playIcon(opponentSelection)}</CardSmall>
</CardContent>
</div>
</Card>
);
}

Some files were not shown because too many files have changed in this diff Show More