Compare commits

...

76 Commits

Author SHA1 Message Date
Trisha Lim
0e521ed8df Add Svelte to docs framework selector 2024-11-29 11:43:00 +00:00
Trisha Lim
3102523cb1 Set /docs to /docs/react redirect to temporary 2024-11-29 11:33:38 +00:00
Trisha Lim
a939a9b7f7 Fix auth pages 2024-11-29 11:33:38 +00:00
Trisha Lim
33aee5f79f Fix links per framework 2024-11-29 11:33:38 +00:00
Trisha Lim
c80086c33e Remove react section in intro for other frameworks 2024-11-29 11:33:38 +00:00
Trisha Lim
36900c6462 Modify generateStaticParams 2024-11-29 11:33:38 +00:00
Trisha Lim
b02f439db9 Add framework to routes when missing 2024-11-29 11:33:38 +00:00
Trisha Lim
833fe2dac4 Fix links in react project setup page 2024-11-29 11:33:38 +00:00
Trisha Lim
c11d7d0103 Move nextjs project setup to react 2024-11-29 11:33:38 +00:00
Trisha Lim
d92413a4ef Fix links in intro page 2024-11-29 11:33:38 +00:00
Trisha Lim
b51c519187 /docs/react/project-setup/react should not exist 2024-11-29 11:33:38 +00:00
Trisha Lim
4f048b4b6e Add framework to coming-soon routes 2024-11-29 11:33:38 +00:00
Trisha Lim
6a8bc02a60 Add framework selector to mobile nav 2024-11-29 11:33:38 +00:00
Trisha Lim
687e7aca2c Use pathname instead of params to retrieve framework; fixes mobile nav 2024-11-29 11:33:38 +00:00
Trisha Lim
d00f57c2a7 Fix types 2024-11-29 11:33:38 +00:00
Trisha Lim
58f2713218 Redirect /docs to /docs/react 2024-11-29 11:33:38 +00:00
Trisha Lim
b3a0fbb5cd Handle different "done" status per framework 2024-11-29 11:33:38 +00:00
Trisha Lim
696347881b Store selected framework in FrameworkContext 2024-11-29 11:33:38 +00:00
Trisha Lim
4a0299a73f Add component for conditionally rendering md content based on selected framework 2024-11-29 11:33:38 +00:00
Trisha Lim
6883c5212f Add pages for RN and vue guides 2024-11-29 11:33:38 +00:00
Trisha Lim
22d1402b71 Switch frameworks using dropdown 2024-11-29 11:33:38 +00:00
Trisha Lim
6e92baa365 Link /project-setup to respective framework installation guide 2024-11-29 11:33:38 +00:00
Trisha Lim
03541d856f Add framework to route 2024-11-29 11:33:38 +00:00
Trisha Lim
27829e96e8 Set url param for framework 2024-11-29 11:33:38 +00:00
Trisha Lim
65b7930b1b Add framework selector on side nav 2024-11-29 11:33:38 +00:00
Trisha Lim
b909e48532 Revert "Add readme to examples"
This reverts commit feb472742b.
2024-11-29 10:20:39 +00:00
Trisha Lim
1f13002663 Fix package version 2024-11-29 10:20:39 +00:00
Trisha Lim
de1469a22f Add image upload example to examples page 2024-11-29 10:20:39 +00:00
Trisha Lim
ef240c207b Add readme to examples 2024-11-29 10:20:39 +00:00
Trisha Lim
202b32a35a Clean up code on Clerk example 2024-11-29 10:20:39 +00:00
Trisha Lim
f13b305644 Clean up code on passkey example 2024-11-29 10:20:39 +00:00
Trisha Lim
bc3c79ea5d Implement simple image upload 2024-11-29 10:20:39 +00:00
Trisha Lim
55333cf910 Create example app with Demo Auth 2024-11-29 10:20:39 +00:00
Anselm Eickhoff
25c4e234d6 Merge pull request #899 from garden-co/trishalim-jazz-505
Add vue examples to examples page
2024-11-28 19:28:55 +00:00
Trisha Lim
ab0760f11b Add vue to supported environments section 2024-11-28 17:52:09 +00:00
Trisha Lim
7e75be6941 Add vue examples to examples page 2024-11-28 17:50:39 +00:00
Anselm Eickhoff
67d106e02a Merge pull request #851 from garden-co/benjamin-jazz-523
Add Svelte lib package
2024-11-28 17:34:47 +00:00
Benjamin S. Leveritt
c255dffe0c Remove dependency on svelte-toolbelt 2024-11-28 17:25:42 +00:00
Benjamin S. Leveritt
158f95289e Exclude any svelte example 2024-11-28 16:59:06 +00:00
Benjamin S. Leveritt
a0e560eae6 Add display name 2024-11-28 16:57:00 +00:00
Benjamin S. Leveritt
10e71ad840 Chore: Update lock file 2024-11-28 16:56:23 +00:00
Benjamin S. Leveritt
eeb7d41219 Rename to match chat-vue 2024-11-28 16:54:03 +00:00
Benjamin S. Leveritt
1f475e568f Chore: Update lock file 2024-11-28 16:52:41 +00:00
Benjamin S. Leveritt
f6a9c33809 Fix formatting 2024-11-28 16:50:44 +00:00
Benjamin S. Leveritt
8dfe64b3d7 Rename to Svelte-passkey 2024-11-28 16:49:50 +00:00
Benjamin S. Leveritt
9b834aa8f8 Add experimental warnings to readme 2024-11-28 16:45:37 +00:00
Benjamin S. Leveritt
554e9e5d73 Tweak styles 2024-11-28 16:45:22 +00:00
Benjamin S. Leveritt
dd43df6bd3 Move PasskeyAuthBasicUI into lib 2024-11-28 16:15:42 +00:00
Benjamin S. Leveritt
b4876ff82b Exclude Svelte projects from biome
Biome doesn't support them yet
2024-11-28 16:14:53 +00:00
Benjamin S. Leveritt
fb48171b22 Resets state on logout 2024-11-28 15:51:56 +00:00
Benjamin S. Leveritt
c4202fd21a Add minimal passkey example for svelte 2024-11-28 15:26:54 +00:00
Benjamin S. Leveritt
db73a765e4 Add check for context 2024-11-28 15:26:54 +00:00
Benjamin S. Leveritt
6ae9df74bc Update readme 2024-11-28 15:26:54 +00:00
Benjamin S. Leveritt
786d185b24 Fix imports and formatting 2024-11-28 15:26:54 +00:00
Benjamin S. Leveritt
4c48722e65 Ports Svelte library package from legowhales/jazz-svelte 2024-11-28 15:26:54 +00:00
Anselm Eickhoff
676f2195ab Merge pull request #898 from garden-co/chore/example-projects-ci
Rename chat-clerk to clerk in yaml file
2024-11-28 15:15:52 +00:00
Trisha Lim
45ba926cff Rename chat-clerk to clerk in yaml file 2024-11-28 14:40:21 +00:00
Anselm Eickhoff
a909f2212f Merge pull request #895 from garden-co/changeset-release/main
Version Packages
2024-11-28 12:51:04 +00:00
github-actions[bot]
d55f944238 Version Packages 2024-11-28 12:45:00 +00:00
Anselm Eickhoff
7b557f188b Merge pull request #894 from garden-co/fix/known-message-errors
fix: removed a no more valid error on the known state message sync
2024-11-28 12:43:23 +00:00
Trisha Lim
9ca25d1cdf Add changeset 2024-11-28 10:09:56 +00:00
Trisha Lim
4339e485e2 Update lock file 2024-11-28 10:09:56 +00:00
Trisha Lim
e6dcec2317 Change thumbnail for password manager example 2024-11-28 10:09:56 +00:00
Trisha Lim
057286a8df Add passkey example to examples page 2024-11-28 10:09:56 +00:00
Trisha Lim
b0fa35e11e Replace chat-clerk example with minimal clerk example 2024-11-28 10:09:56 +00:00
Anselm Eickhoff
ae6f3a39c7 Merge pull request #888 from garden-co/changeset-release/main 2024-11-28 07:00:44 +00:00
Guido D'Orsi
e4f110fa9f fix: Removed a no more valid error on the known state message sync 2024-11-28 01:23:24 +01:00
github-actions[bot]
5d72d0a5a0 Version Packages 2024-11-27 14:25:17 +00:00
Anselm Eickhoff
bb874490c5 Write initial "Defining Schemas" docs (#826)
* Document most of CoValue schemas

* Fix typo and broken links

---------

Co-authored-by: Trisha Lim <hello@trishalim.com>
2024-11-27 14:24:05 +00:00
Anselm Eickhoff
a2c6d0cb16 Merge pull request #883 from garden-co/trishalim-jazz-441
Redesign footer
2024-11-27 14:06:46 +00:00
Trisha Lim
fe6648b3a5 Remove github stars iframe 2024-11-27 13:37:20 +00:00
Anselm Eickhoff
c1ab97d976 Merge pull request #886 from bradstdev/patch-1 2024-11-27 09:05:03 +00:00
Benjamin S. Leveritt
3cb27e11dd Chore: Add changeset 2024-11-27 08:14:38 +00:00
bradstdev
50f94c2b81 Make passkeys discoverable
Reference: https://web.dev/articles/webauthn-discoverable-credentials

"To ensure your credentials are created as passkeys (discoverable credentials), specify residentKey and requireResidentKey when the credential is created."

Bitwarden (and possibly other password managers) won't find passkeys created on other devices unless they are discoverable.
2024-11-27 06:32:26 +10:00
Trisha Lim
b66206f1a6 Change footer links for jazz 2024-11-26 13:56:13 +00:00
Trisha Lim
973824795e Redesign footer 2024-11-26 13:53:42 +00:00
202 changed files with 3902 additions and 2613 deletions

View File

@@ -11,7 +11,8 @@ jobs:
matrix:
example: [
"chat",
"chat-clerk",
"clerk",
"passkey",
"inspector",
"music-player",
"password-manager",

View File

@@ -7,7 +7,13 @@
},
"files": {
"ignoreUnknown": false,
"ignore": ["jazz-tools.json", "**/ios/**", "**/android/**"]
"ignore": [
"jazz-tools.json",
"**/ios/**",
"**/android/**",
"packages/jazz-svelte/**",
"examples/*svelte*/**"
]
},
"formatter": {
"enabled": true,

View File

@@ -1,5 +1,20 @@
# @jazz-e2e/binarycostream
## 0.0.111
### Patch Changes
- Updated dependencies [e4f110f]
- cojson@0.8.34
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.110
### Patch Changes
- jazz-react@0.8.33
## 0.0.109
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@jazz-e2e/filestream",
"private": true,
"version": "0.0.109",
"version": "0.0.111",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,11 +13,11 @@
"test:ui": "playwright test --ui"
},
"dependencies": {
"cojson": "workspace:0.8.32",
"cojson": "workspace:0.8.34",
"hash-slash": "workspace:0.2.1",
"is-ci": "^3.0.1",
"jazz-react": "workspace:0.8.32",
"jazz-tools": "workspace:0.8.32",
"jazz-react": "workspace:0.8.34",
"jazz-tools": "workspace:0.8.34",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},

View File

@@ -1,5 +1,20 @@
# @jazz-e2e/covalues
## 0.0.110
### Patch Changes
- Updated dependencies [e4f110f]
- cojson@0.8.34
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.109
### Patch Changes
- jazz-react@0.8.33
## 0.0.108
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@jazz-e2e/covalues",
"private": true,
"version": "0.0.108",
"version": "0.0.110",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,20 @@
# jazz-example-book-shelf
## 0.1.26
### Patch Changes
- jazz-react@0.8.34
- jazz-tools@0.8.34
- jazz-browser-media-images@0.8.34
## 0.1.25
### Patch Changes
- jazz-browser-media-images@0.8.33
- jazz-react@0.8.33
## 0.1.24
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-example-book-shelf",
"version": "0.1.24",
"version": "0.1.26",
"private": true,
"scripts": {
"dev": "next dev",
@@ -11,9 +11,9 @@
},
"dependencies": {
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.8.32",
"jazz-react": "workspace:0.8.32",
"jazz-tools": "workspace:0.8.32",
"jazz-browser-media-images": "workspace:0.8.34",
"jazz-react": "workspace:0.8.34",
"jazz-tools": "workspace:0.8.34",
"next": "14.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +0,0 @@
FROM caddy:2.7.3-alpine
LABEL org.opencontainers.image.source="https://github.com/gardencmp/jazz"
COPY ./dist /usr/share/caddy/

View File

@@ -1,42 +0,0 @@
# Jazz Chat Example (with Clerk auth)
Live version: [https://chat-clerk-demo.jazz.tools](https://chat-clerk-demo.jazz.tools)
## Installing & running the example locally
(this requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
Start by checking out `jazz`
```bash
git clone https://github.com/gardencmp/jazz.git
cd jazz/examples/chat-clerk
pnpm pack --pack-destination /tmp
mkdir -p ~/jazz-examples/chat-clerk # or any other directory
tar -xf /tmp/jazz-example-chat-* --strip-components 1 -C ~/jazz-examples/chat-clerk
cd ~/jazz-examples/chat-clerk
```
This ensures that you have the example app without git history and independent of the Jazz multi-package monorepo.
Install dependencies:
```bash
pnpm install
```
Start the dev server:
```bash
pnpm dev
```
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
## Configuration: sync server
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
You can also run a local sync server by running `npx jazz-run sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<Jazz.Provider>` provider component in [./src/2_main.tsx](./src/2_main.tsx).

View File

@@ -1,56 +0,0 @@
job "chat$BRANCH_SUFFIX" {
region = "global"
datacenters = ["*"]
group "static" {
count = 4
network {
port "http" {
to = 80
}
}
constraint {
attribute = "${node.class}"
operator = "="
value = "cloud"
}
spread {
attribute = "${node.datacenter}"
weight = 100
}
constraint {
distinct_hosts = true
}
task "server" {
driver = "docker"
config {
image = "$DOCKER_TAG"
ports = ["http"]
auth = {
username = "$DOCKER_USER"
password = "$DOCKER_PASSWORD"
}
}
service {
tags = ["public"]
name = "chat$BRANCH_SUFFIX"
port = "http"
provider = "consul"
}
resources {
cpu = 50 # MHz
memory = 50 # MB
}
}
}
}
# deploy bump 4

View File

@@ -1,47 +0,0 @@
{
"name": "jazz-example-chat-clerk",
"private": true,
"version": "0.0.108",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"preview": "vite preview"
},
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.32",
"hash-slash": "workspace:0.2.1",
"jazz-react": "workspace:0.8.32",
"jazz-react-auth-clerk": "workspace:0.8.32",
"jazz-tools": "workspace:0.8.32",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0",
"react-use": "^17.4.0",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"uniqolor": "^1.1.0"
},
"devDependencies": {
"@types/qrcode": "^1.5.1",
"@types/react": "^18.2.19",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"tailwindcss": "3.3.2",
"typescript": "^5.3.3",
"vite": "^5.0.10"
}
}

View File

@@ -1,6 +0,0 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -1,31 +0,0 @@
import { useIframeHashRouter } from "hash-slash";
import { Group, ID } from "jazz-tools";
import { ChatScreen } from "./chatScreen.tsx";
import { useAccount } from "./main.tsx";
import { Chat } from "./schema.ts";
import { AppContainer, TopBar } from "./ui.tsx";
export function App() {
const { me, logOut } = useAccount();
const router = useIframeHashRouter();
const createChat = () => {
if (!me) return;
const group = Group.create({ owner: me });
group.addMember("everyone", "writer");
const chat = Chat.create([], { owner: group });
router.navigate("/#/chat/" + chat.id);
};
return (
<AppContainer>
<TopBar>
{me?.profile?.name} · <button onClick={logOut}>Log out</button>
</TopBar>
{router.route({
"/": () => createChat() as never,
"/chat/:id": (id) => <ChatScreen chatID={id as ID<Chat>} />,
})}
</AppContainer>
);
}

View File

@@ -1,43 +0,0 @@
import { ID } from "jazz-tools";
import { useCoState } from "./main.tsx";
import { Chat, Message } from "./schema.ts";
import {
BubbleBody,
BubbleContainer,
BubbleInfo,
ChatContainer,
ChatInput,
EmptyChatMessage,
} from "./ui.tsx";
export function ChatScreen(props: { chatID: ID<Chat> }) {
const chat = useCoState(Chat, props.chatID, [{}]);
return chat ? (
<ChatContainer>
{chat.length > 0 ? (
chat.map((msg) => <ChatBubble msg={msg} key={msg.id} />)
) : (
<EmptyChatMessage />
)}
<ChatInput
onSubmit={(text) => {
chat.push(Message.create({ text }, { owner: chat._owner }));
}}
/>
</ChatContainer>
) : (
<div>Loading...</div>
);
}
function ChatBubble(props: { msg: Message }) {
const lastEdit = props.msg._edits.text;
return (
<BubbleContainer fromMe={lastEdit.by?.isMe}>
<BubbleBody>{props.msg.text}</BubbleBody>
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
</BubbleContainer>
);
}

View File

@@ -1,78 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 20 14.3% 4.1%;
--card: 0 0% 100%;
--card-foreground: 20 14.3% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 20 14.3% 4.1%;
--primary: 24 9.8% 10%;
--primary-foreground: 60 9.1% 97.8%;
--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;
--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;
--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 20 14.3% 4.1%;
--radius: 0.5rem;
}
.dark {
--background: 20 14.3% 4.1%;
--foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%;
--popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%;
--primary: 60 9.1% 97.8%;
--primary-foreground: 24 9.8% 10%;
--secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%;
--muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%;
--ring: 24 5.7% 82.9%;
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
margin: 0;
padding: 0;
}
}

