mui-tiptap
Version:
A Material-UI (MUI) styled WYSIWYG rich text editor, using Tiptap
42 lines (41 loc) • 1.91 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const mui_1 = require("tss-react/mui");
const DebounceRender_1 = __importDefault(require("../utils/DebounceRender"));
const useStyles = (0, mui_1.makeStyles)({
name: { MenuControlsContainer: MenuControlsContainer },
})((theme) => {
return {
root: {
display: "flex",
rowGap: theme.spacing(0.3),
columnGap: theme.spacing(0.3),
alignItems: "center",
flexWrap: "wrap",
},
};
});
/** Provides consistent spacing between different editor controls components. */
function MenuControlsContainer(_a) {
var { children, className, debounced, DebounceProps } = _a, boxProps = __rest(_a, ["children", "className", "debounced", "DebounceProps"]);
const { classes, cx } = useStyles();
const content = ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({}, boxProps, { className: cx(classes.root, className), children: children })));
return debounced ? ((0, jsx_runtime_1.jsx)(DebounceRender_1.default, Object.assign({}, DebounceProps, { children: content }))) : (content);
}
exports.default = MenuControlsContainer;
;