reactjs-tiptap-editor
Version:
A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React
54 lines (53 loc) • 1.45 kB
JavaScript
import { O as u } from "./index-Do_dsOGB.js";
import { jsx as n, Fragment as l } from "react/jsx-runtime";
import { u as f, d as v, A as O } from "./index-RcSPeQHn.js";
import "react";
import "./theme.js";
function K() {
const t = f(A.name), {
icon: o = void 0,
tooltip: i = void 0,
shortcutKeys: e = void 0,
tooltipOptions: d = {},
action: s = void 0,
isActive: c = void 0
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: r, update: p } = v(c), m = () => {
r || s && (s(), p());
};
return t ? /* @__PURE__ */ n(
O,
{
action: m,
dataState: a,
disabled: r,
icon: o,
shortcutKeys: e,
tooltip: i,
tooltipOptions: d
}
) : /* @__PURE__ */ n(l, {});
}
const A = /* @__PURE__ */ u.extend({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-expect-error
addOptions() {
var t;
return {
...(t = this.parent) == null ? void 0 : t.call(this),
button: ({ editor: o, t: i, extension: e }) => ({
componentProps: {
action: () => o.commands.toggleOrderedList(),
isActive: () => o.isActive("orderedList"),
disabled: !1,
icon: "ListOrdered",
shortcutKeys: e.options.shortcutKeys ?? ["mod", "shift", "7"],
tooltip: i("editor.orderedlist.tooltip")
}
})
};
}
});
export {
A as OrderedList,
K as RichTextOrderedList
};