UNPKG

@rtdui/editor

Version:

React rich text editor based on tiptap

42 lines (39 loc) 1.57 kB
'use client'; import { jsxs, Fragment, jsx } from 'react/jsx-runtime'; import { forwardRef } from 'react'; import { IconHelp } from '@tabler/icons-react'; import { CloseButton } from '@rtdui/core'; import clsx from 'clsx'; import MDXContent from './editorMan.mdx.mjs'; const HelperControl = forwardRef( (props, ref) => { const { className, ...other } = { ...props }; return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx( "button", { type: "button", className: "btn btn-square btn-sm", onClick: () => document.getElementById("edit_helper_dialog")?.showModal(), children: /* @__PURE__ */ jsx(IconHelp, { size: 20, stroke: 1.5 }) } ), /* @__PURE__ */ jsx("dialog", { id: "edit_helper_dialog", className: "modal", children: /* @__PURE__ */ jsxs( "div", { className: clsx( "modal-box flex flex-col p-6 w-11/12 max-w-5xl", className ), children: [ /* @__PURE__ */ jsx("form", { method: "dialog", children: /* @__PURE__ */ jsx("div", { className: "sticky top-0 flex justify-end mb-1", children: /* @__PURE__ */ jsx(CloseButton, { type: "submit" }) }) }), /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto prose max-w-none", ...other, children: /* @__PURE__ */ jsx(MDXContent, {}) }) ] } ) }) ] }); } ); HelperControl.displayName = "@rtdui/editor/HelperControl"; export { HelperControl }; //# sourceMappingURL=HelperControl.mjs.map