Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PE-193] feat: flat lists #6316

Open
wants to merge 36 commits into
base: preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8a12eba
fix: prosemirror flat list integrated
Palanikannan1437 Dec 3, 2024
76f0c8b
fix: list extension drop behaviour manipulated
Palanikannan1437 Dec 6, 2024
89d2f38
fix: drop cursor above and below added
Palanikannan1437 Dec 10, 2024
649e43e
fix: drop cursor implementation cleaned up
Palanikannan1437 Dec 10, 2024
fc2b3aa
fix: drop cursor optimized
Palanikannan1437 Dec 11, 2024
7147cfd
fix: added nested drop consistently
Palanikannan1437 Dec 12, 2024
ecfc306
fix: css and edge cases while dropping
Palanikannan1437 Dec 12, 2024
62d778f
merge preview into feat/flat-lists
Palanikannan1437 Dec 13, 2024
c89f4b5
fix: remove items from list
Palanikannan1437 Dec 13, 2024
e80d308
style: editor lists
aaryan610 Dec 26, 2024
a530f64
fix: editor lists flickering
aaryan610 Dec 30, 2024
d5a5a24
fix: editor lists flickering
aaryan610 Dec 30, 2024
893fe6c
fix: lists as first node of the editor
aaryan610 Dec 30, 2024
f66cb7c
fix: lists padding
aaryan610 Dec 30, 2024
0cdee27
chore: update css
aaryan610 Dec 30, 2024
8d8df45
fix: css fixes
Palanikannan1437 Dec 31, 2024
723ee1d
fix: optimization of drop cursor
Palanikannan1437 Dec 31, 2024
841d6eb
fix: remove react scan script
Palanikannan1437 Jan 2, 2025
c0e40bc
fix: drop between lists stopped working
Palanikannan1437 Jan 2, 2025
c5fde5f
Merge branch 'preview' into feat/flat-lists
Palanikannan1437 Jan 2, 2025
bace1a0
wip
Palanikannan1437 Jan 2, 2025
5fab502
fix: drop cursor for list stabilized
Palanikannan1437 Jan 2, 2025
f5e28dd
fix: migration script added
Palanikannan1437 Jan 2, 2025
d90bbcd
fix: migration script added and drag drop for all type of nodes
Palanikannan1437 Jan 3, 2025
e2af5b4
fix: insert table inside list
Palanikannan1437 Jan 3, 2025
81796af
fix: add toggle list item in the menu bar
Palanikannan1437 Jan 3, 2025
278a814
wip: migration logic
Palanikannan1437 Jan 3, 2025
f8d8848
fix: loading flat lists before old extensions
Palanikannan1437 Jan 3, 2025
ab02542
fix: keeping old keymaps
Palanikannan1437 Jan 3, 2025
26f3442
fix: add taskItem dependency
Palanikannan1437 Jan 3, 2025
7536a78
chore: remove testing code
Palanikannan1437 Jan 3, 2025
97f3028
removed console logs
Palanikannan1437 Jan 6, 2025
151dc42
fix: type
Palanikannan1437 Jan 6, 2025
e094b49
Merge branch 'preview' into feat/flat-lists
Palanikannan1437 Jan 6, 2025
61ded96
fix: read only extensions and write extensions synced
Palanikannan1437 Jan 6, 2025
8487bb3
fix: remove paragraph tag's hardcoded values
Palanikannan1437 Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
"@plane/utils": "*",
"@tiptap/core": "^2.1.13",
"@tiptap/extension-blockquote": "^2.1.13",
"@tiptap/extension-bullet-list": "^2.10.3",
"@tiptap/extension-character-count": "^2.6.5",
"@tiptap/extension-collaboration": "^2.3.2",
"@tiptap/extension-image": "^2.1.13",
"@tiptap/extension-list-item": "^2.1.13",
"@tiptap/extension-list-item": "^2.10.3",
"@tiptap/extension-mention": "^2.1.13",
"@tiptap/extension-ordered-list": "^2.10.3",
"@tiptap/extension-placeholder": "^2.3.0",
"@tiptap/extension-task-item": "^2.1.13",
"@tiptap/extension-task-list": "^2.1.13",
Expand All @@ -64,6 +66,7 @@
"lowlight": "^3.0.0",
"lucide-react": "^0.378.0",
"prosemirror-codemark": "^0.4.2",
"prosemirror-safari-ime-span": "^1.0.2",
"prosemirror-utils": "^1.2.2",
"react-moveable": "^0.54.2",
"tippy.js": "^6.3.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
HeadingFiveItem,
HeadingSixItem,
EditorMenuItem,
ToggleListItem,
} from "@/components/menus";
// types
import { TEditorCommands } from "@/types";
Expand All @@ -42,6 +43,7 @@ export const BubbleMenuNodeSelector: FC<Props> = (props) => {
BulletListItem(editor),
NumberedListItem(editor),
TodoListItem(editor),
ToggleListItem(editor),
QuoteItem(editor),
CodeItem(editor),
];
Expand Down
29 changes: 20 additions & 9 deletions packages/editor/src/core/components/menus/menu-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
MinusSquare,
Palette,
AlignCenter,
ListCollapse,
} from "lucide-react";
// helpers
import {
Expand All @@ -33,18 +34,19 @@ import {
toggleBackgroundColor,
toggleBlockquote,
toggleBold,
toggleBulletList,
toggleCodeBlock,
toggleFlatBulletList,
toggleFlatOrderedList,
toggleFlatTaskList,
toggleFlatToggleList,
toggleHeadingFive,
toggleHeadingFour,
toggleHeadingOne,
toggleHeadingSix,
toggleHeadingThree,
toggleHeadingTwo,
toggleItalic,
toggleOrderedList,
toggleStrike,
toggleTaskList,
toggleTextColor,
toggleUnderline,
} from "@/helpers/editor-commands";
Expand Down Expand Up @@ -153,27 +155,35 @@ export const StrikeThroughItem = (editor: Editor): EditorMenuItem<"strikethrough
export const BulletListItem = (editor: Editor): EditorMenuItem<"bulleted-list"> => ({
key: "bulleted-list",
name: "Bulleted list",
isActive: () => editor?.isActive("bulletList"),
command: () => toggleBulletList(editor),
isActive: () => editor?.isActive("list", { kind: "bullet" }),
command: () => toggleFlatBulletList(editor),
icon: ListIcon,
});

export const NumberedListItem = (editor: Editor): EditorMenuItem<"numbered-list"> => ({
key: "numbered-list",
name: "Numbered list",
isActive: () => editor?.isActive("orderedList"),
command: () => toggleOrderedList(editor),
isActive: () => editor?.isActive("list", { kind: "ordered" }),
command: () => toggleFlatOrderedList(editor),
icon: ListOrderedIcon,
});

export const TodoListItem = (editor: Editor): EditorMenuItem<"to-do-list"> => ({
key: "to-do-list",
name: "To-do list",
isActive: () => editor.isActive("taskItem"),
command: () => toggleTaskList(editor),
isActive: () => editor?.isActive("list", { kind: "task" }),
command: () => toggleFlatTaskList(editor),
icon: CheckSquare,
});

export const ToggleListItem = (editor: Editor): EditorMenuItem<"toggle-list"> => ({
key: "toggle-list",
name: "Toggle list",
isActive: () => editor?.isActive("list", { kind: "toggle" }),
command: () => toggleFlatToggleList(editor),
icon: ListCollapse,
});

export const QuoteItem = (editor: Editor): EditorMenuItem<"quote"> => ({
key: "quote",
name: "Quote",
Expand Down Expand Up @@ -257,6 +267,7 @@ export const getEditorMenuItems = (editor: Editor | null): EditorMenuItem<TEdito
StrikeThroughItem(editor),
BulletListItem(editor),
TodoListItem(editor),
ToggleListItem(editor),
CodeItem(editor),
NumberedListItem(editor),
QuoteItem(editor),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export const ListKeymap = ({ tabIndex }: { tabIndex?: number }) =>
if (tabIndex !== undefined && tabIndex !== null) {
return false;
}
return true;
return false;
},
"Shift-Tab": () => {
if (this.editor.commands.liftListItem("listItem")) {
return true;
} else if (this.editor.commands.liftListItem("taskItem")) {
return true;
}
return true;
return false;
},
Delete: ({ editor }) => {
try {
Expand Down
Loading
Loading