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

[PULSE-42] feat: text alignment for all editors #5847

Merged
merged 11 commits into from
Nov 5, 2024
Prev Previous commit
Next Next commit
fix: merge conflicts resolved from preview
  • Loading branch information
aaryan610 committed Oct 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b05f40790c862cfdedd4e6856260f3b37bee2a71
4 changes: 2 additions & 2 deletions packages/editor/src/core/components/menus/menu-items.ts
Original file line number Diff line number Diff line change
@@ -208,15 +208,15 @@ export const ImageItem = (editor: Editor): EditorMenuItem<"image"> => ({
export const TextColorItem = (editor: Editor): EditorMenuItem<"text-color"> => ({
key: "text-color",
name: "Color",
isActive: ({ color }) => editor.getAttributes("textStyle").color === color,
isActive: ({ color }) => editor.isActive("customColor", { color }),
command: ({ color }) => toggleTextColor(color, editor),
icon: Palette,
});

export const BackgroundColorItem = (editor: Editor): EditorMenuItem<"background-color"> => ({
key: "background-color",
name: "Background color",
isActive: ({ color }) => editor.getAttributes("textStyle").backgroundColor === color,
isActive: ({ color }) => editor.isActive("customColor", { backgroundColor: color }),
command: ({ color }) => toggleBackgroundColor(color, editor),
icon: Palette,
});
6 changes: 2 additions & 4 deletions packages/editor/src/core/extensions/core-without-props.ts
Original file line number Diff line number Diff line change
@@ -16,9 +16,8 @@ import { IssueWidgetWithoutProps } from "./issue-embed/issue-embed-without-props
import { CustomMentionWithoutProps } from "./mentions/mentions-without-props";
import { CustomQuoteExtension } from "./quote";
import { TableHeader, TableCell, TableRow, Table } from "./table";
import { CustomTextColorExtension } from "./custom-text-color";
import { CustomBackgroundColorExtension } from "./custom-background-color";
import { CustomTextAlignExtension } from "./text-align";
import { CustomColorExtension } from "./custom-color";

export const CoreEditorExtensionsWithoutProps = [
StarterKit.configure({
@@ -86,9 +85,8 @@ export const CoreEditorExtensionsWithoutProps = [
TableCell,
TableRow,
CustomMentionWithoutProps(),
CustomTextColorExtension,
CustomBackgroundColorExtension,
CustomTextAlignExtension,
CustomColorExtension,
];

export const DocumentEditorExtensionsWithoutProps = [IssueWidgetWithoutProps()];
4 changes: 1 addition & 3 deletions packages/editor/src/core/extensions/extensions.tsx
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ import {
CustomMention,
CustomQuoteExtension,
CustomTextAlignExtension,
CustomTextColorExtension,
CustomTypographyExtension,
DropHandlerExtension,
ImageExtension,
@@ -156,8 +155,7 @@ export const CoreEditorExtensions = (args: TArguments) => {
includeChildren: true,
}),
CharacterCount,
CustomTextColorExtension,
CustomBackgroundColorExtension,
CustomTextAlignExtension,
aaryan610 marked this conversation as resolved.
Show resolved Hide resolved
CustomColorExtension,
];
};
3 changes: 1 addition & 2 deletions packages/editor/src/core/extensions/read-only-extensions.tsx
Original file line number Diff line number Diff line change
@@ -21,9 +21,8 @@ import {
CustomMention,
HeadingListExtension,
CustomReadOnlyImageExtension,
CustomTextColorExtension,
CustomBackgroundColorExtension,
CustomTextAlignExtension,
CustomColorExtension,
} from "@/extensions";
// helpers
import { isValidHttpUrl } from "@/helpers/common";
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.