This commit is contained in:
Kevin Jahns
2026-07-01 12:00:42 +02:00
parent bdb182df31
commit c0f9ee9961
2 changed files with 7 additions and 4 deletions

View File

@@ -175,7 +175,7 @@ are implemented in separate modules.
| [Superdoc](https://superdoc.dev/) | ✔ | (native) | [demo](https://superdoc.dev/) |
| [valtio](https://github.com/pmndrs/valtio) | | [valtio-yjs](https://github.com/dai-shi/valtio-yjs) | [demo](https://codesandbox.io/s/valtio-yjs-demo-ox3iy) |
| [immer](https://github.com/immerjs/immer) | | [immer-yjs](https://github.com/sep2/immer-yjs) | [demo](https://codesandbox.io/s/immer-yjs-demo-6e0znb) |
| [mutative](https://github.com/unadlib/mutative) | | [mutative-yjs](https://github.com/mutativejs/mutative-yjs) | [demo](https://codesandbox.io/p/sandbox/fjrwk3) |
| [mutative](https://github.com/unadlib/mutative) | | [mutative-yjs](https://github.com/mutativejs/mutative-yjs) | [demo](https://codesandbox.io/p/sandbox/fjrwk3) |
| React | | [react-yjs](https://github.com/nikgraf/react-yjs) | [demo](https://react-yjs-example.vercel.app/) |
| React / Vue / Svelte / MobX | | [SyncedStore](https://syncedstore.org) | [demo](https://syncedstore.org/docs/react) |
| [mobx-keystone](https://mobx-keystone.js.org/) | | [mobx-keystone-yjs](https://github.com/xaviergonz/mobx-keystone/tree/master/packages/mobx-keystone-yjs) | [demo](https://mobx-keystone.js.org/examples/yjs-binding) |

View File

@@ -553,7 +553,8 @@ export const testRdtFormatRebold = () => {
root.insert(0, 'abcdef')
// diff against a baseline taken BEFORE formatting => every format change is an attributed suggestion
root.useRenderer(Y.createDiffRenderer(Y.cloneDoc(doc), doc))
void root.delta // first access starts maintaining the incremental cache
// first access starts maintaining the incremental cache (baseline == current, so no suggestions yet)
t.assert(root.delta.equals(delta.create().insert('abcdef').done()))
root.format(0, 6, { bold: true }) // all bold
root.format(2, 2, { bold: null }) // un-bold "cd" (inserts a transient bold:null marker)
root.format(2, 2, { bold: true }) // re-bold "cd" => DELETES that transient marker
@@ -592,7 +593,8 @@ export const testRdtFormatEmbedInBold = () => {
const root = doc.get('root')
root.insert(0, 'ab')
root.useRenderer(Y.createDiffRenderer(Y.cloneDoc(doc), doc))
void root.delta // first access starts maintaining the incremental cache
// first access starts maintaining the incremental cache (baseline == current, so no suggestions yet)
t.assert(root.delta.equals(delta.create().insert('ab').done()))
root.format(0, 2, { bold: true }) // bold "ab"
root.insert(1, [new Y.Type()]) // insert an embed inside the bold run: "a<T>b"
const cached = root.delta
@@ -624,7 +626,8 @@ export const testRdtFormatDeleteFormatted = () => {
const root = doc.get('root')
root.insert(0, 'a')
root.useRenderer(Y.createDiffRenderer(Y.cloneDoc(doc), doc)) // baseline before formatting
void root.delta // start maintaining the incremental cache
// start maintaining the incremental cache (baseline == current, so no suggestions yet)
t.assert(root.delta.equals(delta.create().insert('a').done()))
root.format(0, 1, { bold: true }) // bold "a"
root.delete(0, 1) // delete "a"
const cached = root.delta