Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
9,121 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "yjs-demos-prosemirror-dat", | ||
"version": "1.0.0", | ||
"description": "Yjs ProseMirror editor binding demo", | ||
"main": "index.js", | ||
"scripts": { | ||
"dist": "webpack --mode=production", | ||
"start": "webpack-dev-server --open-page prosemirror.html", | ||
"postinstall": "npm run dist" | ||
}, | ||
"author": "Kevin Jahns <kevin.jahns@pm.me>", | ||
"license": "UNLICENSE", | ||
"dependencies": { | ||
"prosemirror-example-setup": "^1.1.2", | ||
"prosemirror-model": "^1.9.1", | ||
"prosemirror-state": "^1.3.3", | ||
"prosemirror-view": "^1.14.6", | ||
"serve": "^11.2.0", | ||
"webpack": "^4.42.1", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3", | ||
"y-dat": "0.0.1", | ||
"y-prosemirror": "^0.3.3", | ||
"yjs": "^13.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>Yjs Prosemirror Dat Example</title> | ||
<script type="text/javascript" src="./dist/prosemirror.bundle.js" async></script> | ||
<link rel=stylesheet href="./prosemirror.css" async defer> | ||
<style> | ||
placeholder { | ||
display: inline; | ||
border: 1px solid #ccc; | ||
color: #ccc; | ||
} | ||
placeholder:after { | ||
content: "☁"; | ||
font-size: 200%; | ||
line-height: 0.1; | ||
font-weight: bold; | ||
} | ||
.ProseMirror img { max-width: 100px } | ||
|
||
/* this is a rough fix for the first cursor position when the first paragraph is empty */ | ||
.ProseMirror > .ProseMirror-yjs-cursor:first-child { | ||
margin-top: 16px; | ||
} | ||
.ProseMirror p:first-child, .ProseMirror h1:first-child, .ProseMirror h2:first-child, .ProseMirror h3:first-child, .ProseMirror h4:first-child, .ProseMirror h5:first-child, .ProseMirror h6:first-child { | ||
margin-top: 16px | ||
} | ||
/* This gives the remote user caret. The colors are automatically overwritten*/ | ||
.ProseMirror-yjs-cursor { | ||
position: relative; | ||
margin-left: -1px; | ||
margin-right: -1px; | ||
border-left: 1px solid black; | ||
border-right: 1px solid black; | ||
border-color: orange; | ||
word-break: normal; | ||
pointer-events: none; | ||
} | ||
/* This renders the username above the caret */ | ||
.ProseMirror-yjs-cursor > div { | ||
position: absolute; | ||
top: -1.05em; | ||
left: -1px; | ||
font-size: 13px; | ||
background-color: rgb(250, 129, 0); | ||
font-family: serif; | ||
font-style: normal; | ||
font-weight: normal; | ||
line-height: normal; | ||
user-select: none; | ||
color: white; | ||
padding-left: 2px; | ||
padding-right: 2px; | ||
white-space: nowrap; | ||
} | ||
#y-functions { | ||
position: absolute; | ||
top: 20px; | ||
right: 20px; | ||
} | ||
#y-functions > * { | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="y-functions"> | ||
<div id="y-version"></div> | ||
<button type="button" id="y-connect-btn">Disconnect</button> | ||
</div> | ||
<p></p> | ||
<p>This is a demo of the <a href="https://github.com/yjs/yjs">Yjs</a> ⇔ <a href="http://prosemirror.net/">ProseMirror</a> binding: <a href="https://github.com/yjs/y-prosemirror">y-prosemirror</a>.</p> | ||
<p>The content of this editor is shared with every client that visits this domain.</p> | ||
</body> | ||
</html> |
Oops, something went wrong.