UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

26 lines (25 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CursorPlugin = void 0; const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const RenderCaret_1 = require("./RenderCaret"); const RenderFocus_1 = require("./RenderFocus"); const RenderAnchor_1 = require("./RenderAnchor"); const RenderInline_1 = require("./RenderInline"); const RenderPeritext_1 = require("./RenderPeritext"); const h = React.createElement; /** * Plugin which renders the main cursor and all other current user local * cursors. */ class CursorPlugin { constructor() { this.caret = (props, children) => h(RenderCaret_1.RenderCaret, props, children); this.focus = (props, children) => h(RenderFocus_1.RenderFocus, props, children); this.anchor = (props, children) => h(RenderAnchor_1.RenderAnchor, props, children); this.inline = (props, children) => h(RenderInline_1.RenderInline, props, children); this.peritext = (children, ctx) => h(RenderPeritext_1.RenderPeritext, { children, ctx }); } } exports.CursorPlugin = CursorPlugin;