You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
739 B
31 lines
739 B
5 years ago
|
import onChange from './onChange'
|
||
|
import renderEditor from './renderEditor'
|
||
5 years ago
|
import renderAnnotation from './renderAnnotation'
|
||
5 years ago
|
|
||
5 years ago
|
import renderCursor from './renderCursor'
|
||
|
|
||
5 years ago
|
import { PluginOptions } from './model'
|
||
5 years ago
|
|
||
5 years ago
|
export const defaultOpts = {
|
||
|
url: 'http://localhost:9000',
|
||
|
cursorAnnotationType: 'collaborative_selection',
|
||
5 years ago
|
renderCursor,
|
||
5 years ago
|
annotationDataMixin: {
|
||
5 years ago
|
name: 'an collaborator name',
|
||
|
color: 'palevioletred',
|
||
|
alphaColor: 'rgba(233, 30, 99, 0.2)'
|
||
5 years ago
|
}
|
||
5 years ago
|
}
|
||
|
|
||
5 years ago
|
const plugin = (opts: PluginOptions = defaultOpts) => {
|
||
5 years ago
|
const options = { ...defaultOpts, ...opts }
|
||
|
|
||
|
return {
|
||
|
onChange: onChange(options),
|
||
5 years ago
|
renderEditor: renderEditor(options),
|
||
5 years ago
|
renderAnnotation: renderAnnotation(options)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
|
||
|
export default plugin
|