json-joy
Version:
Collection of libraries for building collaborative editing apps.
21 lines (20 loc) • 831 B
JavaScript
import * as React from 'react';
import { RenderInline } from './inline/RenderInline';
import { RenderPeritext } from './RenderPeritext';
import { text } from '../minimal/text';
import { RenderBlock } from './block/RenderBlock';
import { RenderCaret } from './RenderCaret';
import { RenderFocus } from './RenderFocus';
const h = React.createElement;
export class ToolbarPlugin {
opts;
constructor(opts = {}) {
this.opts = opts;
}
text = text;
inline = (props, children) => h(RenderInline, props, children);
block = (props, children) => h(RenderBlock, props, children);
peritext = (children, surface) => h(RenderPeritext, { children, surface, opts: this.opts });
caret = (props, children) => h(RenderCaret, props, children);
focus = (props, children) => h(RenderFocus, props, children);
}