0.0.12 • Published 1 year ago

@automerge/automerge-codemirror v0.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Automerge + Codemirror

This plugin adds collaborative editing to codemirror using automerge-repo.

Example

import { Repo } from "@automerge/automerge-repo";
import { automergeSyncPlugin } from "@automerge/automerge-codemirror";
import { EditorView } from "@codemirror/view"
import { basicSetup } from "codemirror"

// Setup a repo and create a doc handle. In practice you'll probably get a
// DocHandle by loading it from a document URL
const repo = new Repo(..)
const doc = repo.create({text: ""})

// Setup the codemirror view
const container = document.createElement("div")
const view = new EditorView({
  doc: handle.docSync()!.text,
  extensions: [
    basicSetup,
    automergeSyncPlugin({
      handle,
      path: ["text"],
    }),
  ],
  parent: container,
})
0.0.12

1 year ago

0.0.10

2 years ago

0.0.11

1 year ago

0.0.9

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago