@dndbuilder.com/react
Version:
Drag and drop builder for React
33 lines (32 loc) • 1.04 kB
JavaScript
"use client";
import { jsx as T } from "react/jsx-runtime";
import { useBlockSettings as h } from "../../../hooks/use-block-settings.js";
import { useRef as p } from "react";
import b from "../../../../../../_virtual/index18.js";
import x from "../../../components/shared/content-editable.js";
const z = ({ id: a, settings: o, meta: t }) => {
var l;
const r = (t == null ? void 0 : t.locale) || "en", [s, i] = h(a, `title.${r}`), c = p(""), m = {
allowedTags: ["div", "span", "br", "p", "strong", "small", "abbr", "sub", "mark", "em"]
}, u = (e) => {
const n = e.currentTarget.innerText;
c.current = n;
}, g = (e) => {
const n = e.currentTarget.innerText;
i(b(n, m));
}, d = o.htmlTag || "h2", f = ((l = o.title) == null ? void 0 : l.en) || "";
return /* @__PURE__ */ T(
x,
{
tagName: d,
onChange: u,
onBlur: g,
html: s || f,
className: "heading leading-5 focus-visible:outline-0"
}
);
};
export {
z as default
};
//# sourceMappingURL=heading-editable.js.map