Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: add rtl support in task lists

Abdullah Attaef104e412669
diff --git a/packages/editor/src/extensions/task-item/component.tsx b/packages/editor/src/extensions/task-item/component.tsx
index fe2a113cb..7e89064de 100644
--- a/packages/editor/src/extensions/task-item/component.tsx
+++ b/packages/editor/src/extensions/task-item/component.tsx
@@ -80,6 +80,7 @@ export function TaskItemComponent(
sx={{
bg: "background",
borderRadius: "default",
+ gap: 2,
":hover > .dragHandle": {
opacity: editor.isEditable ? 1 : 0
},
@@ -100,7 +101,6 @@ export function TaskItemComponent(
sx={{
opacity: [1, 1, 0],
alignSelf: "start",
- mr: 2,
bg: "transparent",
cursor: "grab",
".icon:hover path": {
@@ -121,7 +121,6 @@ export function TaskItemComponent(
borderColor: checked ? "checked" : "icon",
borderRadius: "default",
alignSelf: "start",
- mr: 2,
p: "1px",
mt: "2px",
cursor: editor.isEditable ? "pointer" : "unset",
@@ -172,10 +171,10 @@ export function TaskItemComponent(
className="taskItemTools"
sx={{
bg: "background",
- ml: 0,
- mt: "4px",
- alignSelf: "end",
opacity: 0,
+ position: "absolute",
+ top: 1,
+ right: 0,
alignItems: "center"
}}
>
diff --git a/packages/editor/src/extensions/task-list/task-list.ts b/packages/editor/src/extensions/task-list/task-list.ts
index 8028178cd..34f3d0c57 100644
--- a/packages/editor/src/extensions/task-list/task-list.ts
+++ b/packages/editor/src/extensions/task-list/task-list.ts
@@ -28,7 +28,6 @@ import { findChildrenByType } from "../../utils/prosemirror";
export type TaskListAttributes = {
title: string;
- textDirection: string;
};
const stateKey = new PluginKey("task-item-drop-override");
@@ -48,17 +47,6 @@ export const TaskListNode = TaskList.extend({
"data-title": attributes.title
};
}
- },
- textDirection: {
- default: "ltr",
- parseHTML: (element) => element.dir,
- renderHTML(attributes) {
- if (!attributes.textDirection) {
- return {};
- }
-
- return { dir: attributes.textDirection };
- }
}
};
},