View File

@@ -1,46 +0,0 @@
import { createJazzReactApp } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { App } from "./app.tsx";
import { ClerkProvider, SignInButton, useClerk } from "@clerk/clerk-react";
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
const Jazz = createJazzReactApp();
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const clerk = useClerk();
const [auth, state] = useJazzClerkAuth(clerk);
return (
<>
{state.errors.map((error) => (
<div key={error}>{error}</div>
))}
{clerk.user && auth ? (
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=chat-example-jazz-clerk@gcmp.io"
>
{children}
</Jazz.Provider>
) : (
<SignInButton />
)}
</>
);
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<ClerkProvider
publishableKey={import.meta.env.VITE_CLERK_PUBLISHABLE_KEY}
afterSignOutUrl="/"
>
<JazzAndAuth>
<App />
</JazzAndAuth>
</ClerkProvider>
</StrictMode>,
);

View File

@@ -1,7 +0,0 @@
import { CoList, CoMap, co } from "jazz-tools";
export class Message extends CoMap {
text = co.string;
}
export class Chat extends CoList.Of(co.ref(Message)) {}

View File

@@ -1,63 +0,0 @@
export function AppContainer(props: { children: React.ReactNode }) {
return (
<div className="flex flex-col items-center justify-between w-screen h-screen p-2 dark:bg-black dark:text-white">
{props.children}
</div>
);
}
export function TopBar(props: { children: React.ReactNode }) {
return (
<div className="mb-5 px-2 py-1 text-sm self-end">{props.children}</div>
);
}
export function ChatContainer(props: { children: React.ReactNode }) {
return (
<div className="w-full max-w-xl h-full flex flex-col items-stretch">
{props.children}
</div>
);
}
export function EmptyChatMessage() {
return <div className="m-auto text-sm">(Empty chat)</div>;
}
export function BubbleContainer(props: {
children: React.ReactNode;
fromMe: boolean | undefined;
}) {
const align = props.fromMe ? "items-end" : "items-start";
return <div className={`${align} flex flex-col`}>{props.children}</div>;
}
export function BubbleBody(props: { children: React.ReactNode }) {
return (
<div className="rounded-xl bg-stone-100 dark:bg-stone-700 dark:text-white py-2 px-4 mt-2 min-w-[5rem]">
{props.children}
</div>
);
}
export function BubbleInfo(props: { by: string | undefined; madeAt: Date }) {
return (
<div className="text-xs text-neutral-500 ml-2">
{props.by} {props.madeAt.toLocaleTimeString()}
</div>
);
}
export function ChatInput(props: { onSubmit: (text: string) => void }) {
return (
<input
className="rounded p-2 border mt-auto dark:bg-black dark:text-white border-stone-300 dark:border-stone-700"
placeholder="Type a message and press Enter"
onKeyDown={({ key, currentTarget: input }) => {
if (key !== "Enter" || !input.value) return;
props.onSubmit(input.value);
input.value = "";
}}
/>
);
}

