[WEB-5416] fix: Use proper import syntax (#8105)

This commit is contained in:
Aaron 2025-11-13 04:11:06 -08:00 committed by GitHub
parent 34c0e81d8e
commit 95c742244e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
526 changed files with 1002 additions and 923 deletions

View file

@ -3,7 +3,6 @@ module.exports = {
extends: ["@plane/eslint-config/next.js"], extends: ["@plane/eslint-config/next.js"],
ignorePatterns: ["build/**", "dist/**", ".vite/**"], ignorePatterns: ["build/**", "dist/**", ".vite/**"],
rules: { rules: {
"no-duplicate-imports": "off",
"import/no-duplicates": ["error", { "prefer-inline": false }], "import/no-duplicates": ["error", { "prefer-inline": false }],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"], "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-import-type-side-effects": "error",

View file

@ -5,7 +5,7 @@ import { Controller, Post } from "@plane/decorators";
import { convertHTMLDocumentToAllFormats } from "@plane/editor"; import { convertHTMLDocumentToAllFormats } from "@plane/editor";
// logger // logger
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import { type TConvertDocumentRequestBody } from "@/types"; import type { TConvertDocumentRequestBody } from "@/types";
// Define the schema with more robust validation // Define the schema with more robust validation
const convertDocumentSchema = z.object({ const convertDocumentSchema = z.object({

View file

@ -1,15 +1,8 @@
import type { Connection, Extension, Hocuspocus, onConfigurePayload } from "@hocuspocus/server"; import type { Connection, Extension, Hocuspocus, onConfigurePayload } from "@hocuspocus/server";
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import { Redis } from "@/extensions/redis"; import { Redis } from "@/extensions/redis";
import { import { AdminCommand, CloseCode, getForceCloseMessage, isForceCloseCommand } from "@/types/admin-commands";
AdminCommand, import type { ForceCloseReason, ClientForceCloseMessage, ForceCloseCommandData } from "@/types/admin-commands";
CloseCode,
ForceCloseReason,
getForceCloseMessage,
isForceCloseCommand,
type ClientForceCloseMessage,
type ForceCloseCommandData,
} from "@/types/admin-commands";
/** /**
* Extension to handle force close commands from other servers via Redis admin channel * Extension to handle force close commands from other servers via Redis admin channel

View file

@ -1,5 +1,6 @@
import { Redis as HocuspocusRedis } from "@hocuspocus/extension-redis"; import { Redis as HocuspocusRedis } from "@hocuspocus/extension-redis";
import { OutgoingMessage, type onConfigurePayload } from "@hocuspocus/server"; import { OutgoingMessage } from "@hocuspocus/server";
import type { onConfigurePayload } from "@hocuspocus/server";
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import { AppError } from "@/lib/errors"; import { AppError } from "@/lib/errors";
import { redisManager } from "@/redis"; import { redisManager } from "@/redis";

View file

@ -1,4 +1,4 @@
import { AxiosError } from "axios"; import type { AxiosError } from "axios";
/** /**
* Application error class that sanitizes and standardizes errors across the app. * Application error class that sanitizes and standardizes errors across the app.

View file

@ -1,5 +1,6 @@
import type { onStatelessPayload } from "@hocuspocus/server"; import type { onStatelessPayload } from "@hocuspocus/server";
import { DocumentCollaborativeEvents, type TDocumentEventsServer } from "@plane/editor/lib"; import { DocumentCollaborativeEvents } from "@plane/editor/lib";
import type { TDocumentEventsServer } from "@plane/editor/lib";
/** /**
* Broadcast the client event to all the clients so that they can update their state * Broadcast the client event to all the clients so that they can update their state

View file

@ -1,8 +1,9 @@
import { Server as HttpServer } from "http"; import type { Server as HttpServer } from "http";
import { type Hocuspocus } from "@hocuspocus/server"; import type { Hocuspocus } from "@hocuspocus/server";
import compression from "compression"; import compression from "compression";
import cors from "cors"; import cors from "cors";
import express, { Express, Request, Response, Router } from "express"; import type { Express, Request, Response, Router } from "express";
import express from "express";
import expressWs from "express-ws"; import expressWs from "express-ws";
import helmet from "helmet"; import helmet from "helmet";
// plane imports // plane imports

View file

@ -1,4 +1,5 @@
import axios, { AxiosInstance } from "axios"; import type { AxiosInstance } from "axios";
import axios from "axios";
import { env } from "@/env"; import { env } from "@/env";
import { AppError } from "@/lib/errors"; import { AppError } from "@/lib/errors";

View file

@ -1,5 +1,5 @@
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import { TPage } from "@plane/types"; import type { TPage } from "@plane/types";
// services // services
import { AppError } from "@/lib/errors"; import { AppError } from "@/lib/errors";
import { APIService } from "../api.service"; import { APIService } from "../api.service";

View file

@ -1,4 +1,4 @@
import { type Hocuspocus } from "@hocuspocus/server"; import type { Hocuspocus } from "@hocuspocus/server";
import { createRealtimeEvent } from "@plane/editor"; import { createRealtimeEvent } from "@plane/editor";
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import type { FetchPayloadWithContext, StorePayloadWithContext } from "@/types"; import type { FetchPayloadWithContext, StorePayloadWithContext } from "@/types";

View file

@ -1,5 +1,5 @@
import { Hocuspocus } from "@hocuspocus/server"; import type { Hocuspocus } from "@hocuspocus/server";
import { BroadcastedEvent } from "@plane/editor"; import type { BroadcastedEvent } from "@plane/editor";
import { logger } from "@plane/logger"; import { logger } from "@plane/logger";
import { Redis } from "@/extensions/redis"; import { Redis } from "@/extensions/redis";
import { AppError } from "@/lib/errors"; import { AppError } from "@/lib/errors";

View file

@ -1,14 +1,9 @@
module.exports = { module.exports = {
root: true, root: true,
extends: ["@plane/eslint-config/next.js"], extends: ["@plane/eslint-config/next.js"],
ignorePatterns: [ ignorePatterns: ["build/**", "dist/**", ".vite/**"],
"build/**",
"dist/**",
".vite/**",
],
rules: { rules: {
"no-duplicate-imports": "off", "import/no-duplicates": ["error", { "prefer-inline": false }],
"import/no-duplicates": ["error", {"prefer-inline": false}],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"], "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/consistent-type-imports": [ "@typescript-eslint/consistent-type-imports": [
@ -21,5 +16,3 @@ module.exports = {
], ],
}, },
}; };

View file

@ -3,7 +3,6 @@ module.exports = {
extends: ["@plane/eslint-config/next.js"], extends: ["@plane/eslint-config/next.js"],
ignorePatterns: ["build/**", "dist/**", ".vite/**"], ignorePatterns: ["build/**", "dist/**", ".vite/**"],
rules: { rules: {
"no-duplicate-imports": "off",
"import/no-duplicates": ["error", { "prefer-inline": false }], "import/no-duplicates": ["error", { "prefer-inline": false }],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"], "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@typescript-eslint/no-import-type-side-effects": "error", "@typescript-eslint/no-import-type-side-effects": "error",

View file

@ -1254,7 +1254,6 @@ declare module "wa-sqlite/src/examples/IndexedDbVFS.js" {
/** @ignore */ /** @ignore */
declare module "wa-sqlite/src/examples/MemoryVFS.js" { declare module "wa-sqlite/src/examples/MemoryVFS.js" {
// eslint-disable-next-line no-duplicate-imports
import * as VFS from "wa-sqlite/src/VFS.js"; import * as VFS from "wa-sqlite/src/VFS.js";
/** @ignore */ /** @ignore */
export class MemoryVFS extends VFS.Base { export class MemoryVFS extends VFS.Base {

View file

@ -1,4 +1,5 @@
import { ChartXAxisProperty, ChartYAxisMetric, TAnalyticsTabsBase } from "@plane/types"; import type { TAnalyticsTabsBase } from "@plane/types";
import { ChartXAxisProperty, ChartYAxisMetric } from "@plane/types";
export interface IInsightField { export interface IInsightField {
key: string; key: string;

View file

@ -1,4 +1,5 @@
import { ChartXAxisProperty, TChartColorScheme } from "@plane/types"; import type { TChartColorScheme } from "@plane/types";
import { ChartXAxisProperty } from "@plane/types";
export const LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide"; export const LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide";
export const AXIS_LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide"; export const AXIS_LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide";

View file

@ -1,5 +1,5 @@
// types // types
import { TIssuesListTypes } from "@plane/types"; import type { TIssuesListTypes } from "@plane/types";
export enum EDurationFilters { export enum EDurationFilters {
NONE = "none", NONE = "none",

View file

@ -1,5 +1,5 @@
// plane imports // plane imports
import { TEstimateSystems } from "@plane/types"; import type { TEstimateSystems } from "@plane/types";
export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20; export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20;

View file

@ -1,4 +1,4 @@
import { EProductSubscriptionEnum } from "@plane/types"; import type { EProductSubscriptionEnum } from "@plane/types";
/** /**
* =========================================================================== * ===========================================================================

View file

@ -1,4 +1,5 @@
import { EInboxIssueStatus, TInboxIssueStatus } from "@plane/types"; import type { TInboxIssueStatus } from "@plane/types";
import { EInboxIssueStatus } from "@plane/types";
export const INBOX_STATUS: { export const INBOX_STATUS: {
key: string; key: string;

View file

@ -1,4 +1,4 @@
import { import type {
TIssueGroupByOptions, TIssueGroupByOptions,
TIssueOrderByOptions, TIssueOrderByOptions,
IIssueDisplayProperties, IIssueDisplayProperties,

View file

@ -1,17 +1,14 @@
import { import type {
EIssuesStoreType,
IIssueFilterOptions, IIssueFilterOptions,
ILayoutDisplayFiltersOptions, ILayoutDisplayFiltersOptions,
TIssueActivityComment, TIssueActivityComment,
TWorkItemFilterProperty, TWorkItemFilterProperty,
} from "@plane/types"; } from "@plane/types";
import { import { EIssuesStoreType } from "@plane/types";
TIssueFilterPriorityObject, import type { TIssueFilterPriorityObject } from "./common";
ISSUE_DISPLAY_PROPERTIES_KEYS, import { ISSUE_DISPLAY_PROPERTIES_KEYS, SUB_ISSUES_DISPLAY_PROPERTIES_KEYS } from "./common";
SUB_ISSUES_DISPLAY_PROPERTIES_KEYS,
} from "./common";
import { TIssueLayout } from "./layout"; import type { TIssueLayout } from "./layout";
export type TIssueFilterKeys = "priority" | "state" | "labels"; export type TIssueFilterKeys = "priority" | "state" | "labels";

View file

@ -1,5 +1,5 @@
// plane imports // plane imports
import { TIssue } from "@plane/types"; import type { TIssue } from "@plane/types";
export const DEFAULT_WORK_ITEM_FORM_VALUES: Partial<TIssue> = { export const DEFAULT_WORK_ITEM_FORM_VALUES: Partial<TIssue> = {
project_id: "", project_id: "",

View file

@ -1,5 +1,5 @@
// types // types
import { TModuleLayoutOptions, TModuleOrderByOptions, TModuleStatus } from "@plane/types"; import type { TModuleLayoutOptions, TModuleOrderByOptions, TModuleStatus } from "@plane/types";
export const MODULE_STATUS_COLORS: { export const MODULE_STATUS_COLORS: {
[key in TModuleStatus]: string; [key in TModuleStatus]: string;

View file

@ -1,4 +1,4 @@
import { TUnreadNotificationsCount } from "@plane/types"; import type { TUnreadNotificationsCount } from "@plane/types";
export enum ENotificationTab { export enum ENotificationTab {
ALL = "all", ALL = "all",

View file

@ -1,4 +1,5 @@
import { EProductSubscriptionEnum, IPaymentProduct, TBillingFrequency, TProductBillingFrequency } from "@plane/types"; import type { IPaymentProduct, TBillingFrequency, TProductBillingFrequency } from "@plane/types";
import { EProductSubscriptionEnum } from "@plane/types";
/** /**
* Default billing frequency for each product subscription type * Default billing frequency for each product subscription type

View file

@ -1,5 +1,5 @@
// plane imports // plane imports
import { IProject, TProjectAppliedDisplayFilterKeys, TProjectOrderByOptions } from "@plane/types"; import type { IProject, TProjectAppliedDisplayFilterKeys, TProjectOrderByOptions } from "@plane/types";
// local imports // local imports
import { RANDOM_EMOJI_CODES } from "./emoji"; import { RANDOM_EMOJI_CODES } from "./emoji";

View file

@ -1,10 +1,5 @@
import { import type { TCoreSupportedOperators, TCoreSupportedDateFilterOperators } from "@plane/types";
CORE_EQUALITY_OPERATOR, import { CORE_EQUALITY_OPERATOR, CORE_COLLECTION_OPERATOR, CORE_COMPARISON_OPERATOR } from "@plane/types";
CORE_COLLECTION_OPERATOR,
CORE_COMPARISON_OPERATOR,
TCoreSupportedOperators,
TCoreSupportedDateFilterOperators,
} from "@plane/types";
/** /**
* Core operator labels * Core operator labels

View file

@ -1,4 +1,4 @@
import { TExtendedSupportedOperators } from "@plane/types"; import type { TExtendedSupportedOperators } from "@plane/types";
/** /**
* Extended operator labels * Extended operator labels

View file

@ -1,4 +1,4 @@
import { TAllAvailableOperatorsForDisplay, TAllAvailableDateFilterOperatorsForDisplay } from "@plane/types"; import type { TAllAvailableOperatorsForDisplay, TAllAvailableDateFilterOperatorsForDisplay } from "@plane/types";
import { CORE_OPERATOR_LABELS_MAP, CORE_DATE_OPERATOR_LABELS_MAP } from "./core"; import { CORE_OPERATOR_LABELS_MAP, CORE_DATE_OPERATOR_LABELS_MAP } from "./core";
import { import {
EXTENDED_OPERATOR_LABELS_MAP, EXTENDED_OPERATOR_LABELS_MAP,

View file

@ -1,4 +1,4 @@
import { TExternalFilter } from "@plane/types"; import type { TExternalFilter } from "@plane/types";
/** /**
* Filter config options. * Filter config options.

View file

@ -1,4 +1,4 @@
import { TStateGroups } from "@plane/types"; import type { TStateGroups } from "@plane/types";
export type TDraggableData = { export type TDraggableData = {
groupKey: TStateGroups; groupKey: TStateGroups;

View file

@ -1,4 +1,5 @@
import { TStaticViewTypes, IWorkspaceSearchResults, EUserWorkspaceRoles } from "@plane/types"; import type { TStaticViewTypes, IWorkspaceSearchResults } from "@plane/types";
import { EUserWorkspaceRoles } from "@plane/types";
export const ORGANIZATION_SIZE = ["Just myself", "2-10", "11-50", "51-200", "201-500", "500+"]; export const ORGANIZATION_SIZE = ["Just myself", "2-10", "11-50", "51-200", "201-500", "500+"];

View file

@ -1,5 +1,5 @@
import "reflect-metadata"; import "reflect-metadata";
import { RequestHandler } from "express"; import type { RequestHandler } from "express";
// Define valid HTTP methods // Define valid HTTP methods
type RestMethod = "get" | "post" | "put" | "patch" | "delete"; type RestMethod = "get" | "post" | "put" | "patch" | "delete";

View file

@ -1,4 +1,4 @@
import { type Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import type { ReactElement } from "react"; import type { ReactElement } from "react";
import type { IEditorPropsExtended } from "@/types"; import type { IEditorPropsExtended } from "@/types";

View file

@ -1,4 +1,4 @@
import { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { LinkViewContainer } from "@/components/editors/link-view-container"; import { LinkViewContainer } from "@/components/editors/link-view-container";
export const LinkContainer = ({ export const LinkContainer = ({

View file

@ -1,6 +1,6 @@
// helpers // helpers
import { TAssetMetaDataRecord } from "@/helpers/assets"; import type { TAssetMetaDataRecord } from "@/helpers/assets";
// local imports // local imports
import { ADDITIONAL_EXTENSIONS } from "./extensions"; import type { ADDITIONAL_EXTENSIONS } from "./extensions";
export const ADDITIONAL_ASSETS_META_DATA_RECORD: Partial<Record<ADDITIONAL_EXTENSIONS, TAssetMetaDataRecord>> = {}; export const ADDITIONAL_ASSETS_META_DATA_RECORD: Partial<Record<ADDITIONAL_EXTENSIONS, TAssetMetaDataRecord>> = {};

View file

@ -1,5 +1,6 @@
// plane imports // plane imports
import { ADDITIONAL_EXTENSIONS, CORE_EXTENSIONS } from "@plane/utils"; import type { ADDITIONAL_EXTENSIONS } from "@plane/utils";
import { CORE_EXTENSIONS } from "@plane/utils";
// plane editor imports // plane editor imports
import type { ExtensionFileSetStorageKey } from "@/plane-editor/types/storage"; import type { ExtensionFileSetStorageKey } from "@/plane-editor/types/storage";

View file

@ -1,3 +1,3 @@
import { Extensions } from "@tiptap/core"; import type { Extensions } from "@tiptap/core";
export const CoreEditorAdditionalExtensionsWithoutProps: Extensions = []; export const CoreEditorAdditionalExtensionsWithoutProps: Extensions = [];

View file

@ -1,8 +1,8 @@
import { AnyExtension, Extensions } from "@tiptap/core"; import type { AnyExtension, Extensions } from "@tiptap/core";
// extensions // extensions
import { SlashCommands } from "@/extensions/slash-commands/root"; import { SlashCommands } from "@/extensions/slash-commands/root";
// types // types
import { IEditorProps, TExtensions } from "@/types"; import type { IEditorProps, TExtensions } from "@/types";
export type TRichTextEditorAdditionalExtensionsProps = Pick< export type TRichTextEditorAdditionalExtensionsProps = Pick<
IEditorProps, IEditorProps,

View file

@ -1,5 +1,6 @@
import { Extensions } from "@tiptap/core"; import type { Extensions } from "@tiptap/core";
import { forwardRef, MutableRefObject, useMemo } from "react"; import type { MutableRefObject } from "react";
import { forwardRef, useMemo } from "react";
// plane imports // plane imports
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// components // components
@ -15,7 +16,7 @@ import { useEditor } from "@/hooks/use-editor";
// plane editor extensions // plane editor extensions
import { DocumentEditorAdditionalExtensions } from "@/plane-editor/extensions"; import { DocumentEditorAdditionalExtensions } from "@/plane-editor/extensions";
// types // types
import { EditorRefApi, IDocumentEditorProps } from "@/types"; import type { EditorRefApi, IDocumentEditorProps } from "@/types";
const DocumentEditor = (props: IDocumentEditorProps) => { const DocumentEditor = (props: IDocumentEditorProps) => {
const { const {

View file

@ -1,4 +1,4 @@
import { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
// plane imports // plane imports
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// components // components

View file

@ -1,5 +1,6 @@
import type { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { FC, ReactNode, useRef } from "react"; import type { FC, ReactNode } from "react";
import { useRef } from "react";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// constants // constants
@ -8,7 +9,7 @@ import { CORE_EXTENSIONS } from "@/constants/extension";
// components // components
import { LinkContainer } from "@/plane-editor/components/link-container"; import { LinkContainer } from "@/plane-editor/components/link-container";
// types // types
import { TDisplayConfig } from "@/types"; import type { TDisplayConfig } from "@/types";
type Props = { type Props = {
children: ReactNode; children: ReactNode;

View file

@ -1,5 +1,6 @@
import { type Editor, EditorContent } from "@tiptap/react"; import { EditorContent } from "@tiptap/react";
import { FC, ReactNode } from "react"; import type { Editor } from "@tiptap/react";
import type { FC, ReactNode } from "react";
type Props = { type Props = {
children?: ReactNode; children?: ReactNode;

View file

@ -1,4 +1,4 @@
import { Editor, Extensions } from "@tiptap/core"; import type { Editor, Extensions } from "@tiptap/core";
// components // components
import { EditorContainer } from "@/components/editors"; import { EditorContainer } from "@/components/editors";
// constants // constants
@ -7,7 +7,7 @@ import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config";
import { getEditorClassNames } from "@/helpers/common"; import { getEditorClassNames } from "@/helpers/common";
import { useEditor } from "@/hooks/use-editor"; import { useEditor } from "@/hooks/use-editor";
// types // types
import { IEditorProps } from "@/types"; import type { IEditorProps } from "@/types";
import { EditorContentWrapper } from "./editor-content"; import { EditorContentWrapper } from "./editor-content";
type Props = IEditorProps & { type Props = IEditorProps & {

View file

@ -1,9 +1,12 @@
import { autoUpdate, flip, hide, shift, useDismiss, useFloating, useInteractions } from "@floating-ui/react"; import { autoUpdate, flip, hide, shift, useDismiss, useFloating, useInteractions } from "@floating-ui/react";
import { Editor, useEditorState } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { FC, useCallback, useEffect, useRef, useState } from "react"; import { useEditorState } from "@tiptap/react";
import type { FC } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
// components // components
import { LinkView, LinkViewProps } from "@/components/links"; import type { LinkViewProps } from "@/components/links";
import { LinkView } from "@/components/links";
type Props = { type Props = {
editor: Editor; editor: Editor;

View file

@ -4,7 +4,7 @@ import { EditorWrapper } from "@/components/editors/editor-wrapper";
// extensions // extensions
import { EnterKeyExtension } from "@/extensions"; import { EnterKeyExtension } from "@/extensions";
// types // types
import { EditorRefApi, ILiteTextEditorProps } from "@/types"; import type { EditorRefApi, ILiteTextEditorProps } from "@/types";
const LiteTextEditor: React.FC<ILiteTextEditorProps> = (props) => { const LiteTextEditor: React.FC<ILiteTextEditorProps> = (props) => {
const { onEnterKeyPress, disabledExtensions, extensions: externalExtensions = [] } = props; const { onEnterKeyPress, disabledExtensions, extensions: externalExtensions = [] } = props;

View file

@ -7,7 +7,7 @@ import { SideMenuExtension } from "@/extensions";
// plane editor imports // plane editor imports
import { RichTextEditorAdditionalExtensions } from "@/plane-editor/extensions/rich-text-extensions"; import { RichTextEditorAdditionalExtensions } from "@/plane-editor/extensions/rich-text-extensions";
// types // types
import { EditorRefApi, IRichTextEditorProps } from "@/types"; import type { EditorRefApi, IRichTextEditorProps } from "@/types";
const RichTextEditor: React.FC<IRichTextEditorProps> = (props) => { const RichTextEditor: React.FC<IRichTextEditorProps> = (props) => {
const { const {

View file

@ -1,8 +1,8 @@
import { Node } from "@tiptap/pm/model"; import type { Node } from "@tiptap/pm/model";
import { Link2Off } from "lucide-react"; import { Link2Off } from "lucide-react";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
// components // components
import { LinkViewProps, LinkViews } from "@/components/links"; import type { LinkViewProps, LinkViews } from "@/components/links";
// helpers // helpers
import { isValidHttpUrl } from "@/helpers/common"; import { isValidHttpUrl } from "@/helpers/common";

View file

@ -1,6 +1,6 @@
import { Copy, GlobeIcon, Link2Off, PencilIcon } from "lucide-react"; import { Copy, GlobeIcon, Link2Off, PencilIcon } from "lucide-react";
// components // components
import { LinkViewProps, LinkViews } from "@/components/links"; import type { LinkViewProps, LinkViews } from "@/components/links";
export const LinkPreview = ({ export const LinkPreview = ({
viewProps, viewProps,

View file

@ -1,5 +1,6 @@
import { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { CSSProperties, useEffect, useState } from "react"; import type { CSSProperties } from "react";
import { useEffect, useState } from "react";
// components // components
import { LinkEditView, LinkPreview } from "@/components/links"; import { LinkEditView, LinkPreview } from "@/components/links";

View file

@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import tippy, { type Instance } from "tippy.js"; import tippy from "tippy.js";
import type { Instance } from "tippy.js";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// types // types

View file

@ -9,7 +9,8 @@ import {
FloatingPortal, FloatingPortal,
} from "@floating-ui/react"; } from "@floating-ui/react";
import type { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { Copy, LucideIcon, Trash2 } from "lucide-react"; import type { LucideIcon } from "lucide-react";
import { Copy, Trash2 } from "lucide-react";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// constants // constants

View file

@ -1,12 +1,13 @@
import { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { AlignCenter, AlignLeft, AlignRight, LucideIcon } from "lucide-react"; import type { LucideIcon } from "lucide-react";
import { AlignCenter, AlignLeft, AlignRight } from "lucide-react";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// components // components
import { TextAlignItem } from "@/components/menus"; import { TextAlignItem } from "@/components/menus";
// types // types
import { TEditorCommands } from "@/types"; import type { TEditorCommands } from "@/types";
import { EditorStateType } from "./root"; import type { EditorStateType } from "./root";
type Props = { type Props = {
editor: Editor; editor: Editor;

View file

@ -1,6 +1,7 @@
import type { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { ALargeSmall, Ban } from "lucide-react"; import { ALargeSmall, Ban } from "lucide-react";
import { useMemo, type FC } from "react"; import { useMemo } from "react";
import type { FC } from "react";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// constants // constants
@ -9,7 +10,7 @@ import { COLORS_LIST } from "@/constants/common";
import { FloatingMenuRoot } from "../floating-menu/root"; import { FloatingMenuRoot } from "../floating-menu/root";
import { useFloatingMenu } from "../floating-menu/use-floating-menu"; import { useFloatingMenu } from "../floating-menu/use-floating-menu";
import { BackgroundColorItem, TextColorItem } from "../menu-items"; import { BackgroundColorItem, TextColorItem } from "../menu-items";
import { EditorStateType } from "./root"; import type { EditorStateType } from "./root";
type Props = { type Props = {
editor: Editor; editor: Editor;

View file

@ -1,6 +1,7 @@
import type { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { Check, Link, Trash2 } from "lucide-react"; import { Check, Link, Trash2 } from "lucide-react";
import { FC, useCallback, useRef, useState } from "react"; import type { FC } from "react";
import { useCallback, useRef, useState } from "react";
// plane imports // plane imports
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// constants // constants

View file

@ -1,10 +1,11 @@
import { Editor } from "@tiptap/react"; import type { Editor } from "@tiptap/react";
import { Check } from "lucide-react"; import { Check } from "lucide-react";
import { FC } from "react"; import type { FC } from "react";
import { ChevronDownIcon } from "@plane/propel/icons"; import { ChevronDownIcon } from "@plane/propel/icons";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// components // components
import type { EditorMenuItem } from "@/components/menus";
import { import {
BulletListItem, BulletListItem,
HeadingOneItem, HeadingOneItem,
@ -18,7 +19,6 @@ import {
HeadingFourItem, HeadingFourItem,
HeadingFiveItem, HeadingFiveItem,
HeadingSixItem, HeadingSixItem,
EditorMenuItem,
} from "@/components/menus"; } from "@/components/menus";
// types // types
import type { TEditorCommands } from "@/types"; import type { TEditorCommands } from "@/types";

View file

@ -1,16 +1,19 @@
import { type Editor, isNodeSelection } from "@tiptap/core"; import { isNodeSelection } from "@tiptap/core";
import { BubbleMenu, type BubbleMenuProps, useEditorState } from "@tiptap/react"; import type { Editor } from "@tiptap/core";
import { FC, useEffect, useState, useRef } from "react"; import { BubbleMenu, useEditorState } from "@tiptap/react";
import type { BubbleMenuProps } from "@tiptap/react";
import type { FC } from "react";
import { useEffect, useState, useRef } from "react";
// plane utils // plane utils
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// components // components
import type { EditorMenuItem } from "@/components/menus";
import { import {
BackgroundColorItem, BackgroundColorItem,
BoldItem, BoldItem,
BubbleMenuColorSelector, BubbleMenuColorSelector,
BubbleMenuNodeSelector, BubbleMenuNodeSelector,
CodeItem, CodeItem,
EditorMenuItem,
ItalicItem, ItalicItem,
StrikeThroughItem, StrikeThroughItem,
TextAlignItem, TextAlignItem,

View file

@ -1,9 +1,5 @@
import { import { FloatingOverlay, FloatingPortal } from "@floating-ui/react";
FloatingOverlay, import type { UseInteractionsReturn, UseFloatingReturn } from "@floating-ui/react";
FloatingPortal,
type UseInteractionsReturn,
type UseFloatingReturn,
} from "@floating-ui/react";
type Props = { type Props = {
children: React.ReactNode; children: React.ReactNode;

View file

@ -7,9 +7,8 @@ import {
autoUpdate, autoUpdate,
useClick, useClick,
useRole, useRole,
type UseInteractionsReturn,
type UseFloatingReturn,
} from "@floating-ui/react"; } from "@floating-ui/react";
import type { UseInteractionsReturn, UseFloatingReturn } from "@floating-ui/react";
import { useState } from "react"; import { useState } from "react";
type TArgs = { type TArgs = {

View file

@ -18,12 +18,12 @@ import {
Heading5, Heading5,
Heading6, Heading6,
CaseSensitive, CaseSensitive,
type LucideIcon,
MinusSquare, MinusSquare,
Palette, Palette,
AlignCenter, AlignCenter,
LinkIcon, LinkIcon,
} from "lucide-react"; } from "lucide-react";
import type { LucideIcon } from "lucide-react";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
@ -49,7 +49,7 @@ import {
unsetLinkEditor, unsetLinkEditor,
} from "@/helpers/editor-commands"; } from "@/helpers/editor-commands";
// types // types
import { TCommandWithProps, TEditorCommands } from "@/types"; import type { TCommandWithProps, TEditorCommands } from "@/types";
type isActiveFunction<T extends TEditorCommands> = (params?: TCommandWithProps<T>) => boolean; type isActiveFunction<T extends TEditorCommands> = (params?: TCommandWithProps<T>) => boolean;
type commandFunction<T extends TEditorCommands> = (params?: TCommandWithProps<T>) => void; type commandFunction<T extends TEditorCommands> = (params?: TCommandWithProps<T>) => void;

View file

@ -1,3 +1,4 @@
import type { LucideIcon } from "lucide-react";
import { import {
AlignCenter, AlignCenter,
AlignLeft, AlignLeft,
@ -16,13 +17,12 @@ import {
List, List,
ListOrdered, ListOrdered,
ListTodo, ListTodo,
LucideIcon,
Strikethrough, Strikethrough,
Table, Table,
TextQuote, TextQuote,
Underline, Underline,
} from "lucide-react"; } from "lucide-react";
import { TCommandExtraProps, TEditorCommands } from "@/types/editor"; import type { TCommandExtraProps, TEditorCommands } from "@/types/editor";
export type TEditorTypes = "lite" | "document"; export type TEditorTypes = "lite" | "document";

View file

@ -1,5 +1,5 @@
// types // types
import { TDisplayConfig } from "@/types"; import type { TDisplayConfig } from "@/types";
export const DEFAULT_DISPLAY_CONFIG: TDisplayConfig = { export const DEFAULT_DISPLAY_CONFIG: TDisplayConfig = {
fontSize: "large-font", fontSize: "large-font",

View file

@ -1,6 +1,6 @@
import { EPageAccess } from "@plane/constants"; import type { EPageAccess } from "@plane/constants";
import { TPage } from "@plane/types"; import type { TPage } from "@plane/types";
import { CreatePayload, BaseActionPayload } from "@/types"; import type { CreatePayload, BaseActionPayload } from "@/types";
// Define all payload types for each event. // Define all payload types for each event.
export type ArchivedPayload = CreatePayload<{ archived_at: string | null }>; export type ArchivedPayload = CreatePayload<{ archived_at: string | null }>;

View file

@ -1,4 +1,5 @@
import { NodeViewContent, NodeViewProps, NodeViewWrapper } from "@tiptap/react"; import type { NodeViewProps } from "@tiptap/react";
import { NodeViewContent, NodeViewWrapper } from "@tiptap/react";
import React, { useState } from "react"; import React, { useState } from "react";
// constants // constants
import { COLORS_LIST } from "@/constants/common"; import { COLORS_LIST } from "@/constants/common";
@ -6,7 +7,8 @@ import { COLORS_LIST } from "@/constants/common";
import { CalloutBlockColorSelector } from "./color-selector"; import { CalloutBlockColorSelector } from "./color-selector";
import { CalloutBlockLogoSelector } from "./logo-selector"; import { CalloutBlockLogoSelector } from "./logo-selector";
// types // types
import { ECalloutAttributeNames, TCalloutBlockAttributes } from "./types"; import type { TCalloutBlockAttributes } from "./types";
import { ECalloutAttributeNames } from "./types";
// utils // utils
import { updateStoredBackgroundColor } from "./utils"; import { updateStoredBackgroundColor } from "./utils";

View file

@ -1,10 +1,11 @@
import { Node, mergeAttributes } from "@tiptap/core"; import { Node, mergeAttributes } from "@tiptap/core";
import { MarkdownSerializerState } from "@tiptap/pm/markdown"; import type { MarkdownSerializerState } from "@tiptap/pm/markdown";
import type { Node as ProseMirrorNode } from "@tiptap/pm/model"; import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// types // types
import { type CustomCalloutExtensionType, ECalloutAttributeNames, type TCalloutBlockAttributes } from "./types"; import { ECalloutAttributeNames } from "./types";
import type { CustomCalloutExtensionType, TCalloutBlockAttributes } from "./types";
// utils // utils
import { DEFAULT_CALLOUT_BLOCK_ATTRIBUTES } from "./utils"; import { DEFAULT_CALLOUT_BLOCK_ATTRIBUTES } from "./utils";

View file

@ -1,10 +1,12 @@
import { findParentNodeClosestToPos, type Predicate, ReactNodeViewRenderer } from "@tiptap/react"; import { findParentNodeClosestToPos, ReactNodeViewRenderer } from "@tiptap/react";
import type { Predicate } from "@tiptap/react";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary"; import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary";
// local imports // local imports
import { CustomCalloutBlock, type CustomCalloutNodeViewProps } from "./block"; import { CustomCalloutBlock } from "./block";
import type { CustomCalloutNodeViewProps } from "./block";
import { CustomCalloutExtensionConfig } from "./extension-config"; import { CustomCalloutExtensionConfig } from "./extension-config";
import type { CustomCalloutExtensionOptions, CustomCalloutExtensionStorage } from "./types"; import type { CustomCalloutExtensionOptions, CustomCalloutExtensionStorage } from "./types";
import { getStoredBackgroundColor, getStoredLogo } from "./utils"; import { getStoredBackgroundColor, getStoredLogo } from "./utils";

View file

@ -3,7 +3,7 @@ import { EmojiPicker, EmojiIconPickerTypes, Logo } from "@plane/propel/emoji-ico
import type { TLogoProps } from "@plane/types"; import type { TLogoProps } from "@plane/types";
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// types // types
import { TCalloutBlockAttributes } from "./types"; import type { TCalloutBlockAttributes } from "./types";
// utils // utils
import { DEFAULT_CALLOUT_BLOCK_ATTRIBUTES, updateStoredLogo } from "./utils"; import { DEFAULT_CALLOUT_BLOCK_ATTRIBUTES, updateStoredLogo } from "./utils";

View file

@ -2,12 +2,8 @@
import type { TLogoProps } from "@plane/types"; import type { TLogoProps } from "@plane/types";
import { sanitizeHTML } from "@plane/utils"; import { sanitizeHTML } from "@plane/utils";
// types // types
import { import type { TCalloutBlockAttributes, TCalloutBlockEmojiAttributes, TCalloutBlockIconAttributes } from "./types";
ECalloutAttributeNames, import { ECalloutAttributeNames } from "./types";
TCalloutBlockAttributes,
TCalloutBlockEmojiAttributes,
TCalloutBlockIconAttributes,
} from "./types";
export const DEFAULT_CALLOUT_BLOCK_ATTRIBUTES: TCalloutBlockAttributes = { export const DEFAULT_CALLOUT_BLOCK_ATTRIBUTES: TCalloutBlockAttributes = {
[ECalloutAttributeNames.LOGO_IN_USE]: "emoji", [ECalloutAttributeNames.LOGO_IN_USE]: "emoji",

View file

@ -1,6 +1,7 @@
// import CodeBlock, { CodeBlockOptions } from "@tiptap/extension-code-block"; // import CodeBlock, { CodeBlockOptions } from "@tiptap/extension-code-block";
import { CodeBlockOptions, CodeBlock } from "./code-block"; import type { CodeBlockOptions } from "./code-block";
import { CodeBlock } from "./code-block";
import { LowlightPlugin } from "./lowlight-plugin"; import { LowlightPlugin } from "./lowlight-plugin";
type CodeBlockLowlightOptions = CodeBlockOptions & { type CodeBlockLowlightOptions = CodeBlockOptions & {

View file

@ -1,7 +1,7 @@
// TODO: check all the type errors and fix them // TODO: check all the type errors and fix them
import { findChildren } from "@tiptap/core"; import { findChildren } from "@tiptap/core";
import { Node as ProsemirrorNode } from "@tiptap/pm/model"; import type { Node as ProsemirrorNode } from "@tiptap/pm/model";
import { Plugin, PluginKey } from "@tiptap/pm/state"; import { Plugin, PluginKey } from "@tiptap/pm/state";
import { Decoration, DecorationSet } from "@tiptap/pm/view"; import { Decoration, DecorationSet } from "@tiptap/pm/view";
import highlight from "highlight.js/lib/core"; import highlight from "highlight.js/lib/core";

View file

@ -1,4 +1,5 @@
import { Editor, findParentNode } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { findParentNode } from "@tiptap/core";
type ReplaceCodeBlockParams = { type ReplaceCodeBlockParams = {
editor: Editor; editor: Editor;

View file

@ -3,7 +3,7 @@ import React, { useRef, useState, useCallback, useLayoutEffect, useEffect } from
// plane imports // plane imports
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// local imports // local imports
import { Pixel, TCustomImageAttributes, TCustomImageSize } from "../types"; import type { Pixel, TCustomImageAttributes, TCustomImageSize } from "../types";
import { ensurePixelString, getImageBlockId } from "../utils"; import { ensurePixelString, getImageBlockId } from "../utils";
import type { CustomImageNodeViewProps } from "./node-view"; import type { CustomImageNodeViewProps } from "./node-view";
import { ImageToolbarRoot } from "./toolbar"; import { ImageToolbarRoot } from "./toolbar";

View file

@ -1,4 +1,5 @@
import { type NodeViewProps, NodeViewWrapper } from "@tiptap/react"; import { NodeViewWrapper } from "@tiptap/react";
import type { NodeViewProps } from "@tiptap/react";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
// local imports // local imports
import type { CustomImageExtensionType, TCustomImageAttributes } from "../types"; import type { CustomImageExtensionType, TCustomImageAttributes } from "../types";

View file

@ -1,4 +1,4 @@
import { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { useEditorState } from "@tiptap/react"; import { useEditorState } from "@tiptap/react";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";

View file

@ -1,12 +1,13 @@
import { ImageIcon } from "lucide-react"; import { ImageIcon } from "lucide-react";
import { ChangeEvent, useCallback, useEffect, useMemo, useRef } from "react"; import type { ChangeEvent } from "react";
import { useCallback, useEffect, useMemo, useRef } from "react";
// plane imports // plane imports
import { cn } from "@plane/utils"; import { cn } from "@plane/utils";
// constants // constants
import { ACCEPTED_IMAGE_MIME_TYPES } from "@/constants/config"; import { ACCEPTED_IMAGE_MIME_TYPES } from "@/constants/config";
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
import { EFileError } from "@/helpers/file"; import type { EFileError } from "@/helpers/file";
// hooks // hooks
import { useUploader, useDropZone, uploadFirstFileAndInsertRemaining } from "@/hooks/use-file-upload"; import { useUploader, useDropZone, uploadFirstFileAndInsertRemaining } from "@/hooks/use-file-upload";
// local imports // local imports

View file

@ -3,13 +3,13 @@ import { Image as BaseImageExtension } from "@tiptap/extension-image";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// local imports // local imports
import { import { ECustomImageAttributeNames } from "./types";
type CustomImageExtensionType, import type {
type CustomImageExtensionStorage,
ECustomImageAttributeNames,
type InsertImageComponentProps,
CustomImageExtensionOptions, CustomImageExtensionOptions,
TCustomImageAttributes, TCustomImageAttributes,
CustomImageExtensionType,
CustomImageExtensionStorage,
InsertImageComponentProps,
} from "./types"; } from "./types";
import { DEFAULT_CUSTOM_IMAGE_ATTRIBUTES } from "./utils"; import { DEFAULT_CUSTOM_IMAGE_ATTRIBUTES } from "./utils";

View file

@ -8,7 +8,8 @@ import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-par
// types // types
import type { TFileHandler } from "@/types"; import type { TFileHandler } from "@/types";
// local imports // local imports
import { CustomImageNodeView, CustomImageNodeViewProps } from "./components/node-view"; import type { CustomImageNodeViewProps } from "./components/node-view";
import { CustomImageNodeView } from "./components/node-view";
import { CustomImageExtensionConfig } from "./extension-config"; import { CustomImageExtensionConfig } from "./extension-config";
import type { CustomImageExtensionOptions, CustomImageExtensionStorage } from "./types"; import type { CustomImageExtensionOptions, CustomImageExtensionStorage } from "./types";
import { getImageComponentImageFileMap } from "./utils"; import { getImageComponentImageFileMap } from "./utils";

View file

@ -1,7 +1,9 @@
import type { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { AlignCenter, AlignLeft, AlignRight, type LucideIcon } from "lucide-react"; import { AlignCenter, AlignLeft, AlignRight } from "lucide-react";
import type { LucideIcon } from "lucide-react";
// local imports // local imports
import { ECustomImageAttributeNames, TCustomImageAlignment, type Pixel, type TCustomImageAttributes } from "./types"; import { ECustomImageAttributeNames } from "./types";
import type { TCustomImageAlignment, Pixel, TCustomImageAttributes } from "./types";
export const DEFAULT_CUSTOM_IMAGE_ATTRIBUTES: TCustomImageAttributes = { export const DEFAULT_CUSTOM_IMAGE_ATTRIBUTES: TCustomImageAttributes = {
[ECustomImageAttributeNames.SOURCE]: null, [ECustomImageAttributeNames.SOURCE]: null,

View file

@ -1,5 +1,6 @@
import { Mark, markPasteRule, mergeAttributes, PasteRuleMatch } from "@tiptap/core"; import type { PasteRuleMatch } from "@tiptap/core";
import { Plugin } from "@tiptap/pm/state"; import { Mark, markPasteRule, mergeAttributes } from "@tiptap/core";
import type { Plugin } from "@tiptap/pm/state";
import { find, registerCustomProtocol, reset } from "linkifyjs"; import { find, registerCustomProtocol, reset } from "linkifyjs";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";

View file

@ -1,11 +1,6 @@
import { import type { NodeWithPos } from "@tiptap/core";
combineTransactionSteps, import { combineTransactionSteps, findChildrenInRange, getChangedRanges, getMarksBetween } from "@tiptap/core";
findChildrenInRange, import type { MarkType } from "@tiptap/pm/model";
getChangedRanges,
getMarksBetween,
NodeWithPos,
} from "@tiptap/core";
import { MarkType } from "@tiptap/pm/model";
import { Plugin, PluginKey } from "@tiptap/pm/state"; import { Plugin, PluginKey } from "@tiptap/pm/state";
import { find } from "linkifyjs"; import { find } from "linkifyjs";

View file

@ -1,5 +1,5 @@
import { getAttributes } from "@tiptap/core"; import { getAttributes } from "@tiptap/core";
import { MarkType } from "@tiptap/pm/model"; import type { MarkType } from "@tiptap/pm/model";
import { Plugin, PluginKey } from "@tiptap/pm/state"; import { Plugin, PluginKey } from "@tiptap/pm/state";
type ClickHandlerOptions = { type ClickHandlerOptions = {

View file

@ -1,5 +1,5 @@
import { Editor } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { MarkType } from "@tiptap/pm/model"; import type { MarkType } from "@tiptap/pm/model";
import { Plugin, PluginKey } from "@tiptap/pm/state"; import { Plugin, PluginKey } from "@tiptap/pm/state";
import { find } from "linkifyjs"; import { find } from "linkifyjs";

View file

@ -1,6 +1,7 @@
import { Editor, getNodeType, getNodeAtPosition, isAtEndOfNode, isAtStartOfNode, isNodeActive } from "@tiptap/core"; import type { Editor } from "@tiptap/core";
import { Node, NodeType } from "@tiptap/pm/model"; import { getNodeType, getNodeAtPosition, isAtEndOfNode, isAtStartOfNode, isNodeActive } from "@tiptap/core";
import { EditorState } from "@tiptap/pm/state"; import type { Node, NodeType } from "@tiptap/pm/model";
import type { EditorState } from "@tiptap/pm/state";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";

View file

@ -1,5 +1,5 @@
import { FloatingOverlay } from "@floating-ui/react"; import { FloatingOverlay } from "@floating-ui/react";
import { SuggestionKeyDownProps, type SuggestionProps } from "@tiptap/suggestion"; import type { SuggestionKeyDownProps, SuggestionProps } from "@tiptap/suggestion";
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react"; import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
// plane imports // plane imports
import { useOutsideClickDetector } from "@plane/hooks"; import { useOutsideClickDetector } from "@plane/hooks";

View file

@ -10,10 +10,13 @@ import {
PasteRule, PasteRule,
removeDuplicates, removeDuplicates,
} from "@tiptap/core"; } from "@tiptap/core";
import { EmojiStorage, emojis, emojiToShortcode, shortcodeToEmoji } from "@tiptap/extension-emoji"; import type { EmojiStorage } from "@tiptap/extension-emoji";
import { emojis, emojiToShortcode, shortcodeToEmoji } from "@tiptap/extension-emoji";
import { Fragment } from "@tiptap/pm/model"; import { Fragment } from "@tiptap/pm/model";
import { Plugin, PluginKey, TextSelection, Transaction } from "@tiptap/pm/state"; import type { Transaction } from "@tiptap/pm/state";
import Suggestion, { SuggestionOptions } from "@tiptap/suggestion"; import { Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";
import type { SuggestionOptions } from "@tiptap/suggestion";
import Suggestion from "@tiptap/suggestion";
import emojiRegex from "emoji-regex"; import emojiRegex from "emoji-regex";
import { isEmojiSupported } from "is-emoji-supported"; import { isEmojiSupported } from "is-emoji-supported";
// helpers // helpers

View file

@ -1,7 +1,7 @@
// local imports // local imports
import { gitHubEmojis, shortcodeToEmoji } from "@tiptap/extension-emoji"; import { gitHubEmojis, shortcodeToEmoji } from "@tiptap/extension-emoji";
import { MarkdownSerializerState } from "@tiptap/pm/markdown"; import type { MarkdownSerializerState } from "@tiptap/pm/markdown";
import { Node as ProseMirrorNode } from "@tiptap/pm/model"; import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
import { Emoji } from "./emoji"; import { Emoji } from "./emoji";
import { emojiSuggestion } from "./suggestion"; import { emojiSuggestion } from "./suggestion";

View file

@ -1,12 +1,15 @@
import type { EmojiOptions, EmojiStorage } from "@tiptap/extension-emoji"; import type { EmojiOptions, EmojiStorage } from "@tiptap/extension-emoji";
import { ReactRenderer, type Editor } from "@tiptap/react"; import { ReactRenderer } from "@tiptap/react";
import type { Editor } from "@tiptap/react";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
import { updateFloatingUIFloaterPosition } from "@/helpers/floating-ui"; import { updateFloatingUIFloaterPosition } from "@/helpers/floating-ui";
import { CommandListInstance, DROPDOWN_NAVIGATION_KEYS } from "@/helpers/tippy"; import type { CommandListInstance } from "@/helpers/tippy";
import { DROPDOWN_NAVIGATION_KEYS } from "@/helpers/tippy";
// local imports // local imports
import { type EmojiItem, EmojisListDropdown, EmojisListDropdownProps } from "./components/emojis-list"; import { EmojisListDropdown } from "./components/emojis-list";
import type { EmojisListDropdownProps, EmojiItem } from "./components/emojis-list";
import type { ExtendedEmojiStorage } from "./emoji"; import type { ExtendedEmojiStorage } from "./emoji";
const DEFAULT_EMOJIS = ["+1", "-1", "smile", "orange_heart", "eyes"]; const DEFAULT_EMOJIS = ["+1", "-1", "smile", "orange_heart", "eyes"];

View file

@ -1,4 +1,4 @@
import { Extensions } from "@tiptap/core"; import type { Extensions } from "@tiptap/core";
import { CharacterCount } from "@tiptap/extension-character-count"; import { CharacterCount } from "@tiptap/extension-character-count";
import TaskItem from "@tiptap/extension-task-item"; import TaskItem from "@tiptap/extension-task-item";
import TaskList from "@tiptap/extension-task-list"; import TaskList from "@tiptap/extension-task-list";

View file

@ -1,7 +1,7 @@
import { Image as BaseImageExtension } from "@tiptap/extension-image"; import { Image as BaseImageExtension } from "@tiptap/extension-image";
// local imports // local imports
import { CustomImageExtensionOptions } from "../custom-image/types"; import type { CustomImageExtensionOptions } from "../custom-image/types";
import { ImageExtensionStorage } from "./extension"; import type { ImageExtensionStorage } from "./extension";
export const ImageExtensionConfig = BaseImageExtension.extend< export const ImageExtensionConfig = BaseImageExtension.extend<
Pick<CustomImageExtensionOptions, "getImageSource">, Pick<CustomImageExtensionOptions, "getImageSource">,

View file

@ -1,12 +1,13 @@
import { ReactNodeViewRenderer } from "@tiptap/react"; import { ReactNodeViewRenderer } from "@tiptap/react";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import type { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary"; import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary";
// types // types
import type { TFileHandler } from "@/types"; import type { TFileHandler } from "@/types";
// local imports // local imports
import { CustomImageNodeView, CustomImageNodeViewProps } from "../custom-image/components/node-view"; import type { CustomImageNodeViewProps } from "../custom-image/components/node-view";
import { CustomImageNodeView } from "../custom-image/components/node-view";
import { ImageExtensionConfig } from "./extension-config"; import { ImageExtensionConfig } from "./extension-config";
declare module "@tiptap/core" { declare module "@tiptap/core" {

View file

@ -1,6 +1,7 @@
import { Extension } from "@tiptap/core"; import { Extension } from "@tiptap/core";
import { NodeType } from "@tiptap/pm/model"; import type { NodeType } from "@tiptap/pm/model";
import { Plugin, PluginKey, Transaction } from "@tiptap/pm/state"; import type { Transaction } from "@tiptap/pm/state";
import { Plugin, PluginKey } from "@tiptap/pm/state";
import { canJoin } from "@tiptap/pm/transform"; import { canJoin } from "@tiptap/pm/transform";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";

View file

@ -1,11 +1,13 @@
import { mergeAttributes } from "@tiptap/core"; import { mergeAttributes } from "@tiptap/core";
import Mention, { MentionOptions } from "@tiptap/extension-mention"; import type { MentionOptions } from "@tiptap/extension-mention";
import { MarkdownSerializerState } from "@tiptap/pm/markdown"; import Mention from "@tiptap/extension-mention";
import { Node as NodeType } from "@tiptap/pm/model"; import type { MarkdownSerializerState } from "@tiptap/pm/markdown";
import type { Node as NodeType } from "@tiptap/pm/model";
// types // types
import { TMentionHandler } from "@/types"; import type { TMentionHandler } from "@/types";
// local types // local types
import { EMentionComponentAttributeNames, TMentionComponentAttributes } from "./types"; import type { TMentionComponentAttributes } from "./types";
import { EMentionComponentAttributeNames } from "./types";
export type TMentionExtensionOptions = MentionOptions & { export type TMentionExtensionOptions = MentionOptions & {
renderComponent: TMentionHandler["renderComponent"]; renderComponent: TMentionHandler["renderComponent"];

View file

@ -1,10 +1,11 @@
import { ReactNodeViewRenderer } from "@tiptap/react"; import { ReactNodeViewRenderer } from "@tiptap/react";
// types // types
import { TMentionHandler } from "@/types"; import type { TMentionHandler } from "@/types";
// extension config // extension config
import { CustomMentionExtensionConfig } from "./extension-config"; import { CustomMentionExtensionConfig } from "./extension-config";
// node view // node view
import { MentionNodeView, MentionNodeViewProps } from "./mention-node-view"; import type { MentionNodeViewProps } from "./mention-node-view";
import { MentionNodeView } from "./mention-node-view";
// utils // utils
import { renderMentionsDropdown } from "./utils"; import { renderMentionsDropdown } from "./utils";

View file

@ -1,8 +1,10 @@
import { NodeViewProps, NodeViewWrapper } from "@tiptap/react"; import type { NodeViewProps } from "@tiptap/react";
import { NodeViewWrapper } from "@tiptap/react";
// extension config // extension config
import { TMentionExtensionOptions } from "./extension-config"; import type { TMentionExtensionOptions } from "./extension-config";
// extension types // extension types
import { EMentionComponentAttributeNames, TMentionComponentAttributes } from "./types"; import type { TMentionComponentAttributes } from "./types";
import { EMentionComponentAttributeNames } from "./types";
export type MentionNodeViewProps = NodeViewProps & { export type MentionNodeViewProps = NodeViewProps & {
node: NodeViewProps["node"] & { node: NodeViewProps["node"] & {

View file

@ -10,7 +10,7 @@ import { cn } from "@plane/utils";
// helpers // helpers
import { DROPDOWN_NAVIGATION_KEYS, getNextValidIndex } from "@/helpers/tippy"; import { DROPDOWN_NAVIGATION_KEYS, getNextValidIndex } from "@/helpers/tippy";
// types // types
import { TMentionHandler, TMentionSection, TMentionSuggestion } from "@/types"; import type { TMentionHandler, TMentionSection, TMentionSuggestion } from "@/types";
export type MentionsListDropdownProps = SuggestionProps<TMentionSection, TMentionSuggestion> & export type MentionsListDropdownProps = SuggestionProps<TMentionSection, TMentionSuggestion> &
Pick<TMentionHandler, "searchCallback"> & { Pick<TMentionHandler, "searchCallback"> & {

View file

@ -1,5 +1,5 @@
// plane types // plane types
import { TSearchEntities } from "@plane/types"; import type { TSearchEntities } from "@plane/types";
export enum EMentionComponentAttributeNames { export enum EMentionComponentAttributeNames {
ID = "id", ID = "id",

View file

@ -1,14 +1,17 @@
import { type Editor, ReactRenderer } from "@tiptap/react"; import { ReactRenderer } from "@tiptap/react";
import type { Editor } from "@tiptap/react";
import type { SuggestionOptions } from "@tiptap/suggestion"; import type { SuggestionOptions } from "@tiptap/suggestion";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers // helpers
import { updateFloatingUIFloaterPosition } from "@/helpers/floating-ui"; import { updateFloatingUIFloaterPosition } from "@/helpers/floating-ui";
import { CommandListInstance, DROPDOWN_NAVIGATION_KEYS } from "@/helpers/tippy"; import type { CommandListInstance } from "@/helpers/tippy";
import { DROPDOWN_NAVIGATION_KEYS } from "@/helpers/tippy";
// types // types
import { TMentionHandler } from "@/types"; import type { TMentionHandler } from "@/types";
// local components // local components
import { MentionsListDropdown, MentionsListDropdownProps } from "./mentions-list-dropdown"; import type { MentionsListDropdownProps } from "./mentions-list-dropdown";
import { MentionsListDropdown } from "./mentions-list-dropdown";
export const renderMentionsDropdown = export const renderMentionsDropdown =
(args: Pick<TMentionHandler, "searchCallback">): SuggestionOptions["render"] => (args: Pick<TMentionHandler, "searchCallback">): SuggestionOptions["render"] =>

View file

@ -1,6 +1,6 @@
import { Extension } from "@tiptap/core"; import { Extension } from "@tiptap/core";
import { Plugin, PluginKey } from "@tiptap/pm/state"; import { Plugin, PluginKey } from "@tiptap/pm/state";
import { EditorView } from "@tiptap/pm/view"; import type { EditorView } from "@tiptap/pm/view";
// constants // constants
import { CORE_EXTENSIONS } from "@/constants/extension"; import { CORE_EXTENSIONS } from "@/constants/extension";
// plugins // plugins

View file

@ -38,9 +38,9 @@ import {
// plane editor extensions // plane editor extensions
import { coreEditorAdditionalSlashCommandOptions } from "@/plane-editor/extensions"; import { coreEditorAdditionalSlashCommandOptions } from "@/plane-editor/extensions";
// types // types
import { CommandProps, ISlashCommandItem, TSlashCommandSectionKeys } from "@/types"; import type { CommandProps, ISlashCommandItem, TSlashCommandSectionKeys } from "@/types";
// local types // local types
import { TExtensionProps, TSlashCommandAdditionalOption } from "./root"; import type { TExtensionProps, TSlashCommandAdditionalOption } from "./root";
export type TSlashCommandSection = { export type TSlashCommandSection = {
key: TSlashCommandSectionKeys; key: TSlashCommandSectionKeys;

Some files were not shown because too many files have changed in this diff Show more