From 70a0a03130cd1ee7c234d691d9e87ea074d5139e Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Mon, 26 Nov 2018 16:16:46 +0100 Subject: [PATCH] no start content in prosemirror example --- README.v13.md | 18 ++++++++++++++++++ examples/dom.html | 31 +++++++++++++++++++++++++++++++ examples/dom.mjs | 12 ++++++++++++ examples/prosemirror.html | 5 +---- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 README.v13.md create mode 100644 examples/dom.html create mode 100644 examples/dom.mjs diff --git a/README.v13.md b/README.v13.md new file mode 100644 index 00000000..441e6611 --- /dev/null +++ b/README.v13.md @@ -0,0 +1,18 @@ +# ![Yjs](https://user-images.githubusercontent.com/5553757/48975307-61efb100-f06d-11e8-9177-ee895e5916e5.png) +> A CRDT library with a powerful abstraction of shared data + +Yjs v13 is a work in progress. + +### Typescript Declarations + +Until [this](https://github.com/Microsoft/TypeScript/issues/7546) is fixed, the only way to get type declarations is by adding Yjs to the list of checked files: + +```json +{ + "checkJs": true, + "include": [ + "./node_modules/yjs/" + ] + .. +} +``` diff --git a/examples/dom.html b/examples/dom.html new file mode 100644 index 00000000..f63eb8cf --- /dev/null +++ b/examples/dom.html @@ -0,0 +1,31 @@ + + + + Yjs Prosemirror Example + + + + +
+
+
+ + + \ No newline at end of file diff --git a/examples/dom.mjs b/examples/dom.mjs new file mode 100644 index 00000000..0c4d9197 --- /dev/null +++ b/examples/dom.mjs @@ -0,0 +1,12 @@ +import * as Y from '../index.mjs' +import { WebsocketProvider } from '../provider/websocket.mjs' +import { DomBinding } from '../bindings/dom.mjs' + +const provider = new WebsocketProvider('wss://api.yjs.website') +const ydocument = provider.get('dom') +const type = ydocument.define('xml', Y.XmlFragment) +const binding = new DomBinding(type, document.querySelector('#content'), { scrollingElement: document.scrollingElement }) + +window.example = { + provider, ydocument, type, binding +} diff --git a/examples/prosemirror.html b/examples/prosemirror.html index 512d62c4..9f66f109 100644 --- a/examples/prosemirror.html +++ b/examples/prosemirror.html @@ -43,10 +43,7 @@
- +