View File

@@ -1,75 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
keyframes: {
"accordion-down": {
from: { height: 0 },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: 0 },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
},
},
plugins: [require("tailwindcss-animate")],
};

View File

@@ -1,10 +0,0 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

View File

@@ -1,16 +0,0 @@
import path from "path";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
minify: false,
},
});

View File

@@ -1,5 +1,21 @@
# chat-rn-clerk
## 1.0.26
### Patch Changes
- Updated dependencies [9ca25d1]
- jazz-react-auth-clerk@0.8.34
- jazz-react-native@0.8.34
- jazz-tools@0.8.34
- jazz-react-native-media-images@0.8.25
## 1.0.25
### Patch Changes
- jazz-react-auth-clerk@0.8.33
## 1.0.24
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.24",
"version": "1.0.26",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,12 @@
# chat-rn
## 1.0.24
### Patch Changes
- jazz-react-native@0.8.34
- jazz-tools@0.8.34
## 1.0.23
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.23",
"version": "1.0.24",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",

View File

@@ -1,5 +1,21 @@
# chat-vue
## 0.0.17
### Patch Changes
- jazz-browser@0.8.34
- jazz-tools@0.8.34
- jazz-vue@0.8.22
## 0.0.16
### Patch Changes
- Updated dependencies [3cb27e1]
- jazz-browser@0.8.33
- jazz-vue@0.8.21
## 0.0.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.15",
"version": "0.0.17",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,20 @@
# jazz-example-chat
## 0.0.112
### Patch Changes
- Updated dependencies [e4f110f]
- cojson@0.8.34
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.111
### Patch Changes
- jazz-react@0.8.33
## 0.0.110
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.110",
"version": "0.0.112",
"type": "module",
"scripts": {
"dev": "vite",
@@ -18,10 +18,10 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.32",
"cojson": "workspace:0.8.34",
"hash-slash": "workspace:0.2.1",
"jazz-react": "workspace:0.8.32",
"jazz-tools": "workspace:0.8.32",
"jazz-react": "workspace:0.8.34",
"jazz-tools": "workspace:0.8.34",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.2.0",

View File

@@ -1,5 +1,22 @@
# minimal-auth-clerk
## 0.0.11
### Patch Changes
- 9ca25d1: Rename passkey and clerk examples
- Updated dependencies [9ca25d1]
- jazz-react-auth-clerk@0.8.34
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.10
### Patch Changes
- jazz-react@0.8.33
- jazz-react-auth-clerk@0.8.33
## 0.0.9
### Patch Changes

View File

@@ -1,3 +1,3 @@
# Minimal Jazz Auth Clerk Example
This is a minimal example of how to use Clerk authentication with Jazz.
This is a minimal example of how to use Clerk authentication with Jazz.

View File

@@ -1,7 +1,7 @@
{
"name": "minimal-auth-clerk",
"name": "clerk",
"private": true,
"version": "0.0.9",
"version": "0.0.11",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,7 +14,7 @@
"@clerk/clerk-react": "^5.4.1",
"jazz-tools": "workspace:*",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.8.32",
"jazz-react-auth-clerk": "workspace:0.8.34",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},

View File

@@ -1,15 +1,14 @@
import "./App.css";
import { useAccount } from "./main";
function App() {
const { me, logOut } = useAccount();
return (
<>
<div className="container">
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<button onClick={() => logOut()}>Logout</button>
</>
</div>
);
}

View File

@@ -30,6 +30,10 @@ body {
min-height: 100vh;
}
#root {
width: 100%;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
@@ -37,21 +41,11 @@ h1 {
button {
border-radius: 8px;
border: 1px solid transparent;
border: 0;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
@media (prefers-color-scheme: light) {
@@ -66,3 +60,13 @@ button:focus-visible {
background-color: #f9f9f9;
}
}
.container {
max-width: 200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
}

View File

@@ -21,7 +21,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, state] = useJazzClerkAuth(clerk);
return (
<>
<main className="container">
{state?.errors?.map((error) => (
<div key={error}>{error}</div>
))}
@@ -35,7 +35,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
) : (
<SignInButton />
)}
</>
</main>
);
}

