diff --git a/packages/editor/core/src/index.ts b/packages/editor/core/src/index.ts index c46ad9336..523c1cdff 100644 --- a/packages/editor/core/src/index.ts +++ b/packages/editor/core/src/index.ts @@ -1,16 +1,16 @@ // styles -import "@/styles/tailwind.css"; -import "@/styles/editor.css"; +import "./styles/tailwind.css"; +import "./styles/editor.css"; // utils -export { cn } from "@/lib/utils"; -export { getEditorClassNames } from "@/lib/utils"; -export { startImageUpload } from "@/ui/plugins/upload-image"; +export { cn } from "./lib/utils"; +export { getEditorClassNames } from "./lib/utils"; +export { startImageUpload } from "./ui/plugins/upload-image"; // components -export { EditorContainer } from "@/ui/components/editor-container"; -export { EditorContentWrapper } from "@/ui/components/editor-content"; +export { EditorContainer } from "./ui/components/editor-container"; +export { EditorContentWrapper } from "./ui/components/editor-content"; // hooks -export { useEditor } from "@/ui/hooks/useEditor"; -export { useReadOnlyEditor } from "@/ui/hooks/useReadOnlyEditor"; +export { useEditor } from "./ui/hooks/useEditor"; +export { useReadOnlyEditor } from "./ui/hooks/useReadOnlyEditor"; diff --git a/packages/editor/core/src/ui/components/editor-content.tsx b/packages/editor/core/src/ui/components/editor-content.tsx index 1e56e98c9..5ca077657 100644 --- a/packages/editor/core/src/ui/components/editor-content.tsx +++ b/packages/editor/core/src/ui/components/editor-content.tsx @@ -1,7 +1,7 @@ import { Editor, EditorContent } from "@tiptap/react"; import { ReactNode } from "react"; -import { ImageResizer } from "@/ui/extensions/image/image-resize"; -import { TableMenu } from "@/ui/menus/table-menu"; +import { ImageResizer } from "../extensions/image/image-resize"; +import { TableMenu } from "../menus/table-menu"; interface EditorContentProps { editor: Editor | null; diff --git a/packages/editor/core/src/ui/extensions/image/index.tsx b/packages/editor/core/src/ui/extensions/image/index.tsx index ac8d43597..f9345509d 100644 --- a/packages/editor/core/src/ui/extensions/image/index.tsx +++ b/packages/editor/core/src/ui/extensions/image/index.tsx @@ -1,7 +1,7 @@ import Image from "@tiptap/extension-image"; -import TrackImageDeletionPlugin from "@/ui/plugins/delete-image"; -import UploadImagesPlugin from "@/ui/plugins/upload-image"; -import { DeleteImage } from "@/types/delete-image"; +import TrackImageDeletionPlugin from "../../plugins/delete-image"; +import UploadImagesPlugin from "../../plugins/upload-image"; +import { DeleteImage } from "../../../types/delete-image"; const ImageExtension = (deleteImage: DeleteImage) => Image.extend({ addProseMirrorPlugins() { diff --git a/packages/editor/core/src/ui/extensions/index.tsx b/packages/editor/core/src/ui/extensions/index.tsx index 7aac1adb1..acd60e634 100644 --- a/packages/editor/core/src/ui/extensions/index.tsx +++ b/packages/editor/core/src/ui/extensions/index.tsx @@ -8,16 +8,16 @@ import TaskList from "@tiptap/extension-task-list"; import { Markdown } from "tiptap-markdown"; import Gapcursor from "@tiptap/extension-gapcursor"; -import { CustomTableCell } from "@/ui/extensions/table/table-cell"; -import { Table } from "@/ui/extensions/table"; -import { TableHeader } from "@/ui/extensions/table/table-header"; +import { CustomTableCell } from "./table/table-cell"; +import { Table } from "./table"; +import { TableHeader } from "./table/table-header"; import { TableRow } from "@tiptap/extension-table-row"; -import ImageExtension from "@/ui/extensions/image"; +import ImageExtension from "./image"; -import { DeleteImage } from "@/types/delete-image"; +import { DeleteImage } from "../../types/delete-image"; -import isValidHttpUrl from "@/ui/menus/bubble-menu/utils" +import isValidHttpUrl from "../menus/bubble-menu/utils" export const CoreEditorExtensions = ( deleteFile: DeleteImage, diff --git a/packages/editor/core/src/ui/hooks/useEditor.tsx b/packages/editor/core/src/ui/hooks/useEditor.tsx index 43d7799ee..9a3f4882a 100644 --- a/packages/editor/core/src/ui/hooks/useEditor.tsx +++ b/packages/editor/core/src/ui/hooks/useEditor.tsx @@ -1,12 +1,12 @@ import { useEditor as useCustomEditor, Editor } from "@tiptap/react"; import { useImperativeHandle, useRef, MutableRefObject } from "react"; import { useDebouncedCallback } from "use-debounce"; -import { UploadImage } from '@/types/upload-image'; -import { DeleteImage } from '@/types/delete-image'; +import { DeleteImage } from '../../types/delete-image'; import { CoreEditorProps } from "../props"; import { CoreEditorExtensions } from "../extensions"; import { EditorProps } from '@tiptap/pm/view'; -import { getTrimmedHTML } from "@/lib/utils"; +import { getTrimmedHTML } from "../../lib/utils"; +import { UploadImage } from "../../types/upload-image"; const DEBOUNCE_DELAY = 1500; @@ -25,7 +25,6 @@ interface CustomEditorProps { } export const useEditor = ({ uploadFile, editable, deleteFile, editorProps = {}, value, extensions = [], onChange, setIsSubmitting, debouncedUpdatesEnabled, forwardedRef, setShouldShowAlert, }: CustomEditorProps) => { - console.log("content aaya", value) const editor = useCustomEditor({ editable: editable ?? true, editorProps: { diff --git a/packages/editor/core/src/ui/hooks/useReadOnlyEditor.tsx b/packages/editor/core/src/ui/hooks/useReadOnlyEditor.tsx index 5d08b867c..a6130cff1 100644 --- a/packages/editor/core/src/ui/hooks/useReadOnlyEditor.tsx +++ b/packages/editor/core/src/ui/hooks/useReadOnlyEditor.tsx @@ -1,7 +1,7 @@ import { useEditor as useCustomEditor, Editor } from "@tiptap/react"; import { useImperativeHandle, useRef, MutableRefObject } from "react"; -import { CoreReadOnlyEditorExtensions } from "@/ui/read-only/extensions"; -import { CoreReadOnlyEditorProps } from "@/ui/read-only/props"; +import { CoreReadOnlyEditorExtensions } from "../../ui/read-only/extensions"; +import { CoreReadOnlyEditorProps } from "../../ui/read-only/props"; interface CustomReadOnlyEditorProps { value: string; diff --git a/packages/editor/core/src/ui/index.tsx b/packages/editor/core/src/ui/index.tsx index 93e7b6829..3c64e8ba6 100644 --- a/packages/editor/core/src/ui/index.tsx +++ b/packages/editor/core/src/ui/index.tsx @@ -1,13 +1,13 @@ "use client" import * as React from 'react'; import { Extension } from "@tiptap/react"; -import { UploadImage } from '@/types/upload-image'; -import { DeleteImage } from '@/types/delete-image'; -import { getEditorClassNames } from '@/lib/utils'; +import { UploadImage } from '../types/upload-image'; +import { DeleteImage } from '../types/delete-image'; +import { getEditorClassNames } from '../lib/utils'; import { EditorProps } from '@tiptap/pm/view'; import { useEditor } from './hooks/useEditor'; -import { EditorContainer } from '@/ui/components/editor-container'; -import { EditorContentWrapper } from '@/ui/components/editor-content'; +import { EditorContainer } from '../ui/components/editor-container'; +import { EditorContentWrapper } from '../ui/components/editor-content'; interface ICoreEditor { value: string; diff --git a/packages/editor/core/src/ui/menus/bubble-menu/index.tsx b/packages/editor/core/src/ui/menus/bubble-menu/index.tsx index 9592cf617..686cd9194 100644 --- a/packages/editor/core/src/ui/menus/bubble-menu/index.tsx +++ b/packages/editor/core/src/ui/menus/bubble-menu/index.tsx @@ -4,7 +4,7 @@ import { BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon } from import { NodeSelector } from "./node-selector"; import { LinkSelector } from "./link-selector"; -import { cn } from "@/lib/utils"; +import { cn } from "../../../lib/utils"; export interface BubbleMenuItem { name: string; diff --git a/packages/editor/core/src/ui/menus/bubble-menu/link-selector.tsx b/packages/editor/core/src/ui/menus/bubble-menu/link-selector.tsx index f3730c4dc..7060ff9d8 100644 --- a/packages/editor/core/src/ui/menus/bubble-menu/link-selector.tsx +++ b/packages/editor/core/src/ui/menus/bubble-menu/link-selector.tsx @@ -1,8 +1,8 @@ -import { cn } from "@/lib/utils"; +import { cn } from "../../../lib/utils"; import { Editor } from "@tiptap/core"; import { Check, Trash } from "lucide-react"; import { Dispatch, FC, SetStateAction, useCallback, useEffect, useRef } from "react"; -import isValidHttpUrl from "@/ui/menus/bubble-menu/utils"; +import isValidHttpUrl from "./utils"; interface LinkSelectorProps { editor: Editor; diff --git a/packages/editor/core/src/ui/menus/bubble-menu/node-selector.tsx b/packages/editor/core/src/ui/menus/bubble-menu/node-selector.tsx index 999184506..c3003be23 100644 --- a/packages/editor/core/src/ui/menus/bubble-menu/node-selector.tsx +++ b/packages/editor/core/src/ui/menus/bubble-menu/node-selector.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils"; +import { cn } from "../../../lib/utils"; import { Editor } from "@tiptap/core"; import { Check, diff --git a/packages/editor/core/src/ui/menus/fixed-menu/index.tsx b/packages/editor/core/src/ui/menus/fixed-menu/index.tsx index 7d00b65e6..c9b8cfcb1 100644 --- a/packages/editor/core/src/ui/menus/fixed-menu/index.tsx +++ b/packages/editor/core/src/ui/menus/fixed-menu/index.tsx @@ -1,7 +1,7 @@ import { Editor } from "@tiptap/react"; import { BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon } from "lucide-react"; -import { cn } from "@/lib/utils"; +import { cn } from "../../../lib/utils"; import { Tooltip } from "../table-menu/tooltip"; import { Icon } from "./icon"; diff --git a/packages/editor/core/src/ui/menus/table-menu/index.tsx b/packages/editor/core/src/ui/menus/table-menu/index.tsx index 96a0af228..fc84fd069 100644 --- a/packages/editor/core/src/ui/menus/table-menu/index.tsx +++ b/packages/editor/core/src/ui/menus/table-menu/index.tsx @@ -4,7 +4,7 @@ import InsertLeftTableIcon from "./InsertLeftTableIcon"; import InsertRightTableIcon from "./InsertRightTableIcon"; import InsertTopTableIcon from "./InsertTopTableIcon"; import InsertBottomTableIcon from "./InsertBottomTableIcon"; -import { cn, findTableAncestor } from "@/lib/utils"; +import { cn, findTableAncestor } from "../../../lib/utils"; import { Tooltip } from "./tooltip"; interface TableMenuItem { diff --git a/packages/editor/core/src/ui/plugins/delete-image.tsx b/packages/editor/core/src/ui/plugins/delete-image.tsx index 9204481a8..ba21d686d 100644 --- a/packages/editor/core/src/ui/plugins/delete-image.tsx +++ b/packages/editor/core/src/ui/plugins/delete-image.tsx @@ -1,6 +1,6 @@ import { EditorState, Plugin, PluginKey, Transaction } from "@tiptap/pm/state"; import { Node as ProseMirrorNode } from "@tiptap/pm/model"; -import { DeleteImage } from "@/types/delete-image"; +import { DeleteImage } from "../../types/delete-image"; const deleteKey = new PluginKey("delete-image"); const IMAGE_NODE_TYPE = "image"; diff --git a/packages/editor/core/src/ui/plugins/upload-image.tsx b/packages/editor/core/src/ui/plugins/upload-image.tsx index 976c4968b..cdd62ae48 100644 --- a/packages/editor/core/src/ui/plugins/upload-image.tsx +++ b/packages/editor/core/src/ui/plugins/upload-image.tsx @@ -1,4 +1,4 @@ -import { UploadImage } from "@/types/upload-image"; +import { UploadImage } from "../../types/upload-image"; import { EditorState, Plugin, PluginKey } from "@tiptap/pm/state"; import { Decoration, DecorationSet, EditorView } from "@tiptap/pm/view"; diff --git a/packages/editor/core/src/ui/props.tsx b/packages/editor/core/src/ui/props.tsx index 7a43005e7..8f002b76c 100644 --- a/packages/editor/core/src/ui/props.tsx +++ b/packages/editor/core/src/ui/props.tsx @@ -1,7 +1,7 @@ import { EditorProps } from "@tiptap/pm/view"; -import { findTableAncestor } from "@/lib/utils"; -import { startImageUpload } from "@/ui/plugins/upload-image"; -import { UploadImage } from "@/types/upload-image"; +import { findTableAncestor } from "../lib/utils"; +import { startImageUpload } from "./plugins/upload-image"; +import { UploadImage } from "../types/upload-image"; export function CoreEditorProps( uploadFile: UploadImage, diff --git a/packages/editor/core/src/ui/read-only/extensions.tsx b/packages/editor/core/src/ui/read-only/extensions.tsx index f879b2744..e9fba4eab 100644 --- a/packages/editor/core/src/ui/read-only/extensions.tsx +++ b/packages/editor/core/src/ui/read-only/extensions.tsx @@ -8,13 +8,13 @@ import TaskList from "@tiptap/extension-task-list"; import { Markdown } from "tiptap-markdown"; import Gapcursor from "@tiptap/extension-gapcursor"; -import { CustomTableCell } from "@/ui/extensions/table/table-cell"; -import { Table } from "@/ui/extensions/table"; -import { TableHeader } from "@/ui/extensions/table/table-header"; +import { CustomTableCell } from "../extensions/table/table-cell"; +import { Table } from "../extensions/table"; +import { TableHeader } from "../extensions/table/table-header"; import { TableRow } from "@tiptap/extension-table-row"; -import isValidHttpUrl from "@/ui/menus/bubble-menu/utils"; -import ReadOnlyImageExtension from "@/ui/extensions/image/read-only-image"; +import isValidHttpUrl from "../menus/bubble-menu/utils"; +import ReadOnlyImageExtension from "../extensions/image/read-only-image"; export const CoreReadOnlyEditorExtensions = [ StarterKit.configure({ diff --git a/packages/editor/core/tsconfig.json b/packages/editor/core/tsconfig.json index bf38514e1..b9964c0ca 100644 --- a/packages/editor/core/tsconfig.json +++ b/packages/editor/core/tsconfig.json @@ -11,10 +11,5 @@ ], "compilerOptions": { "baseUrl": ".", - "paths": { - "@/*": [ - "src/*" - ] - } } } diff --git a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx b/packages/editor/lite-text-editor/src/ui/extensions/index.tsx index e1ef3db84..cea0dfc61 100644 --- a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx +++ b/packages/editor/lite-text-editor/src/ui/extensions/index.tsx @@ -1,5 +1,5 @@ import { EnterKeyExtension } from "./enter-key-extension"; export const LiteTextEditorExtensions = () => [ - EnterKeyExtension + EnterKeyExtension, ]; diff --git a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx b/packages/editor/rich-text-editor/src/ui/extensions/index.tsx index 69f89e2f1..e70fcc88d 100644 --- a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx +++ b/packages/editor/rich-text-editor/src/ui/extensions/index.tsx @@ -8,7 +8,7 @@ import ts from "highlight.js/lib/languages/typescript"; // import "highlight.js/styles/github-dark.css"; import SlashCommand from "./slash-command"; -import { UploadImage } from ".."; +import { UploadImage } from "../"; const lowlight = createLowlight(common) lowlight.register("ts", ts);