[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
526 changed files with 1002 additions and 923 deletions

View File

@@ -3,7 +3,6 @@ module.exports = {
extends: ["@plane/eslint-config/next.js"],
ignorePatterns: ["build/**", "dist/**", ".vite/**"],
rules: {
"no-duplicate-imports": "off",
"import/no-duplicates": ["error", { "prefer-inline": false }],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"@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";
// logger
import { logger } from "@plane/logger";
import { type TConvertDocumentRequestBody } from "@/types";
import type { TConvertDocumentRequestBody } from "@/types";
// Define the schema with more robust validation
const convertDocumentSchema = z.object({

View File

@@ -1,15 +1,8 @@
import type { Connection, Extension, Hocuspocus, onConfigurePayload } from "@hocuspocus/server";
import { logger } from "@plane/logger";
import { Redis } from "@/extensions/redis";
import {
AdminCommand,
CloseCode,
ForceCloseReason,
getForceCloseMessage,
isForceCloseCommand,
type ClientForceCloseMessage,
type ForceCloseCommandData,
} from "@/types/admin-commands";
import { AdminCommand, CloseCode, getForceCloseMessage, isForceCloseCommand } from "@/types/admin-commands";
import type { ForceCloseReason, ClientForceCloseMessage, ForceCloseCommandData } from "@/types/admin-commands";
/**
* 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 { OutgoingMessage, type onConfigurePayload } from "@hocuspocus/server";
import { OutgoingMessage } from "@hocuspocus/server";
import type { onConfigurePayload } from "@hocuspocus/server";
import { logger } from "@plane/logger";
import { AppError } from "@/lib/errors";
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.

View File

@@ -1,5 +1,6 @@
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

View File

@@ -1,8 +1,9 @@
import { Server as HttpServer } from "http";
import { type Hocuspocus } from "@hocuspocus/server";
import type { Server as HttpServer } from "http";
import type { Hocuspocus } from "@hocuspocus/server";
import compression from "compression";
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 helmet from "helmet";
// 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 { AppError } from "@/lib/errors";

View File

@@ -1,5 +1,5 @@
import { logger } from "@plane/logger";
import { TPage } from "@plane/types";
import type { TPage } from "@plane/types";
// services
import { AppError } from "@/lib/errors";
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 { logger } from "@plane/logger";
import type { FetchPayloadWithContext, StorePayloadWithContext } from "@/types";

View File

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

View File

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

View File

@@ -1254,7 +1254,6 @@ declare module "wa-sqlite/src/examples/IndexedDbVFS.js" {
/** @ignore */
declare module "wa-sqlite/src/examples/MemoryVFS.js" {
// eslint-disable-next-line no-duplicate-imports
import * as VFS from "wa-sqlite/src/VFS.js";
/** @ignore */
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 {
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 AXIS_LABEL_CLASSNAME = "uppercase text-custom-text-300/60 text-sm tracking-wide";

View File

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

View File

@@ -1,5 +1,5 @@
// plane imports
import { TEstimateSystems } from "@plane/types";
import type { TEstimateSystems } from "@plane/types";
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: {
key: string;

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
import { TUnreadNotificationsCount } from "@plane/types";
import type { TUnreadNotificationsCount } from "@plane/types";
export enum ENotificationTab {
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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
import { TExtendedSupportedOperators } from "@plane/types";
import type { TExtendedSupportedOperators } from "@plane/types";
/**
* 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 {
EXTENDED_OPERATOR_LABELS_MAP,

View File

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

View File

@@ -1,4 +1,4 @@
import { TStateGroups } from "@plane/types";
import type { TStateGroups } from "@plane/types";
export type TDraggableData = {
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+"];

View File

@@ -1,5 +1,5 @@
import "reflect-metadata";
import { RequestHandler } from "express";
import type { RequestHandler } from "express";
// Define valid HTTP methods
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 { 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";
export const LinkContainer = ({

View File

@@ -1,6 +1,6 @@
// helpers
import { TAssetMetaDataRecord } from "@/helpers/assets";
import type { TAssetMetaDataRecord } from "@/helpers/assets";
// 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>> = {};

View File

@@ -1,5 +1,6 @@
// 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
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 = [];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@ import { SideMenuExtension } from "@/extensions";
// plane editor imports
import { RichTextEditorAdditionalExtensions } from "@/plane-editor/extensions/rich-text-extensions";
// types
import { EditorRefApi, IRichTextEditorProps } from "@/types";
import type { EditorRefApi, IRichTextEditorProps } from "@/types";
const RichTextEditor: React.FC<IRichTextEditorProps> = (props) => {
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 { useCallback, useEffect, useRef, useState } from "react";
// components
import { LinkViewProps, LinkViews } from "@/components/links";
import type { LinkViewProps, LinkViews } from "@/components/links";
// helpers
import { isValidHttpUrl } from "@/helpers/common";

View File

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

View File

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

View File

@@ -1,5 +1,6 @@
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
import { cn } from "@plane/utils";
// types

View File

@@ -9,7 +9,8 @@ import {
FloatingPortal,
} from "@floating-ui/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 { cn } from "@plane/utils";
// constants

View File

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

View File

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

View File

@@ -1,6 +1,7 @@
import type { Editor } from "@tiptap/core";
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
import { cn } from "@plane/utils";
// constants

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import { EPageAccess } from "@plane/constants";
import { TPage } from "@plane/types";
import { CreatePayload, BaseActionPayload } from "@/types";
import type { EPageAccess } from "@plane/constants";
import type { TPage } from "@plane/types";
import type { CreatePayload, BaseActionPayload } from "@/types";
// Define all payload types for each event.
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";
// constants
import { COLORS_LIST } from "@/constants/common";
@@ -6,7 +7,8 @@ import { COLORS_LIST } from "@/constants/common";
import { CalloutBlockColorSelector } from "./color-selector";
import { CalloutBlockLogoSelector } from "./logo-selector";
// types
import { ECalloutAttributeNames, TCalloutBlockAttributes } from "./types";
import type { TCalloutBlockAttributes } from "./types";
import { ECalloutAttributeNames } from "./types";
// utils
import { updateStoredBackgroundColor } from "./utils";

View File

@@ -1,10 +1,11 @@
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";
// constants
import { CORE_EXTENSIONS } from "@/constants/extension";
// types
import { type CustomCalloutExtensionType, ECalloutAttributeNames, type TCalloutBlockAttributes } from "./types";
import { ECalloutAttributeNames } from "./types";
import type { CustomCalloutExtensionType, TCalloutBlockAttributes } from "./types";
// 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
import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers
import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary";
// local imports
import { CustomCalloutBlock, type CustomCalloutNodeViewProps } from "./block";
import { CustomCalloutBlock } from "./block";
import type { CustomCalloutNodeViewProps } from "./block";
import { CustomCalloutExtensionConfig } from "./extension-config";
import type { CustomCalloutExtensionOptions, CustomCalloutExtensionStorage } from "./types";
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 { cn } from "@plane/utils";
// types
import { TCalloutBlockAttributes } from "./types";
import type { TCalloutBlockAttributes } from "./types";
// utils
import { DEFAULT_CALLOUT_BLOCK_ATTRIBUTES, updateStoredLogo } from "./utils";

View File

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

View File

@@ -1,6 +1,7 @@
// 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";
type CodeBlockLowlightOptions = CodeBlockOptions & {

View File

@@ -1,7 +1,7 @@
// TODO: check all the type errors and fix them
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 { Decoration, DecorationSet } from "@tiptap/pm/view";
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 = {
editor: Editor;

View File

@@ -3,7 +3,7 @@ import React, { useRef, useState, useCallback, useLayoutEffect, useEffect } from
// plane imports
import { cn } from "@plane/utils";
// local imports
import { Pixel, TCustomImageAttributes, TCustomImageSize } from "../types";
import type { Pixel, TCustomImageAttributes, TCustomImageSize } from "../types";
import { ensurePixelString, getImageBlockId } from "../utils";
import type { CustomImageNodeViewProps } from "./node-view";
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";
// local imports
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 { useEffect, useRef, useState } from "react";

View File

@@ -1,12 +1,13 @@
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
import { cn } from "@plane/utils";
// constants
import { ACCEPTED_IMAGE_MIME_TYPES } from "@/constants/config";
import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers
import { EFileError } from "@/helpers/file";
import type { EFileError } from "@/helpers/file";
// hooks
import { useUploader, useDropZone, uploadFirstFileAndInsertRemaining } from "@/hooks/use-file-upload";
// local imports

View File

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

View File

@@ -8,7 +8,8 @@ import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-par
// types
import type { TFileHandler } from "@/types";
// 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 type { CustomImageExtensionOptions, CustomImageExtensionStorage } from "./types";
import { getImageComponentImageFileMap } from "./utils";

View File

@@ -1,7 +1,9 @@
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
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 = {
[ECustomImageAttributeNames.SOURCE]: null,

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
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";
type ClickHandlerOptions = {

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
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";
// plane imports
import { useOutsideClickDetector } from "@plane/hooks";

View File

@@ -10,10 +10,13 @@ import {
PasteRule,
removeDuplicates,
} 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 { Plugin, PluginKey, TextSelection, Transaction } from "@tiptap/pm/state";
import Suggestion, { SuggestionOptions } from "@tiptap/suggestion";
import type { Transaction } from "@tiptap/pm/state";
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 { isEmojiSupported } from "is-emoji-supported";
// helpers

View File

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

View File

@@ -1,12 +1,15 @@
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
import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers
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
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";
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 TaskItem from "@tiptap/extension-task-item";
import TaskList from "@tiptap/extension-task-list";

View File

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

View File

@@ -1,12 +1,13 @@
import { ReactNodeViewRenderer } from "@tiptap/react";
// constants
import { CORE_EXTENSIONS } from "@/constants/extension";
import type { CORE_EXTENSIONS } from "@/constants/extension";
// helpers
import { insertEmptyParagraphAtNodeBoundaries } from "@/helpers/insert-empty-paragraph-at-node-boundary";
// types
import type { TFileHandler } from "@/types";
// 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";
declare module "@tiptap/core" {

View File

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

View File

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

View File

@@ -1,10 +1,11 @@
import { ReactNodeViewRenderer } from "@tiptap/react";
// types
import { TMentionHandler } from "@/types";
import type { TMentionHandler } from "@/types";
// extension config
import { CustomMentionExtensionConfig } from "./extension-config";
// node view
import { MentionNodeView, MentionNodeViewProps } from "./mention-node-view";
import type { MentionNodeViewProps } from "./mention-node-view";
import { MentionNodeView } from "./mention-node-view";
// 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
import { TMentionExtensionOptions } from "./extension-config";
import type { TMentionExtensionOptions } from "./extension-config";
// extension types
import { EMentionComponentAttributeNames, TMentionComponentAttributes } from "./types";
import type { TMentionComponentAttributes } from "./types";
import { EMentionComponentAttributeNames } from "./types";
export type MentionNodeViewProps = NodeViewProps & {
node: NodeViewProps["node"] & {

View File

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

View File

@@ -1,5 +1,5 @@
// plane types
import { TSearchEntities } from "@plane/types";
import type { TSearchEntities } from "@plane/types";
export enum EMentionComponentAttributeNames {
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";
// constants
import { CORE_EXTENSIONS } from "@/constants/extension";
// helpers
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
import { TMentionHandler } from "@/types";
import type { TMentionHandler } from "@/types";
// 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 =
(args: Pick<TMentionHandler, "searchCallback">): SuggestionOptions["render"] =>

View File

@@ -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

View File

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

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