View File

@@ -0,0 +1 @@
# Jazz example

View File

@@ -2,13 +2,11 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/jazz-logo.png" />
<link rel="stylesheet" href="/src/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz Chat Example</title>
<title>Jazz | Image upload example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/app.tsx"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -0,0 +1,29 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.9",
"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"
},
"dependencies": {
"jazz-browser-media-images": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@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": "^5.4.10"
}
}

View File

@@ -0,0 +1,22 @@
import ImageUpload from "./ImageUpload.tsx";
import { useAccount } from "./main";
function App() {
const { me, logOut } = useAccount();
return (
<div className="container">
<nav>
<span>
You're logged in as <strong>{me?.profile?.name}</strong>
</span>
<button onClick={() => logOut()}>Logout</button>
</nav>
<main>
<ImageUpload />
</main>
</div>
);
}
export default App;

View File

@@ -0,0 +1,56 @@
import { createImage } from "jazz-browser-media-images";
import { ProgressiveImg } from "jazz-react";
import { ImageDefinition } from "jazz-tools";
import { ChangeEvent, useRef } from "react";
import { useAccount } from "./main.tsx";
function Image({ image }: { image: ImageDefinition }) {
return (
<ProgressiveImg image={image}>
{({ src }) => <img src={src} />}
</ProgressiveImg>
);
}
export default function ImageUpload() {
const { me } = useAccount();
const inputRef = useRef<HTMLInputElement>(null);
const onImageChange = async (event: ChangeEvent<HTMLInputElement>) => {
if (!me?.profile) return;
const file = event.currentTarget.files?.[0];
if (file) {
me.profile.image = await createImage(file, {
owner: me.profile._owner,
});
}
};
const deleteImage = () => {
if (!me?.profile) return;
me.profile.image = null;
};
return (
<>
<div>{me?.profile?.image && <Image image={me.profile.image} />}</div>
<div>
{me?.profile?.image ? (
<button type="button" onClick={deleteImage}>
Delete image
</button>
) : (
<div>
<label>Upload image</label>
<input ref={inputRef} type="file" onChange={onImageChange} />
</div>
)}
</div>
</>
);
}

