UNPKG

@frontify/fondue

Version:
27 lines (26 loc) 864 B
import { jsx as r } from "react/jsx-runtime"; import { useEditorState as n, useEventPlateId as m } from "@udecode/plate-core"; import { isRangeInSameBlock as l } from "@udecode/slate-utils"; import { LinkToolbarButton as s } from "./LinkToolbarButton.es.js"; import { getHotkeyByPlatform as a } from "../../helpers/getHotkeyByPlatform.es.js"; import { getTooltip as p } from "../../helpers/getTooltip.es.js"; import { ButtonWrapper as f } from "../helper.es.js"; const L = ({ id: e, editorId: i }) => { const t = n(m(i)), o = !!l(t, { at: t.selection }); return /* @__PURE__ */ r(f, { id: e, children: /* @__PURE__ */ r( s, { disabled: !o, tooltip: p( o ? `Link ${a("Ctrl+K")}` : "Links can only be set for a single text block." ) } ) }); }; export { L as LinkButton }; //# sourceMappingURL=LinkButton.es.js.map