Compare commits

...

16 Commits

Author SHA1 Message Date
Benjamin S. Leveritt
7a3cfabb4c Merge pull request #2481 from garden-co/changeset-release/main
Version Packages
2025-06-11 09:49:08 +01:00
github-actions[bot]
df7101a8ee Version Packages 2025-06-11 08:47:01 +00:00
Benjamin S. Leveritt
f74b46ee2f Merge pull request #2495 from garden-co/2494-applydiff-out-of-bounds-for-strings-with-emoji
Fix: `applyDiff` out of bounds for strings with emoji
2025-06-11 09:43:30 +01:00
Benjamin S. Leveritt
9177579f53 Fixs coText applyDiff out of bounds insertion with emoji 2025-06-11 09:35:56 +01:00
Benjamin S. Leveritt
f1c00903f9 Removes unused navigator code 2025-06-11 09:34:06 +01:00
Benjamin S. Leveritt
1ca9299590 Adds grapheme split helpers for coText 2025-06-11 09:33:45 +01:00
Benjamin S. Leveritt
34082ccaf5 Merge pull request #2486 from garden-co/add-context-to-twoslash-errors
Adds more details to twoslash errors
2025-06-10 17:40:55 +01:00
Benjamin S. Leveritt
a09c417d81 Formats title and code to make is easier to spot 2025-06-10 17:36:41 +01:00
Benjamin S. Leveritt
00a188c22f Merge pull request #2484 from garden-co/2483-encryption-in-jazz-docs
2483 encryption in jazz docs
2025-06-10 16:39:31 +01:00
Benjamin S. Leveritt
dc630b0807 Update homepage/homepage/content/docs/resources/encryption.mdx
Co-authored-by: Anselm Eickhoff <anselm.eickhoff@gmail.com>
2025-06-10 16:39:20 +01:00
Benjamin S. Leveritt
484baabe22 Updates introduction sentence as per feedback 2025-06-10 16:38:16 +01:00
Benjamin S. Leveritt
f529bede7b Adds more details to twoslash errors
To make it easier to track down
2025-06-10 16:37:01 +01:00
Trisha Lim
6f637d21ab Merge pull request #2446 from garden-co/feat/analytics
feat: track create-jazz-app copy action in hero
2025-06-10 15:54:23 +01:00
Benjamin S. Leveritt
aeb96510da Adds a section to the FAQ 2025-06-10 15:31:20 +01:00
Benjamin S. Leveritt
d53cc3676d Adds Encryption reference doc 2025-06-10 15:23:13 +01:00
Trisha Lim
2a2b474aa4 feat: track create-jazz-app copy action in hero 2025-06-05 16:16:06 +01:00
97 changed files with 518 additions and 113 deletions

View File

@@ -1,8 +0,0 @@
---
"cojson-storage-sqlite": patch
"jazz-react-native": patch
"cojson-storage": patch
"jazz-expo": patch
---
Close the DB connection when the node/context is closed

View File

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

View File

