-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: consolidate rich text editor and viewer configurations thro…
…ugh plugins and default styles
- Loading branch information
1 parent
3a1ccab
commit 6fa789f
Showing
5 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TaskItem } from "@tiptap/extension-task-item"; | ||
import { TaskList } from "@tiptap/extension-task-list"; | ||
import { StarterKit } from "@tiptap/starter-kit"; | ||
|
||
export const plugins = [ | ||
StarterKit, | ||
TaskList.configure({ | ||
HTMLAttributes: { | ||
class: "list-none", | ||
}, | ||
}), | ||
TaskItem.configure({ | ||
nested: true, | ||
HTMLAttributes: { | ||
class: "flex items-start gap-2 [&_p]:inline [&_p]:m-0", | ||
}, | ||
onReadOnlyChecked: (_node, _checked) => true, | ||
}), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const defaultClasses = { | ||
ul: ` | ||
[&>div>ul]:list-disc | ||
[&>div>ul]:pl-5 | ||
[&>div>ul>li>p]:inline | ||
[&>div>ul>li>p]:text-neutral-900 | ||
[&_ul]:list-disc | ||
[&_[contenteditable='true']>ul>li]:pl-0 | ||
[&_[contenteditable='true']>ul>li_ul_li]:pl-0 | ||
[&_[contenteditable='false']>ul>li]:pl-4 | ||
[&_[contenteditable='false']>ul>li_ul_li]:pl-4 | ||
[&_ul>li]:marker:text-neutral-400 | ||
[&_ul>li>p]:inline | ||
[&_ul>li>p]:text-neutral-900 | ||
`, | ||
ol: ` | ||
[&>div>ol]:list-decimal | ||
[&>div>ol]:list-inside | ||
[&>div>ol>li>p]:inline | ||
[&>div>ol>li>ol]:pl-4 | ||
[&_ol>li>ol]:pl-4 | ||
`, | ||
taskList: "[&_[data-type='taskList']]:list-none [&_[data-type='taskList']]:pl-0", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters