@mantine/tiptap
Version:
Rich text editor based on tiptap
272 lines (271 loc) • 10.7 kB
JavaScript
"use client";
require("../_virtual/_rolldown/runtime.cjs");
const require_Icons = require("../icons/Icons.cjs");
const require_RichTextEditorControl = require("./RichTextEditorControl.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/tiptap/src/RichTextEditorControl/controls.tsx
const BoldControl = require_RichTextEditorControl.createControl({
label: "boldControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconBold, { ...props }),
isActive: { name: "bold" },
operation: { name: "toggleBold" }
});
const ItalicControl = require_RichTextEditorControl.createControl({
label: "italicControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconItalic, { ...props }),
isActive: { name: "italic" },
operation: { name: "toggleItalic" }
});
const UnderlineControl = require_RichTextEditorControl.createControl({
label: "underlineControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconUnderline, { ...props }),
isActive: { name: "underline" },
operation: { name: "toggleUnderline" }
});
const StrikeThroughControl = require_RichTextEditorControl.createControl({
label: "strikeControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconStrikethrough, { ...props }),
isActive: { name: "strike" },
operation: { name: "toggleStrike" }
});
const ClearFormattingControl = require_RichTextEditorControl.createControl({
label: "clearFormattingControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconClearFormatting, { ...props }),
operation: { name: "unsetAllMarks" }
});
const UnlinkControl = require_RichTextEditorControl.createControl({
label: "unlinkControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconUnlink, { ...props }),
operation: { name: "unsetLink" }
});
const BulletListControl = require_RichTextEditorControl.createControl({
label: "bulletListControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconList, { ...props }),
isActive: { name: "bulletList" },
operation: { name: "toggleBulletList" }
});
const OrderedListControl = require_RichTextEditorControl.createControl({
label: "orderedListControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconListNumbers, { ...props }),
isActive: { name: "orderedList" },
operation: { name: "toggleOrderedList" }
});
const H1Control = require_RichTextEditorControl.createControl({
label: "h1ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH1, { ...props }),
isActive: {
name: "heading",
attributes: { level: 1 }
},
operation: {
name: "toggleHeading",
attributes: { level: 1 }
}
});
const H2Control = require_RichTextEditorControl.createControl({
label: "h2ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH2, { ...props }),
isActive: {
name: "heading",
attributes: { level: 2 }
},
operation: {
name: "toggleHeading",
attributes: { level: 2 }
}
});
const H3Control = require_RichTextEditorControl.createControl({
label: "h3ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH3, { ...props }),
isActive: {
name: "heading",
attributes: { level: 3 }
},
operation: {
name: "toggleHeading",
attributes: { level: 3 }
}
});
const H4Control = require_RichTextEditorControl.createControl({
label: "h4ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH4, { ...props }),
isActive: {
name: "heading",
attributes: { level: 4 }
},
operation: {
name: "toggleHeading",
attributes: { level: 4 }
}
});
const H5Control = require_RichTextEditorControl.createControl({
label: "h5ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH5, { ...props }),
isActive: {
name: "heading",
attributes: { level: 5 }
},
operation: {
name: "toggleHeading",
attributes: { level: 5 }
}
});
const H6Control = require_RichTextEditorControl.createControl({
label: "h6ControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconH6, { ...props }),
isActive: {
name: "heading",
attributes: { level: 6 }
},
operation: {
name: "toggleHeading",
attributes: { level: 6 }
}
});
const BlockquoteControl = require_RichTextEditorControl.createControl({
label: "blockquoteControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconBlockquote, { ...props }),
isActive: { name: "blockquote" },
operation: { name: "toggleBlockquote" }
});
const AlignLeftControl = require_RichTextEditorControl.createControl({
label: "alignLeftControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconAlignLeft, { ...props }),
operation: {
name: "setTextAlign",
attributes: "left"
}
});
const AlignRightControl = require_RichTextEditorControl.createControl({
label: "alignRightControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconAlignRight, { ...props }),
operation: {
name: "setTextAlign",
attributes: "right"
}
});
const AlignCenterControl = require_RichTextEditorControl.createControl({
label: "alignCenterControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconAlignCenter, { ...props }),
operation: {
name: "setTextAlign",
attributes: "center"
}
});
const AlignJustifyControl = require_RichTextEditorControl.createControl({
label: "alignJustifyControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconAlignJustified, { ...props }),
operation: {
name: "setTextAlign",
attributes: "justify"
}
});
const SubscriptControl = require_RichTextEditorControl.createControl({
label: "subscriptControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconSubscript, { ...props }),
isActive: { name: "subscript" },
operation: { name: "toggleSubscript" }
});
const SuperscriptControl = require_RichTextEditorControl.createControl({
label: "superscriptControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconSuperscript, { ...props }),
isActive: { name: "superscript" },
operation: { name: "toggleSuperscript" }
});
const CodeControl = require_RichTextEditorControl.createControl({
label: "codeControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconCode, { ...props }),
isActive: { name: "code" },
operation: { name: "toggleCode" }
});
const CodeBlockControl = require_RichTextEditorControl.createControl({
label: "codeBlockControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconCode, { ...props }),
isActive: { name: "codeBlock" },
operation: { name: "toggleCodeBlock" }
});
const HighlightControl = require_RichTextEditorControl.createControl({
label: "highlightControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconHighlight, { ...props }),
isActive: { name: "highlight" },
operation: { name: "toggleHighlight" }
});
const HrControl = require_RichTextEditorControl.createControl({
label: "hrControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconLineDashed, { ...props }),
operation: { name: "setHorizontalRule" }
});
const UnsetColorControl = require_RichTextEditorControl.createControl({
label: "unsetColorControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconCircleOff, { ...props }),
operation: { name: "unsetColor" }
});
const UndoControl = require_RichTextEditorControl.createControl({
label: "undoControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconArrowBackUp, { ...props }),
isDisabled: (editor) => !editor?.can().undo(),
operation: { name: "undo" }
});
const RedoControl = require_RichTextEditorControl.createControl({
label: "redoControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconArrowForwardUp, { ...props }),
isDisabled: (editor) => !editor?.can().redo(),
operation: { name: "redo" }
});
const TaskListControl = require_RichTextEditorControl.createControl({
label: "tasksControlLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconListCheck, { ...props }),
isActive: { name: "taskList" },
operation: { name: "toggleTaskList" }
});
const TaskListSinkControl = require_RichTextEditorControl.createControl({
label: "tasksSinkLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconIndentIncrease, { ...props }),
operation: {
name: "sinkListItem",
attributes: "taskItem"
},
isDisabled: (editor) => !editor?.can().sinkListItem("taskItem")
});
const TaskListLiftControl = require_RichTextEditorControl.createControl({
label: "tasksLiftLabel",
icon: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icons.IconIndentDecrease, { ...props }),
operation: {
name: "liftListItem",
attributes: "taskItem"
},
isDisabled: (editor) => !editor?.can().liftListItem("taskItem")
});
//#endregion
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.ItalicControl = ItalicControl;
exports.OrderedListControl = OrderedListControl;
exports.RedoControl = RedoControl;
exports.StrikeThroughControl = StrikeThroughControl;
exports.SubscriptControl = SubscriptControl;
exports.SuperscriptControl = SuperscriptControl;
exports.TaskListControl = TaskListControl;
exports.TaskListLiftControl = TaskListLiftControl;
exports.TaskListSinkControl = TaskListSinkControl;
exports.UnderlineControl = UnderlineControl;
exports.UndoControl = UndoControl;
exports.UnlinkControl = UnlinkControl;
exports.UnsetColorControl = UnsetColorControl;
//# sourceMappingURL=controls.cjs.map