@frontify/fondue
Version:
Design system of Frontify
38 lines (37 loc) • 1.18 kB
JavaScript
import { jsx as l } from "react/jsx-runtime";
import { ELEMENT_LI as i } from "@udecode/plate-list";
import { MarkupElement as n } from "../MarkupElement.es.js";
import { TextStyles as c } from "../TextStylePlugin/types.es.js";
import { useRichTextEditorContext as m } from "../../context/RichTextEditorContext.es.js";
const p = "[&>p]:before:tw-flex [&>p]:before:tw-justify-end [&>p]:before:tw-w-[1.2em] !tw-no-underline !tw-list-item", f = ({ attributes: e, children: t, element: r }) => {
const { styles: s } = m();
return /* @__PURE__ */ l("li", { style: u(r, s), ...e, className: p, children: t });
};
class d extends n {
constructor(t = i, r = f) {
super(t, r);
}
}
const u = (e, t) => ({
...t[o(e) ?? c.p],
counterIncrement: "count"
}), o = (e) => {
let t;
if (e.type === "a")
t = e.children[0].textStyle;
else if (e.children)
for (const r of e.children) {
const s = o(r);
s && (!t || s.startsWith(t)) && (t = s);
}
else
t = e.textStyle;
return t;
};
export {
p as LI_CLASSNAMES,
d as ListItemMarkupElement,
f as ListItemMarkupElementNode,
u as getLiStyles
};
//# sourceMappingURL=ListItemMarkupElement.es.js.map