Skip to content

Commit 71c48b1

Browse files
committed
feat: Fixed UL and OL list styling in editor
1 parent 19a0e0c commit 71c48b1

4 files changed

Lines changed: 24 additions & 1 deletion

File tree

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@radix-ui/react-toggle": "^1.1.2",
3535
"@radix-ui/react-toggle-group": "^1.1.2",
3636
"@radix-ui/react-tooltip": "^1.1.8",
37+
"@tiptap/extension-horizontal-rule": "^2.11.7",
3738
"@tiptap/extension-text-align": "^2.11.7",
3839
"@tiptap/extension-text-style": "^2.11.5",
3940
"@tiptap/extension-underline": "^2.11.5",

‎src/components/form-builder/form-components/wysiwyg/editor-toolbar.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from "./hooks/useEditorContentTypes";
2727
import { useTextAlign } from "./hooks/useTextAlign";
2828
import { icons } from "lucide-react";
29+
import HorizontalRule from "@tiptap/extension-horizontal-rule";
2930
// Memoize the toolbar button to prevent re-renders
3031
const ToolbarButton = memo(
3132
({

‎src/components/form-builder/form-components/wysiwyg/form-wysiwyg-editor.tsx‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ export const FormWysiwygEditor: React.FC<FormWysiwygEditorProps> = memo(
5353
},
5454
},
5555
heading: false,
56+
bulletList: {
57+
HTMLAttributes: {
58+
class: "my-6 ml-6 list-disc [&>li]:mt-2",
59+
},
60+
},
61+
orderedList: {
62+
HTMLAttributes: {
63+
class: "my-6 ml-6 list-decimal [&>li]:mt-2",
64+
},
65+
},
5666
}),
5767
Heading.configure({ levels: [1, 2, 3, 4] }).extend({
5868
levels: [1, 2, 3, 4],
@@ -80,7 +90,7 @@ export const FormWysiwygEditor: React.FC<FormWysiwygEditorProps> = memo(
8090
customClass,
8191
TextAlign.configure({
8292
types: ['heading', 'paragraph', "textStyle"],
83-
}),
93+
})
8494
],
8595
[]
8696
);

‎yarn.lock‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,16 @@ __metadata:
18351835
languageName: node
18361836
linkType: hard
18371837

1838+
"@tiptap/extension-horizontal-rule@npm:^2.11.7":
1839+
version: 2.11.7
1840+
resolution: "@tiptap/extension-horizontal-rule@npm:2.11.7"
1841+
peerDependencies:
1842+
"@tiptap/core": ^2.7.0
1843+
"@tiptap/pm": ^2.7.0
1844+
checksum: 10c0/cb04c4910d234ab85672bb9aa08c4415fd2bc7b094440e0293776dcebb3f13cdc21ac9c3dcdde2aa280cf842a75818c8cbad8d5e5bb5e8052fc6a82464fe5867
1845+
languageName: node
1846+
linkType: hard
1847+
18381848
"@tiptap/extension-italic@npm:^2.11.5":
18391849
version: 2.11.5
18401850
resolution: "@tiptap/extension-italic@npm:2.11.5"
@@ -3608,6 +3618,7 @@ __metadata:
36083618
"@radix-ui/react-toggle-group": "npm:^1.1.2"
36093619
"@radix-ui/react-tooltip": "npm:^1.1.8"
36103620
"@tailwindcss/postcss": "npm:^4.0.9"
3621+
"@tiptap/extension-horizontal-rule": "npm:^2.11.7"
36113622
"@tiptap/extension-text-align": "npm:^2.11.7"
36123623
"@tiptap/extension-text-style": "npm:^2.11.5"
36133624
"@tiptap/extension-underline": "npm:^2.11.5"

0 commit comments

Comments
 (0)