UNPKG

@frontify/fondue

Version:
57 lines (56 loc) 1.67 kB
var a = Object.defineProperty; var i = (s, t, e) => t in s ? a(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e; var l = (s, t, e) => i(s, typeof t != "symbol" ? t + "" : t, e); import { jsx as u } from "react/jsx-runtime"; import { createPluginFactory as c } from "@udecode/plate-core"; import { defaultStyles as p } from "../../../utils/defaultStyles.es.js"; import { merge as g } from "../../../../../utilities/merge.es.js"; import { MarkupElement as f } from "../../MarkupElement.es.js"; import { Plugin as y } from "../../Plugin.es.js"; import { alignmentClassnames as C } from "../../helper.es.js"; import { TextStyles as m } from "../types.es.js"; import { getColumnBreakClasses as d } from "../../ColumnBreakPlugin/utils/getColumnBreakClasses.es.js"; const k = "textstyle-custom1-plugin"; class B extends y { constructor({ styles: e = p.custom1, ...o } = {}) { super(m.custom1, { label: "Custom 1", markupElement: new x(), ...o }); l(this, "styles", {}); this.styles = e; } plugins() { return [E(this.styles)]; } } class x extends f { constructor(t = k, e = n) { super(t, e); } } const n = ({ element: s, attributes: t, children: e, styles: o }) => { const r = s.align; return /* @__PURE__ */ u( "p", { ...t, className: g([r && C[r], d(s)]), style: o, children: e } ); }, E = (s) => c({ key: m.custom1, isElement: !0, deserializeHtml: { rules: [{ validClassName: m.custom1 }] } })({ component: (t) => /* @__PURE__ */ u(n, { ...t, styles: s }) }); export { B as Custom1Plugin }; //# sourceMappingURL=custom1Plugin.es.js.map