diff --git a/.jsdoc.json b/.jsdoc.json index f8638a27..c987d659 100644 --- a/.jsdoc.json +++ b/.jsdoc.json @@ -17,7 +17,7 @@ "useCollapsibles": true, "collapse": true, "resources": { - "y-js.org": "y-js.org" + "y-js.org": "yjs.website" }, "logo": { "url": "https://user-images.githubusercontent.com/5553757/48975307-61efb100-f06d-11e8-9177-ee895e5916e5.png", diff --git a/README.new.md b/README.new.md deleted file mode 100644 index b5589784..00000000 --- a/README.new.md +++ /dev/null @@ -1,14 +0,0 @@ - -### 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/examples.json b/examples/examples.json index 31e1a19c..7f2e9d55 100644 --- a/examples/examples.json +++ b/examples/examples.json @@ -7,5 +7,8 @@ }, "quill": { "title": "Quill Binding" + }, + "dom": { + "title": "Dom Binding" } } \ No newline at end of file diff --git a/examples/prosemirror.html b/examples/prosemirror.html index 37271c36..512d62c4 100644 --- a/examples/prosemirror.html +++ b/examples/prosemirror.html @@ -42,7 +42,6 @@
-
\ No newline at end of file diff --git a/examples/prosemirror.mjs b/examples/prosemirror.mjs index 737eb8b6..d4f21c52 100644 --- a/examples/prosemirror.mjs +++ b/examples/prosemirror.mjs @@ -12,9 +12,11 @@ const provider = new WebsocketProvider('wss://api.yjs.website') const ydocument = provider.get('prosemirror') const type = ydocument.define('prosemirror', Y.XmlFragment) -window.prosemirrorView = new EditorView(document.querySelector('#editor'), { +const prosemirrorView = new EditorView(document.querySelector('#editor'), { state: EditorState.create({ doc: DOMParser.fromSchema(schema).parse(document.querySelector('#content')), plugins: exampleSetup({schema}).concat([prosemirrorPlugin(type), cursorPlugin]) }) }) + +window.example = { provider, ydocument, type, prosemirrorView } diff --git a/examples/quill.html b/examples/quill.html index e9740b83..12cc6491 100644 --- a/examples/quill.html +++ b/examples/quill.html @@ -3,42 +3,6 @@ Yjs Prosemirror Example - @@ -49,6 +13,35 @@
\ No newline at end of file diff --git a/examples/style.css b/examples/style.css index cf68ca83..232e234b 100644 --- a/examples/style.css +++ b/examples/style.css @@ -24,6 +24,6 @@ footer { } .main section article.readme h1:first-child::before { - content: "The Shared Editing Library"; + content: "Yjs"; font-size: 2em; } \ No newline at end of file diff --git a/examples/textarea.html b/examples/textarea.html index 13c80650..cff19dc6 100644 --- a/examples/textarea.html +++ b/examples/textarea.html @@ -1,58 +1,23 @@ - Yjs Prosemirror Example + Yjs Textarea Example -
-
- - - - - - -
-
-
-
- - - diff --git a/examples_all/quill/index.js b/examples_all/quill/index.js deleted file mode 100644 index 2634c0d8..00000000 --- a/examples_all/quill/index.js +++ /dev/null @@ -1,29 +0,0 @@ -/* global Y, Quill */ - -let y = new Y('quill-cursors-0', { - connector: { - name: 'websockets-client', - url: 'http://127.0.0.1:1234' - } -}) - -let quill = new Quill('#quill-container', { - modules: { - toolbar: [ - [{ header: [1, 2, false] }], - ['bold', 'italic', 'underline'], - ['image', 'code-block'], - [{ color: [] }, { background: [] }], // Snow theme fills in values - [{ script: 'sub' }, { script: 'super' }], - ['link', 'image'], - ['link', 'code-block'], - [{ list: 'ordered' }, { list: 'bullet' }] - ] - }, - placeholder: 'Compose an epic...', - theme: 'snow' // or 'bubble' -}) - -let yText = y.define('quill', Y.Text) - -window.quillBinding = new Y.QuillBinding(yText, quill) diff --git a/examples_all/xml/index.html b/examples_all/xml/index.html deleted file mode 100644 index 78403a40..00000000 --- a/examples_all/xml/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - -

Shared DOM Example

-

Use native DOM function or jQuery to manipulate the shared DOM (window.sharedDom).

-
- - -
-
- - -
-
- - -
- - - - diff --git a/examples_all/xml/index.js b/examples_all/xml/index.js deleted file mode 100644 index 02b33561..00000000 --- a/examples_all/xml/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/* global Y */ - -let y = new Y('xml-example', { - connector: { - name: 'websockets-client', - url: 'http://127.0.0.1:1234' - } -}) - -window.yXml = y -// bind xml type to a dom, and put it in body -window.sharedDom = y.define('xml', Y.XmlElement).toDom() -document.body.appendChild(window.sharedDom) diff --git a/package.json b/package.json index 1f7f3f63..a100c98d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "watch": "rollup -wc", "debug": "concurrently 'rollup -wc' 'cutest-serve build/y.test.js -o'", "lint": "standard **/*.js", - "docs": "rm -rf docs; jsdoc --configure ./.jsdoc.json --verbose --readme ./README.md --package ./package.json || true", + "docs": "rm -rf docs; jsdoc --configure ./.jsdoc.json --verbose --readme ./README.v13.md --package ./package.json || true", "serve-docs": "npm run docs && serve ./docs/", "postversion": "npm run build", "websocket-server": "node --experimental-modules ./provider/websocket/server.mjs", diff --git a/rollup.config.js b/rollup.config.js index cc4e1d05..68a9354c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -43,6 +43,18 @@ export default [{ babel(), uglify() ] +}, { + input: './examples/dom.mjs', + output: { + name: 'dom', + file: 'examples/build/dom.js', + format: 'iife', + sourcemap: true + }, + plugins: [ + babel(), + uglify() + ] }, { input: './examples/textarea.mjs', output: {