@@ -1,6 +1,5 @@
{
"name": "chat-rn-expo",
"main": "index.ts",
"scripts": {
"build": "expo prebuild",

View File

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

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-example-chat",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "clerk",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,5 @@
{
"name": "file-share-svelte",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,7 +1,6 @@
{
"name": "filestream",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "form",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "image-upload",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-inspector-app",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,5 @@
{
"name": "jazz-nextjs",
"private": true,
"scripts": {
"dev": "next dev --turbopack",

View File

@@ -1,7 +1,6 @@
{
"name": "multi-cursors",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "multiauth",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-example-music-player",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "organization",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,5 @@
{
"name": "passkey-svelte",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,7 +1,6 @@
{
"name": "passkey",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "passphrase",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-password-manager",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-example-pets",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "reactions",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,5 @@
{
"name": "example-prosekit-jazz",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,7 +1,6 @@
{
"name": "richtext",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "richtext-tiptap",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,5 @@
{
"name": "todo-vue",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,7 +1,6 @@
{
"name": "jazz-example-todo",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,7 +1,6 @@
{
"name": "version-history",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -8,7 +8,13 @@ export function CopyButton({
code,
size,
className,
}: { code: string; size: "md" | "lg"; className?: string }) {
onCopy,
}: {
code: string;
size: "md" | "lg";
className?: string;
onCopy?: () => void;
}) {
const [copyCount, setCopyCount] = useState(0);
const copied = copyCount > 0;
@@ -38,6 +44,7 @@ export function CopyButton({
window.navigator.clipboard.writeText(code).then(() => {
setCopyCount((count) => count + 1);
});
onCopy?.();
}}
>
<span

View File

@@ -1,3 +1,5 @@
"use client";
import CreateJazzApp from "@/components/home/CreateJazzApp.mdx";
import { marketingCopy } from "@/content/marketingCopy";
import { H1 } from "@garden-co/design-system/src/components/atoms/Headings";
@@ -9,6 +11,7 @@ import { Kicker } from "@garden-co/design-system/src/components/atoms/Kicker";
import { CopyButton } from "@garden-co/design-system/src/components/molecules/CodeGroup";
import { Prose } from "@garden-co/design-system/src/components/molecules/Prose";
import { SectionHeader } from "@garden-co/design-system/src/components/molecules/SectionHeader";
import { track } from "@vercel/analytics";
import Link from "next/link";
const features: Array<{
@@ -107,6 +110,7 @@ export function HeroSection() {
code="npx create-jazz-app@latest"
size="md"
className="mt-0.5 mr-0.5"
onCopy={() => track("create-jazz-app command copied from hero")}
/>
</div>
<div className="p-3">

View File

@@ -306,6 +306,11 @@ export const docNavigationItems = [
{
name: "Resources",
items: [
{
name: "Encryption",
href: "/docs/resources/encryption",
done: 100,
},
{
name: "Jazz under the hood",
href: "/docs/jazz-under-the-hood",

View File

@@ -19,3 +19,16 @@ That's why we've designed Jazz with longevity in mind from the start:
This approach creates a foundation that can continue regardless of any single company's involvement. The local-first architecture means your apps will always work, even offline, and your data remains yours.
## How secure is my data?
Jazz encrypts all your data by default using modern cryptographic standards. Every transaction is cryptographically signed, and data is encrypted using industry-standard algorithms including Blake3 hashing, ed25519 signatures, and xsalsa20 stream ciphers.
Key features of Jazz's security:
- **Privacy by default**: Your data is encrypted even on Jazz Cloud servers
- **Automatic key rotation**: When members are removed from Groups, encryption keys rotate automatically
- **Verifiable authenticity**: Every change is cryptographically signed
- **Zero-trust architecture**: Only people you explicitly grant access can read your data
For technical details, see our [encryption documentation](/docs/resources/encryption).

View File

@@ -0,0 +1,80 @@
export const metadata = {
description: "How Jazz encrypts your data to ensure privacy and security."
};
# Encryption
Jazz uses proven cryptographic primitives in a novel, but simple protocol to implement auditable permissions while allowing real-time collaboration and offline editing.
## How encryption works
Jazz uses proven cryptographic primitives in a novel, but simple protocol to implement auditable permissions while allowing real-time collaboration and offline editing.
### Write permissions: Signing with your keys
When you create or modify CoValues, Jazz cryptographically signs every transaction:
- All transactions are signed with your account's signing keypair
- This proves the transaction came from you
- Whether transactions are valid depends on your permissions in the Group that owns the CoValue
- Groups have internal logic ensuring only admins can change roles or create invites
- You can add yourself to a Group only with a specific role via invites
### Read permissions: Symmetric encryption
Groups use a shared "read key" for encrypting data:
- Admins reveal this symmetric encryption key to accounts with "reader" role or higher
- All transactions in CoValues owned by that Group are encrypted with the current read key
- When someone is removed from a Group, the read key rotates and gets revealed to all remaining members
- CoValues start using the new read key for future transactions
This means removed members can't read new data, but existing data they already had access to remains readable to them.
## Key rotation and security
Jazz automatically handles key management:
- **Member removal triggers rotation**: When you remove someone from a Group, Jazz generates a new read key
- **Seamless transition**: New transactions use the new key immediately
- **No data loss**: Existing members get the new key automatically
## Streaming encryption
Jazz encrypts data efficiently for real-time collaboration:
- **Incremental hashing**: CoValue sessions use [Blake3](https://github.com/BLAKE3-team/BLAKE3) for append-only hashing
- **Session signatures**: Each session is signed with [ed25519](https://ed25519.cr.yp.to/) after each transaction
- **Stream ciphers**: Data is encrypted using [xsalsa20](https://cr.yp.to/salsa20.html) stream cipher
- **Integrity protection**: Hashing and signing ensure data hasn't been tampered with
## Content addressing
CoValue IDs are the [Blake3](https://github.com/BLAKE3-team/BLAKE3) hash of their immutable "header" (containing CoValue type and owning group). This allows CoValues to be "content addressed" while remaining dynamic and changeable.
## What this means for you
**Privacy by default**: Your data is always encrypted, even on Jazz Cloud servers. Only people you explicitly give access to can read your data.
**Flexible permissions**: Use Groups to control exactly who can read, write, or admin your CoValues.
**Automatic security**: Key rotation and encryption happen behind the scenes - you don't need to think about it.
**Verifiable authenticity**: Every change is cryptographically signed, so you always know who made what changes.
## Further reading
- [Blake3](https://github.com/BLAKE3-team/BLAKE3) - append-only hashing
- [ed25519](https://ed25519.cr.yp.to/) - signature scheme
- [xsalsa20](https://cr.yp.to/salsa20.html) - stream cipher for data encryption
### Implementation details
The cryptographic primitives are implemented in the [`cojson/src/crypto`](https://github.com/garden-co/jazz/tree/main/packages/cojson/src/crypto) package.
Key files to explore:
- [`permissions.ts`](https://github.com/garden-co/jazz/blob/main/packages/cojson/src/permissions.ts) - Permission logic
- [`permissions.test.ts`](https://github.com/garden-co/jazz/blob/main/packages/cojson/src/tests/permissions.test.ts) - Permission tests
- [`verifiedState.ts`](https://github.com/garden-co/jazz/blob/main/packages/cojson/src/coValueCore/verifiedState.ts) - State verification
- [`coValueCore.test.ts`](https://github.com/garden-co/jazz/blob/main/packages/cojson/src/tests/coValueCore.test.ts) - Core functionality tests

View File

@@ -52,7 +52,16 @@ const config = {
};
const highlighterPromise = createHighlighter({
langs: ["typescript", "bash", "tsx", "json", "ruby", "groovy", "svelte", "vue"],
langs: [
"typescript",
"bash",
"tsx",
"json",
"ruby",
"groovy",
"svelte",
"vue",
],
themes: [jazzLight, jazzDark],
});
@@ -78,8 +87,12 @@ function highlightPlugin() {
throws: false, //process.env.NODE_ENV === "production",
onTwoslashError:
process.env.NODE_ENV !== "production"
? (e) => {
console.error(e);
? (e, code) => {
const { description, recommendation } = e;
console.error("\nTwoslash error: ");
console.log(description);
console.log(recommendation);
console.log("\nCode: \n```\n" + code + "\n```");
error = e;
}
: undefined,

View File

@@ -1,5 +1,14 @@
# cojson-storage-indexeddb
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [5f42c97]
- cojson@0.14.23
- cojson-storage@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage-indexeddb",
"version": "0.14.22",
"version": "0.14.23",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,15 @@
# cojson-storage-sqlite
## 0.14.23
### Patch Changes
- 5f42c97: Close the DB connection when the node/context is closed
- Updated dependencies [1ca9299]
- Updated dependencies [5f42c97]
- cojson@0.14.23
- cojson-storage@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,13 +1,13 @@
{
"name": "cojson-storage-sqlite",
"type": "module",
"version": "0.14.22",
"version": "0.14.23",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"better-sqlite3": "^11.7.0",
"cojson": "workspace:0.14.22",
"cojson": "workspace:0.14.23",
"cojson-storage": "workspace:*"
},
"devDependencies": {

View File

@@ -1,5 +1,13 @@
# cojson-storage
## 0.14.23
### Patch Changes
- 5f42c97: Close the DB connection when the node/context is closed
- Updated dependencies [1ca9299]
- cojson@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage",
"version": "0.14.22",
"version": "0.14.23",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,12 @@
# cojson-transport-nodejs-ws
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- cojson@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-transport-ws",
"type": "module",
"version": "0.14.22",
"version": "0.14.23",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,11 @@
# cojson
## 0.14.23
### Patch Changes
- 1ca9299: Adds grapheme split helpers for coText
## 0.14.22
### Patch Changes

View File

@@ -25,7 +25,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.14.22",
"version": "0.14.23",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^2.0.0",
"typescript": "catalog:"

View File

@@ -3,12 +3,6 @@ import { AvailableCoValueCore } from "../coValueCore/coValueCore.js";
import { JsonObject } from "../jsonValue.js";
import { DeletionOpPayload, OpID, RawCoList } from "./coList.js";
declare const navigator:
| {
language: string;
}
| undefined;
export type StringifiedOpID = string & { __stringifiedOpID: true };
export function stringifyOpID(opID: OpID): StringifiedOpID {
@@ -63,15 +57,6 @@ export class RawCoPlainText<
constructor(core: AvailableCoValueCore) {
super(core);
this._cachedMapping = new WeakMap();
// Use locale from meta if provided, fallback to browser locale, or 'en' as last resort
const effectiveLocale =
(core.verified.header.meta &&
typeof core.verified.header.meta === "object" &&
"locale" in core.verified.header.meta
? (core.verified.header.meta.locale as string)
: undefined) ||
(typeof navigator !== "undefined" ? navigator.language : "en");
}
get mapping() {
@@ -182,4 +167,14 @@ export class RawCoPlainText<
this.core.makeTransaction(ops, privacy);
this.processNewTransactions();
}
/** @internal Helper method to split text into graphemes */
toGraphemes(text: string): string[] {
return [...splitGraphemes(text)];
}
/** @internal Helper method to join graphemes into a string */
fromGraphemes(graphemes: string[]): string {
return graphemes.join("");
}
}

View File

@@ -265,3 +265,24 @@ test("Handle deletion of complex grapheme clusters correctly", () => {
content.deleteRange({ from: 1, to: 2 }, "trusting");
expect(content.toString()).toEqual(" 녕!");
});
test("Splits into and from grapheme string arrays", () => {
const node = nodeWithRandomAgentAndSessionID();
const coValue = node.createCoValue({
type: "coplaintext",
ruleset: { type: "unsafeAllowAll" },
meta: null,
...Crypto.createdNowUnique(),
});
const content = expectPlainText(coValue.getCurrentContent());
content.insertAfter(0, "👋 안녕!", "trusting");
expect(content.toString()).toEqual("👋 안녕!");
const graphemes = content.toGraphemes("👋 안녕!");
expect(graphemes).toEqual(["👋", " ", "안", "녕", "!"]);
const text = content.fromGraphemes(graphemes);
expect(text).toEqual("👋 안녕!");
});

View File

@@ -1,5 +1,16 @@
# jazz-auth-betterauth
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-browser@0.14.23
- jazz-betterauth-client-plugin@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-auth-betterauth",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,15 @@
# jazz-auth-clerk
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,14 +1,14 @@
{
"name": "jazz-auth-clerk",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"cojson": "workspace:0.14.22",
"jazz-browser": "workspace:0.14.22",
"jazz-tools": "workspace:0.14.22"
"cojson": "workspace:0.14.23",
"jazz-browser": "workspace:0.14.23",
"jazz-tools": "workspace:0.14.23"
},
"scripts": {
"format-and-lint": "biome check .",

View File

@@ -1,5 +1,11 @@
# jazz-betterauth-client-plugin
## 0.14.23
### Patch Changes
- jazz-betterauth-server-plugin@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-betterauth-client-plugin",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,15 @@
# jazz-betterauth-server-plugin
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-betterauth-server-plugin",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,13 @@
# jazz-browser-media-images
## 0.14.23
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser-media-images",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
"dependencies": {
"@types/image-blob-reduce": "^4.1.1",
"image-blob-reduce": "^4.1.0",
"jazz-browser": "workspace:0.14.22",
"jazz-tools": "workspace:0.14.22",
"jazz-browser": "workspace:0.14.23",
"jazz-tools": "workspace:0.14.23",
"pica": "^9.0.1"
},
"scripts": {

View File

@@ -1,5 +1,16 @@
# jazz-browser
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-storage-indexeddb@0.14.23
- cojson-transport-ws@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,19 @@
# jazz-browser
## 0.14.23
### Patch Changes
- 5f42c97: Close the DB connection when the node/context is closed
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-transport-ws@0.14.23
- jazz-auth-clerk@0.14.23
- jazz-react-core@0.14.23
- jazz-react-native-core@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-expo",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,13 @@
# jazz-inspector-element
## 0.14.23
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
- jazz-inspector@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector-element",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "./dist/main.js",
"types": "./dist/main.d.ts",

View File

@@ -1,5 +1,15 @@
# jazz-inspector
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-react-core@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "./dist/app.js",
"types": "./dist/app.d.ts",

View File

@@ -1,5 +1,15 @@
# jazz-autosub
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-transport-ws@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -5,7 +5,7 @@
"types": "dist/index.d.ts",
"type": "module",
"license": "MIT",
"version": "0.14.22",
"version": "0.14.23",
"dependencies": {
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",

View File

@@ -1,5 +1,18 @@
# jazz-react-auth-betterauth
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-auth-betterauth@0.14.23
- jazz-browser@0.14.23
- jazz-react@0.14.23
- jazz-betterauth-client-plugin@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-auth-betterauth",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "src/index.tsx",

View File

@@ -1,5 +1,17 @@
# jazz-browser-media-images
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-auth-clerk@0.14.23
- jazz-browser@0.14.23
- jazz-react@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-auth-clerk",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,14 @@
# jazz-react-core
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-core",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,18 @@
# jazz-browser
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- Updated dependencies [5f42c97]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-storage@0.14.23
- cojson-transport-ws@0.14.23
- jazz-react-core@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-react-native-core",
"type": "module",
"version": "0.14.22",
"version": "0.14.23",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,12 @@
# jazz-browser-media-images
## 0.14.23
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native-media-images",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,18 @@
# jazz-browser
## 0.14.23
### Patch Changes
- 5f42c97: Close the DB connection when the node/context is closed
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- Updated dependencies [5f42c97]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-storage@0.14.23
- jazz-react-native-core@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,18 @@
# jazz-react
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-transport-ws@0.14.23
- jazz-browser@0.14.23
- jazz-react-core@0.14.23
- jazz-browser-media-images@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -23,10 +23,10 @@
"@scure/bip39": "^1.3.0",
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",
"jazz-browser-media-images": "workspace:0.14.22",
"jazz-browser": "workspace:0.14.22",
"jazz-react-core": "workspace:0.14.22",
"jazz-tools": "workspace:0.14.22"
"jazz-browser-media-images": "workspace:0.14.23",
"jazz-browser": "workspace:0.14.23",
"jazz-react-core": "workspace:0.14.23",
"jazz-tools": "workspace:0.14.23"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",

View File

@@ -1,5 +1,13 @@
# jazz-richtext-prosemirror
## 0.14.23
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-richtext-prosemirror",
"version": "0.14.22",
"version": "0.14.23",
"description": "ProseMirror integration for Jazz rich text editing",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,14 @@
# jazz-richtext-tiptap
## 0.14.23
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
- jazz-browser@0.14.23
- jazz-richtext-prosemirror@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-richtext-tiptap",
"version": "0.14.22",
"version": "0.14.23",
"description": "Tiptap integration for Jazz rich text editing",
"main": "dist/index.js",
"types": "src/index.ts",

View File

@@ -1,5 +1,17 @@
# jazz-run
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- Updated dependencies [5f42c97]
- cojson@0.14.23
- jazz-tools@0.14.23
- cojson-storage-sqlite@0.14.23
- cojson-transport-ws@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -3,7 +3,7 @@
"bin": "./dist/index.js",
"type": "module",
"license": "MIT",
"version": "0.14.22",
"version": "0.14.23",
"exports": {
"./startSyncServer": {
"import": "./dist/startSyncServer.js",
@@ -28,11 +28,11 @@
"@effect/printer-ansi": "^0.34.5",
"@effect/schema": "^0.71.1",
"@effect/typeclass": "^0.25.5",
"cojson": "workspace:0.14.22",
"cojson-storage-sqlite": "workspace:0.14.22",
"cojson-transport-ws": "workspace:0.14.22",
"cojson": "workspace:0.14.23",
"cojson-storage-sqlite": "workspace:0.14.23",
"cojson-transport-ws": "workspace:0.14.23",
"effect": "^3.6.5",
"jazz-tools": "workspace:0.14.22",
"jazz-tools": "workspace:0.14.23",
"ws": "^8.14.2"
},
"devDependencies": {

View File

@@ -1,5 +1,15 @@
# jazz-svelte
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-svelte",
"version": "0.14.22",
"version": "0.14.23",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",

View File

@@ -1,5 +1,13 @@
# jazz-tools
## 0.14.23
### Patch Changes
- 9177579: Fixs coText applyDiff out of bounds insertion with emoji
- Updated dependencies [1ca9299]
- cojson@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -17,7 +17,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.14.22",
"version": "0.14.23",
"dependencies": {
"@scure/bip39": "^1.3.0",
"cojson": "workspace:*",

View File

@@ -178,12 +178,22 @@ export class CoPlainText extends String implements CoValue {
*/
applyDiff(other: string) {
const current = this._raw.toString();
for (const [from, to, insert] of [...calcPatch(current, other)].reverse()) {
// Split both strings into grapheme arrays for proper comparison
const currentGraphemes = this._raw.toGraphemes(current);
const otherGraphemes = this._raw.toGraphemes(other);
// Calculate the diff on grapheme arrays
const patches = [...calcPatch(currentGraphemes, otherGraphemes)];
// Apply patches in reverse order to avoid index shifting issues
for (const [from, to, insert] of patches.reverse()) {
if (to > from) {
this.deleteRange({ from, to });
}
if (insert.length > 0) {
this.insertBefore(from, insert);
// Join the graphemes back into a string for insertion
this.insertBefore(from, this._raw.fromGraphemes(insert));
}
}
}

View File

@@ -85,6 +85,14 @@ describe("CoPlainText", () => {
text.applyDiff("hello cruel world");
expect(text.toString()).toEqual("hello cruel world");
});
test("applyDiff with complex grapheme clusters", () => {
const text = co.plainText().create(`😊`, { owner: me });
text.applyDiff(`😊안녕!`);
expect(text.toString()).toEqual(`😊안녕!`);
text.applyDiff(`😊👋 안녕!`);
expect(text.toString()).toEqual(`😊👋 안녕!`);
});
});
describe("Properties", () => {

View File

@@ -1,5 +1,15 @@
# jazz-react
## 0.14.23
### Patch Changes
- Updated dependencies [1ca9299]
- Updated dependencies [9177579]
- cojson@0.14.23
- jazz-tools@0.14.23
- jazz-browser@0.14.23
## 0.14.22
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-vue",
"version": "0.14.22",
"version": "0.14.23",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

28
pnpm-lock.yaml generated
View File

@@ -2142,7 +2142,7 @@ importers:
specifier: ^11.7.0
version: 11.7.0
cojson:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../cojson
cojson-storage:
specifier: workspace:*
@@ -2241,13 +2241,13 @@ importers:
packages/jazz-auth-clerk:
dependencies:
cojson:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../cojson
jazz-browser:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-browser
jazz-tools:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-tools
devDependencies:
typescript:
@@ -2323,10 +2323,10 @@ importers:
specifier: ^4.1.0
version: 4.1.0
jazz-browser:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-browser
jazz-tools:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-tools
pica:
specifier: ^9.0.1
@@ -2487,16 +2487,16 @@ importers:
specifier: workspace:*
version: link:../cojson-transport-ws
jazz-browser:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-browser
jazz-browser-media-images:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-browser-media-images
jazz-react-core:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-react-core
jazz-tools:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-tools
devDependencies:
'@testing-library/dom':
@@ -2820,19 +2820,19 @@ importers:
specifier: ^0.25.5
version: 0.25.8(effect@3.11.9)
cojson:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../cojson
cojson-storage-sqlite:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../cojson-storage-sqlite
cojson-transport-ws:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../cojson-transport-ws
effect:
specifier: ^3.6.5
version: 3.11.9
jazz-tools:
specifier: workspace:0.14.22
specifier: workspace:0.14.23
version: link:../jazz-tools
ws:
specifier: ^8.14.2

View File

@@ -1,5 +1,14 @@
# jazz-tailwind-demo-auth-starter
## 0.0.114
### Patch Changes
- Updated dependencies [9177579]
- jazz-tools@0.14.23
- jazz-inspector@0.14.23
- jazz-react@0.14.23
## 0.0.113
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-react-tailwind-starter",
"private": true,
"version": "0.0.113",
"version": "0.0.114",
"type": "module",
"scripts": {
"dev": "vite",