0.0.3 • Published 10 months ago

automerge-monaco v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
10 months ago

Automerge + Monaco

This plugin adds collaborative editing to monaco-editor using automerge.

Example

import {Repo} from "@automerge/automerge-repo"
import automonaco from "automerge-monaco"
import {EditorView} from "@codemirror/view"
import {basicSetup} from "codemirror"

// set up a repo and create a doc handle.
// see https://automerge.org/docs/quickstart/
let repo = new Repo(..)
let doc = repo.create({code: ""})

// set up monaco
let monaco = await loader.init()
let container = document.getElementById("editor")!
let editor = monaco.editor.create(container, {
	value: handle.docSync()?.code,
	language: "javascript",
	automaticLayout: true,
})

automonaco(editor, handle, ["code"])
0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

11 months ago

0.0.0

11 months ago