diff --git a/packages/editor/package.json b/packages/editor/package.json index 01d03db1fd..d0c323423e 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -42,8 +42,6 @@ "@tiptap/extension-blockquote": "^2.1.13", "@tiptap/extension-character-count": "^2.6.5", "@tiptap/extension-collaboration": "^2.3.2", - "@tiptap/extension-color": "^2.7.1", - "@tiptap/extension-highlight": "^2.7.1", "@tiptap/extension-image": "^2.1.13", "@tiptap/extension-list-item": "^2.1.13", "@tiptap/extension-mention": "^2.1.13", diff --git a/packages/editor/src/core/components/menus/bubble-menu/color-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/color-selector.tsx index cc3eb5412e..0f0ae62b5b 100644 --- a/packages/editor/src/core/components/menus/bubble-menu/color-selector.tsx +++ b/packages/editor/src/core/components/menus/bubble-menu/color-selector.tsx @@ -16,12 +16,8 @@ type Props = { export const BubbleMenuColorSelector: FC = (props) => { const { editor, isOpen, setIsOpen } = props; - const activeTextColor = COLORS_LIST.find((c) => editor.getAttributes("textStyle").color === c.textColor); - const activeBackgroundColor = COLORS_LIST.find((c) => - editor.isActive("highlight", { - color: c.backgroundColor, - }) - ); + const activeTextColor = COLORS_LIST.find((c) => editor.getAttributes("textStyle").color === c.key); + const activeBackgroundColor = COLORS_LIST.find((c) => editor.getAttributes("textStyle").backgroundColor === c.key); return (
@@ -41,25 +37,19 @@ export const BubbleMenuColorSelector: FC = (props) => { "bg-custom-background-100": !activeBackgroundColor, } )} - style={ - activeBackgroundColor - ? { - backgroundColor: activeBackgroundColor.backgroundColor, - } - : {} - } + style={{ + backgroundColor: activeBackgroundColor + ? `var(${activeBackgroundColor.backgroundColorVariable})` + : "transparent", + }} > @@ -70,13 +60,13 @@ export const BubbleMenuColorSelector: FC = (props) => {
{COLORS_LIST.map((color) => (