UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

21 lines (20 loc) 866 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FormattingPane = void 0; const tslib_1 = require("tslib"); // biome-ignore lint: lint/style/useImportType const React = tslib_1.__importStar(require("react")); const ContextPane_1 = require("nice-ui/lib/4-card/ContextMenu/ContextPane"); const FormattingPane = ({ onEsc, children, ...rest }) => { return (React.createElement("div", { onKeyDown: onEsc ? (e) => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); onEsc(); } } : void 0 }, React.createElement(ContextPane_1.ContextPane, { ...rest, style: { width: 'calc(min(600px, max(65vw, 260px)))', ...rest.style } }, children))); }; exports.FormattingPane = FormattingPane;