@frontify/fondue
Version:
Design system of Frontify
52 lines (51 loc) • 1.75 kB
JavaScript
var i = Object.defineProperty;
var u = (t, r, e) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
var n = (t, r, e) => u(t, typeof r != "symbol" ? r + "" : r, e);
import { jsx as p } from "react/jsx-runtime";
import { createPluginFactory as c } from "@udecode/plate-core";
import { createParagraphPlugin as g } from "@udecode/plate-paragraph";
import { defaultStyles as P } from "../../../utils/defaultStyles.es.js";
import { merge as f } from "../../../../../utilities/merge.es.js";
import { MarkupElement as y } from "../../MarkupElement.es.js";
import { Plugin as h } from "../../Plugin.es.js";
import { alignmentClassnames as x } from "../../helper.es.js";
import { TextStyles as s } from "../types.es.js";
import { getColumnBreakClasses as k } from "../../ColumnBreakPlugin/utils/getColumnBreakClasses.es.js";
class G extends h {
constructor({ styles: e = P.p, ...a } = {}) {
super(s.p, {
markupElement: new d(),
label: "Body Text",
...a
});
n(this, "styles", {});
this.styles = e;
}
plugins() {
return [S(this.styles)];
}
}
const E = "tw-m-0 tw-px-0 tw-py-0", o = ({ element: t, attributes: r, children: e, styles: a }) => {
const m = t.align, l = f([m && x[m], E, k(t)]);
return /* @__PURE__ */ p("p", { ...r, className: l, style: a, children: e });
};
class d extends y {
constructor(r = s.p, e = o) {
super(r, e);
}
}
const S = (t) => c({
...g(),
key: s.p,
isElement: !0,
component: o
})({
component: (r) => /* @__PURE__ */ p(o, { ...r, styles: t })
});
export {
E as PARAGRAPH_CLASSES,
d as ParagraphMarkupElement,
o as ParagraphMarkupElementNode,
G as ParagraphPlugin
};
//# sourceMappingURL=paragraphPlugin.es.js.map