From 1e17c30e37fc5a2d29ac7bed382b72af12bd2ed4 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 9 Jul 2025 13:20:42 +0530 Subject: [PATCH] refactor: editor warnings --- .../components/editor/lite-text-editor.tsx | 2 +- .../peek-overview/comment/add-comment.tsx | 6 +++--- .../comment/comment-detail-card.tsx | 2 +- .../issues/issue-modal/issue-type-select.tsx | 2 +- .../ce/components/pages/editor/ai/menu.tsx | 2 +- .../core/components/comments/comment-card.tsx | 6 +++--- .../components/comments/comment-create.tsx | 6 +++--- .../editor/lite-text-editor/toolbar.tsx | 2 +- .../editor/sticky-editor/toolbar.tsx | 2 +- .../components/inbox/content/issue-root.tsx | 2 +- .../inbox/modals/create-modal/create-root.tsx | 2 +- .../modals/create-modal/issue-description.tsx | 4 ++-- .../issues/issue-detail/main-content.tsx | 2 +- .../context/issue-modal-context.tsx | 8 ++++---- .../components/issues/issue-modal/form.tsx | 11 +++++++++-- .../issues/peek-overview/issue-detail.tsx | 4 ++-- .../components/pages/dropdowns/actions.tsx | 8 +++----- .../components/pages/editor/page-root.tsx | 2 +- .../pages/editor/summary/content-browser.tsx | 2 +- .../core/components/pages/editor/title.tsx | 6 ++---- .../pages/editor/toolbar/toolbar.tsx | 5 ++--- .../pages/modals/export-page-modal.tsx | 3 +-- .../components/stickies/sticky/inputs.tsx | 8 +++----- .../hooks/use-collaborative-page-actions.tsx | 4 ++-- apps/web/core/hooks/use-page-operations.ts | 2 +- apps/web/core/store/pages/page-editor-info.ts | 2 +- .../editors/document/collaborative-editor.tsx | 4 ++-- .../editors/document/page-renderer.tsx | 11 +++++++---- .../editors/document/read-only-editor.tsx | 6 +++--- .../components/editors/editor-container.tsx | 5 +++-- .../components/editors/editor-content.tsx | 3 +-- .../components/editors/editor-wrapper.tsx | 10 +++++----- .../src/core/components/editors/index.ts | 4 ---- .../components/editors/lite-text/editor.tsx | 8 ++++---- .../editors/lite-text/read-only-editor.tsx | 6 +++--- .../editors/read-only-editor-wrapper.tsx | 9 +++++---- .../components/editors/rich-text/editor.tsx | 7 ++++--- .../src/core/components/links/link-view.tsx | 2 +- .../src/core/components/menus/block-menu.tsx | 2 +- .../menus/bubble-menu/alignment-selector.tsx | 2 +- .../menus/bubble-menu/color-selector.tsx | 2 +- .../menus/bubble-menu/link-selector.tsx | 2 +- .../menus/bubble-menu/node-selector.tsx | 2 +- .../components/menus/bubble-menu/root.tsx | 19 ++++++++++--------- .../src/core/components/menus/menu-items.ts | 2 +- .../custom-image/components/upload-status.tsx | 2 +- .../custom-link/helpers/pasteHandler.ts | 2 +- .../editor/src/core/extensions/enter-key.ts | 4 +++- .../mentions/mentions-list-dropdown.tsx | 2 +- .../editor/src/core/extensions/side-menu.ts | 2 +- .../editor/src/core/helpers/scroll-to-node.ts | 1 + packages/editor/src/core/hooks/use-editor.ts | 8 ++++++++ packages/editor/src/core/types/editor.ts | 5 ++++- packages/editor/src/core/types/hook.ts | 4 ++++ packages/editor/src/core/types/mention.ts | 2 +- .../core/types/slash-commands-suggestion.ts | 6 +++--- 56 files changed, 134 insertions(+), 115 deletions(-) diff --git a/apps/space/core/components/editor/lite-text-editor.tsx b/apps/space/core/components/editor/lite-text-editor.tsx index 6342d93447..9276107e70 100644 --- a/apps/space/core/components/editor/lite-text-editor.tsx +++ b/apps/space/core/components/editor/lite-text-editor.tsx @@ -69,7 +69,7 @@ export const LiteTextEditor = React.forwardRef rest.onEnterKeyPress?.(e)} + handleSubmit={() => rest.onEnterKeyPress?.()} isCommentEmpty={isEmpty} editorRef={editorRef} /> diff --git a/apps/space/core/components/issues/peek-overview/comment/add-comment.tsx b/apps/space/core/components/issues/peek-overview/comment/add-comment.tsx index d746d77662..e2020cf3a8 100644 --- a/apps/space/core/components/issues/peek-overview/comment/add-comment.tsx +++ b/apps/space/core/components/issues/peek-overview/comment/add-comment.tsx @@ -4,7 +4,7 @@ import React, { useRef, useState } from "react"; import { observer } from "mobx-react"; import { useForm, Controller } from "react-hook-form"; // plane imports -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { SitesFileService } from "@plane/services"; import { TIssuePublicComment } from "@plane/types"; import { TOAST_TYPE, setToast } from "@plane/ui"; @@ -75,8 +75,8 @@ export const AddComment: React.FC = observer((props) => { control={control} render={({ field: { value, onChange } }) => ( { - if (currentUser) handleSubmit(onSubmit)(e); + onEnterKeyPress={() => { + if (currentUser) handleSubmit(onSubmit)(); }} anchor={anchor} workspaceId={workspaceID?.toString() ?? ""} diff --git a/apps/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx b/apps/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx index 9adebeb2db..bb9f039070 100644 --- a/apps/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx +++ b/apps/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx @@ -4,7 +4,7 @@ import { Controller, useForm } from "react-hook-form"; import { Check, MessageSquare, MoreVertical, X } from "lucide-react"; import { Menu, Transition } from "@headlessui/react"; // plane imports -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { TIssuePublicComment } from "@plane/types"; import { getFileURL } from "@plane/utils"; // components diff --git a/apps/web/ce/components/issues/issue-modal/issue-type-select.tsx b/apps/web/ce/components/issues/issue-modal/issue-type-select.tsx index b7b6e0898c..00a192be12 100644 --- a/apps/web/ce/components/issues/issue-modal/issue-type-select.tsx +++ b/apps/web/ce/components/issues/issue-modal/issue-type-select.tsx @@ -1,6 +1,6 @@ import { Control } from "react-hook-form"; // plane imports -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // types import { TBulkIssueProperties, TIssue } from "@plane/types"; diff --git a/apps/web/ce/components/pages/editor/ai/menu.tsx b/apps/web/ce/components/pages/editor/ai/menu.tsx index 956422256b..a4e1fa91f5 100644 --- a/apps/web/ce/components/pages/editor/ai/menu.tsx +++ b/apps/web/ce/components/pages/editor/ai/menu.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from "react"; import { ChevronRight, CornerDownRight, LucideIcon, RefreshCcw, Sparkles, TriangleAlert } from "lucide-react"; // plane editor -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // plane ui import { Tooltip } from "@plane/ui"; // components diff --git a/apps/web/core/components/comments/comment-card.tsx b/apps/web/core/components/comments/comment-card.tsx index 66dd75427f..ea089c9080 100644 --- a/apps/web/core/components/comments/comment-card.tsx +++ b/apps/web/core/components/comments/comment-card.tsx @@ -6,7 +6,7 @@ import { useForm } from "react-hook-form"; import { Check, Globe2, Lock, Pencil, Trash2, X } from "lucide-react"; // PLane import { EIssueCommentAccessSpecifier } from "@plane/constants"; -import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor"; +import type { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor"; import { useTranslation } from "@plane/i18n"; import { TIssueComment, TCommentsOperations } from "@plane/types"; import { CustomMenu } from "@plane/ui"; @@ -150,9 +150,9 @@ export const CommentCard: FC = observer((props) => { initialValue={commentHTML ?? ""} value={null} onChange={(comment_json, comment_html) => setValue("comment_html", comment_html)} - onEnterKeyPress={(e) => { + onEnterKeyPress={() => { if (!isEmpty && !isSubmitting) { - handleSubmit(onEnter)(e); + handleSubmit(onEnter)(); } }} showSubmitButton={false} diff --git a/apps/web/core/components/comments/comment-create.tsx b/apps/web/core/components/comments/comment-create.tsx index 450814f519..4ac27837a9 100644 --- a/apps/web/core/components/comments/comment-create.tsx +++ b/apps/web/core/components/comments/comment-create.tsx @@ -4,7 +4,7 @@ import { useForm, Controller } from "react-hook-form"; // plane constants import { EIssueCommentAccessSpecifier } from "@plane/constants"; // plane editor -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // plane types import { TIssueComment, TCommentsOperations } from "@plane/types"; import { cn, isCommentEmpty } from "@plane/utils"; @@ -117,9 +117,9 @@ export const CommentCreate: FC = observer((props) => { id={"add_comment_" + entityId} value={"

