reactjs-tiptap-editor
Version:
A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React
65 lines (64 loc) • 1.67 kB
JavaScript
import { T as u, a as l } from "./index-Do_dsOGB.js";
import { jsx as a, Fragment as k } from "react/jsx-runtime";
import { u as T, d as f, A as v } from "./index-RcSPeQHn.js";
import "react";
import "./theme.js";
function y() {
const t = T(A.name), {
icon: s = void 0,
tooltip: o = void 0,
shortcutKeys: i = void 0,
tooltipOptions: r = {},
action: e = void 0,
isActive: c = void 0
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: d, disabled: n, update: p } = f(c), m = () => {
n || e && (e(), p());
};
return t ? /* @__PURE__ */ a(
v,
{
action: m,
dataState: d,
disabled: n,
icon: s,
shortcutKeys: i,
tooltip: o,
tooltipOptions: r
}
) : /* @__PURE__ */ a(k, {});
}
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),
HTMLAttributes: {
class: "task-list"
},
taskItem: {
HTMLAttributes: {
class: "task-list-item"
}
},
button: ({ editor: s, t: o, extension: i }) => ({
componentProps: {
action: () => s.commands.toggleTaskList(),
isActive: () => s.isActive("taskList"),
disabled: !1,
icon: "ListTodo",
shortcutKeys: i.options.shortcutKeys ?? ["shift", "mod", "9"],
tooltip: o("editor.tasklist.tooltip")
}
})
};
},
addExtensions() {
return [l.configure(this.options.taskItem)];
}
});
export {
y as RichTextTaskList,
A as TaskList
};