Compare commits
62 Commits
jazz-react
...
jazz-react
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b8f5ed3ca | ||
|
|
fcf0baee2e | ||
|
|
07183ffe5b | ||
|
|
11c36460ac | ||
|
|
e0d7b266e7 | ||
|
|
3706360ffc | ||
|
|
3d7a20ca64 | ||
|
|
381ecaaf96 | ||
|
|
25435ba597 | ||
|
|
c56fd81bff | ||
|
|
707bf332d0 | ||
|
|
40225635f1 | ||
|
|
e4ff701488 | ||
|
|
314cdee815 | ||
|
|
fa549f49b7 | ||
|
|
c38460afd2 | ||
|
|
7657c8469e | ||
|
|
97abe86d7e | ||
|
|
a339dfaeb0 | ||
|
|
3710776d09 | ||
|
|
dffc2ee2fe | ||
|
|
cd47928252 | ||
|
|
4b84ede0b5 | ||
|
|
0de4d684d8 | ||
|
|
d78a5364f6 | ||
|
|
228dfa1799 | ||
|
|
74a66eaa94 | ||
|
|
96670db342 | ||
|
|
e4655c3705 | ||
|
|
5a5f767b3d | ||
|
|
9c8038ffb6 | ||
|
|
a524cd38a1 | ||
|
|
70960e917d | ||
|
|
a28d899e5c | ||
|
|
20ef6474d4 | ||
|
|
6947593414 | ||
|
|
23369dce80 | ||
|
|
a7cd61ce75 | ||
|
|
c702d632a2 | ||
|
|
9b90ae195c | ||
|
|
7820232282 | ||
|
|
32d588451a | ||
|
|
ae56765efa | ||
|
|
467decfcce | ||
|
|
2ab17d0569 | ||
|
|
543517f80a | ||
|
|
9ef0be665e | ||
|
|
6a147c2d28 | ||
|
|
c2b62a0fee | ||
|
|
301458e713 | ||
|
|
1a979b64b3 | ||
|
|
8b7b57fe2c | ||
|
|
ad40b883eb | ||
|
|
1c64ae1bba | ||
|
|
6ce20517bc | ||
|
|
9509ceb975 | ||
|
|
bcec3be423 | ||
|
|
e3958d1609 | ||
|
|
0fc7291178 | ||
|
|
51d1cc677b | ||
|
|
0cf7a7aa85 | ||
|
|
0503479fcf |
@@ -9,6 +9,8 @@
|
|||||||
"jazz-tools",
|
"jazz-tools",
|
||||||
"jazz-browser",
|
"jazz-browser",
|
||||||
"jazz-browser-media-images",
|
"jazz-browser-media-images",
|
||||||
|
"jazz-browser-auth-clerk",
|
||||||
|
"jazz-react-auth-clerk",
|
||||||
"jazz-react",
|
"jazz-react",
|
||||||
"jazz-nodejs",
|
"jazz-nodejs",
|
||||||
"jazz-run",
|
"jazz-run",
|
||||||
@@ -20,5 +22,8 @@
|
|||||||
"access": "public",
|
"access": "public",
|
||||||
"baseBranch": "main",
|
"baseBranch": "main",
|
||||||
"updateInternalDependencies": "patch",
|
"updateInternalDependencies": "patch",
|
||||||
"ignore": []
|
"ignore": [],
|
||||||
|
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
|
||||||
|
"onlyUpdatePeerDependentsWhenOutOfRange": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
106
.github/workflows/build-and-deploy.yaml
vendored
106
.github/workflows/build-and-deploy.yaml
vendored
@@ -1,106 +0,0 @@
|
|||||||
name: Build and Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-examples:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
example: ["chat", "pets", "todo", "inspector"]
|
|
||||||
# example: ["twit", "chat", "counter-js-auth0", "pets", "twit", "file-drop", "inspector"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Enable corepack
|
|
||||||
run: corepack enable
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: gardencmp
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Pnpm Build
|
|
||||||
run: |
|
|
||||||
pnpm install
|
|
||||||
pnpm turbo build;
|
|
||||||
working-directory: ./examples/${{ matrix.example }}
|
|
||||||
|
|
||||||
- name: Docker Build & Push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: ./examples/${{ matrix.example }}
|
|
||||||
push: true
|
|
||||||
tags: ghcr.io/gardencmp/${{github.event.repository.name}}-example-${{ matrix.example }}:${{github.head_ref || github.ref_name}}-${{github.sha}}-${{github.run_number}}-${{github.run_attempt}}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
deploy-examples:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build-examples
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
example: ["chat", "pets", "todo", "inspector"]
|
|
||||||
# example: ["twit", "chat", "counter-js-auth0", "pets", "twit", "file-drop", "inspector"]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- uses: gacts/install-nomad@v1
|
|
||||||
- name: Tailscale
|
|
||||||
uses: tailscale/github-action@v1
|
|
||||||
with:
|
|
||||||
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
|
|
||||||
|
|
||||||
- name: Deploy on Nomad
|
|
||||||
run: |
|
|
||||||
if [ "${{github.ref_name}}" == "main" ]; then
|
|
||||||
export BRANCH_SUFFIX="";
|
|
||||||
export BRANCH_SUBDOMAIN="";
|
|
||||||
else
|
|
||||||
export BRANCH_SUFFIX=-${{github.head_ref || github.ref_name}};
|
|
||||||
export BRANCH_SUBDOMAIN=${{github.head_ref || github.ref_name}}.;
|
|
||||||
fi
|
|
||||||
|
|
||||||
export DOCKER_USER=gardencmp;
|
|
||||||
export DOCKER_PASSWORD=${{ secrets.DOCKER_PULL_PAT }};
|
|
||||||
export DOCKER_TAG=ghcr.io/gardencmp/${{github.event.repository.name}}-example-${{ matrix.example }}:${{github.head_ref || github.ref_name}}-${{github.sha}}-${{github.run_number}}-${{github.run_attempt}};
|
|
||||||
|
|
||||||
envsubst '${DOCKER_USER} ${DOCKER_PASSWORD} ${DOCKER_TAG} ${BRANCH_SUFFIX} ${BRANCH_SUBDOMAIN}' < job-template.nomad > job-instance.nomad;
|
|
||||||
cat job-instance.nomad;
|
|
||||||
NOMAD_ADDR=${{ secrets.NOMAD_ADDR }} nomad job run job-instance.nomad;
|
|
||||||
working-directory: ./examples/${{ matrix.example }}
|
|
||||||
58
.github/workflows/build-examples.yaml
vendored
Normal file
58
.github/workflows/build-examples.yaml
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
name: Build Examples
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-examples:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
example: [
|
||||||
|
"chat",
|
||||||
|
"chat-clerk",
|
||||||
|
"inspector",
|
||||||
|
"music-player",
|
||||||
|
"password-manager",
|
||||||
|
"pets",
|
||||||
|
"todo",
|
||||||
|
]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Enable corepack
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version-file: '.node-version'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Setup pnpm cache
|
||||||
|
with:
|
||||||
|
path: ${{ env.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
||||||
|
- name: Pnpm Build
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
pnpm turbo build;
|
||||||
|
working-directory: ./examples/${{ matrix.example }}
|
||||||
9
e2e/BinaryCoStream/CHANGELOG.md
Normal file
9
e2e/BinaryCoStream/CHANGELOG.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# @jazz-e2e/binarycostream
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@jazz-e2e/binarycostream",
|
"name": "@jazz-e2e/binarycostream",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.81",
|
"version": "0.0.82",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
"*.{js,jsx,mdx,json}": "prettier --write"
|
"*.{js,jsx,mdx,json}": "prettier --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cojson": "workspace:*",
|
"cojson": "workspace:0.8.0",
|
||||||
"hash-slash": "workspace:*",
|
"hash-slash": "workspace:0.2.0",
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:0.8.1",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:0.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import { DownloaderPeer } from "./DownloaderPeer";
|
import { DownloaderPeer } from "./DownloaderPeer";
|
||||||
import { Jazz } from "./jazz";
|
|
||||||
import { UploaderPeer } from "./UploaderPeer";
|
import { UploaderPeer } from "./UploaderPeer";
|
||||||
import { getValueId } from "./lib/searchParams";
|
import { getValueId } from "./lib/searchParams";
|
||||||
|
import { AuthAndJazz } from "./jazz";
|
||||||
|
|
||||||
function Main() {
|
function Main() {
|
||||||
const valueId = getValueId();
|
const valueId = getValueId();
|
||||||
@@ -17,8 +17,8 @@ function Main() {
|
|||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Jazz.Provider>
|
<AuthAndJazz>
|
||||||
<Main />
|
<Main />
|
||||||
</Jazz.Provider>
|
</AuthAndJazz>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,22 +1,7 @@
|
|||||||
import { createJazzReactContext, DemoAuth } from "jazz-react";
|
import { createJazzReactApp } from "jazz-react";
|
||||||
import { useEffect } from "react";
|
|
||||||
import { getValueId } from "./lib/searchParams";
|
import { getValueId } from "./lib/searchParams";
|
||||||
|
import { ephemeralCredentialsAuth } from "jazz-tools";
|
||||||
function AutoLoginComponent(props: {
|
import { useState } from "react";
|
||||||
appName: string;
|
|
||||||
loading: boolean;
|
|
||||||
existingUsers: string[];
|
|
||||||
logInAs: (existingUser: string) => void;
|
|
||||||
signUp: (username: string) => void;
|
|
||||||
}) {
|
|
||||||
useEffect(() => {
|
|
||||||
if (props.loading) return;
|
|
||||||
|
|
||||||
props.signUp("Test User");
|
|
||||||
}, [props.loading]);
|
|
||||||
|
|
||||||
return <div>Signing up...</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const key = getValueId()
|
const key = getValueId()
|
||||||
? `downloader-e2e@jazz.tools`
|
? `downloader-e2e@jazz.tools`
|
||||||
@@ -24,15 +9,20 @@ const key = getValueId()
|
|||||||
|
|
||||||
const localSync = new URLSearchParams(location.search).has("localSync");
|
const localSync = new URLSearchParams(location.search).has("localSync");
|
||||||
|
|
||||||
const Jazz = createJazzReactContext({
|
const Jazz = createJazzReactApp();
|
||||||
auth: DemoAuth({
|
|
||||||
appName: "BinaryCoStream Sync",
|
|
||||||
Component: AutoLoginComponent,
|
|
||||||
}),
|
|
||||||
peer: localSync
|
|
||||||
? `ws://localhost:4200?key=${key}`
|
|
||||||
: `wss://mesh.jazz.tools/?key=${key}`,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const { useAccount, useCoState } = Jazz;
|
export const { useAccount, useCoState } = Jazz;
|
||||||
export { Jazz };
|
|
||||||
|
export function AuthAndJazz({ children }: { children: React.ReactNode }) {
|
||||||
|
const [ephemeralAuth] = useState(ephemeralCredentialsAuth())
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Jazz.Provider auth={ephemeralAuth} peer={
|
||||||
|
localSync
|
||||||
|
? `ws://localhost:4200?key=${key}`
|
||||||
|
: `wss://mesh.jazz.tools/?key=${key}`
|
||||||
|
}>
|
||||||
|
{children}
|
||||||
|
</Jazz.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
1
examples/chat-clerk/.env
Normal file
1
examples/chat-clerk/.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
VITE_CLERK_PUBLISHABLE_KEY=pk_test_ZXZpZGVudC1kYW5lLTg5LmNsZXJrLmFjY291bnRzLmRldiQ
|
||||||
13
examples/chat-clerk/.eslintrc.cjs
Normal file
13
examples/chat-clerk/.eslintrc.cjs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
env: { browser: true, es2020: true },
|
||||||
|
extends: [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:react-hooks/recommended",
|
||||||
|
],
|
||||||
|
ignorePatterns: ["dist", ".eslintrc.cjs"],
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
|
plugins: ["react-refresh"],
|
||||||
|
rules: {},
|
||||||
|
};
|
||||||
26
examples/chat-clerk/.gitignore
vendored
Normal file
26
examples/chat-clerk/.gitignore
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
sync-db/
|
||||||
10
examples/chat-clerk/.prettierrc
Normal file
10
examples/chat-clerk/.prettierrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"printWidth": 80
|
||||||
|
}
|
||||||
886
examples/chat-clerk/CHANGELOG.md
Normal file
886
examples/chat-clerk/CHANGELOG.md
Normal file
@@ -0,0 +1,886 @@
|
|||||||
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
|
- jazz-react-auth-clerk@0.8.1
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6a147c2]
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- Updated dependencies [23369dc]
|
||||||
|
- Updated dependencies [c2b62a0]
|
||||||
|
- Updated dependencies [1a979b6]
|
||||||
|
- Updated dependencies [bcec3be]
|
||||||
|
- Updated dependencies [6ce2051]
|
||||||
|
- cojson@0.8.0
|
||||||
|
- jazz-tools@0.8.0
|
||||||
|
- jazz-react@0.8.0
|
||||||
|
|
||||||
|
## 0.0.82-guest-auth.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.35-guest-auth.6
|
||||||
|
- jazz-tools@0.7.35-guest-auth.6
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [49a8b54]
|
||||||
|
- Updated dependencies [35bbcd9]
|
||||||
|
- Updated dependencies [6f80282]
|
||||||
|
- Updated dependencies [35bbcd9]
|
||||||
|
- Updated dependencies [cac2ec9]
|
||||||
|
- Updated dependencies [f350e90]
|
||||||
|
- jazz-tools@0.7.35
|
||||||
|
- cojson@0.7.35
|
||||||
|
- jazz-react@0.7.35
|
||||||
|
|
||||||
|
## 0.0.81
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5d91f9f]
|
||||||
|
- Updated dependencies [5094e6d]
|
||||||
|
- Updated dependencies [b09589b]
|
||||||
|
- Updated dependencies [2c3a40c]
|
||||||
|
- Updated dependencies [4e16575]
|
||||||
|
- Updated dependencies [ea882ab]
|
||||||
|
- cojson@0.7.34
|
||||||
|
- jazz-react@0.7.34
|
||||||
|
- jazz-tools@0.7.34
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.8
|
||||||
|
- jazz-react@0.7.34-neverthrow.8
|
||||||
|
- jazz-tools@0.7.34-neverthrow.8
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.7
|
||||||
|
- jazz-react@0.7.34-neverthrow.7
|
||||||
|
- jazz-tools@0.7.34-neverthrow.7
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.4
|
||||||
|
- jazz-react@0.7.34-neverthrow.4
|
||||||
|
- jazz-tools@0.7.34-neverthrow.4
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.3
|
||||||
|
- jazz-react@0.7.34-neverthrow.3
|
||||||
|
- jazz-tools@0.7.34-neverthrow.3
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.34-neverthrow.2
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.1
|
||||||
|
- jazz-react@0.7.34-neverthrow.1
|
||||||
|
- jazz-tools@0.7.34-neverthrow.1
|
||||||
|
|
||||||
|
## 0.0.81-neverthrow.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.34-neverthrow.0
|
||||||
|
- jazz-react@0.7.34-neverthrow.0
|
||||||
|
- jazz-tools@0.7.34-neverthrow.0
|
||||||
|
|
||||||
|
## 0.0.80
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b297c93]
|
||||||
|
- Updated dependencies [3bf5127]
|
||||||
|
- Updated dependencies [a8b74ff]
|
||||||
|
- Updated dependencies [db53161]
|
||||||
|
- cojson@0.7.33
|
||||||
|
- jazz-react@0.7.33
|
||||||
|
- jazz-tools@0.7.33
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.33-hotfixes.5
|
||||||
|
- jazz-react@0.7.33-hotfixes.5
|
||||||
|
- jazz-tools@0.7.33-hotfixes.5
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.33-hotfixes.4
|
||||||
|
- jazz-react@0.7.33-hotfixes.4
|
||||||
|
- jazz-tools@0.7.33-hotfixes.4
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.33-hotfixes.3
|
||||||
|
- jazz-react@0.7.33-hotfixes.3
|
||||||
|
- jazz-tools@0.7.33-hotfixes.3
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.33-hotfixes.2
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.33-hotfixes.1
|
||||||
|
|
||||||
|
## 0.0.80-hotfixes.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.33-hotfixes.0
|
||||||
|
- jazz-react@0.7.33-hotfixes.0
|
||||||
|
- jazz-tools@0.7.33-hotfixes.0
|
||||||
|
|
||||||
|
## 0.0.79
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.32
|
||||||
|
- jazz-react@0.7.32
|
||||||
|
|
||||||
|
## 0.0.78
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.31
|
||||||
|
- jazz-react@0.7.31
|
||||||
|
- jazz-tools@0.7.31
|
||||||
|
|
||||||
|
## 0.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.30
|
||||||
|
|
||||||
|
## 0.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.29
|
||||||
|
- jazz-react@0.7.29
|
||||||
|
- jazz-tools@0.7.29
|
||||||
|
|
||||||
|
## 0.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.28
|
||||||
|
- jazz-react@0.7.28
|
||||||
|
- jazz-tools@0.7.28
|
||||||
|
|
||||||
|
## 0.0.74
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.27
|
||||||
|
|
||||||
|
## 0.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.26
|
||||||
|
- jazz-react@0.7.26
|
||||||
|
- jazz-tools@0.7.26
|
||||||
|
|
||||||
|
## 0.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.25
|
||||||
|
- jazz-react@0.7.25
|
||||||
|
|
||||||
|
## 0.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.24
|
||||||
|
- jazz-react@0.7.24
|
||||||
|
|
||||||
|
## 0.0.70
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.23
|
||||||
|
- jazz-react@0.7.23
|
||||||
|
- jazz-tools@0.7.23
|
||||||
|
|
||||||
|
## 0.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.22
|
||||||
|
|
||||||
|
## 0.0.68
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.21
|
||||||
|
- jazz-react@0.7.21
|
||||||
|
|
||||||
|
## 0.0.67
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.20
|
||||||
|
- jazz-react@0.7.20
|
||||||
|
|
||||||
|
## 0.0.66
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.19
|
||||||
|
- jazz-react@0.7.19
|
||||||
|
|
||||||
|
## 0.0.65
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.18
|
||||||
|
- jazz-react@0.7.18
|
||||||
|
- jazz-tools@0.7.18
|
||||||
|
|
||||||
|
## 0.0.64
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.17
|
||||||
|
- jazz-react@0.7.17
|
||||||
|
- jazz-tools@0.7.17
|
||||||
|
|
||||||
|
## 0.0.63
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.16
|
||||||
|
- jazz-react@0.7.16
|
||||||
|
|
||||||
|
## 0.0.62
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.15
|
||||||
|
|
||||||
|
## 0.0.61
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.14
|
||||||
|
- jazz-tools@0.7.14
|
||||||
|
- jazz-react@0.7.14
|
||||||
|
|
||||||
|
## 0.0.60
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.13
|
||||||
|
- jazz-react@0.7.13
|
||||||
|
|
||||||
|
## 0.0.59
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.12
|
||||||
|
- jazz-react@0.7.12
|
||||||
|
|
||||||
|
## 0.0.58
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.11
|
||||||
|
- jazz-react@0.7.11
|
||||||
|
- jazz-tools@0.7.11
|
||||||
|
|
||||||
|
## 0.0.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.10
|
||||||
|
- jazz-react@0.7.10
|
||||||
|
- jazz-tools@0.7.10
|
||||||
|
|
||||||
|
## 0.0.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.9
|
||||||
|
- jazz-react@0.7.9
|
||||||
|
- jazz-tools@0.7.9
|
||||||
|
|
||||||
|
## 0.0.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.8
|
||||||
|
- jazz-react@0.7.8
|
||||||
|
|
||||||
|
## 0.0.54
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [9fdc91c]
|
||||||
|
- jazz-react@0.7.7
|
||||||
|
|
||||||
|
## 0.0.53
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.6
|
||||||
|
- jazz-react@0.7.6
|
||||||
|
|
||||||
|
## 0.0.52
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.5
|
||||||
|
|
||||||
|
## 0.0.51
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.4
|
||||||
|
|
||||||
|
## 0.0.50
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.3
|
||||||
|
- jazz-react@0.7.3
|
||||||
|
|
||||||
|
## 0.0.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.2
|
||||||
|
|
||||||
|
## 0.0.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.1
|
||||||
|
- jazz-react@0.7.1
|
||||||
|
|
||||||
|
## 0.0.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8636319]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [8636319]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [96c494f]
|
||||||
|
- Updated dependencies [59c18c3]
|
||||||
|
- Updated dependencies [19f52b7]
|
||||||
|
- Updated dependencies [8636319]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [d8fe2b1]
|
||||||
|
- Updated dependencies [19004b4]
|
||||||
|
- Updated dependencies [a78f168]
|
||||||
|
- Updated dependencies [1200aae]
|
||||||
|
- Updated dependencies [60d5ca2]
|
||||||
|
- Updated dependencies [52675c9]
|
||||||
|
- Updated dependencies [129e2c1]
|
||||||
|
- Updated dependencies [6d49e9b]
|
||||||
|
- Updated dependencies [1cfa279]
|
||||||
|
- Updated dependencies [704af7d]
|
||||||
|
- Updated dependencies [e97f730]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [460478f]
|
||||||
|
- Updated dependencies [6b0418f]
|
||||||
|
- Updated dependencies [e299c3e]
|
||||||
|
- Updated dependencies [ed5643a]
|
||||||
|
- Updated dependencies [bde684f]
|
||||||
|
- Updated dependencies [bf0f8ec]
|
||||||
|
- Updated dependencies [c4151fc]
|
||||||
|
- Updated dependencies [63374cc]
|
||||||
|
- Updated dependencies [8636319]
|
||||||
|
- Updated dependencies [01ac646]
|
||||||
|
- Updated dependencies [a5e68a4]
|
||||||
|
- Updated dependencies [8636319]
|
||||||
|
- Updated dependencies [952982e]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [5fa277c]
|
||||||
|
- Updated dependencies [60d5ca2]
|
||||||
|
- Updated dependencies [21771c4]
|
||||||
|
- Updated dependencies [77c2b56]
|
||||||
|
- Updated dependencies [63374cc]
|
||||||
|
- Updated dependencies [d2e03ff]
|
||||||
|
- Updated dependencies [354bdcd]
|
||||||
|
- Updated dependencies [ece35b3]
|
||||||
|
- Updated dependencies [60d5ca2]
|
||||||
|
- Updated dependencies [69ac514]
|
||||||
|
- Updated dependencies [f8a5c46]
|
||||||
|
- Updated dependencies [f0f6f1b]
|
||||||
|
- Updated dependencies [e5eed5b]
|
||||||
|
- Updated dependencies [1a44f87]
|
||||||
|
- Updated dependencies [627d895]
|
||||||
|
- Updated dependencies [1200aae]
|
||||||
|
- Updated dependencies [63374cc]
|
||||||
|
- Updated dependencies [ece35b3]
|
||||||
|
- Updated dependencies [38d4410]
|
||||||
|
- Updated dependencies [85d2b62]
|
||||||
|
- Updated dependencies [fd86c11]
|
||||||
|
- Updated dependencies [52675c9]
|
||||||
|
- jazz-tools@0.7.0
|
||||||
|
- cojson@0.7.0
|
||||||
|
- jazz-react@0.7.0
|
||||||
|
- hash-slash@0.2.0
|
||||||
|
|
||||||
|
## 0.0.47-alpha.42
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.42
|
||||||
|
- cojson@0.7.0-alpha.42
|
||||||
|
- jazz-react@0.7.0-alpha.42
|
||||||
|
|
||||||
|
## 0.0.47-alpha.41
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-tools@0.7.0-alpha.41
|
||||||
|
- jazz-react@0.7.0-alpha.41
|
||||||
|
|
||||||
|
## 0.0.47-alpha.40
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.40
|
||||||
|
|
||||||
|
## 0.0.47-alpha.39
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.0-alpha.39
|
||||||
|
- jazz-react@0.7.0-alpha.39
|
||||||
|
- jazz-tools@0.7.0-alpha.39
|
||||||
|
|
||||||
|
## 0.0.47-alpha.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.38
|
||||||
|
- jazz-react@0.7.0-alpha.38
|
||||||
|
- cojson@0.7.0-alpha.38
|
||||||
|
|
||||||
|
## 0.0.47-alpha.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.37
|
||||||
|
- cojson@0.7.0-alpha.37
|
||||||
|
- jazz-tools@0.7.0-alpha.37
|
||||||
|
|
||||||
|
## 0.0.47-alpha.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- Updated dependencies [6b0418f]
|
||||||
|
- Updated dependencies [1a35307]
|
||||||
|
- cojson@0.7.0-alpha.36
|
||||||
|
- jazz-tools@0.7.0-alpha.36
|
||||||
|
- jazz-react@0.7.0-alpha.36
|
||||||
|
|
||||||
|
## 0.0.47-alpha.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- cojson@0.7.0-alpha.35
|
||||||
|
- jazz-tools@0.7.0-alpha.35
|
||||||
|
- jazz-react@0.7.0-alpha.35
|
||||||
|
|
||||||
|
## 0.0.47-alpha.34
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.34
|
||||||
|
- jazz-react@0.7.0-alpha.34
|
||||||
|
|
||||||
|
## 0.0.47-alpha.33
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.33
|
||||||
|
|
||||||
|
## 0.0.47-alpha.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- hash-slash@0.2.0-alpha.3
|
||||||
|
- jazz-tools@0.7.0-alpha.32
|
||||||
|
- jazz-react@0.7.0-alpha.32
|
||||||
|
|
||||||
|
## 0.0.47-alpha.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.31
|
||||||
|
- jazz-react@0.7.0-alpha.31
|
||||||
|
|
||||||
|
## 0.0.47-alpha.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.30
|
||||||
|
- jazz-react@0.7.0-alpha.30
|
||||||
|
|
||||||
|
## 0.0.47-alpha.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.29
|
||||||
|
- cojson@0.7.0-alpha.29
|
||||||
|
- jazz-react@0.7.0-alpha.29
|
||||||
|
|
||||||
|
## 0.0.47-alpha.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.28
|
||||||
|
- cojson@0.7.0-alpha.28
|
||||||
|
- jazz-react@0.7.0-alpha.28
|
||||||
|
|
||||||
|
## 0.0.47-alpha.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.27
|
||||||
|
- cojson@0.7.0-alpha.27
|
||||||
|
- jazz-react@0.7.0-alpha.27
|
||||||
|
|
||||||
|
## 0.0.47-alpha.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.26
|
||||||
|
- jazz-react@0.7.0-alpha.26
|
||||||
|
|
||||||
|
## 0.0.47-alpha.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.25
|
||||||
|
- jazz-react@0.7.0-alpha.25
|
||||||
|
|
||||||
|
## 0.0.47-alpha.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.24
|
||||||
|
- cojson@0.7.0-alpha.24
|
||||||
|
- jazz-react@0.7.0-alpha.24
|
||||||
|
|
||||||
|
## 0.0.47-alpha.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.23
|
||||||
|
- jazz-react@0.7.0-alpha.23
|
||||||
|
|
||||||
|
## 0.0.47-alpha.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.22
|
||||||
|
- jazz-react@0.7.0-alpha.22
|
||||||
|
|
||||||
|
## 0.0.47-alpha.21
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.21
|
||||||
|
- jazz-tools@0.7.0-alpha.21
|
||||||
|
|
||||||
|
## 0.0.47-alpha.20
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.20
|
||||||
|
- jazz-tools@0.7.0-alpha.20
|
||||||
|
|
||||||
|
## 0.0.47-alpha.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.19
|
||||||
|
- jazz-react@0.7.0-alpha.19
|
||||||
|
|
||||||
|
## 0.0.47-alpha.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react@0.7.0-alpha.18
|
||||||
|
|
||||||
|
## 0.0.47-alpha.17
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.17
|
||||||
|
- jazz-react@0.7.0-alpha.17
|
||||||
|
|
||||||
|
## 0.0.47-alpha.16
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.16
|
||||||
|
- jazz-react@0.7.0-alpha.16
|
||||||
|
|
||||||
|
## 0.0.47-alpha.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.15
|
||||||
|
- jazz-react@0.7.0-alpha.15
|
||||||
|
|
||||||
|
## 0.0.47-alpha.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.14
|
||||||
|
- jazz-react@0.7.0-alpha.14
|
||||||
|
|
||||||
|
## 0.0.47-alpha.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.13
|
||||||
|
- jazz-react@0.7.0-alpha.13
|
||||||
|
|
||||||
|
## 0.0.47-alpha.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.12
|
||||||
|
- jazz-tools@0.7.0-alpha.12
|
||||||
|
|
||||||
|
## 0.0.47-alpha.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.11
|
||||||
|
- jazz-tools@0.7.0-alpha.11
|
||||||
|
- cojson@0.7.0-alpha.11
|
||||||
|
|
||||||
|
## 0.0.47-alpha.10
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.10
|
||||||
|
- jazz-tools@0.7.0-alpha.10
|
||||||
|
- cojson@0.7.0-alpha.10
|
||||||
|
|
||||||
|
## 0.0.47-alpha.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.9
|
||||||
|
- jazz-tools@0.7.0-alpha.9
|
||||||
|
|
||||||
|
## 0.0.47-alpha.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.8
|
||||||
|
- jazz-tools@0.7.0-alpha.8
|
||||||
|
|
||||||
|
## 0.0.47-alpha.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.7
|
||||||
|
- jazz-tools@0.7.0-alpha.7
|
||||||
|
- cojson@0.7.0-alpha.7
|
||||||
|
|
||||||
|
## 0.0.47-alpha.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.6
|
||||||
|
- jazz-tools@0.7.0-alpha.6
|
||||||
|
|
||||||
|
## 0.0.47-alpha.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.0-alpha.5
|
||||||
|
- jazz-tools@0.7.0-alpha.5
|
||||||
|
- cojson@0.7.0-alpha.5
|
||||||
|
|
||||||
|
## 0.0.47-alpha.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.4
|
||||||
|
- jazz-react@0.7.0-alpha.4
|
||||||
|
|
||||||
|
## 0.0.47-alpha.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.7.0-alpha.3
|
||||||
|
- jazz-react@0.7.0-alpha.3
|
||||||
|
|
||||||
|
## 0.0.47-alpha.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- hash-slash@0.2.0-alpha.2
|
||||||
|
- jazz-react@0.7.0-alpha.2
|
||||||
|
- jazz-tools@0.7.0-alpha.2
|
||||||
|
|
||||||
|
## 0.0.47-alpha.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- hash-slash@0.2.0-alpha.1
|
||||||
|
- jazz-react@0.7.0-alpha.1
|
||||||
|
- jazz-tools@0.7.0-alpha.1
|
||||||
|
- cojson@0.7.0-alpha.1
|
||||||
|
|
||||||
|
## 0.0.47-alpha.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- hash-slash@0.2.0-alpha.0
|
||||||
|
- jazz-react@0.7.0-alpha.0
|
||||||
|
- jazz-tools@0.7.0-alpha.0
|
||||||
|
- cojson@0.7.0-alpha.0
|
||||||
|
|
||||||
|
## 0.0.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.5.0
|
||||||
|
- jazz-react-auth-local@0.4.16
|
||||||
42
examples/chat-clerk/README.md
Normal file
42
examples/chat-clerk/README.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Jazz Chat Example (with Clerk auth)
|
||||||
|
|
||||||
|
<!-- Live version: [https://chat-clerk.jazz.tools](https://chat-clerk.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 Global Mesh](https://jazz.tools/mesh) (`wss://sync.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).
|
||||||
14
examples/chat-clerk/index.html
Normal file
14
examples/chat-clerk/index.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<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>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/app.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
56
examples/chat-clerk/job-template.nomad
Normal file
56
examples/chat-clerk/job-template.nomad
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
job "chat$BRANCH_SUFFIX" {
|
||||||
|
region = "global"
|
||||||
|
datacenters = ["*"]
|
||||||
|
|
||||||
|
group "static" {
|
||||||
|
count = 4
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" {
|
||||||
|
to = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
constraint {
|
||||||
|
attribute = "${node.class}"
|
||||||
|
operator = "="
|
||||||
|
value = "mesh"
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
56
examples/chat-clerk/package.json
Normal file
56
examples/chat-clerk/package.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"name": "jazz-example-chat-clerk",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.81",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
|
"format": "echo 'chat example is codegolfed'",
|
||||||
|
"preview": "vite preview"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{ts,tsx}": "eslint --fix",
|
||||||
|
"*.{js,jsx,mdx,json}": "prettier --write"
|
||||||
|
},
|
||||||
|
"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.0",
|
||||||
|
"hash-slash": "workspace:0.2.0",
|
||||||
|
"jazz-react": "workspace:0.8.1",
|
||||||
|
"jazz-react-auth-clerk": "workspace:0.8.1",
|
||||||
|
"jazz-tools": "workspace:0.8.1",
|
||||||
|
"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",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||||
|
"@typescript-eslint/parser": "^6.2.1",
|
||||||
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||||
|
"autoprefixer": "^10.4.14",
|
||||||
|
"eslint": "^8.46.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.3",
|
||||||
|
"postcss": "^8.4.27",
|
||||||
|
"tailwindcss": "^3.3.3",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
|
"vite": "^5.0.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
examples/chat-clerk/postcss.config.js
Normal file
6
examples/chat-clerk/postcss.config.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
30
examples/chat-clerk/src/app.tsx
Normal file
30
examples/chat-clerk/src/app.tsx
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { Group, ID } from "jazz-tools";
|
||||||
|
import { useIframeHashRouter } from "hash-slash";
|
||||||
|
import { useAccount } from "./main.tsx";
|
||||||
|
import { Chat } from "./schema.ts";
|
||||||
|
import { ChatScreen } from "./chatScreen.tsx";
|
||||||
|
import { AppContainer, TopBar } from "./ui.tsx";
|
||||||
|
|
||||||
|
export function App() {
|
||||||
|
const { me, logOut } = useAccount();
|
||||||
|
|
||||||
|
const createChat = () => {
|
||||||
|
if (!me) return;
|
||||||
|
const group = Group.create({ owner: me });
|
||||||
|
group.addMember("everyone", "writer");
|
||||||
|
const chat = Chat.create([], { owner: group });
|
||||||
|
location.hash = "/chat/" + chat.id;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppContainer>
|
||||||
|
<TopBar>
|
||||||
|
{me?.profile?.name} · <button onClick={logOut}>Log out</button>
|
||||||
|
</TopBar>
|
||||||
|
{useIframeHashRouter().route({
|
||||||
|
"/": () => createChat() as never,
|
||||||
|
"/chat/:id": id => <ChatScreen chatID={id as ID<Chat>} />,
|
||||||
|
})}
|
||||||
|
</AppContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
43
examples/chat-clerk/src/chatScreen.tsx
Normal file
43
examples/chat-clerk/src/chatScreen.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import { ID } from "jazz-tools";
|
||||||
|
import { Chat, Message } from "./schema.ts";
|
||||||
|
import { useCoState } from "./main.tsx";
|
||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
78
examples/chat-clerk/src/index.css
Normal file
78
examples/chat-clerk/src/index.css
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
examples/chat-clerk/src/main.tsx
Normal file
46
examples/chat-clerk/src/main.tsx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { StrictMode } from "react";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
|
import { createJazzReactApp } from "jazz-react";
|
||||||
|
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>
|
||||||
|
))}
|
||||||
|
{auth ? (
|
||||||
|
<Jazz.Provider
|
||||||
|
auth={auth}
|
||||||
|
peer="wss://mesh.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>
|
||||||
|
);
|
||||||
7
examples/chat-clerk/src/schema.ts
Normal file
7
examples/chat-clerk/src/schema.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { CoMap, CoList, co } from "jazz-tools";
|
||||||
|
|
||||||
|
export class Message extends CoMap {
|
||||||
|
text = co.string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||||
63
examples/chat-clerk/src/ui.tsx
Normal file
63
examples/chat-clerk/src/ui.tsx
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
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 = "";
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
75
examples/chat-clerk/tailwind.config.js
Normal file
75
examples/chat-clerk/tailwind.config.js
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/** @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")],
|
||||||
|
};
|
||||||
16
examples/chat-clerk/vite.config.ts
Normal file
16
examples/chat-clerk/vite.config.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
import react from "@vitejs/plugin-react-swc";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
minify: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -2,12 +2,12 @@ module.exports = {
|
|||||||
root: true,
|
root: true,
|
||||||
env: { browser: true, es2020: true },
|
env: { browser: true, es2020: true },
|
||||||
extends: [
|
extends: [
|
||||||
'eslint:recommended',
|
"eslint:recommended",
|
||||||
'plugin:@typescript-eslint/recommended',
|
"plugin:@typescript-eslint/recommended",
|
||||||
'plugin:react-hooks/recommended',
|
"plugin:react-hooks/recommended",
|
||||||
],
|
],
|
||||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
ignorePatterns: ["dist", ".eslintrc.cjs"],
|
||||||
parser: '@typescript-eslint/parser',
|
parser: "@typescript-eslint/parser",
|
||||||
plugins: ['react-refresh'],
|
plugins: ["react-refresh"],
|
||||||
rules: {},
|
rules: {},
|
||||||
}
|
};
|
||||||
|
|||||||
10
examples/chat/.prettierrc
Normal file
10
examples/chat/.prettierrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"printWidth": 80
|
||||||
|
}
|
||||||
@@ -1,5 +1,36 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 0.0.83
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
|
|
||||||
|
## 0.0.82
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6a147c2]
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- Updated dependencies [23369dc]
|
||||||
|
- Updated dependencies [c2b62a0]
|
||||||
|
- Updated dependencies [1a979b6]
|
||||||
|
- Updated dependencies [bcec3be]
|
||||||
|
- Updated dependencies [6ce2051]
|
||||||
|
- cojson@0.8.0
|
||||||
|
- jazz-tools@0.8.0
|
||||||
|
- jazz-react@0.8.0
|
||||||
|
|
||||||
|
## 0.0.82-guest-auth.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.35-guest-auth.6
|
||||||
|
- jazz-tools@0.7.35-guest-auth.6
|
||||||
|
|
||||||
## 0.0.82
|
## 0.0.82
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-chat",
|
"name": "jazz-example-chat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.82",
|
"version": "0.0.83",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -20,10 +20,10 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cojson": "workspace:*",
|
"cojson": "workspace:0.8.0",
|
||||||
"hash-slash": "workspace:*",
|
"hash-slash": "workspace:0.2.0",
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:0.8.1",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:0.8.1",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ export default {
|
|||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,43 +1,30 @@
|
|||||||
import { CoMap, CoList, co, Group, ID } from "jazz-tools";
|
import { Group, ID } from "jazz-tools";
|
||||||
import { createJazzReactContext, DemoAuth } from "jazz-react";
|
|
||||||
import { createRoot } from "react-dom/client";
|
|
||||||
import { useIframeHashRouter } from "hash-slash";
|
import { useIframeHashRouter } from "hash-slash";
|
||||||
|
import { useAccount } from "./main.tsx";
|
||||||
|
import { Chat } from "./schema.ts";
|
||||||
import { ChatScreen } from "./chatScreen.tsx";
|
import { ChatScreen } from "./chatScreen.tsx";
|
||||||
import { StrictMode } from "react";
|
import { AppContainer, TopBar } from "./ui.tsx";
|
||||||
|
|
||||||
export class Message extends CoMap {
|
export function App() {
|
||||||
text = co.string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
|
||||||
|
|
||||||
const Jazz = createJazzReactContext({
|
|
||||||
auth: DemoAuth({ appName: "Jazz Chat" }),
|
|
||||||
peer: `wss://mesh.jazz.tools/?key=you@example.com`
|
|
||||||
});
|
|
||||||
export const { useAccount, useCoState } = Jazz;
|
|
||||||
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const { me, logOut } = useAccount();
|
const { me, logOut } = useAccount();
|
||||||
|
|
||||||
const createChat = () => {
|
const createChat = () => {
|
||||||
|
if (!me) return;
|
||||||
const group = Group.create({ owner: me });
|
const group = Group.create({ owner: me });
|
||||||
group.addMember("everyone", "writer");
|
group.addMember("everyone", "writer");
|
||||||
const chat = Chat.create([], { owner: group });
|
const chat = Chat.create([], { owner: group });
|
||||||
location.hash = "/chat/" + chat.id;
|
location.hash = "/chat/" + chat.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
return <div className="flex flex-col items-center justify-between w-screen h-screen p-2 dark:bg-black dark:text-white">
|
return (
|
||||||
<div className="rounded mb-5 px-2 py-1 text-sm self-end">
|
<AppContainer>
|
||||||
{me.profile?.name} · <button onClick={logOut}>Log Out</button>
|
<TopBar>
|
||||||
</div>
|
{me?.profile?.name} · <button onClick={logOut}>Log out</button>
|
||||||
{useIframeHashRouter().route({
|
</TopBar>
|
||||||
'/': () => createChat() as never,
|
{useIframeHashRouter().route({
|
||||||
'/chat/:id': (id) => <ChatScreen chatID={id as ID<Chat>} />
|
"/": () => createChat() as never,
|
||||||
})}
|
"/chat/:id": id => <ChatScreen chatID={id as ID<Chat>} />,
|
||||||
</div>;
|
})}
|
||||||
|
</AppContainer>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!)
|
|
||||||
.render(<StrictMode><Jazz.Provider><App/></Jazz.Provider></StrictMode>);
|
|
||||||
@@ -1,42 +1,43 @@
|
|||||||
import { ID } from 'jazz-tools';
|
import { ID } from "jazz-tools";
|
||||||
import { Chat, Message, useCoState } from './app.tsx';
|
import { Chat, Message } from "./schema.ts";
|
||||||
|
import { useCoState } from "./main.tsx";
|
||||||
|
import {
|
||||||
|
BubbleBody,
|
||||||
|
BubbleContainer,
|
||||||
|
BubbleInfo,
|
||||||
|
ChatContainer,
|
||||||
|
ChatInput,
|
||||||
|
EmptyChatMessage,
|
||||||
|
} from "./ui.tsx";
|
||||||
|
|
||||||
export function ChatScreen(props: { chatID: ID<Chat> }) {
|
export function ChatScreen(props: { chatID: ID<Chat> }) {
|
||||||
const chat = useCoState(Chat, props.chatID, [{}]);
|
const chat = useCoState(Chat, props.chatID, [{}]);
|
||||||
|
|
||||||
return chat ? <div className='w-full max-w-xl h-full flex flex-col items-stretch'>
|
return chat ? (
|
||||||
{chat.length > 0
|
<ChatContainer>
|
||||||
? chat.map((msg) => <ChatBubble msg={msg} key={msg.id} />)
|
{chat.length > 0 ? (
|
||||||
: <div className='m-auto text-sm'>(Empty chat)</div>}
|
chat.map(msg => <ChatBubble msg={msg} key={msg.id} />)
|
||||||
<ChatInput onSubmit={(text) => {
|
) : (
|
||||||
chat.push(
|
<EmptyChatMessage />
|
||||||
Message.create({ text }, { owner: chat._owner })
|
)}
|
||||||
);
|
<ChatInput
|
||||||
}} />
|
onSubmit={text => {
|
||||||
</div> : <div>Loading...</div>;
|
chat.push(Message.create({ text }, { owner: chat._owner }));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ChatContainer>
|
||||||
|
) : (
|
||||||
|
<div>Loading...</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ChatBubble(props: { msg: Message }) {
|
function ChatBubble(props: { msg: Message }) {
|
||||||
const lastEdit = props.msg._edits.text;
|
const lastEdit = props.msg._edits.text;
|
||||||
const align = lastEdit.by?.isMe ? 'items-end' : 'items-start';
|
|
||||||
|
|
||||||
return <div className={`${align} flex flex-col`}>
|
return (
|
||||||
<div className='rounded-xl bg-stone-100 dark:bg-stone-700 dark:text-white py-2 px-4 mt-2 min-w-[5rem]'>
|
<BubbleContainer fromMe={lastEdit.by?.isMe}>
|
||||||
{ props.msg.text }
|
<BubbleBody>{props.msg.text}</BubbleBody>
|
||||||
</div>
|
<BubbleInfo by={lastEdit.by?.profile?.name} madeAt={lastEdit.madeAt} />
|
||||||
<div className='text-xs text-neutral-500 ml-2'>
|
</BubbleContainer>
|
||||||
{ lastEdit.by?.profile?.name }{' '}
|
);
|
||||||
{ lastEdit.madeAt?.toLocaleTimeString() }
|
|
||||||
</div>
|
|
||||||
</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 = '';
|
|
||||||
}} />;
|
|
||||||
}
|
}
|
||||||
|
|||||||
33
examples/chat/src/main.tsx
Normal file
33
examples/chat/src/main.tsx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { StrictMode } from "react";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
|
import { createJazzReactApp, DemoAuthBasicUI, useDemoAuth } from "jazz-react";
|
||||||
|
import { App } from "./app.tsx";
|
||||||
|
|
||||||
|
const Jazz = createJazzReactApp();
|
||||||
|
export const { useAccount, useCoState } = Jazz;
|
||||||
|
|
||||||
|
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||||
|
const [auth, state] = useDemoAuth();
|
||||||
|
|
||||||
|
console.log(state, auth)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Jazz.Provider
|
||||||
|
auth={auth}
|
||||||
|
peer="wss://mesh.jazz.tools/?key=chat-example-jazz@gcmp.io"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Jazz.Provider>
|
||||||
|
{state.state !== "signedIn" && <DemoAuthBasicUI appName="Jazz Chat" state={state} />}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
createRoot(document.getElementById("root")!).render(
|
||||||
|
<StrictMode>
|
||||||
|
<JazzAndAuth>
|
||||||
|
<App />
|
||||||
|
</JazzAndAuth>
|
||||||
|
</StrictMode>
|
||||||
|
);
|
||||||
7
examples/chat/src/schema.ts
Normal file
7
examples/chat/src/schema.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { CoMap, CoList, co } from "jazz-tools";
|
||||||
|
|
||||||
|
export class Message extends CoMap {
|
||||||
|
text = co.string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Chat extends CoList.Of(co.ref(Message)) {}
|
||||||
63
examples/chat/src/ui.tsx
Normal file
63
examples/chat/src/ui.tsx
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
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 = "";
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
content: [
|
content: [
|
||||||
'./pages/**/*.{ts,tsx}',
|
"./pages/**/*.{ts,tsx}",
|
||||||
'./components/**/*.{ts,tsx}',
|
"./components/**/*.{ts,tsx}",
|
||||||
'./app/**/*.{ts,tsx}',
|
"./app/**/*.{ts,tsx}",
|
||||||
'./src/**/*.{ts,tsx}',
|
"./src/**/*.{ts,tsx}",
|
||||||
],
|
],
|
||||||
theme: {
|
theme: {
|
||||||
container: {
|
container: {
|
||||||
center: true,
|
center: true,
|
||||||
@@ -72,4 +72,4 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [require("tailwindcss-animate")],
|
plugins: [require("tailwindcss-animate")],
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import react from '@vitejs/plugin-react-swc'
|
import react from "@vitejs/plugin-react-swc";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
@@ -11,6 +11,6 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: false
|
minify: false,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-inspector
|
||||||
|
|
||||||
|
## 0.0.60
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6a147c2]
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- cojson@0.8.0
|
||||||
|
- cojson-transport-ws@0.8.0
|
||||||
|
|
||||||
## 0.0.60
|
## 0.0.60
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cojson": "workspace:*",
|
"cojson": "workspace:0.8.0",
|
||||||
"cojson-transport-ws": "workspace:*",
|
"cojson-transport-ws": "workspace:0.8.0",
|
||||||
"hash-slash": "workspace:*",
|
"hash-slash": "workspace:0.2.0",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import {
|
|||||||
RawCoValue,
|
RawCoValue,
|
||||||
RawAccount,
|
RawAccount,
|
||||||
AgentSecret,
|
AgentSecret,
|
||||||
AccountID,
|
RawAccountID,
|
||||||
cojsonInternals,
|
|
||||||
WasmCrypto,
|
WasmCrypto,
|
||||||
} from "cojson";
|
} from "cojson";
|
||||||
import { createWebSocketPeer } from "cojson-transport-ws";
|
import { createWebSocketPeer } from "cojson-transport-ws";
|
||||||
@@ -69,7 +68,7 @@ export default function CoJsonViewerApp() {
|
|||||||
const node = await LocalNode.withLoadedAccount({
|
const node = await LocalNode.withLoadedAccount({
|
||||||
accountID: currentAccount.id,
|
accountID: currentAccount.id,
|
||||||
accountSecret: currentAccount.secret,
|
accountSecret: currentAccount.secret,
|
||||||
sessionID: cojsonInternals.newRandomSessionID(
|
sessionID: crypto.newRandomSessionID(
|
||||||
currentAccount.id,
|
currentAccount.id,
|
||||||
),
|
),
|
||||||
peersToLoadFrom: [wsPeer],
|
peersToLoadFrom: [wsPeer],
|
||||||
@@ -82,7 +81,7 @@ export default function CoJsonViewerApp() {
|
|||||||
});
|
});
|
||||||
}, [currentAccount, goToIndex]);
|
}, [currentAccount, goToIndex]);
|
||||||
|
|
||||||
const addAccount = (id: AccountID, secret: AgentSecret) => {
|
const addAccount = (id: RawAccountID, secret: AgentSecret) => {
|
||||||
const newAccount = { id, secret };
|
const newAccount = { id, secret };
|
||||||
setAccounts([...accounts, newAccount]);
|
setAccounts([...accounts, newAccount]);
|
||||||
setCurrentAccount(newAccount);
|
setCurrentAccount(newAccount);
|
||||||
@@ -238,14 +237,14 @@ function AccountSwitcher({
|
|||||||
function AddAccountForm({
|
function AddAccountForm({
|
||||||
addAccount,
|
addAccount,
|
||||||
}: {
|
}: {
|
||||||
addAccount: (id: AccountID, secret: AgentSecret) => void;
|
addAccount: (id: RawAccountID, secret: AgentSecret) => void;
|
||||||
}) {
|
}) {
|
||||||
const [id, setId] = useState("");
|
const [id, setId] = useState("");
|
||||||
const [secret, setSecret] = useState("");
|
const [secret, setSecret] = useState("");
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
addAccount(id as AccountID, secret as AgentSecret);
|
addAccount(id as RawAccountID, secret as AgentSecret);
|
||||||
setId("");
|
setId("");
|
||||||
setSecret("");
|
setSecret("");
|
||||||
};
|
};
|
||||||
|
|||||||
42
examples/music-player/CHANGELOG.md
Normal file
42
examples/music-player/CHANGELOG.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# jazz-example-musicplayer
|
||||||
|
|
||||||
|
## 0.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
|
|
||||||
|
## 0.0.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- Updated dependencies [23369dc]
|
||||||
|
- Updated dependencies [c2b62a0]
|
||||||
|
- Updated dependencies [1a979b6]
|
||||||
|
- Updated dependencies [bcec3be]
|
||||||
|
- Updated dependencies [6ce2051]
|
||||||
|
- jazz-tools@0.8.0
|
||||||
|
- jazz-react@0.8.0
|
||||||
|
|
||||||
|
## 0.0.3-guest-auth.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.35-guest-auth.6
|
||||||
|
- jazz-tools@0.7.35-guest-auth.6
|
||||||
|
|
||||||
|
## 0.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [49a8b54]
|
||||||
|
- Updated dependencies [6f80282]
|
||||||
|
- Updated dependencies [35bbcd9]
|
||||||
|
- Updated dependencies [cac2ec9]
|
||||||
|
- Updated dependencies [f350e90]
|
||||||
|
- jazz-tools@0.7.35
|
||||||
|
- jazz-react@0.7.35
|
||||||
4
examples/music-player/Dockerfile
Normal file
4
examples/music-player/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM caddy:2.7.3-alpine
|
||||||
|
LABEL org.opencontainers.image.source="https://github.com/gardencmp/jazz"
|
||||||
|
|
||||||
|
COPY ./dist /usr/share/caddy/
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-music-player",
|
"name": "jazz-example-music-player",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.2",
|
"version": "0.0.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:0.8.1",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:0.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-router": "^6.16.0",
|
"react-router": "^6.16.0",
|
||||||
BIN
examples/music-player/public/jazz-logo.png
Normal file
BIN
examples/music-player/public/jazz-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -12,7 +12,7 @@ import { PlayerControls } from "./components/PlayerControls";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import { MusicaAccount } from "@/1_schema";
|
import { MusicaAccount } from "@/1_schema";
|
||||||
import { createJazzReactContext, DemoAuth } from "jazz-react";
|
import { createJazzReactApp, DemoAuthBasicUI, useDemoAuth } from "jazz-react";
|
||||||
import { useUploadExampleData } from "./lib/useUploadExampleData";
|
import { useUploadExampleData } from "./lib/useUploadExampleData";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,9 +25,8 @@ import { useUploadExampleData } from "./lib/useUploadExampleData";
|
|||||||
*
|
*
|
||||||
* `<Jazz.Provider/>` also runs our account migration
|
* `<Jazz.Provider/>` also runs our account migration
|
||||||
*/
|
*/
|
||||||
const Jazz = createJazzReactContext({
|
const Jazz = createJazzReactApp({
|
||||||
auth: DemoAuth({ appName: "Musica Jazz", accountSchema: MusicaAccount }),
|
AccountSchema: MusicaAccount
|
||||||
peer: "wss://mesh.jazz.tools/?key=you@example.com",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
||||||
@@ -97,10 +96,23 @@ function Main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||||
|
const [auth, state] = useDemoAuth();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Jazz.Provider auth={auth} peer="wss://mesh.jazz.tools/?key=music-player-example-jazz@gcmp.io">
|
||||||
|
{children}
|
||||||
|
</Jazz.Provider>
|
||||||
|
<DemoAuthBasicUI appName="Jazz Music Player" state={state} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Jazz.Provider>
|
<JazzAndAuth>
|
||||||
<Main />
|
<Main />
|
||||||
</Jazz.Provider>
|
</JazzAndAuth>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
1
examples/music-player/src/vite-env.d.ts
vendored
Normal file
1
examples/music-player/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
29
examples/music-player/tsconfig.json
Normal file
29
examples/music-player/tsconfig.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
||||||
|
"module": "ESNext",
|
||||||
|
"skipLibCheck": true,
|
||||||
|
|
||||||
|
/* Bundler mode */
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
|
}
|
||||||
10
examples/music-player/tsconfig.node.json
Normal file
10
examples/music-player/tsconfig.node.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# jazz-example-musicplayer
|
|
||||||
|
|
||||||
## 0.0.2
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [49a8b54]
|
|
||||||
- Updated dependencies [6f80282]
|
|
||||||
- Updated dependencies [35bbcd9]
|
|
||||||
- Updated dependencies [cac2ec9]
|
|
||||||
- Updated dependencies [f350e90]
|
|
||||||
- jazz-tools@0.7.35
|
|
||||||
- jazz-react@0.7.35
|
|
||||||
@@ -1,5 +1,34 @@
|
|||||||
# jazz-password-manager
|
# jazz-password-manager
|
||||||
|
|
||||||
|
## 0.0.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
|
|
||||||
|
## 0.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- Updated dependencies [23369dc]
|
||||||
|
- Updated dependencies [c2b62a0]
|
||||||
|
- Updated dependencies [1a979b6]
|
||||||
|
- Updated dependencies [bcec3be]
|
||||||
|
- Updated dependencies [6ce2051]
|
||||||
|
- jazz-tools@0.8.0
|
||||||
|
- jazz-react@0.8.0
|
||||||
|
|
||||||
|
## 0.0.2-guest-auth.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.35-guest-auth.6
|
||||||
|
- jazz-tools@0.7.35-guest-auth.6
|
||||||
|
|
||||||
## 0.0.1
|
## 0.0.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-password-manager",
|
"name": "jazz-password-manager",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.1",
|
"version": "0.0.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
|
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:0.8.1",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:0.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-hook-form": "^7.41.5",
|
"react-hook-form": "^7.41.5",
|
||||||
|
|||||||
@@ -1,23 +1,42 @@
|
|||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import App from "./5_App.tsx";
|
import App from "./5_App.tsx";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { createJazzReactContext, PasskeyAuth } from "jazz-react";
|
import {
|
||||||
|
createJazzReactApp,
|
||||||
|
PasskeyAuthBasicUI,
|
||||||
|
usePasskeyAuth,
|
||||||
|
} from "jazz-react";
|
||||||
import { PasswordManagerAccount } from "./1_schema.ts";
|
import { PasswordManagerAccount } from "./1_schema.ts";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
const auth = PasskeyAuth<PasswordManagerAccount>({
|
const Jazz = createJazzReactApp<PasswordManagerAccount>({
|
||||||
appName: "Jazz Password Manager",
|
AccountSchema: PasswordManagerAccount,
|
||||||
accountSchema: PasswordManagerAccount,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Jazz = createJazzReactContext<PasswordManagerAccount>({
|
|
||||||
auth,
|
|
||||||
peer: "wss://mesh.jazz.tools/?key=you@example.com",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
||||||
|
|
||||||
|
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||||
|
const [auth, state] = usePasskeyAuth({
|
||||||
|
appName: "Jazz Password Manager",
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Jazz.Provider
|
||||||
|
auth={auth}
|
||||||
|
peer="wss://mesh.jazz.tools/?key=password-manager-example-jazz@gcmp.io"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Jazz.Provider>
|
||||||
|
<PasskeyAuthBasicUI state={state} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<Jazz.Provider>
|
<React.StrictMode>
|
||||||
<App />
|
<JazzAndAuth>
|
||||||
</Jazz.Provider>
|
<App />
|
||||||
|
</JazzAndAuth>
|
||||||
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
import { PasskeyAuth } from "jazz-react";
|
|
||||||
|
|
||||||
export const PrettyAuthUI: PasskeyAuth.Component = ({
|
|
||||||
loading,
|
|
||||||
logIn,
|
|
||||||
signUp,
|
|
||||||
}) => {
|
|
||||||
const [username, setUsername] = useState<string>("");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="w-full h-full flex items-center justify-center p-5">
|
|
||||||
{loading ? (
|
|
||||||
<div>Loading...</div>
|
|
||||||
) : (
|
|
||||||
<div className="w-72 flex flex-col gap-4">
|
|
||||||
<form
|
|
||||||
className="w-72 flex flex-col gap-2"
|
|
||||||
onSubmit={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
signUp(username);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
placeholder="Display name"
|
|
||||||
value={username}
|
|
||||||
onChange={(e) => setUsername(e.target.value)}
|
|
||||||
autoComplete="webauthn"
|
|
||||||
className="text-base"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input type="submit" value="Sign Up as new account" />
|
|
||||||
</form>
|
|
||||||
<button onClick={logIn}>Log In with existing account</button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,5 +1,37 @@
|
|||||||
# jazz-example-pets
|
# jazz-example-pets
|
||||||
|
|
||||||
|
## 0.0.101
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-tools@0.8.1
|
||||||
|
- jazz-browser-media-images@0.8.1
|
||||||
|
- jazz-react@0.8.1
|
||||||
|
|
||||||
|
## 0.0.100
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ad40b88]
|
||||||
|
- Updated dependencies [23369dc]
|
||||||
|
- Updated dependencies [c2b62a0]
|
||||||
|
- Updated dependencies [1a979b6]
|
||||||
|
- Updated dependencies [bcec3be]
|
||||||
|
- Updated dependencies [6ce2051]
|
||||||
|
- jazz-tools@0.8.0
|
||||||
|
- jazz-react@0.8.0
|
||||||
|
- jazz-browser-media-images@0.8.0
|
||||||
|
|
||||||
|
## 0.0.100-guest-auth.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react@0.7.35-guest-auth.6
|
||||||
|
- jazz-tools@0.7.35-guest-auth.6
|
||||||
|
- jazz-browser-media-images@0.7.35-guest-auth.6
|
||||||
|
|
||||||
## 0.0.100
|
## 0.0.100
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-pets",
|
"name": "jazz-example-pets",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.100",
|
"version": "0.0.101",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"jazz-browser-media-images": "workspace:*",
|
"jazz-browser-media-images": "workspace:0.8.1",
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:0.8.1",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:0.8.1",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
@@ -3,54 +3,54 @@ import ReactDOM from "react-dom/client";
|
|||||||
import { Link, RouterProvider, createHashRouter } from "react-router-dom";
|
import { Link, RouterProvider, createHashRouter } from "react-router-dom";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import { createJazzReactContext, DemoAuth, PasskeyAuth } from "jazz-react";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
createJazzReactApp,
|
||||||
ThemeProvider,
|
DemoAuthBasicUI,
|
||||||
TitleAndLogo,
|
useDemoAuth,
|
||||||
} from "./basicComponents/index.ts";
|
} from "jazz-react";
|
||||||
import { PrettyAuthUI } from "./components/Auth.tsx";
|
|
||||||
|
import { Button, ThemeProvider, TitleAndLogo } from "./basicComponents/index.ts";
|
||||||
import { NewPetPostForm } from "./3_NewPetPostForm.tsx";
|
import { NewPetPostForm } from "./3_NewPetPostForm.tsx";
|
||||||
import { RatePetPostUI } from "./4_RatePetPostUI.tsx";
|
import { RatePetPostUI } from "./4_RatePetPostUI.tsx";
|
||||||
import { PetAccount, PetPost } from "./1_schema.ts";
|
import { PetAccount, PetPost } from "./1_schema.ts";
|
||||||
import { supportsWebAuthn } from "./lib/support.ts";
|
|
||||||
|
|
||||||
/** Walkthrough: The top-level provider `<WithJazz/>`
|
/** Walkthrough: The top-level provider `<Jazz.Provider/>`
|
||||||
*
|
*
|
||||||
* This shows how to use the top-level provider `<WithJazz/>`,
|
* This shows how to use the top-level provider `<Jazz.Provider/>`,
|
||||||
* which provides the rest of the app with a `LocalNode` (used through `useJazz` later),
|
* which provides the rest of the app with a `LocalNode` (used through `useJazz` later),
|
||||||
* based on `LocalAuth` that uses PassKeys (aka WebAuthn) to store a user's account secret
|
* based on `LocalAuth` that uses PassKeys (aka WebAuthn) to store a user's account secret
|
||||||
* - no backend needed. */
|
* - no backend needed. */
|
||||||
|
|
||||||
const appName = "Jazz Rate My Pet Example";
|
const appName = "Jazz Rate My Pet Example";
|
||||||
|
|
||||||
const passkeyAuth = PasskeyAuth<PetAccount>({
|
const Jazz = createJazzReactApp({ AccountSchema: PetAccount });
|
||||||
appName,
|
|
||||||
Component: PrettyAuthUI,
|
|
||||||
accountSchema: PetAccount,
|
|
||||||
});
|
|
||||||
|
|
||||||
const authFallback = DemoAuth<PetAccount>({
|
|
||||||
appName,
|
|
||||||
accountSchema: PetAccount,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Jazz = createJazzReactContext({
|
|
||||||
auth: supportsWebAuthn ? passkeyAuth : authFallback,
|
|
||||||
peer: "wss://mesh.jazz.tools/?key=you@example.com",
|
|
||||||
});
|
|
||||||
// eslint-disable-next-line react-refresh/only-export-components
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
export const { useAccount, useCoState, useAcceptInvite } = Jazz;
|
||||||
|
|
||||||
|
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||||
|
const [auth, authState] = useDemoAuth();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Jazz.Provider
|
||||||
|
auth={auth}
|
||||||
|
peer="wss://mesh.jazz.tools/?key=pets-example-jazz@gcmp.io"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Jazz.Provider>
|
||||||
|
<DemoAuthBasicUI appName={appName} state={authState} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<TitleAndLogo name={appName} />
|
<TitleAndLogo name={appName} />
|
||||||
<div className="flex flex-col h-full items-center justify-start gap-10 pt-10 pb-10 px-5">
|
<div className="flex flex-col h-full items-center justify-start gap-10 pt-10 pb-10 px-5">
|
||||||
<Jazz.Provider loading={<div>Loading</div>}>
|
<JazzAndAuth>
|
||||||
<App />
|
<App />
|
||||||
</Jazz.Provider>
|
</JazzAndAuth>
|
||||||
</div>
|
</div>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
@@ -95,10 +95,12 @@ export default function App() {
|
|||||||
<RouterProvider router={router} />
|
<RouterProvider router={router} />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => router.navigate("/").then(logOut)}
|
onClick={() =>
|
||||||
|
router.navigate("/").then(() => logOut())
|
||||||
|
}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
>
|
>
|
||||||
Log Out
|
Log out
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -107,7 +109,7 @@ export default function App() {
|
|||||||
export function PostOverview() {
|
export function PostOverview() {
|
||||||
const { me } = useAccount();
|
const { me } = useAccount();
|
||||||
|
|
||||||
const myPosts = me.root?.posts;
|
const myPosts = me?.root?.posts;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export function NewPetPostForm() {
|
|||||||
|
|
||||||
const onChangeName = useCallback(
|
const onChangeName = useCallback(
|
||||||
(name: string) => {
|
(name: string) => {
|
||||||
|
if (!me) return;
|
||||||
if (newPetPost) {
|
if (newPetPost) {
|
||||||
newPetPost.name = name;
|
newPetPost.name = name;
|
||||||
} else {
|
} else {
|
||||||
@@ -63,7 +64,7 @@ export function NewPetPostForm() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onSubmit = useCallback(() => {
|
const onSubmit = useCallback(() => {
|
||||||
if (!newPetPost) return;
|
if (!me || !newPetPost) return;
|
||||||
const myPosts = me.root?.posts;
|
const myPosts = me.root?.posts;
|
||||||
|
|
||||||
if (!myPosts) {
|
if (!myPosts) {
|
||||||
@@ -73,7 +74,7 @@ export function NewPetPostForm() {
|
|||||||
myPosts.push(newPetPost as PetPost);
|
myPosts.push(newPetPost as PetPost);
|
||||||
|
|
||||||
navigate("/pet/" + newPetPost.id);
|
navigate("/pet/" + newPetPost.id);
|
||||||
}, [me.root?.posts, newPetPost, navigate]);
|
}, [me?.root?.posts, newPetPost, navigate]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-10">
|
<div className="flex flex-col gap-10">
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
import { PasskeyAuth } from "jazz-react";
|
|
||||||
|
|
||||||
import { Input, Button } from "../basicComponents";
|
|
||||||
|
|
||||||
export const PrettyAuthUI: PasskeyAuth.Component = ({
|
|
||||||
loading,
|
|
||||||
logIn,
|
|
||||||
signUp,
|
|
||||||
}) => {
|
|
||||||
const [username, setUsername] = useState<string>("");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="w-full h-full flex items-center justify-center p-5">
|
|
||||||
{loading ? (
|
|
||||||
<div>Loading...</div>
|
|
||||||
) : (
|
|
||||||
<div className="w-72 flex flex-col gap-4">
|
|
||||||
<form
|
|
||||||
className="w-72 flex flex-col gap-2"
|
|
||||||
onSubmit={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
signUp(username);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
placeholder="Display name"
|
|
||||||
value={username}
|
|
||||||
onChange={(e) => setUsername(e.target.value)}
|
|
||||||
autoComplete="webauthn"
|
|
||||||
className="text-base"
|
|
||||||
/>
|
|
||||||
<Button asChild>
|
|
||||||
<Input
|
|
||||||
type="submit"
|
|
||||||
value="Sign Up as new account"
|
|
||||||
/>
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
<Button onClick={logIn}>
|
|
||||||
Log In with existing account
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -9,7 +9,7 @@ export class LoginPage {
|
|||||||
this.page = page;
|
this.page = page;
|
||||||
this.usernameInput = page.getByRole("textbox");
|
this.usernameInput = page.getByRole("textbox");
|
||||||
this.signupButton = page.getByRole("button", {
|
this.signupButton = page.getByRole("button", {
|
||||||
name: "Sign Up as new account",
|
name: "Sign up as new account",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export class LoginPage {
|
|||||||
async loginAs(value: string) {
|
async loginAs(value: string) {
|
||||||
await this.page
|
await this.page
|
||||||
.getByRole("button", {
|
.getByRole("button", {
|
||||||
name: `Log In as "${value}"`,
|
name: `Log in as "${value}"`,
|
||||||
})
|
})
|
||||||
.click();
|
.click();
|
||||||
}
|
}
|
||||||
|
|||||||
5
examples/richtext/package.json
Normal file
5
examples/richtext/package.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "richtext",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user