Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/editor/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@plane/editor-core",
"version": "0.0.1",
"description": "Core Editor that powers Plane",
"private": true,
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
Expand Down
7 changes: 4 additions & 3 deletions packages/editor/lite-text-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@plane/lite-text-editor",
"version": "0.0.1",
"description": "Package that powers Plane's Comment Editor",
"private": true,
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
Expand Down Expand Up @@ -29,9 +30,6 @@
"dependencies": {
"@plane/editor-core": "*",
"@tiptap/extension-list-item": "^2.1.11",
"@types/node": "18.15.3",
"@types/react": "^18.2.5",
"@types/react-dom": "18.0.11",
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
"eslint": "8.36.0",
Expand All @@ -46,6 +44,9 @@
"use-debounce": "^9.0.4"
},
"devDependencies": {
"@types/node": "18.15.3",
"@types/react": "^18.2.35",
"@types/react-dom": "^18.2.14",
"eslint": "^7.32.0",
"postcss": "^8.4.29",
"tailwind-config-custom": "*",
Expand Down
5 changes: 2 additions & 3 deletions packages/editor/lite-text-editor/src/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use client";
import * as React from "react";
import {
EditorContainer,
Expand Down Expand Up @@ -32,7 +31,7 @@ interface ILiteTextEditor {
editorContentCustomClassNames?: string;
onChange?: (json: any, html: string) => void;
setIsSubmitting?: (
isSubmitting: "submitting" | "submitted" | "saved",
isSubmitting: "submitting" | "submitted" | "saved"
) => void;
setShouldShowAlert?: (showAlert: boolean) => void;
forwardedRef?: any;
Expand Down Expand Up @@ -127,7 +126,7 @@ const LiteTextEditor = (props: LiteTextEditorProps) => {
};

const LiteTextEditorWithRef = React.forwardRef<EditorHandle, ILiteTextEditor>(
(props, ref) => <LiteTextEditor {...props} forwardedRef={ref} />,
(props, ref) => <LiteTextEditor {...props} forwardedRef={ref} />
);

LiteTextEditorWithRef.displayName = "LiteTextEditorWithRef";
Expand Down
38 changes: 25 additions & 13 deletions packages/editor/lite-text-editor/src/ui/read-only/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
"use client"
import { EditorContainer, EditorContentWrapper, getEditorClassNames, useReadOnlyEditor } from '@plane/editor-core';
import * as React from 'react';
import * as React from "react";
import {
EditorContainer,
EditorContentWrapper,
getEditorClassNames,
useReadOnlyEditor,
} from "@plane/editor-core";

interface ICoreReadOnlyEditor {
value: string;
editorContentCustomClassNames?: string;
noBorder?: boolean;
borderOnFocus?: boolean;
customClassName?: string;
mentionHighlights: string[]
mentionHighlights: string[];
}

interface EditorCoreProps extends ICoreReadOnlyEditor {
Expand All @@ -27,31 +31,39 @@ const LiteReadOnlyEditor = ({
customClassName,
value,
forwardedRef,
mentionHighlights
mentionHighlights,
}: EditorCoreProps) => {
const editor = useReadOnlyEditor({
value,
forwardedRef,
mentionHighlights
mentionHighlights,
});

const editorClassNames = getEditorClassNames({ noBorder, borderOnFocus, customClassName });
const editorClassNames = getEditorClassNames({
noBorder,
borderOnFocus,
customClassName,
});

if (!editor) return null;

return (
<EditorContainer editor={editor} editorClassNames={editorClassNames}>
<div className="flex flex-col">
<EditorContentWrapper editor={editor} editorContentCustomClassNames={editorContentCustomClassNames} />
<EditorContentWrapper
editor={editor}
editorContentCustomClassNames={editorContentCustomClassNames}
/>
</div>
</EditorContainer >
</EditorContainer>
);
};

const LiteReadOnlyEditorWithRef = React.forwardRef<EditorHandle, ICoreReadOnlyEditor>((props, ref) => (
<LiteReadOnlyEditor {...props} forwardedRef={ref} />
));
const LiteReadOnlyEditorWithRef = React.forwardRef<
EditorHandle,
ICoreReadOnlyEditor
>((props, ref) => <LiteReadOnlyEditor {...props} forwardedRef={ref} />);

LiteReadOnlyEditorWithRef.displayName = "LiteReadOnlyEditorWithRef";

export { LiteReadOnlyEditor , LiteReadOnlyEditorWithRef };
export { LiteReadOnlyEditor, LiteReadOnlyEditorWithRef };
15 changes: 11 additions & 4 deletions packages/editor/lite-text-editor/src/ui/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';

import * as React from "react";
// next-themes
import { useTheme } from "next-themes";
// tooltip2
Expand Down Expand Up @@ -69,8 +68,16 @@ export const Tooltip: React.FC<Props> = ({
</div>
}
position={position}
renderTarget={({ isOpen: isTooltipOpen, ref: eleReference, ...tooltipProps }) =>
React.cloneElement(children, { ref: eleReference, ...tooltipProps, ...children.props })
renderTarget={({
isOpen: isTooltipOpen,
ref: eleReference,
...tooltipProps
}) =>
React.cloneElement(children, {
ref: eleReference,
...tooltipProps,
...children.props,
})
}
/>
);
Expand Down
11 changes: 6 additions & 5 deletions packages/editor/rich-text-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@plane/rich-text-editor",
"version": "0.0.1",
"description": "Rich Text Editor that powers Plane",
"private": true,
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
Expand All @@ -21,28 +22,28 @@
"check-types": "tsc --noEmit"
},
"peerDependencies": {
"@tiptap/core": "^2.1.11",
"next": "12.3.2",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-dom": "18.2.0",
"@tiptap/core": "^2.1.11"
"react-dom": "18.2.0"
},
"dependencies": {
"@plane/editor-core": "*",
"@tiptap/extension-code-block-lowlight": "^2.1.11",
"@tiptap/extension-horizontal-rule": "^2.1.11",
"@tiptap/extension-placeholder": "^2.1.11",
"class-variance-authority": "^0.7.0",
"@tiptap/suggestion": "^2.1.7",
"class-variance-authority": "^0.7.0",
"clsx": "^1.2.1",
"highlight.js": "^11.8.0",
"lowlight": "^3.0.0",
"lucide-react": "^0.244.0"
},
"devDependencies": {
"@types/node": "18.15.3",
"@types/react": "^18.2.5",
"@types/react-dom": "18.0.11",
"@types/react": "^18.2.35",
"@types/react-dom": "^18.2.14",
"eslint": "^7.32.0",
"postcss": "^8.4.29",
"react": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "eslint-config-custom",
"private": true,
"version": "0.13.2",
"main": "index.js",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/tailwind-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.13.2",
"description": "common tailwind configuration across monorepo",
"main": "index.js",
"private": true,
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "@plane/ui",
"description": "UI components shared across multiple apps internally",
"private": true,
"version": "0.0.1",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const CommentCard: React.FC<Props> = observer((props) => {
ref={showEditorRef}
value={comment.comment_html}
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
mentionHighlights={userStore.currentUser?.id ? [userStore.currentUser?.id] : []}
/>
<CommentReactions commentId={comment.id} projectId={comment.project} />
</div>
Expand Down
1 change: 0 additions & 1 deletion space/store/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { observable, action, computed, makeObservable, runInAction } from "mobx";
// service
import UserService from "services/user.service";
import { ActorDetail } from "types/issue";
// types
import { IUser } from "types/user";

Expand Down
4 changes: 2 additions & 2 deletions web/components/issues/comment/add-comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export const AddComment: React.FC<Props> = ({ disabled = false, onSubmit, showAc
const editorRef = React.useRef<any>(null);

const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug } = router.query;

const editorSuggestions = useEditorSuggestions(workspaceSlug as string | undefined, projectId as string | undefined);
const editorSuggestions = useEditorSuggestions();

const {
control,
Expand Down
2 changes: 1 addition & 1 deletion web/components/issues/comment/comment-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const CommentCard: React.FC<Props> = ({
const editorRef = React.useRef<any>(null);
const showEditorRef = React.useRef<any>(null);

const editorSuggestions = useEditorSuggestions(workspaceSlug, comment.project_detail.id)
const editorSuggestions = useEditorSuggestions();

const [isEditing, setIsEditing] = useState(false);

Expand Down
7 changes: 4 additions & 3 deletions web/components/issues/description-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {

const { setShowAlert } = useReloadConfirmations();

const editorSuggestion = useEditorSuggestions(workspaceSlug, issue.project_id)
const editorSuggestion = useEditorSuggestions();

const {
handleSubmit,
Expand Down Expand Up @@ -164,8 +164,9 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {
)}
/>
<div
className={`absolute right-5 bottom-5 text-xs text-custom-text-200 border border-custom-border-400 rounded-xl w-[6.5rem] py-1 z-10 flex items-center justify-center ${isSubmitting === "saved" ? "fadeOut" : "fadeIn"
}`}
className={`absolute right-5 bottom-5 text-xs text-custom-text-200 border border-custom-border-400 rounded-xl w-[6.5rem] py-1 z-10 flex items-center justify-center ${
isSubmitting === "saved" ? "fadeOut" : "fadeIn"
}`}
>
{isSubmitting === "submitting" ? "Saving..." : "Saved"}
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/components/issues/draft-issue-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {

const { setToastAlert } = useToast();

const editorSuggestions = useEditorSuggestions(workspaceSlug as string | undefined, projectId)
const editorSuggestions = useEditorSuggestions();

const {
formState: { errors, isSubmitting },
Expand Down
2 changes: 1 addition & 1 deletion web/components/issues/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const IssueForm: FC<IssueFormProps> = observer((props) => {

const user = userStore.currentUser;

const editorSuggestion = useEditorSuggestions(workspaceSlug as string | undefined, projectId);
const editorSuggestion = useEditorSuggestions();

const { setToastAlert } = useToast();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const IssueCommentCard: React.FC<IIssueCommentCard> = (props) => {

const [isEditing, setIsEditing] = useState(false);

const editorSuggestions = useEditorSuggestions(workspaceSlug, projectId);
const editorSuggestions = useEditorSuggestions();

const {
formState: { isSubmitting },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const IssueCommentEditor: React.FC<IIssueCommentEditor> = (props) => {
const editorRef = React.useRef<any>(null);

const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { workspaceSlug } = router.query;

const editorSuggestions = useEditorSuggestions(workspaceSlug as string | undefined, projectId as string | undefined);
const editorSuggestions = useEditorSuggestions();

const {
control,
Expand Down
2 changes: 1 addition & 1 deletion web/components/issues/issue-peek-overview/issue-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = (props) =
const [characterLimit, setCharacterLimit] = useState(false);
// hooks
const { setShowAlert } = useReloadConfirmations();
const editorSuggestions = useEditorSuggestions(workspaceSlug, issue.project_detail.id);
const editorSuggestions = useEditorSuggestions();

const {
handleSubmit,
Expand Down
2 changes: 1 addition & 1 deletion web/components/pages/create-update-block-inline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const CreateUpdateBlockInline: FC<Props> = ({
const router = useRouter();
const { workspaceSlug, projectId, pageId } = router.query;

const editorSuggestion = useEditorSuggestions(workspaceSlug as string | undefined, projectId as string | undefined)
const editorSuggestion = useEditorSuggestions();

const { setToastAlert } = useToast();

Expand Down
2 changes: 1 addition & 1 deletion web/components/pages/single-page-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const SinglePageBlock: React.FC<Props> = ({ block, projectDetails, showBl
},
});

const editorSuggestion = useEditorSuggestions(workspaceSlug as string | undefined, projectId as string | undefined);
const editorSuggestion = useEditorSuggestions();

const updatePageBlock = async (formData: Partial<IPageBlock>) => {
if (!workspaceSlug || !projectId || !pageId) return;
Expand Down
4 changes: 1 addition & 3 deletions web/hooks/use-editor-suggestions.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { IMentionHighlight, IMentionSuggestion } from "@plane/rich-text-editor";
import useUser from "./use-user";
import { useMobxStore } from "lib/mobx/store-provider";
import { RootStore } from "store/root";

const useEditorSuggestions = (_workspaceSlug: string | undefined, _projectId: string | undefined) => {
const useEditorSuggestions = () => {
const { mentionsStore }: RootStore = useMobxStore();

return {
Expand Down
5 changes: 2 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
"@types/js-cookie": "^3.0.2",
"@types/node": "18.0.6",
"@types/nprogress": "^0.2.0",
"@types/react": "18.0.15",
"@types/react-beautiful-dnd": "^13.1.2",
"@types/react": "^18.2.35",
"@types/react-color": "^3.0.6",
"@types/react-dom": "18.0.6",
"@types/react-dom": "^18.2.14",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
Expand Down
Loading