View File

@@ -0,0 +1,68 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html,
body,
#root {
height: 100%;
}
button {
border-radius: 8px;
border: 0;
padding: 0.6em 1.2em;
font-weight: 500;
background-color: #1a1a1a;
cursor: pointer;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem 0;
border-bottom: 1px solid whitesmoke;
margin-bottom: 2rem;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
}
label {
display: block;
margin-bottom: 0.25rem;
}

View File

@@ -0,0 +1,36 @@
import { DemoAuthBasicUI, createJazzReactApp, useDemoAuth } from "jazz-react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { JazzAccount } from "./schema.ts";
const Jazz = createJazzReactApp({
AccountSchema: JazzAccount,
});
export const { useAccount, useCoState } = Jazz;
function JazzAndAuth({ children }: { children: React.ReactNode }) {
const [auth, authState] = useDemoAuth();
return (
<>
<Jazz.Provider
auth={auth}
peer="wss://cloud.jazz.tools/?key=image-upload-example@gcmp.io"
>
{children}
</Jazz.Provider>
<DemoAuthBasicUI appName="Image upload" state={authState} />
</>
);
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<JazzAndAuth>
<App />
</JazzAndAuth>
</StrictMode>,
);

View File

@@ -0,0 +1,16 @@
import { Account, ImageDefinition, Profile, co } from "jazz-tools";
export class JazzProfile extends Profile {
image = co.ref(ImageDefinition, { optional: true });
}
export class JazzAccount extends Account {
profile = co.ref(JazzProfile);
/** The account migration is run on account creation and on every log-in.
* You can use it to set up the account root and any other initial CoValues you need.
*/
migrate(this: JazzAccount, creationProps?: { name: string }) {
super.migrate(creationProps);
}
}

