laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
27 lines (26 loc) • 1.13 kB
JavaScript
"use client";
import { jsx as l, jsxs as s } from "react/jsx-runtime";
import { INSERT_UNORDERED_LIST_COMMAND as m } from "../../../../../node_modules/@lexical/list/LexicalList.prod.js";
import { $setBlocksType as c } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
import { $getSelection as n, $isRangeSelection as f, $createParagraphNode as p } from "../../../../../node_modules/lexical/Lexical.prod.js";
import { useToolbarContext as d } from "../../../context/toolbar-context.js";
import { blockTypeToBlockName as r } from "./block-format-data.js";
import { SelectItem as u } from "../../../../ui/select.js";
const e = "bullet";
function x() {
const { activeEditor: t, blockType: a } = d(), i = () => {
t.update(() => {
const o = n();
f(o) && c(o, () => p());
});
};
return /* @__PURE__ */ l(u, { value: e, onPointerDown: () => {
a !== "bullet" ? t.dispatchCommand(m, void 0) : i();
}, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1 font-normal", children: [
r[e].icon,
r[e].label
] }) });
}
export {
x as FormatBulletedList
};