@rtdui/editor
Version:
React rich text editor based on tiptap
199 lines (195 loc) • 8.71 kB
JavaScript
'use client';
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var iconsReact = require('@tabler/icons-react');
var createTiptapControl = require('./createTiptapControl.cjs');
const BoldControl = createTiptapControl({
label: "boldControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconBold, { ...props, stroke: 1.5 }),
isActive: { name: "bold" },
operation: { name: "toggleBold" }
});
const ItalicControl = createTiptapControl({
label: "italicControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconItalic, { ...props, stroke: 1.5 }),
isActive: { name: "italic" },
operation: { name: "toggleItalic" }
});
const UnderlineControl = createTiptapControl({
label: "underlineControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconUnderline, { ...props, stroke: 1.5 }),
isActive: { name: "underline" },
operation: { name: "toggleUnderline" }
});
const StrikeThroughControl = createTiptapControl({
label: "strikeControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconStrikethrough, { ...props, stroke: 1.5 }),
isActive: { name: "strike" },
operation: { name: "toggleStrike" }
});
const ClearFormattingControl = createTiptapControl({
label: "clearFormattingControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconClearFormatting, { ...props, stroke: 1.5 }),
operation: { name: "unsetAllMarks" }
});
const UnlinkControl = createTiptapControl({
label: "unlinkControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconUnlink, { ...props, stroke: 1.5 }),
operation: { name: "unsetLink" }
});
const BulletListControl = createTiptapControl({
label: "bulletListControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconList, { ...props, stroke: 1.5 }),
isActive: { name: "bulletList" },
operation: { name: "toggleBulletList" }
});
const OrderedListControl = createTiptapControl({
label: "orderedListControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconListNumbers, { ...props, stroke: 1.5 }),
isActive: { name: "orderedList" },
operation: { name: "toggleOrderedList" }
});
const H1Control = createTiptapControl({
label: "h1ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH1, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 1 } },
operation: { name: "toggleHeading", attributes: { level: 1 } }
});
const H2Control = createTiptapControl({
label: "h2ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH2, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 2 } },
operation: { name: "toggleHeading", attributes: { level: 2 } }
});
const H3Control = createTiptapControl({
label: "h3ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH3, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 3 } },
operation: { name: "toggleHeading", attributes: { level: 3 } }
});
const H4Control = createTiptapControl({
label: "h4ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH4, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 4 } },
operation: { name: "toggleHeading", attributes: { level: 4 } }
});
const H5Control = createTiptapControl({
label: "h5ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH5, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 5 } },
operation: { name: "toggleHeading", attributes: { level: 5 } }
});
const H6Control = createTiptapControl({
label: "h6ControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconH6, { ...props, stroke: 1.5 }),
isActive: { name: "heading", attributes: { level: 6 } },
operation: { name: "toggleHeading", attributes: { level: 6 } }
});
const BlockquoteControl = createTiptapControl({
label: "blockquoteControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconBlockquote, { ...props, stroke: 1.5 }),
isActive: { name: "blockquote" },
operation: { name: "toggleBlockquote" }
});
const AlignLeftControl = createTiptapControl({
label: "alignLeftControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconAlignLeft, { ...props, stroke: 1.5 }),
operation: { name: "setTextAlign", attributes: "left" }
});
const AlignRightControl = createTiptapControl({
label: "alignRightControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconAlignRight, { ...props, stroke: 1.5 }),
operation: { name: "setTextAlign", attributes: "right" }
});
const AlignCenterControl = createTiptapControl({
label: "alignCenterControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconAlignCenter, { ...props, stroke: 1.5 }),
operation: { name: "setTextAlign", attributes: "center" }
});
const AlignJustifyControl = createTiptapControl({
label: "alignJustifyControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconAlignJustified, { ...props, stroke: 1.5 }),
operation: { name: "setTextAlign", attributes: "justify" }
});
const SubscriptControl = createTiptapControl({
label: "subscriptControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSubscript, { ...props, stroke: 1.5 }),
isActive: { name: "subscript" },
operation: { name: "toggleSubscript" }
});
const SuperscriptControl = createTiptapControl({
label: "superscriptControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSuperscript, { ...props, stroke: 1.5 }),
isActive: { name: "superscript" },
operation: { name: "toggleSuperscript" }
});
const CodeControl = createTiptapControl({
label: "codeControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconCode, { ...props, stroke: 1.5 }),
isActive: { name: "code" },
operation: { name: "toggleCode" }
});
const CodeBlockControl = createTiptapControl({
label: "codeBlockControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconCode, { ...props, stroke: 1.5 }),
isActive: { name: "codeBlock" },
operation: { name: "toggleCodeBlock" }
});
const HighlightControl = createTiptapControl({
label: "highlightControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconHighlight, { ...props, stroke: 1.5 }),
isActive: { name: "highlight" },
operation: { name: "toggleHighlight" }
});
const HrControl = createTiptapControl({
label: "hrControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconLineDashed, { ...props, stroke: 1.5 }),
operation: { name: "setHorizontalRule" }
});
const UnsetColorControl = createTiptapControl({
label: "unsetColorControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconCircleOff, { ...props, stroke: 1.5 }),
operation: { name: "unsetColor" }
});
const ImageControl = createTiptapControl({
label: "ImageControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconPhoto, { ...props, stroke: 1.5 }),
operation: { name: "uploadImage", attributes: {} }
});
const TableControl = createTiptapControl({
label: "TableControlLabel",
icon: (props) => /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconTable, { ...props, stroke: 1.5 }),
operation: {
name: "insertTable",
attributes: { rows: 3, cols: 3, withHeaderRow: true }
}
});
exports.AlignCenterControl = AlignCenterControl;
exports.AlignJustifyControl = AlignJustifyControl;
exports.AlignLeftControl = AlignLeftControl;
exports.AlignRightControl = AlignRightControl;
exports.BlockquoteControl = BlockquoteControl;
exports.BoldControl = BoldControl;
exports.BulletListControl = BulletListControl;
exports.ClearFormattingControl = ClearFormattingControl;
exports.CodeBlockControl = CodeBlockControl;
exports.CodeControl = CodeControl;
exports.H1Control = H1Control;
exports.H2Control = H2Control;
exports.H3Control = H3Control;
exports.H4Control = H4Control;
exports.H5Control = H5Control;
exports.H6Control = H6Control;
exports.HighlightControl = HighlightControl;
exports.HrControl = HrControl;
exports.ImageControl = ImageControl;
exports.ItalicControl = ItalicControl;
exports.OrderedListControl = OrderedListControl;
exports.StrikeThroughControl = StrikeThroughControl;
exports.SubscriptControl = SubscriptControl;
exports.SuperscriptControl = SuperscriptControl;
exports.TableControl = TableControl;
exports.UnderlineControl = UnderlineControl;
exports.UnlinkControl = UnlinkControl;
exports.UnsetColorControl = UnsetColorControl;
//# sourceMappingURL=tiptapControls.cjs.map