Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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: 5 additions & 0 deletions .changeset/two-glasses-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Fixed issues with ordered and unordered lists in product and category descriptions. Lists now work correctly when editing, and the inline formatting toolbar no longer gets cut off on smaller screens.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: should we also add a note about the format change in editor.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering about it - format is changed but we are converting to old one anyway and end users won't be able to see the difference

146 changes: 128 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.1",
"@editorjs/editorjs": "^2.30.7",
"@editorjs/header": "^2.6.2",
"@editorjs/list": "^1.7.0",
"@editorjs/paragraph": "^2.8.0",
"@editorjs/quote": "^2.4.0",
"@editorjs/editorjs": "2.30.7",
"@editorjs/header": "2.8.8",
"@editorjs/list": "2.0.8",
"@editorjs/paragraph": "2.11.7",
"@editorjs/quote": "2.7.6",
"@glideapps/glide-data-grid": "5.3.0",
"@glideapps/glide-data-grid-cells": "^5.3.0",
"@graphiql/plugin-explorer": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion src/components/RichTextEditor/RichTextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { tools } from "./consts";
import { useHasRendered, useUpdateOnRerender } from "./hooks";
import { ReactEditorJS } from "./ReactEditorJS";
import useStyles from "./styles";
import { convertEditorJSListBlocks } from "./utils";

export type EditorJsProps = Omit<ReactEditorJSProps, "factory">;

Expand Down Expand Up @@ -105,7 +106,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({

setHasValue(editorJsValue.blocks.length > 0);

return onChange?.(editorJsValue);
return onChange?.(convertEditorJSListBlocks(editorJsValue));
}}
{...props}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RichTextEditor/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-strict-ignore
import strikethroughIcon from "@dashboard/icons/StrikethroughIcon";
import { StrikethroughIcon } from "@dashboard/icons/StrikethroughIcon";
import { ToolConstructable, ToolSettings } from "@editorjs/editorjs";
import Embed from "@editorjs/embed";
import Header from "@editorjs/header";
Expand Down Expand Up @@ -38,6 +38,6 @@ export const tools: Record<string, ToolConstructable | ToolSettings> = {
},
shortcut: "CMD+S",
tagName: "s",
toolboxIcon: strikethroughIcon,
toolboxIcon: StrikethroughIcon,
}),
};
9 changes: 2 additions & 7 deletions src/components/RichTextEditor/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ const useStyles = makeStyles(
},
"& .ce-popover": {
backgroundColor: vars.colors.background.default1,
position: "absolute",
top: 0,
left: "-186px",
},
"& .ce-settings": {
position: "absolute",
left: "-56px",
"& .ce-popover__items": {
overflowY: "hidden",
},
"& .ce-popover__item": {
...hover,
Expand All @@ -92,7 +88,6 @@ const useStyles = makeStyles(
color: vars.colors.text.default1,
backgroundColor: vars.colors.background.default1,
},

"& .codex-editor__loader": {
height: "30px",
},
Expand Down
Loading
Loading