View File

@@ -1,5 +1,13 @@
# jazz-example-inspector
## 0.0.81
### Patch Changes
- Updated dependencies [e4f110f]
- cojson@0.8.34
- cojson-transport-ws@0.8.34
## 0.0.80
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector",
"private": true,
"version": "0.0.80",
"version": "0.0.81",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.8.32",
"cojson-transport-ws": "workspace:0.8.32",
"cojson": "workspace:0.8.34",
"cojson-transport-ws": "workspace:0.8.34",
"hash-slash": "workspace:0.2.1",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -1 +0,0 @@
VITE_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,42 +0,0 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,42 +0,0 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -1,5 +1,18 @@
# jazz-example-musicplayer
## 0.0.32
### Patch Changes
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.31
### Patch Changes
- jazz-react@0.8.33
## 0.0.30
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.30",
"version": "0.0.32",
"type": "module",
"scripts": {
"dev": "vite",
@@ -18,8 +18,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.8.32",
"jazz-tools": "workspace:0.8.32",
"jazz-react": "workspace:0.8.34",
"jazz-tools": "workspace:0.8.34",
"lucide-react": "^0.274.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@@ -1,5 +1,20 @@
# jazz-example-onboarding
## 0.0.13
### Patch Changes
- jazz-react@0.8.34
- jazz-tools@0.8.34
- jazz-browser-media-images@0.8.34
## 0.0.12
### Patch Changes
- jazz-browser-media-images@0.8.33
- jazz-react@0.8.33
## 0.0.11
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-onboarding",
"private": true,
"version": "0.0.11",
"version": "0.0.13",
"type": "module",
"scripts": {
"dev": "vite",

21
examples/passkey-svelte/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
node_modules
# Output
.output
.vercel
/.svelte-kit
/build
# OS
.DS_Store
Thumbs.db
# Env
.env
.env.*
!.env.example
!.env.test
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -0,0 +1 @@
engine-strict=true

View File

@@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock

View File

@@ -0,0 +1,16 @@
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}

View File

@@ -0,0 +1,38 @@
# sv
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

View File

@@ -0,0 +1,33 @@
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';
export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);