"} workspaceSlug={workspaceSlug} - onEnterKeyPress={(e) => { + onEnterKeyPress={() => { if (!isEmpty && !isSubmitting) { - handleSubmit(onSubmit)(e); + handleSubmit(onSubmit)(); } }} ref={editorRef} diff --git a/apps/web/core/components/editor/lite-text-editor/toolbar.tsx b/apps/web/core/components/editor/lite-text-editor/toolbar.tsx index 13cd07c44e..0c2759f252 100644 --- a/apps/web/core/components/editor/lite-text-editor/toolbar.tsx +++ b/apps/web/core/components/editor/lite-text-editor/toolbar.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState, useCallback } from "react"; import { Globe2, Lock, LucideIcon } from "lucide-react"; import { EIssueCommentAccessSpecifier } from "@plane/constants"; // editor -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // i18n import { useTranslation } from "@plane/i18n"; // ui diff --git a/apps/web/core/components/editor/sticky-editor/toolbar.tsx b/apps/web/core/components/editor/sticky-editor/toolbar.tsx index 84b27226ec..6811e70039 100644 --- a/apps/web/core/components/editor/sticky-editor/toolbar.tsx +++ b/apps/web/core/components/editor/sticky-editor/toolbar.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState, useCallback } from "react"; import { Palette, Trash2 } from "lucide-react"; // editor -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // ui import { useOutsideClickDetector } from "@plane/hooks"; import { TSticky } from "@plane/types"; diff --git a/apps/web/core/components/inbox/content/issue-root.tsx b/apps/web/core/components/inbox/content/issue-root.tsx index e77147fa07..0bfc6d94b7 100644 --- a/apps/web/core/components/inbox/content/issue-root.tsx +++ b/apps/web/core/components/inbox/content/issue-root.tsx @@ -4,7 +4,7 @@ import { Dispatch, SetStateAction, useEffect, useMemo, useRef } from "react"; import { observer } from "mobx-react"; // plane imports import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants"; -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { EInboxIssueSource, TIssue, TNameDescriptionLoader } from "@plane/types"; import { Loader, TOAST_TYPE, setToast } from "@plane/ui"; // components diff --git a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx index 32dbfc42a9..e54a9055c3 100644 --- a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx +++ b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx @@ -4,7 +4,7 @@ import { FC, FormEvent, useCallback, useEffect, useRef, useState } from "react"; import { observer } from "mobx-react"; // plane imports import { ETabIndices, WORK_ITEM_TRACKER_EVENTS } from "@plane/constants"; -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // types import { useTranslation } from "@plane/i18n"; import { TIssue } from "@plane/types"; diff --git a/apps/web/core/components/inbox/modals/create-modal/issue-description.tsx b/apps/web/core/components/inbox/modals/create-modal/issue-description.tsx index 907f48e700..6105926659 100644 --- a/apps/web/core/components/inbox/modals/create-modal/issue-description.tsx +++ b/apps/web/core/components/inbox/modals/create-modal/issue-description.tsx @@ -4,7 +4,7 @@ import { FC, RefObject } from "react"; import { observer } from "mobx-react"; // plane imports import { ETabIndices } from "@plane/constants"; -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { useTranslation } from "@plane/i18n"; import { EFileAssetType, TIssue } from "@plane/types"; import { Loader } from "@plane/ui"; @@ -27,7 +27,7 @@ type TInboxIssueDescription = { data: Partial; handleData: (issueKey: keyof Partial, issueValue: Partial[keyof Partial]) => void; editorRef: RefObject; - onEnterKeyPress?: (e?: any) => void; + onEnterKeyPress?: () => void; onAssetUpload?: (assetId: string) => void; }; diff --git a/apps/web/core/components/issues/issue-detail/main-content.tsx b/apps/web/core/components/issues/issue-detail/main-content.tsx index 29a22c9c48..a7736a7aa3 100644 --- a/apps/web/core/components/issues/issue-detail/main-content.tsx +++ b/apps/web/core/components/issues/issue-detail/main-content.tsx @@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from "react"; import { observer } from "mobx-react"; // plane imports -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { EIssueServiceType, TNameDescriptionLoader } from "@plane/types"; // components import { getTextContent } from "@plane/utils"; diff --git a/apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx b/apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx index e2c2f39573..11b9e90035 100644 --- a/apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx +++ b/apps/web/core/components/issues/issue-modal/context/issue-modal-context.tsx @@ -1,12 +1,12 @@ import { createContext } from "react"; // ce imports +import { TIssueFields } from "ce/components/issues"; // react-hook-form import { UseFormReset, UseFormWatch } from "react-hook-form"; // plane imports -import { EditorRefApi } from "@plane/editor"; -import { ISearchIssueResponse, TIssue } from "@plane/types"; -import { TIssuePropertyValues, TIssuePropertyValueErrors } from "@/plane-web/types/issue-types"; -import { TIssueFields } from "ce/components/issues"; +import type { EditorRefApi } from "@plane/editor"; +import type { ISearchIssueResponse, TIssue } from "@plane/types"; +import type { TIssuePropertyValues, TIssuePropertyValueErrors } from "@/plane-web/types/issue-types"; export type TPropertyValuesValidationProps = { projectId: string | null; diff --git a/apps/web/core/components/issues/issue-modal/form.tsx b/apps/web/core/components/issues/issue-modal/form.tsx index f80d091be0..e818ab6b3e 100644 --- a/apps/web/core/components/issues/issue-modal/form.tsx +++ b/apps/web/core/components/issues/issue-modal/form.tsx @@ -6,13 +6,20 @@ import { useParams } from "next/navigation"; import { FormProvider, useForm } from "react-hook-form"; // editor import { ETabIndices, DEFAULT_WORK_ITEM_FORM_VALUES } from "@plane/constants"; -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; // i18n import { useTranslation } from "@plane/i18n"; import { EIssuesStoreType, TIssue, TWorkspaceDraftIssue } from "@plane/types"; // hooks import { Button, ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui"; -import { convertWorkItemDataToSearchResponse, getUpdateFormDataForReset, cn, getTextContent, getChangedIssuefields, getTabIndex } from "@plane/utils"; +import { + convertWorkItemDataToSearchResponse, + getUpdateFormDataForReset, + cn, + getTextContent, + getChangedIssuefields, + getTabIndex, +} from "@plane/utils"; // components import { IssueDefaultProperties, diff --git a/apps/web/core/components/issues/peek-overview/issue-detail.tsx b/apps/web/core/components/issues/peek-overview/issue-detail.tsx index 6873da488c..dc06c1264e 100644 --- a/apps/web/core/components/issues/peek-overview/issue-detail.tsx +++ b/apps/web/core/components/issues/peek-overview/issue-detail.tsx @@ -2,8 +2,8 @@ import { FC, useEffect, useRef } from "react"; import { observer } from "mobx-react"; // plane imports -import { EditorRefApi } from "@plane/editor"; -import { TNameDescriptionLoader } from "@plane/types"; +import type { EditorRefApi } from "@plane/editor"; +import type { TNameDescriptionLoader } from "@plane/types"; // components import { getTextContent } from "@plane/utils"; import { DescriptionVersionsRoot } from "@/components/core/description-versions"; diff --git a/apps/web/core/components/pages/dropdowns/actions.tsx b/apps/web/core/components/pages/dropdowns/actions.tsx index 538d0b8556..c53707c602 100644 --- a/apps/web/core/components/pages/dropdowns/actions.tsx +++ b/apps/web/core/components/pages/dropdowns/actions.tsx @@ -15,14 +15,12 @@ import { LockKeyholeOpen, Trash2, } from "lucide-react"; -// constants +// plane imports import { EPageAccess, PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants"; -// plane editor -import { EditorRefApi } from "@plane/editor"; -// plane ui +import type { EditorRefApi } from "@plane/editor"; import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem } from "@plane/ui"; -// components import { cn } from "@plane/utils"; +// components import { DeletePageModal } from "@/components/pages"; // helpers // hooks diff --git a/apps/web/core/components/pages/editor/page-root.tsx b/apps/web/core/components/pages/editor/page-root.tsx index e0e2fa9f4b..56b0962d39 100644 --- a/apps/web/core/components/pages/editor/page-root.tsx +++ b/apps/web/core/components/pages/editor/page-root.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { observer } from "mobx-react"; import { useSearchParams } from "next/navigation"; // plane imports -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { TDocumentPayload, TPage, TPageVersion, TWebhookConnectionQueryParams } from "@plane/types"; // components import { diff --git a/apps/web/core/components/pages/editor/summary/content-browser.tsx b/apps/web/core/components/pages/editor/summary/content-browser.tsx index d22a1ec2cc..e5e38c8bbe 100644 --- a/apps/web/core/components/pages/editor/summary/content-browser.tsx +++ b/apps/web/core/components/pages/editor/summary/content-browser.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, useCallback } from "react"; // plane imports -import { EditorRefApi, IMarking } from "@plane/editor"; +import type { EditorRefApi, IMarking } from "@plane/editor"; import { cn } from "@plane/utils"; // components import { OutlineHeading1, OutlineHeading2, OutlineHeading3, THeadingComponentProps } from "./heading-components"; diff --git a/apps/web/core/components/pages/editor/title.tsx b/apps/web/core/components/pages/editor/title.tsx index 416c43e071..f1a3ab556f 100644 --- a/apps/web/core/components/pages/editor/title.tsx +++ b/apps/web/core/components/pages/editor/title.tsx @@ -2,12 +2,10 @@ import { useState } from "react"; import { observer } from "mobx-react"; -// editor -import { EditorRefApi } from "@plane/editor"; -// ui +// plane imports +import type { EditorRefApi } from "@plane/editor"; import { TextArea } from "@plane/ui"; import { cn, getPageName } from "@plane/utils"; -// helpers // hooks import { usePageFilters } from "@/hooks/use-page-filters"; diff --git a/apps/web/core/components/pages/editor/toolbar/toolbar.tsx b/apps/web/core/components/pages/editor/toolbar/toolbar.tsx index ca85e60661..f636aea6de 100644 --- a/apps/web/core/components/pages/editor/toolbar/toolbar.tsx +++ b/apps/web/core/components/pages/editor/toolbar/toolbar.tsx @@ -2,9 +2,8 @@ import React, { useEffect, useState, useCallback } from "react"; import { Check, ChevronDown } from "lucide-react"; -// editor -import { EditorRefApi } from "@plane/editor"; -// ui +// plane imports +import type { EditorRefApi } from "@plane/editor"; import { CustomMenu, Tooltip } from "@plane/ui"; // components import { cn } from "@plane/utils"; diff --git a/apps/web/core/components/pages/modals/export-page-modal.tsx b/apps/web/core/components/pages/modals/export-page-modal.tsx index 67e2f629d8..8c48a54ef1 100644 --- a/apps/web/core/components/pages/modals/export-page-modal.tsx +++ b/apps/web/core/components/pages/modals/export-page-modal.tsx @@ -4,8 +4,7 @@ import { useState } from "react"; import { PageProps, pdf } from "@react-pdf/renderer"; import { Controller, useForm } from "react-hook-form"; // plane editor -import { EditorRefApi } from "@plane/editor"; -// plane ui +import type { EditorRefApi } from "@plane/editor"; import { Button, CustomSelect, EModalPosition, EModalWidth, ModalCore, setToast, TOAST_TYPE } from "@plane/ui"; // components import { PDFDocument } from "@/components/editor"; diff --git a/apps/web/core/components/stickies/sticky/inputs.tsx b/apps/web/core/components/stickies/sticky/inputs.tsx index ed03fe1855..545accd181 100644 --- a/apps/web/core/components/stickies/sticky/inputs.tsx +++ b/apps/web/core/components/stickies/sticky/inputs.tsx @@ -1,11 +1,9 @@ import { useCallback, useEffect, useRef } from "react"; import { usePathname } from "next/navigation"; import { Controller, useForm } from "react-hook-form"; -// plane editor -import { EditorRefApi } from "@plane/editor"; -// plane types -import { TSticky } from "@plane/types"; -// plane utils +// plane imports +import type { EditorRefApi } from "@plane/editor"; +import type { TSticky } from "@plane/types"; import { cn, isCommentEmpty } from "@plane/utils"; // hooks import { useWorkspace } from "@/hooks/store"; diff --git a/apps/web/core/hooks/use-collaborative-page-actions.tsx b/apps/web/core/hooks/use-collaborative-page-actions.tsx index 5ef1bfec9f..ad2990b8f9 100644 --- a/apps/web/core/hooks/use-collaborative-page-actions.tsx +++ b/apps/web/core/hooks/use-collaborative-page-actions.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useCallback, useMemo } from "react"; -import { EditorRefApi, TDocumentEventsServer } from "@plane/editor"; +// plane imports +import type { EditorRefApi, TDocumentEventsServer } from "@plane/editor"; import { DocumentCollaborativeEvents, TDocumentEventsClient, getServerEventName } from "@plane/editor/lib"; -// plane ui import { TOAST_TYPE, setToast } from "@plane/ui"; // store import { TPageInstance } from "@/store/pages/base-page"; diff --git a/apps/web/core/hooks/use-page-operations.ts b/apps/web/core/hooks/use-page-operations.ts index f3c635748e..fe319dba78 100644 --- a/apps/web/core/hooks/use-page-operations.ts +++ b/apps/web/core/hooks/use-page-operations.ts @@ -1,7 +1,7 @@ import { useMemo } from "react"; // plane imports import { IS_FAVORITE_MENU_OPEN, PROJECT_PAGE_TRACKER_EVENTS } from "@plane/constants"; -import { EditorRefApi } from "@plane/editor"; +import type { EditorRefApi } from "@plane/editor"; import { EPageAccess } from "@plane/types"; import { setToast, TOAST_TYPE } from "@plane/ui"; import { copyUrlToClipboard } from "@plane/utils"; diff --git a/apps/web/core/store/pages/page-editor-info.ts b/apps/web/core/store/pages/page-editor-info.ts index 442b534f36..937302443f 100644 --- a/apps/web/core/store/pages/page-editor-info.ts +++ b/apps/web/core/store/pages/page-editor-info.ts @@ -1,6 +1,6 @@ import { action, makeObservable, observable, runInAction } from "mobx"; // plane imports -import { EditorRefApi, TEditorAsset } from "@plane/editor"; +import type { EditorRefApi, TEditorAsset } from "@plane/editor"; export type TPageEditorInstance = { // observables diff --git a/packages/editor/src/core/components/editors/document/collaborative-editor.tsx b/packages/editor/src/core/components/editors/document/collaborative-editor.tsx index daaa561773..cb8cac54b0 100644 --- a/packages/editor/src/core/components/editors/document/collaborative-editor.tsx +++ b/packages/editor/src/core/components/editors/document/collaborative-editor.tsx @@ -1,4 +1,4 @@ -import { Extensions } from "@tiptap/core"; +import type { Extensions } from "@tiptap/core"; import React from "react"; // plane imports import { cn } from "@plane/utils"; @@ -7,7 +7,7 @@ import { PageRenderer } from "@/components/editors"; // constants import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config"; // extensions -import { WorkItemEmbedExtension } from "@/extensions"; +import { WorkItemEmbedExtension } from "@/extensions/work-item-embed"; // helpers import { getEditorClassNames } from "@/helpers/common"; // hooks diff --git a/packages/editor/src/core/components/editors/document/page-renderer.tsx b/packages/editor/src/core/components/editors/document/page-renderer.tsx index 1316d2d724..756aabca23 100644 --- a/packages/editor/src/core/components/editors/document/page-renderer.tsx +++ b/packages/editor/src/core/components/editors/document/page-renderer.tsx @@ -1,11 +1,14 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; // plane imports import { cn } from "@plane/utils"; // components -import { DocumentContentLoader, EditorContainer, EditorContentWrapper } from "@/components/editors"; +import { DocumentContentLoader } from "@/components/editors"; import { AIFeaturesMenu, BlockMenu, EditorBubbleMenu } from "@/components/menus"; // types -import { TAIHandler, TDisplayConfig } from "@/types"; +import type { TAIHandler, TDisplayConfig } from "@/types"; +// local imports +import { EditorContainer } from "../editor-container"; +import { EditorContentWrapper } from "../editor-content"; type Props = { aiHandler?: TAIHandler; @@ -37,7 +40,7 @@ export const PageRenderer = (props: Props) => { editorContainerClassName={editorContainerClassName} id={id} > - + {editor.isEditable && (
{bubbleMenuEnabled && } diff --git a/packages/editor/src/core/components/editors/document/read-only-editor.tsx b/packages/editor/src/core/components/editors/document/read-only-editor.tsx index 8f0d67ddc0..0b4cd1dee1 100644 --- a/packages/editor/src/core/components/editors/document/read-only-editor.tsx +++ b/packages/editor/src/core/components/editors/document/read-only-editor.tsx @@ -1,4 +1,4 @@ -import { Extensions } from "@tiptap/core"; +import type { Extensions } from "@tiptap/core"; import React, { forwardRef, MutableRefObject } from "react"; // plane imports import { cn } from "@plane/utils"; @@ -7,13 +7,13 @@ import { PageRenderer } from "@/components/editors"; // constants import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config"; // extensions -import { WorkItemEmbedExtension } from "@/extensions"; +import { WorkItemEmbedExtension } from "@/extensions/work-item-embed"; // helpers import { getEditorClassNames } from "@/helpers/common"; // hooks import { useReadOnlyEditor } from "@/hooks/use-read-only-editor"; // types -import { EditorReadOnlyRefApi, IDocumentReadOnlyEditorProps } from "@/types"; +import type { EditorReadOnlyRefApi, IDocumentReadOnlyEditorProps } from "@/types"; const DocumentReadOnlyEditor: React.FC = (props) => { const { diff --git a/packages/editor/src/core/components/editors/editor-container.tsx b/packages/editor/src/core/components/editors/editor-container.tsx index 3553f07fd8..3669d1b7f6 100644 --- a/packages/editor/src/core/components/editors/editor-container.tsx +++ b/packages/editor/src/core/components/editors/editor-container.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { FC, ReactNode, useRef } from "react"; // plane utils import { cn } from "@plane/utils"; @@ -55,7 +55,8 @@ export const EditorContainer: FC = (props) => { // Check if its last node and add new node if (lastNode) { - const isLastNodeEmptyParagraph = lastNode.type.name === CORE_EXTENSIONS.PARAGRAPH && lastNode.content.size === 0; + const isLastNodeEmptyParagraph = + lastNode.type.name === CORE_EXTENSIONS.PARAGRAPH && lastNode.content.size === 0; // Only insert a new paragraph if the last node is not an empty paragraph and not a doc node if (!isLastNodeEmptyParagraph && lastNode.type.name !== "doc") { const endPosition = editor?.state.doc.content.size; diff --git a/packages/editor/src/core/components/editors/editor-content.tsx b/packages/editor/src/core/components/editors/editor-content.tsx index 8171d06d9d..cc664538e2 100644 --- a/packages/editor/src/core/components/editors/editor-content.tsx +++ b/packages/editor/src/core/components/editors/editor-content.tsx @@ -4,12 +4,11 @@ import { FC, ReactNode } from "react"; interface EditorContentProps { children?: ReactNode; editor: Editor | null; - id: string; tabIndex?: number; } export const EditorContentWrapper: FC = (props) => { - const { editor, children, id, tabIndex } = props; + const { editor, children, tabIndex } = props; return (
editor?.chain().focus(undefined, { scrollIntoView: false }).run()}> diff --git a/packages/editor/src/core/components/editors/editor-wrapper.tsx b/packages/editor/src/core/components/editors/editor-wrapper.tsx index 0ca626683d..a76c9f0ed7 100644 --- a/packages/editor/src/core/components/editors/editor-wrapper.tsx +++ b/packages/editor/src/core/components/editors/editor-wrapper.tsx @@ -1,13 +1,13 @@ -import { Editor, Extensions } from "@tiptap/core"; -// components -import { EditorContainer } from "@/components/editors"; +import type { Editor, Extensions } from "@tiptap/core"; // constants import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config"; // hooks import { getEditorClassNames } from "@/helpers/common"; import { useEditor } from "@/hooks/use-editor"; // types -import { IEditorProps } from "@/types"; +import type { IEditorProps } from "@/types"; +// local imports +import { EditorContainer } from "./editor-container"; import { EditorContentWrapper } from "./editor-content"; type Props = IEditorProps & { @@ -78,7 +78,7 @@ export const EditorWrapper: React.FC = (props) => { > {children?.(editor)}
- +
); diff --git a/packages/editor/src/core/components/editors/index.ts b/packages/editor/src/core/components/editors/index.ts index 03ada4f726..ca4e3306b9 100644 --- a/packages/editor/src/core/components/editors/index.ts +++ b/packages/editor/src/core/components/editors/index.ts @@ -1,7 +1,3 @@ export * from "./document"; export * from "./lite-text"; export * from "./rich-text"; -export * from "./editor-container"; -export * from "./editor-content"; -export * from "./editor-wrapper"; -export * from "./read-only-editor-wrapper"; diff --git a/packages/editor/src/core/components/editors/lite-text/editor.tsx b/packages/editor/src/core/components/editors/lite-text/editor.tsx index 66913057b8..ec70447534 100644 --- a/packages/editor/src/core/components/editors/lite-text/editor.tsx +++ b/packages/editor/src/core/components/editors/lite-text/editor.tsx @@ -1,10 +1,10 @@ import { forwardRef, useMemo } from "react"; -// components -import { EditorWrapper } from "@/components/editors/editor-wrapper"; // extensions -import { EnterKeyExtension } from "@/extensions"; +import { EnterKeyExtension } from "@/extensions/enter-key"; // types -import { EditorRefApi, ILiteTextEditorProps } from "@/types"; +import type { EditorRefApi, ILiteTextEditorProps } from "@/types"; +// local imports +import { EditorWrapper } from "../editor-wrapper"; const LiteTextEditor: React.FC = (props) => { const { onEnterKeyPress, disabledExtensions, extensions: externalExtensions = [] } = props; diff --git a/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx b/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx index 75e02791de..654eda6668 100644 --- a/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx +++ b/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx @@ -1,8 +1,8 @@ import { forwardRef } from "react"; -// components -import { ReadOnlyEditorWrapper } from "@/components/editors"; // types -import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditorProps } from "@/types"; +import type { EditorReadOnlyRefApi, ILiteTextReadOnlyEditorProps } from "@/types"; +// local imports +import { ReadOnlyEditorWrapper } from "../read-only-editor-wrapper"; const LiteTextReadOnlyEditorWithRef = forwardRef((props, ref) => ( } /> diff --git a/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx b/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx index b6abd1a6a5..178c761004 100644 --- a/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx +++ b/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx @@ -1,5 +1,3 @@ -// components -import { EditorContainer, EditorContentWrapper } from "@/components/editors"; // constants import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config"; // helpers @@ -7,7 +5,10 @@ import { getEditorClassNames } from "@/helpers/common"; // hooks import { useReadOnlyEditor } from "@/hooks/use-read-only-editor"; // types -import { IReadOnlyEditorProps } from "@/types"; +import type { IReadOnlyEditorProps } from "@/types"; +// local imports +import { EditorContainer } from "./editor-container"; +import { EditorContentWrapper } from "./editor-content"; export const ReadOnlyEditorWrapper = (props: IReadOnlyEditorProps) => { const { @@ -49,7 +50,7 @@ export const ReadOnlyEditorWrapper = (props: IReadOnlyEditorProps) => { id={id} >
- +
); diff --git a/packages/editor/src/core/components/editors/rich-text/editor.tsx b/packages/editor/src/core/components/editors/rich-text/editor.tsx index 8544dcc832..3e72fc5911 100644 --- a/packages/editor/src/core/components/editors/rich-text/editor.tsx +++ b/packages/editor/src/core/components/editors/rich-text/editor.tsx @@ -1,13 +1,14 @@ import { forwardRef, useCallback } from "react"; // components -import { EditorWrapper } from "@/components/editors"; import { EditorBubbleMenu } from "@/components/menus"; // extensions -import { SideMenuExtension } from "@/extensions"; +import { SideMenuExtension } from "@/extensions/side-menu"; // plane editor imports import { RichTextEditorAdditionalExtensions } from "@/plane-editor/extensions/rich-text/extensions"; // types -import { EditorRefApi, IRichTextEditorProps } from "@/types"; +import type { EditorRefApi, IRichTextEditorProps } from "@/types"; +// local imports +import { EditorWrapper } from "../editor-wrapper"; const RichTextEditor: React.FC = (props) => { const { diff --git a/packages/editor/src/core/components/links/link-view.tsx b/packages/editor/src/core/components/links/link-view.tsx index 699f94e400..4c6204ad43 100644 --- a/packages/editor/src/core/components/links/link-view.tsx +++ b/packages/editor/src/core/components/links/link-view.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { CSSProperties, useEffect, useState } from "react"; // components import { LinkEditView, LinkPreview } from "@/components/links"; diff --git a/packages/editor/src/core/components/menus/block-menu.tsx b/packages/editor/src/core/components/menus/block-menu.tsx index bd86628cb3..3a63f966c8 100644 --- a/packages/editor/src/core/components/menus/block-menu.tsx +++ b/packages/editor/src/core/components/menus/block-menu.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { Copy, LucideIcon, Trash2 } from "lucide-react"; import { useCallback, useEffect, useRef } from "react"; import tippy, { Instance } from "tippy.js"; diff --git a/packages/editor/src/core/components/menus/bubble-menu/alignment-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/alignment-selector.tsx index b168525a79..3f7434ffd2 100644 --- a/packages/editor/src/core/components/menus/bubble-menu/alignment-selector.tsx +++ b/packages/editor/src/core/components/menus/bubble-menu/alignment-selector.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/core"; +import type { Editor } from "@tiptap/core"; import { AlignCenter, AlignLeft, AlignRight, LucideIcon } from "lucide-react"; // plane utils import { cn } from "@plane/utils"; 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 ced7ea1793..dd1073f37b 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 @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { ALargeSmall, Ban } from "lucide-react"; import { Dispatch, FC, SetStateAction } from "react"; // plane utils diff --git a/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx index 6f582f89c6..bd7421fbb6 100644 --- a/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx +++ b/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/core"; +import type { Editor } from "@tiptap/core"; import { Check, Link, Trash2 } from "lucide-react"; import { Dispatch, FC, SetStateAction, useCallback, useRef, useState } from "react"; // plane imports diff --git a/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx index 564f7d97ca..dfecb04654 100644 --- a/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx +++ b/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { Check, ChevronDown } from "lucide-react"; import { Dispatch, FC, SetStateAction } from "react"; // plane utils diff --git a/packages/editor/src/core/components/menus/bubble-menu/root.tsx b/packages/editor/src/core/components/menus/bubble-menu/root.tsx index a3fa3e2d7d..cca5a744a0 100644 --- a/packages/editor/src/core/components/menus/bubble-menu/root.tsx +++ b/packages/editor/src/core/components/menus/bubble-menu/root.tsx @@ -1,6 +1,6 @@ import { BubbleMenu, BubbleMenuProps, Editor, isNodeSelection, useEditorState } from "@tiptap/react"; import { FC, useEffect, useState, useRef } from "react"; -// plane utils +// plane imports import { cn } from "@plane/utils"; // components import { @@ -22,9 +22,10 @@ import { COLORS_LIST } from "@/constants/common"; import { CORE_EXTENSIONS } from "@/constants/extension"; // extensions import { isCellSelection } from "@/extensions/table/table/utilities/is-cell-selection"; +// types +import type { TEditorCommands } from "@/types"; // local components import { TextAlignmentSelector } from "./alignment-selector"; -import { TEditorCommands } from "@/types"; type EditorBubbleMenuProps = Omit; @@ -39,13 +40,13 @@ export interface EditorStateType { center: boolean; color: { key: string; label: string; textColor: string; backgroundColor: string } | undefined; backgroundColor: - | { - key: string; - label: string; - textColor: string; - backgroundColor: string; - } - | undefined; + | { + key: string; + label: string; + textColor: string; + backgroundColor: string; + } + | undefined; } export const EditorBubbleMenu: FC = (props: { editor: Editor }) => { diff --git a/packages/editor/src/core/components/menus/menu-items.ts b/packages/editor/src/core/components/menus/menu-items.ts index c3aa4d414a..649b27d586 100644 --- a/packages/editor/src/core/components/menus/menu-items.ts +++ b/packages/editor/src/core/components/menus/menu-items.ts @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { BoldIcon, Heading1, diff --git a/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx b/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx index f88c69c6f3..92038d1e83 100644 --- a/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx +++ b/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/core"; +import type { Editor } from "@tiptap/core"; import { useEditorState } from "@tiptap/react"; import { useEffect, useRef, useState } from "react"; // constants diff --git a/packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.ts b/packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.ts index 475bf28d94..e02209af19 100644 --- a/packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.ts +++ b/packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.ts @@ -1,4 +1,4 @@ -import { Editor } from "@tiptap/core"; +import type { Editor } from "@tiptap/core"; import { MarkType } from "@tiptap/pm/model"; import { Plugin, PluginKey } from "@tiptap/pm/state"; import { find } from "linkifyjs"; diff --git a/packages/editor/src/core/extensions/enter-key.ts b/packages/editor/src/core/extensions/enter-key.ts index e36adde3cb..3b0ddd857c 100644 --- a/packages/editor/src/core/extensions/enter-key.ts +++ b/packages/editor/src/core/extensions/enter-key.ts @@ -3,8 +3,10 @@ import { Extension } from "@tiptap/core"; import { CORE_EXTENSIONS } from "@/constants/extension"; // helpers import { getExtensionStorage } from "@/helpers/get-extension-storage"; +// types +import type { IEditorProps } from "@/types"; -export const EnterKeyExtension = (onEnterKeyPress?: () => void) => +export const EnterKeyExtension = (onEnterKeyPress?: IEditorProps["onEnterKeyPress"]) => Extension.create({ name: CORE_EXTENSIONS.ENTER_KEY, diff --git a/packages/editor/src/core/extensions/mentions/mentions-list-dropdown.tsx b/packages/editor/src/core/extensions/mentions/mentions-list-dropdown.tsx index da11d0f995..e98c4b6bea 100644 --- a/packages/editor/src/core/extensions/mentions/mentions-list-dropdown.tsx +++ b/packages/editor/src/core/extensions/mentions/mentions-list-dropdown.tsx @@ -1,6 +1,6 @@ "use client"; -import { Editor } from "@tiptap/react"; +import type { Editor } from "@tiptap/react"; import { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react"; import { v4 as uuidv4 } from "uuid"; // plane utils diff --git a/packages/editor/src/core/extensions/side-menu.ts b/packages/editor/src/core/extensions/side-menu.ts index ca139f7231..01c95956a0 100644 --- a/packages/editor/src/core/extensions/side-menu.ts +++ b/packages/editor/src/core/extensions/side-menu.ts @@ -1,6 +1,6 @@ import { Extension } from "@tiptap/core"; import { Plugin, PluginKey } from "@tiptap/pm/state"; -import { EditorView } from "@tiptap/pm/view"; +import type { EditorView } from "@tiptap/pm/view"; // constants import { CORE_EXTENSIONS } from "@/constants/extension"; // plugins diff --git a/packages/editor/src/core/helpers/scroll-to-node.ts b/packages/editor/src/core/helpers/scroll-to-node.ts index 973f3cf141..7e5aa0979a 100644 --- a/packages/editor/src/core/helpers/scroll-to-node.ts +++ b/packages/editor/src/core/helpers/scroll-to-node.ts @@ -32,6 +32,7 @@ function scrollToNode(editor: Editor, pos: number): void { } } +// eslint-disable-next-line no-undef export function scrollToNodeViaDOMCoordinates(editor: Editor, pos: number, behavior?: ScrollBehavior): void { const view = editor.view; diff --git a/packages/editor/src/core/hooks/use-editor.ts b/packages/editor/src/core/hooks/use-editor.ts index 1979d46b14..9447ab4043 100644 --- a/packages/editor/src/core/hooks/use-editor.ts +++ b/packages/editor/src/core/hooks/use-editor.ts @@ -36,7 +36,9 @@ export const useEditor = (props: TEditorHookProps) => { initialValue, mentionHandler, onAssetChange, + onBlur, onChange, + onFocus, onTransaction, placeholder, provider, @@ -75,6 +77,12 @@ export const useEditor = (props: TEditorHookProps) => { onTransaction: () => { onTransaction?.(); }, + onFocus: () => { + onFocus?.(); + }, + onBlur: () => { + onBlur?.(); + }, onUpdate: ({ editor }) => onChange?.(editor.getJSON(), editor.getHTML()), onDestroy: () => handleEditorReady?.(false), }, diff --git a/packages/editor/src/core/types/editor.ts b/packages/editor/src/core/types/editor.ts index d4d572502f..51d73e5b80 100644 --- a/packages/editor/src/core/types/editor.ts +++ b/packages/editor/src/core/types/editor.ts @@ -111,6 +111,7 @@ export interface EditorRefApi extends EditorReadOnlyRefApi { onDocumentInfoChange: (callback: (documentInfo: TDocumentInfo) => void) => () => void; onHeadingChange: (callback: (headings: IMarking[]) => void) => () => void; onStateChange: (callback: () => void) => () => void; + // eslint-disable-next-line no-undef scrollToNodeViaDOMCoordinates: (behavior?: ScrollBehavior, position?: number) => void; setEditorValueAtCursorPosition: (content: string) => void; setFocusAtPosition: (position: number) => void; @@ -134,8 +135,10 @@ export interface IEditorProps { initialValue: string; mentionHandler: TMentionHandler; onAssetChange?: (assets: TEditorAsset[]) => void; + onBlur?: () => void; onChange?: (json: object, html: string) => void; - onEnterKeyPress?: (e?: any) => void; + onEnterKeyPress?: () => void; + onFocus?: () => void; onTransaction?: () => void; placeholder?: string | ((isFocused: boolean, value: string) => string); tabIndex?: number; diff --git a/packages/editor/src/core/types/hook.ts b/packages/editor/src/core/types/hook.ts index 40974981b7..34eaf0db8c 100644 --- a/packages/editor/src/core/types/hook.ts +++ b/packages/editor/src/core/types/hook.ts @@ -19,7 +19,9 @@ export type TEditorHookProps = TCoreHookProps & | "id" | "mentionHandler" | "onAssetChange" + | "onBlur" | "onChange" + | "onFocus" | "onTransaction" | "placeholder" | "tabIndex" @@ -40,7 +42,9 @@ export type TCollaborativeEditorHookProps = TCoreHookProps & | "id" | "mentionHandler" | "onAssetChange" + | "onBlur" | "onChange" + | "onFocus" | "onTransaction" | "placeholder" | "tabIndex" diff --git a/packages/editor/src/core/types/mention.ts b/packages/editor/src/core/types/mention.ts index b7a65f8b4c..529d64bde1 100644 --- a/packages/editor/src/core/types/mention.ts +++ b/packages/editor/src/core/types/mention.ts @@ -1,5 +1,5 @@ // plane types -import { IUserLite, TSearchEntities } from "@plane/types"; +import { TSearchEntities } from "@plane/types"; export type TMentionSuggestion = { entity_identifier: string; diff --git a/packages/editor/src/core/types/slash-commands-suggestion.ts b/packages/editor/src/core/types/slash-commands-suggestion.ts index d6dfae076f..faf74bfb08 100644 --- a/packages/editor/src/core/types/slash-commands-suggestion.ts +++ b/packages/editor/src/core/types/slash-commands-suggestion.ts @@ -1,7 +1,7 @@ -import { CSSProperties } from "react"; import { Editor, Range } from "@tiptap/core"; -// types -import { TEditorCommands } from "@/types"; +import { CSSProperties } from "react"; +// local imports +import type { TEditorCommands } from "./editor"; export type CommandProps = { editor: Editor;