UNPKG

collaborative-ui

Version:

React component library for building real-time collaborative editing applications.

23 lines (22 loc) 803 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); const CodeMirrorEditor_1 = require("./CodeMirrorEditor"); const DisplayCodeMirror = ({ model, path = [] }) => { try { const str = model.api.str(path); return (React.createElement("div", { style: { boxSizing: 'border-box', padding: 2, borderRadius: 4, overflow: 'hidden', width: '100%', height: '100%', } }, !str ? null : React.createElement(CodeMirrorEditor_1.CodeMirrorEditor, { style: { height: 300 }, str: () => str }))); } catch { return null; } }; exports.default = DisplayCodeMirror;