View File

@@ -0,0 +1,34 @@
{
"name": "passkey-svelte",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/eslint": "^9.6.0",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3"
},
"dependencies": {
"jazz-svelte": "workspace:*"
}
}

View File

@@ -0,0 +1,3 @@
import { createJazzApp } from 'jazz-svelte';
export const { useAccount, useCoState } = createJazzApp();

13
examples/passkey-svelte/src/app.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@@ -0,0 +1,30 @@
<script lang="ts">
import { JazzProvider, usePasskeyAuth, PasskeyAuthBasicUI } from 'jazz-svelte';
let { children } = $props();
let auth = usePasskeyAuth({ appName: 'minimal-svelte-auth-passkey' });
$inspect(auth.state);
</script>
<div
style="width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center;"
>
<PasskeyAuthBasicUI state={auth.state} />
{#if auth.current}
<JazzProvider
auth={auth.current}
peer="wss://cloud.jazz.tools/?key=minimal-svelte-auth-passkey@gcmp.io"
>
{@render children?.()}
</JazzProvider>
{/if}
</div>
<style>
:global(html, body) {
margin: 0;
}
</style>

View File

@@ -0,0 +1,34 @@
<script lang="ts">
import { useAccount } from '../Jazz.svelte.js';
const account = useAccount({
root: {}
});
$inspect(account);
</script>
<div class="container">
<h1>Welcome back, {account?.me?.profile?.name}</h1>
<button onclick={() => account.logOut()}>Log out</button>
</div>
<style>
.container {
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1rem;
align-items: start;
}
button {
background: #000;
color: #fff;
padding: 6px 12px;
border: none;
border-radius: 6px;
min-height: 38px;
cursor: pointer;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;

View File

@@ -0,0 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

View File

@@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});

