[WEB-5416] fix: Use proper import syntax (#8105)
This commit is contained in:
parent
34c0e81d8e
commit
95c742244e
526 changed files with 1002 additions and 923 deletions
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = ({
|
||||
|
|
|
|||
|
|
@ -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>> = {};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { Extensions } from "@tiptap/core";
|
||||
import type { Extensions } from "@tiptap/core";
|
||||
|
||||
export const CoreEditorAdditionalExtensionsWithoutProps: Extensions = [];
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Editor } from "@tiptap/react";
|
||||
import type { Editor } from "@tiptap/react";
|
||||
// plane imports
|
||||
import { cn } from "@plane/utils";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 & {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// types
|
||||
import { TDisplayConfig } from "@/types";
|
||||
import type { TDisplayConfig } from "@/types";
|
||||
|
||||
export const DEFAULT_DISPLAY_CONFIG: TDisplayConfig = {
|
||||
fontSize: "large-font",
|
||||
|
|
|
|||
|
|
@ -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 }>;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 & {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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">,
|
||||
|
|
|
|||
|
|
@ -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" {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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"] & {
|
||||
|
|
|
|||
|
|
@ -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"> & {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// plane types
|
||||
import { TSearchEntities } from "@plane/types";
|
||||
import type { TSearchEntities } from "@plane/types";
|
||||
|
||||
export enum EMentionComponentAttributeNames {
|
||||
ID = "id",
|
||||
|
|
|
|||
|
|
@ -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"] =>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// plane utils
|
||||
import { cn } from "@plane/utils";
|
||||
// types
|
||||
import { ISlashCommandItem } from "@/types";
|
||||
import type { ISlashCommandItem } from "@/types";
|
||||
|
||||
type Props = {
|
||||
isSelected: boolean;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { DROPDOWN_NAVIGATION_KEYS, getNextValidIndex } from "@/helpers/tippy";
|
|||
// types
|
||||
import type { ISlashCommandItem } from "@/types";
|
||||
// components
|
||||
import { TSlashCommandSection } from "./command-items-list";
|
||||
import type { TSlashCommandSection } from "./command-items-list";
|
||||
import { CommandMenuItem } from "./command-menu-item";
|
||||
|
||||
export type SlashCommandsMenuProps = SuggestionProps<TSlashCommandSection, ISlashCommandItem> & {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
import { type Editor, Extension } from "@tiptap/core";
|
||||
import { Extension } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
import { ReactRenderer } from "@tiptap/react";
|
||||
import Suggestion, { type SuggestionOptions } from "@tiptap/suggestion";
|
||||
import Suggestion from "@tiptap/suggestion";
|
||||
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 { IEditorProps, ISlashCommandItem, TEditorCommands, TSlashCommandSectionKeys } from "@/types";
|
||||
import type { IEditorProps, ISlashCommandItem, TEditorCommands, TSlashCommandSectionKeys } from "@/types";
|
||||
// components
|
||||
import { getSlashCommandFilteredSections } from "./command-items-list";
|
||||
import { SlashCommandsMenu, SlashCommandsMenuProps } from "./command-menu";
|
||||
import type { SlashCommandsMenuProps } from "./command-menu";
|
||||
import { SlashCommandsMenu } from "./command-menu";
|
||||
|
||||
export type SlashCommandOptions = {
|
||||
suggestion: Omit<SuggestionOptions, "editor">;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import type { Editor } from "@tiptap/core";
|
||||
import { Fragment, type Node, type Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import { Fragment } from "@tiptap/pm/model";
|
||||
import type { Node, Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import type { Transaction } from "@tiptap/pm/state";
|
||||
import { type CellSelection, TableMap } from "@tiptap/pm/tables";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
import type { CellSelection } from "@tiptap/pm/tables";
|
||||
// extensions
|
||||
import { TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
import type { TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
|
||||
type TableRow = (ProseMirrorNode | null)[];
|
||||
type TableRows = TableRow[];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import type { Editor } from "@tiptap/core";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
import { ArrowLeft, ArrowRight, Copy, ToggleRight, Trash2, type LucideIcon } from "lucide-react";
|
||||
import { ArrowLeft, ArrowRight, Copy, ToggleRight, Trash2 } from "lucide-react";
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
// extensions
|
||||
import { CloseIcon, ISvgIcons } from "@plane/propel/icons";
|
||||
import type { ISvgIcons } from "@plane/propel/icons";
|
||||
import { CloseIcon } from "@plane/propel/icons";
|
||||
import { findTable, getSelectedColumns } from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { duplicateColumns } from "../actions";
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import {
|
|||
haveTableRelatedChanges,
|
||||
} from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { ColumnDragHandle, ColumnDragHandleProps } from "./drag-handle";
|
||||
import type { ColumnDragHandleProps } from "./drag-handle";
|
||||
import { ColumnDragHandle } from "./drag-handle";
|
||||
|
||||
type TableColumnDragHandlePluginState = {
|
||||
decorations?: DecorationSet;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import type { Editor } from "@tiptap/core";
|
|||
import type { Selection } from "@tiptap/pm/state";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
// extensions
|
||||
import { getSelectedRect, isCellSelection, type TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
import { getSelectedRect, isCellSelection } from "@/extensions/table/table/utilities/helpers";
|
||||
import type { TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { cloneTableCell, constructDragPreviewTable, updateCellContentVisibility } from "../utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import type { Editor } from "@tiptap/core";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
import { ArrowDown, ArrowUp, Copy, ToggleRight, Trash2, type LucideIcon } from "lucide-react";
|
||||
import { ArrowDown, ArrowUp, Copy, ToggleRight, Trash2 } from "lucide-react";
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
// extensions
|
||||
import { CloseIcon, ISvgIcons } from "@plane/propel/icons";
|
||||
import type { ISvgIcons } from "@plane/propel/icons";
|
||||
import { CloseIcon } from "@plane/propel/icons";
|
||||
import { findTable, getSelectedRows } from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { duplicateRows } from "../actions";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type Editor } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
||||
|
|
@ -10,7 +10,8 @@ import {
|
|||
haveTableRelatedChanges,
|
||||
} from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { RowDragHandle, RowDragHandleProps } from "./drag-handle";
|
||||
import type { RowDragHandleProps } from "./drag-handle";
|
||||
import { RowDragHandle } from "./drag-handle";
|
||||
|
||||
type TableRowDragHandlePluginState = {
|
||||
decorations?: DecorationSet;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import type { Editor } from "@tiptap/core";
|
|||
import type { Selection } from "@tiptap/pm/state";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
// extensions
|
||||
import { getSelectedRect, isCellSelection, type TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
import { getSelectedRect, isCellSelection } from "@/extensions/table/table/utilities/helpers";
|
||||
import type { TableNodeLocation } from "@/extensions/table/table/utilities/helpers";
|
||||
// local imports
|
||||
import { cloneTableCell, constructDragPreviewTable, updateCellContentVisibility } from "../utils";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import type { Editor } from "@tiptap/core";
|
|||
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
||||
// local imports
|
||||
import { COL_DRAG_MARKER_CLASS, DROP_MARKER_CLASS, ROW_DRAG_MARKER_CLASS } from "../drag-handles/marker-utils";
|
||||
import { createColumnInsertButton, createRowInsertButton, findAllTables, TableInfo } from "./utils";
|
||||
import type { TableInfo } from "./utils";
|
||||
import { createColumnInsertButton, createRowInsertButton, findAllTables } from "./utils";
|
||||
|
||||
const TABLE_INSERT_PLUGIN_KEY = new PluginKey("table-insert");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import type { Editor } from "@tiptap/core";
|
||||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import { addColumn, removeColumn, addRow, removeRow, TableMap, type TableRect } from "@tiptap/pm/tables";
|
||||
import { addColumn, removeColumn, addRow, removeRow, TableMap } from "@tiptap/pm/tables";
|
||||
import type { TableRect } from "@tiptap/pm/tables";
|
||||
// local imports
|
||||
import { isCellEmpty } from "../../table/utilities/helpers";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { findParentNode, type Editor } from "@tiptap/core";
|
||||
import { findParentNode } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
import { Decoration, DecorationSet } from "@tiptap/pm/view";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { callOrReturn, getExtensionField, mergeAttributes, Node, ParentConfig } from "@tiptap/core";
|
||||
import type { ParentConfig } from "@tiptap/core";
|
||||
import { callOrReturn, getExtensionField, mergeAttributes, Node } from "@tiptap/core";
|
||||
import { TextSelection } from "@tiptap/pm/state";
|
||||
import {
|
||||
addColumnAfter,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Fragment, Node as ProsemirrorNode, NodeType } from "@tiptap/pm/model";
|
||||
import type { Fragment, Node as ProsemirrorNode, NodeType } from "@tiptap/pm/model";
|
||||
|
||||
export function createCell(
|
||||
cellType: NodeType,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Fragment, Node as ProsemirrorNode, Schema } from "@tiptap/pm/model";
|
||||
import type { Fragment, Node as ProsemirrorNode, Schema } from "@tiptap/pm/model";
|
||||
// extensions
|
||||
import { createCell } from "@/extensions/table/table/utilities/create-cell";
|
||||
import { getTableNodeTypes } from "@/extensions/table/table/utilities/get-table-node-types";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { type Editor, findParentNodeClosestToPos, type KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import { findParentNodeClosestToPos } from "@tiptap/core";
|
||||
import type { Editor, KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import { CellSelection, TableMap } from "@tiptap/pm/tables";
|
||||
import type { CellSelection } from "@tiptap/pm/tables";
|
||||
import { TableMap } from "@tiptap/pm/tables";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
// extensions
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { NodeType, Schema } from "@tiptap/pm/model";
|
||||
import type { NodeType, Schema } from "@tiptap/pm/model";
|
||||
|
||||
export function getTableNodeTypes(schema: Schema): { [key: string]: NodeType } {
|
||||
if (schema.cached.tableNodeTypes) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import { type Editor, findParentNode } from "@tiptap/core";
|
||||
import { findParentNode } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import type { EditorState, Selection, Transaction } from "@tiptap/pm/state";
|
||||
import { CellSelection, type Rect, TableMap } from "@tiptap/pm/tables";
|
||||
import { CellSelection, TableMap } from "@tiptap/pm/tables";
|
||||
import type { Rect } from "@tiptap/pm/tables";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import type { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import type { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Extension } from "@tiptap/core";
|
||||
import { NodeType, Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import type { NodeType, Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Extension, InputRule } from "@tiptap/core";
|
||||
import type { InputRule } from "@tiptap/core";
|
||||
import { Extension } from "@tiptap/core";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
import type { TypographyOptions } from "./inputRules";
|
||||
import {
|
||||
TypographyOptions,
|
||||
emDash,
|
||||
ellipsis,
|
||||
leftArrow,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Extension } from "@tiptap/core";
|
||||
import codemark from "prosemirror-codemark";
|
||||
// helpers
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
import type { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
import { restorePublicImages } from "@/helpers/image-helpers";
|
||||
// plugins
|
||||
import { TAdditionalActiveDropbarExtensions } from "@/plane-editor/types/utils";
|
||||
import type { TAdditionalActiveDropbarExtensions } from "@/plane-editor/types/utils";
|
||||
import { DropHandlerPlugin } from "@/plugins/drop";
|
||||
import { FilePlugins } from "@/plugins/file/root";
|
||||
import { MarkdownClipboardPlugin } from "@/plugins/markdown-clipboard";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { ReactNodeViewRenderer, NodeViewWrapper, type NodeViewProps } from "@tiptap/react";
|
||||
import { ReactNodeViewRenderer, NodeViewWrapper } from "@tiptap/react";
|
||||
import type { NodeViewProps } from "@tiptap/react";
|
||||
// local imports
|
||||
import { WorkItemEmbedExtensionConfig } from "./extension-config";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
// plane imports
|
||||
import { ADDITIONAL_EXTENSIONS, CORE_EXTENSIONS } from "@plane/utils";
|
||||
import type { ADDITIONAL_EXTENSIONS } from "@plane/utils";
|
||||
import { CORE_EXTENSIONS } from "@plane/utils";
|
||||
// extensions
|
||||
import { getImageBlockId } from "@/extensions/custom-image/utils";
|
||||
// plane editor imports
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import { EditorState, Selection } from "@tiptap/pm/state";
|
||||
import type { EditorState, Selection } from "@tiptap/pm/state";
|
||||
// plane imports
|
||||
import { cn } from "@plane/utils";
|
||||
// constants
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { CORE_EXTENSIONS } from "@/constants/extension";
|
|||
import { replaceCodeWithText } from "@/extensions/code/utils/replace-code-block-with-text";
|
||||
import type { InsertImageComponentProps } from "@/extensions/custom-image/types";
|
||||
// helpers
|
||||
import { ExtendedEmojiStorage } from "@/extensions/emoji/emoji";
|
||||
import type { ExtendedEmojiStorage } from "@/extensions/emoji/emoji";
|
||||
import { findTableAncestor } from "@/helpers/common";
|
||||
|
||||
export const setText = (editor: Editor, range?: Range) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { escapeForRegEx } from "@tiptap/core";
|
||||
import { Trigger, SuggestionMatch } from "@tiptap/suggestion";
|
||||
import type { Trigger, SuggestionMatch } from "@tiptap/suggestion";
|
||||
|
||||
export function customFindSuggestionMatch(config: Trigger): SuggestionMatch | null {
|
||||
const { char, allowSpaces: allowSpacesOption, allowToIncludeChar, allowedPrefixes, startOfLine, $position } = config;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
import {
|
||||
computePosition,
|
||||
flip,
|
||||
type Strategy,
|
||||
type Placement,
|
||||
shift,
|
||||
ReferenceElement,
|
||||
autoUpdate,
|
||||
} from "@floating-ui/dom";
|
||||
import { type Editor, posToDOMRect } from "@tiptap/core";
|
||||
import { computePosition, flip, shift, autoUpdate } from "@floating-ui/dom";
|
||||
import type { Placement, ReferenceElement, Strategy } from "@floating-ui/dom";
|
||||
import { posToDOMRect } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
|
||||
export type UpdateFloatingUIFloaterPosition = (
|
||||
editor: Editor,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
import { DocumentCollaborativeEvents } from "@/constants/document-collaborative-events";
|
||||
import { TDocumentEventKey, TDocumentEventsClient, TDocumentEventsServer } from "@/types/document-collaborative-events";
|
||||
import type {
|
||||
TDocumentEventKey,
|
||||
TDocumentEventsClient,
|
||||
TDocumentEventsServer,
|
||||
} from "@/types/document-collaborative-events";
|
||||
|
||||
export const getServerEventName = (clientEvent: TDocumentEventsClient): TDocumentEventsServer | undefined => {
|
||||
for (const key in DocumentCollaborativeEvents) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Editor } from "@tiptap/core";
|
||||
import type { Editor } from "@tiptap/core";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
// types
|
||||
import { TFileHandler } from "@/types";
|
||||
import type { TFileHandler } from "@/types";
|
||||
|
||||
/**
|
||||
* Finds all public image nodes in the document and restores them using the provided restore function
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Editor } from "@tiptap/react";
|
||||
import type { Editor } from "@tiptap/react";
|
||||
|
||||
export const insertContentAtSavedSelection = (editor: Editor, content: string) => {
|
||||
if (!editor || editor.isDestroyed) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
import type { KeyboardShortcutCommand } from "@tiptap/core";
|
||||
import type { Node as ProseMirrorNode } from "@tiptap/pm/model";
|
||||
// constants
|
||||
import { CORE_EXTENSIONS } from "@/constants/extension";
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue