added Ordered List

added Ordered List
This commit is contained in:
Sanjeev Kumar 2023-08-20 16:23:25 +05:30
parent c7061a26fa
commit 0bd6c06987
3 changed files with 10 additions and 2 deletions

View file

@ -23,6 +23,9 @@ import QuizBlock from "./Extensions/Quiz/QuizBlock";
import ToolTip from "@components/StyledElements/Tooltip/Tooltip";
import Link from "next/link";
import { getCourseThumbnailMediaDirectory } from "@services/media/media";
import { OrderedList } from "@tiptap/extension-ordered-list";
import {ListItem} from '@tiptap/extension-list-item'
interface Editor {
content: string;
@ -80,6 +83,8 @@ function Editor(props: Editor) {
controls: true,
modestBranding: true,
}),
OrderedList.configure(),
// Register the document with Tiptap
// Collaboration.configure({
// document: props.ydoc,

View file

@ -1,6 +1,6 @@
import styled from "styled-components";
import { FontBoldIcon, FontItalicIcon, StrikethroughIcon, ArrowLeftIcon, ArrowRightIcon, OpacityIcon, DividerVerticalIcon } from "@radix-ui/react-icons";
import { AlertCircle, AlertTriangle, FileText, GraduationCap, ImagePlus, Info, Sigma, Video, Youtube } from "lucide-react";
import { AlertCircle, AlertTriangle, FileText, GraduationCap, ImagePlus, Info, Sigma, Video, Youtube, ListOrdered } from "lucide-react";
import ToolTip from "@components/StyledElements/Tooltip/Tooltip";
export const ToolbarButtons = ({ editor, props }: any) => {
@ -39,6 +39,9 @@ export const ToolbarButtons = ({ editor, props }: any) => {
<ToolBtn onClick={() => editor.chain().focus().toggleStrike().run()} className={editor.isActive("strike") ? "is-active" : ""}>
<StrikethroughIcon />
</ToolBtn>
<ToolBtn onClick={() => editor.chain().focus().toggleOrderedList().run()} className={editor.isActive('orderedList') ? 'is-active' : ''}>
<ListOrdered />
</ToolBtn>
<ToolSelect
onChange={(e) =>
editor