View File

@@ -22,5 +22,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?
sync-db/

View File

@@ -1,5 +1,19 @@
# minimal-auth-passkey
## 0.0.10
### Patch Changes
- 9ca25d1: Rename passkey and clerk examples
- jazz-react@0.8.34
- jazz-tools@0.8.34
## 0.0.9
### Patch Changes
- jazz-react@0.8.33
## 0.0.8
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "minimal-auth-passkey",
"name": "passkey",
"private": true,
"version": "0.0.8",
"version": "0.0.10",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,15 +1,14 @@
import "./App.css";
import { useAccount } from "./main";
function App() {
const { me, logOut } = useAccount();
return (
<>
<main>
<h1>You're logged in</h1>
<p>Welcome back, {me?.profile?.name}</p>
<p>Welcome back, {me?.profile?.name}!</p>
<button onClick={() => logOut()}>Logout</button>
</>
</main>
);
}

View File

@@ -30,6 +30,10 @@ body {
min-height: 100vh;
}
#root {
width: 100%;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
@@ -37,21 +41,11 @@ h1 {
button {
border-radius: 8px;
border: 1px solid transparent;
border: 0;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
@media (prefers-color-scheme: light) {
@@ -66,3 +60,9 @@ button:focus-visible {
background-color: #f9f9f9;
}
}
main {
padding: 1rem;
margin: 0 auto;
text-align: center;
}

View File

@@ -1,29 +1,24 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
"noUncheckedSideEffectImports": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
"include": ["src"]
}

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