From 0bd6c06987167e4efe61529de9979b007f7d3e0e Mon Sep 17 00:00:00 2001 From: Sanjeev Kumar Date: Sun, 20 Aug 2023 16:23:25 +0530 Subject: [PATCH] added Ordered List added Ordered List --- config/config.yaml | 2 +- front/components/Objects/Editor/Editor.tsx | 5 +++++ front/components/Objects/Editor/Toolbar/ToolbarButtons.tsx | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 12ee9e60..28e3295a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -3,7 +3,7 @@ site_description: LearnHouse is an open-source platform tailored for learning ex contact_email: hi@learnhouse.app general: - development_mode: false + development_mode: true install_mode: false security: diff --git a/front/components/Objects/Editor/Editor.tsx b/front/components/Objects/Editor/Editor.tsx index 79b35d47..8470f22c 100644 --- a/front/components/Objects/Editor/Editor.tsx +++ b/front/components/Objects/Editor/Editor.tsx @@ -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, diff --git a/front/components/Objects/Editor/Toolbar/ToolbarButtons.tsx b/front/components/Objects/Editor/Toolbar/ToolbarButtons.tsx index 212a3e54..b00a71c5 100644 --- a/front/components/Objects/Editor/Toolbar/ToolbarButtons.tsx +++ b/front/components/Objects/Editor/Toolbar/ToolbarButtons.tsx @@ -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) => { editor.chain().focus().toggleStrike().run()} className={editor.isActive("strike") ? "is-active" : ""}> + editor.chain().focus().toggleOrderedList().run()} className={editor.isActive('orderedList') ? 'is-active' : ''}> + + editor