1.0.14 • Published 6 years ago

conclavity v1.0.14

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Conclavity

Demo

Conclavity demo

Summary

Conclavity is a dependency-free, embeddable, real-time, collaborative text editor for the browser.

This library is inspired by the Conclave editor created by the Conclave-Team.


Install

Installing this editor is as easy as:

1. Install the NPM package

npm install --save conclavity

Conclavity install

2. Create an empty div with an ID of "Conclave"

<html>
  <head>
  </head>
  <body>
    <div id="conclave"></div>
  </body>
</html>

3. Include the CSS file

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/conclavity/dist/conclavity.css" />

4. Create a new instance of Conclavity

// script.js
import Conclavity from 'conclavity';

new Conclavity();

You can then use Browserify -- or any other bundling library -- to modularize the script file.


Usage

Conclavity provides an API with options for configurability.

Conclavity(options = {})

OptionDefaultDescription
peerIdnullYou can provide your own peerId to the Peer Server
peernullAllows you to create your own instance of Peer Server. If left blank, Conclavity uses a default instance of Peer Server
shareLinktrueProvides a link to share with other users to collaborate
iconstrueIf set to true, phone icons will appear next to users' name to indicate they can be called
videotrueAllows the ability for users to do one-on-one video chat
changeUrltrueChanges the current URL so if user refreshes page, they will remain in collaboration session with other users
errorMessagetrueProvides an error message when user gets disconnected from signaling server
showPeerstrueShow the other peers that are user is collaborating with
peersLefttrueThe peer lists appear to the left of document if true, otherwise to the right.
placeholdermessageSpecify the placeholder message that will appear in the document. Defaults to Share the link to invite collaborators to your room

Example

// script.js
import Peer from 'peerjs_fork_firefox40';
import Conclavity from 'conclavity';

const peer = new Peer({
  host: location.hostname,
  port: location.port || (location.protocol === 'https:' ? 443 : 80),
  path: '/peerjs',
  debug: 3
});

const demo = new Conclavity({
  peer: peer,
  shareLink: false,
  icons: false,
  video: false,
  changeUrl: false,
  placeholder: 'This is an example!'
});

Debug

If you have cloned the repository, made changes and want to see how those changes look. You can run

npm run debug

and open up the debug.html file listed under the example folder. You should be able to see any changes you've made.


License

MIT

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago