🔥🔥🔥 Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-1682] refactor: editor code splitting (#4893)
Aaryan Khandelwaldcdd1ef065d9
diff --git a/package.json b/package.jsonindex 758af2da6f..b975be60b4 100644--- a/package.json+++ b/package.json@@ -7,7 +7,7 @@"web","space","admin",- "packages/editor/*",+ "packages/editor","packages/eslint-config-custom","packages/tailwind-config-custom","packages/tsconfig",diff --git a/packages/editor/core/.eslintrc.js b/packages/editor/.eslintrc.jssimilarity index 100%rename from packages/editor/core/.eslintrc.jsrename to packages/editor/.eslintrc.jsdiff --git a/packages/editor/core/.prettierignore b/packages/editor/.prettierignoresimilarity index 100%rename from packages/editor/core/.prettierignorerename to packages/editor/.prettierignorediff --git a/packages/editor/core/.prettierrc b/packages/editor/.prettierrcsimilarity index 100%rename from packages/editor/core/.prettierrcrename to packages/editor/.prettierrcdiff --git a/packages/editor/core/Readme.md b/packages/editor/Readme.mdsimilarity index 85%rename from packages/editor/core/Readme.mdrename to packages/editor/Readme.mdindex aafda70086..75aad2c95a 100644--- a/packages/editor/core/Readme.md+++ b/packages/editor/Readme.md@@ -1,8 +1,8 @@-# @plane/editor-core+# @plane/editor## Description-The `@plane/editor-core` package serves as the foundation for our editor system. It provides the base functionality for our other editor packages, but it will not be used directly in any of the projects but only for extending other editors.+The `@plane/editor` package serves as the foundation for our editor system. It provides the base functionality for our other editor packages, but it will not be used directly in any of the projects but only for extending other editors.## Utilities@@ -64,40 +64,6 @@ const customEditorClassNames = getEditorClassNames({- **Value Cleaning**: The Editor’s value is cleaned at the editor core level, eliminating the need for additional validation before sending from our app. This results in cleaner code and less potential for errors.- **Turbo Pipeline**: Added a turbo pipeline for both dev and build tasks for projects depending on the editor package.-```json- "web#develop": {- "cache": false,- "persistent": true,- "dependsOn": [- "@plane/lite-text-editor#build",- "@plane/rich-text-editor#build"- ]- },- "space#develop": {- "cache": false,- "persistent": true,- "dependsOn": [- "@plane/lite-text-editor#build",- "@plane/rich-text-editor#build"- ]- },- "web#build": {- "cache": true,- "dependsOn": [- "@plane/lite-text-editor#build",- "@plane/rich-text-editor#build"- ]- },- "space#build": {- "cache": true,- "dependsOn": [- "@plane/lite-text-editor#build",- "@plane/rich-text-editor#build"- ]- },--```-## Base extensions included- BulletListdiff --git a/packages/editor/core/src/index.ts b/packages/editor/core/src/index.tsdeleted file mode 100644index 493f02d2f1..0000000000--- a/packages/editor/core/src/index.ts+++ /dev/null@@ -1,34 +0,0 @@-// styles-// import "./styles/tailwind.css";-import "src/styles/editor.css";-import "src/styles/table.css";-import "src/styles/github-dark.css";--export { isCellSelection } from "src/ui/extensions/table/table/utilities/is-cell-selection";--// utils-export * from "src/lib/utils";-export * from "src/ui/extensions/table/table";-export { startImageUpload } from "src/ui/plugins/image/image-upload-handler";--// components-export { EditorContainer } from "src/ui/components/editor-container";-export { EditorContentWrapper } from "src/ui/components/editor-content";--// hooks-export { useEditor } from "src/hooks/use-editor";-export { useReadOnlyEditor } from "src/hooks/use-read-only-editor";--// helper items-export * from "src/ui/menus/menu-items";-export * from "src/lib/editor-commands";--// types-export type { CustomEditorProps, TFileHandler } from "src/hooks/use-editor";-export type { DeleteImage } from "src/types/delete-image";-export type { UploadImage } from "src/types/upload-image";-export type { EditorRefApi, EditorReadOnlyRefApi } from "src/types/editor-ref-api";-export type { RestoreImage } from "src/types/restore-image";-export type { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion";-export type { ISlashCommandItem, CommandProps } from "src/types/slash-commands-suggestion";-export type { LucideIconType } from "src/types/lucide-icon";diff --git a/packages/editor/core/src/types/delete-image.ts b/packages/editor/core/src/types/delete-image.tsdeleted file mode 100644index 40bfffe2fd..0000000000--- a/packages/editor/core/src/types/delete-image.ts+++ /dev/null@@ -1 +0,0 @@-export type DeleteImage = (assetUrlWithWorkspaceId: string) => Promise<any>;diff --git a/packages/editor/core/src/types/editor-ref-api.ts b/packages/editor/core/src/types/editor-ref-api.tsdeleted file mode 100644index b15ae943d0..0000000000--- a/packages/editor/core/src/types/editor-ref-api.ts+++ /dev/null@@ -1,19 +0,0 @@-import { IMarking } from "src/helpers/scroll-to-node";-import { EditorMenuItemNames } from "src/ui/menus/menu-items";--export type EditorReadOnlyRefApi = {- getMarkDown: () => string;- getHTML: () => string;- clearEditor: () => void;- setEditorValue: (content: string) => void;- scrollSummary: (marking: IMarking) => void;-};--export interface EditorRefApi extends EditorReadOnlyRefApi {- setEditorValueAtCursorPosition: (content: string) => void;- executeMenuItemCommand: (itemName: EditorMenuItemNames) => void;- isMenuItemActive: (itemName: EditorMenuItemNames) => boolean;- onStateChange: (callback: () => void) => () => void;- setFocusAtPosition: (position: number) => void;- isEditorReadyToDiscard: () => boolean;-}diff --git a/packages/editor/core/src/types/lucide-icon.ts b/packages/editor/core/src/types/lucide-icon.tsdeleted file mode 100644index 2211c18e8f..0000000000--- a/packages/editor/core/src/types/lucide-icon.ts+++ /dev/null@@ -1,3 +0,0 @@-import { Smile } from "lucide-react";--export type LucideIconType = typeof Smile;diff --git a/packages/editor/core/src/types/restore-image.ts b/packages/editor/core/src/types/restore-image.tsdeleted file mode 100644index 9b33177b78..0000000000--- a/packages/editor/core/src/types/restore-image.ts+++ /dev/null@@ -1 +0,0 @@-export type RestoreImage = (assetUrlWithWorkspaceId: string) => Promise<any>;diff --git a/packages/editor/core/src/types/upload-image.ts b/packages/editor/core/src/types/upload-image.tsdeleted file mode 100644index 3cf1408d22..0000000000--- a/packages/editor/core/src/types/upload-image.ts+++ /dev/null@@ -1 +0,0 @@-export type UploadImage = (file: File) => Promise<string>;diff --git a/packages/editor/core/src/ui/mentions/custom.tsx b/packages/editor/core/src/ui/mentions/custom.tsxdeleted file mode 100644index 8bab796667..0000000000--- a/packages/editor/core/src/ui/mentions/custom.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { Mention, MentionOptions } from "@tiptap/extension-mention";-import { mergeAttributes } from "@tiptap/core";-import { ReactNodeViewRenderer } from "@tiptap/react";-import { MentionNodeView } from "src/ui/mentions/mention-node-view";-import { IMentionHighlight } from "src/types/mention-suggestion";--export interface CustomMentionOptions extends MentionOptions {- mentionHighlights: () => Promise<IMentionHighlight[]>;- readonly?: boolean;-}--export const CustomMention = Mention.extend<CustomMentionOptions>({- addStorage(this) {- return {- mentionsOpen: false,- };- },- addAttributes() {- return {- id: {- default: null,- },- label: {- default: null,- },- target: {- default: null,- },- self: {- default: false,- },- redirect_uri: {- default: "/",- },- entity_identifier: {- default: null,- },- entity_name: {- default: null,- },- };- },-- addNodeView() {- return ReactNodeViewRenderer(MentionNodeView);- },-- parseHTML() {- return [- {- tag: "mention-component",- },- ];- },- renderHTML({ HTMLAttributes }) {- return ["mention-component", mergeAttributes(HTMLAttributes)];- },-});diff --git a/packages/editor/core/src/ui/mentions/mention-without-props.tsx b/packages/editor/core/src/ui/mentions/mention-without-props.tsxdeleted file mode 100644index a0d22ef4f8..0000000000--- a/packages/editor/core/src/ui/mentions/mention-without-props.tsx+++ /dev/null@@ -1,79 +0,0 @@-import { CustomMention } from "./custom";-import { ReactRenderer } from "@tiptap/react";-import { Editor } from "@tiptap/core";-import tippy from "tippy.js";--import { MentionList } from "./mention-list";--export const MentionsWithoutProps = () =>- CustomMention.configure({- HTMLAttributes: {- class: "mention",- },- // mentionHighlights: mentionHighlights,- suggestion: {- // @ts-expect-error - Tiptap types are incorrect- render: () => {- let component: ReactRenderer | null = null;- let popup: any | null = null;-- return {- onStart: (props: { editor: Editor; clientRect: DOMRect }) => {- if (!props.clientRect) {- return;- }- component = new ReactRenderer(MentionList, {- props: { ...props },- editor: props.editor,- });- props.editor.storage.mentionsOpen = true;- // @ts-expect-error - Tippy types are incorrect- popup = tippy("body", {- getReferenceClientRect: props.clientRect,- appendTo: () => document.querySelector(".active-editor") ?? document.querySelector("#editor-container"),- content: component.element,- showOnCreate: true,- interactive: true,- trigger: "manual",- placement: "bottom-start",- });- },- onUpdate: (props: { editor: Editor; clientRect: DOMRect }) => {- component?.updateProps(props);-- if (!props.clientRect) {- return;- }-- popup &&- popup[0].setProps({- getReferenceClientRect: props.clientRect,- });- },-- onKeyDown: (props: { event: KeyboardEvent }) => {- if (props.event.key === "Escape") {- popup?.[0].hide();-- return true;- }-- const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];-- if (navigationKeys.includes(props.event.key)) {- // @ts-expect-error - Tippy types are incorrect- component?.ref?.onKeyDown(props);- event?.stopPropagation();- return true;- }- return false;- },- onExit: (props: { editor: Editor; event: KeyboardEvent }) => {- props.editor.storage.mentionsOpen = false;- popup?.[0].destroy();- component?.destroy();- },- };- },- },- });diff --git a/packages/editor/core/src/ui/mentions/suggestion.ts b/packages/editor/core/src/ui/mentions/suggestion.tsdeleted file mode 100644index 8eaf0982f4..0000000000--- a/packages/editor/core/src/ui/mentions/suggestion.ts+++ /dev/null@@ -1,17 +0,0 @@-import { v4 as uuidv4 } from "uuid";-import { IMentionSuggestion } from "src/types/mention-suggestion";--export const getSuggestionItems =- (suggestions: IMentionSuggestion[]) =>- ({ query }: { query: string }) => {- const mappedSuggestions: IMentionSuggestion[] = suggestions.map((suggestion): IMentionSuggestion => {- const transactionId = uuidv4();- return {- ...suggestion,- id: transactionId,- };- });- return mappedSuggestions- .filter((suggestion) => suggestion.title.toLowerCase().startsWith(query.toLowerCase()))- .slice(0, 5);- };diff --git a/packages/editor/core/tsconfig.json b/packages/editor/core/tsconfig.jsondeleted file mode 100644index c15534037a..0000000000--- a/packages/editor/core/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "tsconfig/react-library.json",- "include": [- "src/**/*",- "index.d.ts"- ],- "exclude": [- "dist",- "build",- "node_modules"- ],- "compilerOptions": {- "baseUrl": "."- }-}diff --git a/packages/editor/document-editor/.eslintrc.js b/packages/editor/document-editor/.eslintrc.jsdeleted file mode 100644index c8df607506..0000000000--- a/packages/editor/document-editor/.eslintrc.js+++ /dev/null@@ -1,4 +0,0 @@-module.exports = {- root: true,- extends: ["custom"],-};diff --git a/packages/editor/document-editor/.prettierignore b/packages/editor/document-editor/.prettierignoredeleted file mode 100644index 43e8a7b8ff..0000000000--- a/packages/editor/document-editor/.prettierignore+++ /dev/null@@ -1,6 +0,0 @@-.next-.vercel-.tubro-out/-dis/-build/\ No newline at end of filediff --git a/packages/editor/document-editor/.prettierrc b/packages/editor/document-editor/.prettierrcdeleted file mode 100644index 87d988f1b2..0000000000--- a/packages/editor/document-editor/.prettierrc+++ /dev/null@@ -1,5 +0,0 @@-{- "printWidth": 120,- "tabWidth": 2,- "trailingComma": "es5"-}diff --git a/packages/editor/document-editor/Readme.md b/packages/editor/document-editor/Readme.mddeleted file mode 100644index f019d6827b..0000000000--- a/packages/editor/document-editor/Readme.md+++ /dev/null@@ -1 +0,0 @@-# Document Editordiff --git a/packages/editor/document-editor/package.json b/packages/editor/document-editor/package.jsondeleted file mode 100644index b565bfedf0..0000000000--- a/packages/editor/document-editor/package.json+++ /dev/null@@ -1,67 +0,0 @@-{- "name": "@plane/document-editor",- "version": "0.21.0",- "description": "Package that powers Plane's Pages Editor",- "main": "./dist/index.mjs",- "module": "./dist/index.mjs",- "types": "./dist/index.d.mts",- "files": [- "dist/**/*"- ],- "exports": {- ".": {- "types": "./dist/index.d.mts",- "import": "./dist/index.mjs",- "module": "./dist/index.mjs"- }- },- "scripts": {- "build": "tsup --minify",- "dev": "tsup --watch",- "check-types": "tsc --noEmit",- "format": "prettier --write \"**/*.{ts,tsx,md}\""- },- "peerDependencies": {- "next": "12.3.2",- "next-themes": "^0.2.1",- "react": "^18.2.0",- "react-dom": "18.2.0"- },- "dependencies": {- "@floating-ui/react": "^0.26.4",- "@plane/editor-core": "*",- "@plane/editor-extensions": "*",- "@plane/ui": "*",- "@tippyjs/react": "^4.2.6",- "@tiptap/core": "^2.1.13",- "@tiptap/extension-collaboration": "^2.3.2",- "@tiptap/pm": "^2.1.13",- "@tiptap/suggestion": "^2.1.13",- "lucide-react": "^0.378.0",- "react-popper": "^2.3.0",- "tippy.js": "^6.3.7",- "uuid": "^9.0.1",- "y-indexeddb": "^9.0.12",- "y-prosemirror": "^1.2.5",- "y-protocols": "^1.0.6",- "yjs": "^13.6.15"- },- "devDependencies": {- "@types/node": "18.15.3",- "@types/react": "^18.2.42",- "@types/react-dom": "^18.2.17",- "eslint-config-custom": "*",- "postcss": "^8.4.38",- "tailwind-config-custom": "*",- "tsconfig": "*",- "tsup": "^7.2.0",- "typescript": "4.9.5"- },- "keywords": [- "editor",- "rich-text",- "markdown",- "nextjs",- "react"- ]-}diff --git a/packages/editor/document-editor/postcss.config.js b/packages/editor/document-editor/postcss.config.jsdeleted file mode 100644index 419fe25d10..0000000000--- a/packages/editor/document-editor/postcss.config.js+++ /dev/null@@ -1,9 +0,0 @@-// If you want to use other PostCSS plugins, see the following:-// https://tailwindcss.com/docs/using-with-preprocessors--module.exports = {- plugins: {- tailwindcss: {},- autoprefixer: {},- },- };\ No newline at end of filediff --git a/packages/editor/document-editor/src/index.ts b/packages/editor/document-editor/src/index.tsdeleted file mode 100644index 9e8407ce3f..0000000000--- a/packages/editor/document-editor/src/index.ts+++ /dev/null@@ -1,11 +0,0 @@-export { DocumentEditor, DocumentEditorWithRef } from "src/ui";-export { DocumentReadOnlyEditor, DocumentReadOnlyEditorWithRef } from "src/ui/readonly";--// hooks-export { useEditorMarkings } from "src/hooks/use-editor-markings";-// utils-export { proseMirrorJSONToBinaryString, applyUpdates, mergeUpdates } from "src/utils/yjs";--export type { EditorRefApi, EditorReadOnlyRefApi, EditorMenuItem, EditorMenuItemNames } from "@plane/editor-core";--export type { IMarking } from "src/types/editor-types";diff --git a/packages/editor/document-editor/src/types/editor-types.ts b/packages/editor/document-editor/src/types/editor-types.tsdeleted file mode 100644index 476642103c..0000000000--- a/packages/editor/document-editor/src/types/editor-types.ts+++ /dev/null@@ -1,6 +0,0 @@-export interface IMarking {- type: "heading";- level: number;- text: string;- sequence: number;-}diff --git a/packages/editor/document-editor/src/types/mark.ts b/packages/editor/document-editor/src/types/mark.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/editor/document-editor/src/types/menu-actions.d.ts b/packages/editor/document-editor/src/types/menu-actions.d.tsdeleted file mode 100644index 87e848be73..0000000000--- a/packages/editor/document-editor/src/types/menu-actions.d.ts+++ /dev/null@@ -1,13 +0,0 @@-export interface IDuplicationConfig {- action: () => Promise<void>;-}-export interface IPageLockConfig {- is_locked: boolean;- action: () => Promise<void>;- locked_by?: string;-}-export interface IPageArchiveConfig {- is_archived: boolean;- archived_at?: Date;- action: () => Promise<void>;-}diff --git a/packages/editor/document-editor/src/ui/components/index.ts b/packages/editor/document-editor/src/ui/components/index.tsdeleted file mode 100644index 4d2d76baac..0000000000--- a/packages/editor/document-editor/src/ui/components/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./page-renderer";diff --git a/packages/editor/document-editor/src/ui/extensions/index.tsx b/packages/editor/document-editor/src/ui/extensions/index.tsxdeleted file mode 100644index 10c9fa596e..0000000000--- a/packages/editor/document-editor/src/ui/extensions/index.tsx+++ /dev/null@@ -1,21 +0,0 @@-import { IssueWidgetPlaceholder } from "src/ui/extensions/widgets/issue-embed-widget";--import { SlashCommand, DragAndDrop } from "@plane/editor-extensions";-import { UploadImage } from "@plane/editor-core";-import { CollaborationProvider } from "src/providers/collaboration-provider";-import Collaboration from "@tiptap/extension-collaboration";--type TArguments = {- uploadFile: UploadImage;- setHideDragHandle?: (hideDragHandlerFromDragDrop: () => void) => void;- provider: CollaborationProvider;-};--export const DocumentEditorExtensions = ({ uploadFile, setHideDragHandle, provider }: TArguments) => [- SlashCommand(uploadFile),- DragAndDrop(setHideDragHandle),- IssueWidgetPlaceholder(),- Collaboration.configure({- document: provider.document,- }),-];diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsxdeleted file mode 100644index 35a09bcc29..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/index.tsx+++ /dev/null@@ -1,54 +0,0 @@-import { Editor, Range } from "@tiptap/react";-import { IssueEmbedSuggestions } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension";-import { getIssueSuggestionItems } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items";-import { IssueListRenderer } from "src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer";-import { v4 as uuidv4 } from "uuid";--export type CommandProps = {- editor: Editor;- range: Range;-};--export interface IIssueListSuggestion {- title: string;- priority: "high" | "low" | "medium" | "urgent";- identifier: string;- state: "Cancelled" | "In Progress" | "Todo" | "Done" | "Backlog";- command: ({ editor, range }: CommandProps) => void;-}--export const IssueSuggestions = (suggestions: any[]) => {- const mappedSuggestions: IIssueListSuggestion[] = suggestions.map((suggestion): IIssueListSuggestion => {- const transactionId = uuidv4();- return {- title: suggestion.name,- priority: suggestion.priority.toString(),- identifier: `${suggestion.project_detail.identifier}-${suggestion.sequence_id}`,- state: suggestion.state_detail && suggestion.state_detail.name ? suggestion.state_detail.name : "Todo",- command: ({ editor, range }) => {- editor- .chain()- .focus()- .insertContentAt(range, {- type: "issue-embed-component",- attrs: {- entity_identifier: suggestion.id,- id: transactionId,- title: suggestion.name,- project_identifier: suggestion.project_detail.identifier,- sequence_id: suggestion.sequence_id,- entity_name: "issue",- },- })- .run();- },- };- });-- return IssueEmbedSuggestions.configure({- suggestion: {- items: getIssueSuggestionItems(mappedSuggestions),- render: IssueListRenderer,- },- });-};diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension.tsxdeleted file mode 100644index 96a5c1325b..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-extension.tsx+++ /dev/null@@ -1,29 +0,0 @@-import { Extension, Range } from "@tiptap/core";-import { PluginKey } from "@tiptap/pm/state";-import { Editor } from "@tiptap/react";-import Suggestion from "@tiptap/suggestion";--export const IssueEmbedSuggestions = Extension.create({- name: "issue-embed-suggestions",-- addOptions() {- return {- suggestion: {- char: "#issue_",- allowSpaces: true,- command: ({ editor, range, props }: { editor: Editor; range: Range; props: any }) => {- props.command({ editor, range });- },- },- };- },- addProseMirrorPlugins() {- return [- Suggestion({- pluginKey: new PluginKey("issue-embed-suggestions"),- editor: this.editor,- ...this.options.suggestion,- }),- ];- },-});diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsxdeleted file mode 100644index df468f2eea..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-items.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { IIssueListSuggestion } from "src/ui/extensions/widgets/issue-embed-suggestion-list";--export const getIssueSuggestionItems =- (issueSuggestions: Array<IIssueListSuggestion>) =>- ({ query }: { query: string }) => {- const search = query.toLowerCase();- const filteredSuggestions = issueSuggestions.filter(- (item) =>- item.title.toLowerCase().includes(search) ||- item.identifier.toLowerCase().includes(search) ||- item.priority.toLowerCase().includes(search)- );-- return filteredSuggestions;- };diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsxdeleted file mode 100644index da6cd250cc..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-suggestion-list/issue-suggestion-renderer.tsx+++ /dev/null@@ -1,256 +0,0 @@-"use client";--import { cn } from "@plane/editor-core";-import { Editor } from "@tiptap/core";-import tippy from "tippy.js";-import { ReactRenderer } from "@tiptap/react";-import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";-import { PriorityIcon } from "@plane/ui";--const updateScrollView = (container: HTMLElement, item: HTMLElement) => {- const containerHeight = container.offsetHeight;- const itemHeight = item ? item.offsetHeight : 0;-- const top = item.offsetTop;- const bottom = top + itemHeight;-- if (top < container.scrollTop) {- // container.scrollTop = top - containerHeight;- item.scrollIntoView({- behavior: "smooth",- block: "center",- });- } else if (bottom > containerHeight + container.scrollTop) {- // container.scrollTop = bottom - containerHeight;- item.scrollIntoView({- behavior: "smooth",- block: "center",- });- }-};-interface IssueSuggestionProps {- title: string;- priority: "high" | "low" | "medium" | "urgent" | "none";- state: "Cancelled" | "In Progress" | "Todo" | "Done" | "Backlog";- identifier: string;-}--const IssueSuggestionList = ({- items,- command,- editor,-}: {- items: IssueSuggestionProps[];- command: any;- editor: Editor;- range: any;-}) => {- const [selectedIndex, setSelectedIndex] = useState(0);- const [currentSection, setCurrentSection] = useState<string>("Backlog");- const sections = ["Backlog", "In Progress", "Todo", "Done", "Cancelled"];- const [displayedItems, setDisplayedItems] = useState<{- [key: string]: IssueSuggestionProps[];- }>({});- const [displayedTotalLength, setDisplayedTotalLength] = useState(0);- const commandListContainer = useRef<HTMLDivElement>(null);-- useEffect(() => {- const newDisplayedItems: { [key: string]: IssueSuggestionProps[] } = {};- let totalLength = 0;- sections.forEach((section) => {- newDisplayedItems[section] = items.filter((item) => item.state === section).slice(0, 5);-- totalLength += newDisplayedItems[section].length;- });- setDisplayedTotalLength(totalLength);- setDisplayedItems(newDisplayedItems);- }, [items]);-- const selectItem = useCallback(- (section: string, index: number) => {- const item = displayedItems[section][index];- if (item) {- command(item);- }- },- [command, displayedItems, currentSection]- );-- useEffect(() => {- const navigationKeys = ["ArrowUp", "ArrowDown", "Enter", "Tab"];- const onKeyDown = (e: KeyboardEvent) => {- if (navigationKeys.includes(e.key)) {- // if (editor.isFocused) {- // editor.chain().blur();- // commandListContainer.current?.focus();- // }- if (e.key === "ArrowUp") {- setSelectedIndex(- (selectedIndex + displayedItems[currentSection].length - 1) % displayedItems[currentSection].length- );- return true;- }- if (e.key === "ArrowDown") {- const nextIndex = (selectedIndex + 1) % displayedItems[currentSection].length;- setSelectedIndex(nextIndex);- if (nextIndex === 4) {- const nextItems = items- .filter((item) => item.state === currentSection)- .slice(displayedItems[currentSection].length, displayedItems[currentSection].length + 5);- setDisplayedItems((prevItems) => ({- ...prevItems,- [currentSection]: [...prevItems[currentSection], ...nextItems],- }));- }- return true;- }- if (e.key === "Enter") {- selectItem(currentSection, selectedIndex);- return true;- }- if (e.key === "Tab") {- const currentSectionIndex = sections.indexOf(currentSection);- const nextSectionIndex = (currentSectionIndex + 1) % sections.length;- setCurrentSection(sections[nextSectionIndex]);- setSelectedIndex(0);- return true;- }- return false;- } else if (e.key === "Escape") {- if (!editor.isFocused) {- editor.chain().focus();- }- }- };- document.addEventListener("keydown", onKeyDown);- return () => {- document.removeEventListener("keydown", onKeyDown);- };- }, [displayedItems, selectedIndex, setSelectedIndex, selectItem, currentSection]);-- useLayoutEffect(() => {- const container = commandListContainer?.current;- if (container) {- const sectionContainer = container?.querySelector(`#${currentSection}-container`) as HTMLDivElement;- if (sectionContainer) {- updateScrollView(container, sectionContainer);- }- const sectionScrollContainer = container?.querySelector(`#${currentSection}`) as HTMLElement;- const item = sectionScrollContainer?.children[selectedIndex] as HTMLElement;- if (item && sectionScrollContainer) {- updateScrollView(sectionScrollContainer, item);- }- }- }, [selectedIndex, currentSection]);-- return displayedTotalLength > 0 ? (- <div- id="issue-list-container"- ref={commandListContainer}- className=" fixed z-[10] max-h-80 w-96 overflow-y-auto overflow-x-hidden rounded-md border border-custom-border-100 bg-custom-background-100 px-1 shadow-custom-shadow-xs transition-all"- >- {sections.map((section) => {- const sectionItems = displayedItems[section];- return (- sectionItems &&- sectionItems.length > 0 && (- <div className={"flex h-full w-full flex-col"} key={`${section}-container`} id={`${section}-container`}>- <h6- className={- "sticky top-0 z-[10] bg-custom-background-100 px-2 py-1 text-xs font-medium text-custom-text-400"- }- >- {section}- </h6>- <div key={section} id={section} className={"max-h-[140px] overflow-x-hidden overflow-y-scroll"}>- {sectionItems.map((item: IssueSuggestionProps, index: number) => (- <button- className={cn(- `flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm text-custom-text-200 hover:bg-custom-primary-100/5 hover:text-custom-text-100`,- {- "bg-custom-primary-100/5 text-custom-text-100":- section === currentSection && index === selectedIndex,- }- )}- key={item.identifier}- onClick={() => selectItem(section, index)}- >- <h5 className="whitespace-nowrap text-xs text-custom-text-300">{item.identifier}</h5>- <PriorityIcon priority={item.priority} />- <div className="w-full truncate">- <p className="flex-grow w-full truncate text-xs">{item.title}</p>- </div>- </button>- ))}- </div>- </div>- )- );- })}- </div>- ) : null;-};-export const IssueListRenderer = () => {- let component: ReactRenderer | null = null;- let popup: any | null = null;-- return {- onStart: (props: { editor: Editor; clientRect?: (() => DOMRect | null) | null }) => {- const container = document.querySelector(".frame-renderer") as HTMLElement;- component = new ReactRenderer(IssueSuggestionList, {- props,- // @ts-ignore- editor: props.editor,- });- // @ts-ignore- popup = tippy(".frame-renderer", {- flipbehavior: ["bottom", "top"],- appendTo: () => document.querySelector(".frame-renderer") as HTMLElement,- flip: true,- flipOnUpdate: true,- getReferenceClientRect: props.clientRect,- content: component.element,- showOnCreate: true,- interactive: true,- trigger: "manual",- placement: "bottom-start",- });-- container.addEventListener("scroll", () => {- popup?.[0].destroy();- });- },- onUpdate: (props: { editor: Editor; clientRect?: (() => DOMRect | null) | null }) => {- component?.updateProps(props);-- popup &&- popup[0].setProps({- getReferenceClientRect: props.clientRect,- });- },- onKeyDown: (props: { event: KeyboardEvent }) => {- if (props.event.key === "Escape") {- popup?.[0].hide();- return true;- }-- const navigationKeys = ["ArrowUp", "ArrowDown", "Enter", "Tab"];- if (navigationKeys.includes(props.event.key)) {- // @ts-ignore- component?.ref?.onKeyDown(props);- return true;- }- return false;- },- onExit: (e) => {- const container = document.querySelector(".frame-renderer") as HTMLElement;- if (container) {- container.removeEventListener("scroll", () => {});- }- popup?.[0].destroy();- setTimeout(() => {- component?.destroy();- }, 300);- },- };-};diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsxdeleted file mode 100644index 264a701521..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/index.tsx+++ /dev/null@@ -1,3 +0,0 @@-import { IssueWidget } from "src/ui/extensions/widgets/issue-embed-widget/issue-widget-node";--export const IssueWidgetPlaceholder = () => IssueWidget.configure({});diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsxdeleted file mode 100644index bc0ca00fae..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-card.tsx+++ /dev/null@@ -1,35 +0,0 @@-"use client";--// @ts-nocheck-import { Button } from "@plane/ui";-import { NodeViewWrapper } from "@tiptap/react";-import { Crown } from "lucide-react";--export const IssueWidgetCard = (props) => (- <NodeViewWrapper className="issue-embed-component m-2">- <div- className={`${- props.selected ? "border-custom-primary-200 border-[2px]" : ""- } w-full h-[100px] cursor-pointer space-y-2 rounded-md border-[0.5px] border-custom-border-200 shadow-custom-shadow-2xs`}- >- <h5 className="h-[20%] text-xs text-custom-text-300 p-2">- {props.node.attrs.project_identifier}-{props.node.attrs.sequence_id}- </h5>- <div className="relative h-[71%]">- <div className="h-full backdrop-filter backdrop-blur-[30px] bg-custom-background-80 bg-opacity-30 flex items-center w-full justify-between gap-5 mt-2.5 pl-4 pr-5 py-3 max-md:max-w-full max-md:flex-wrap relative">- <div className="flex gap-2 items-center">- <div className="rounded">- <Crown className="m-2" size={16} color="#FFBA18" />- </div>- <div className="text-custom-text text-sm">- Embed and access issues in pages seamlessly, upgrade to plane pro now.- </div>- </div>- <a href="https://plane.so/pricing" target="_blank" rel="noreferrer">- <Button>Upgrade</Button>- </a>- </div>- </div>- </div>- </NodeViewWrapper>-);diff --git a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsx b/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsxdeleted file mode 100644index 6c744927ad..0000000000--- a/packages/editor/document-editor/src/ui/extensions/widgets/issue-embed-widget/issue-widget-node.tsx+++ /dev/null@@ -1,63 +0,0 @@-import { mergeAttributes, Node } from "@tiptap/core";-import { IssueWidgetCard } from "src/ui/extensions/widgets/issue-embed-widget/issue-widget-card";-import { ReactNodeViewRenderer } from "@tiptap/react";--export const IssueWidget = Node.create({- name: "issue-embed-component",- group: "block",- atom: true,-- addAttributes() {- return {- id: {- default: null,- },- class: {- default: "w-[600px]",- },- title: {- default: null,- },- entity_name: {- default: null,- },- entity_identifier: {- default: null,- },- project_identifier: {- default: null,- },- sequence_id: {- default: null,- },- };- },-- addNodeView() {- return ReactNodeViewRenderer((props: Object) => <IssueWidgetCard {...props} />);- },-- parseHTML() {- return [- {- tag: "issue-embed-component",- getAttrs: (node: string | HTMLElement) => {- if (typeof node === "string") {- return null;- }- return {- id: node.getAttribute("id") || "",- title: node.getAttribute("title") || "",- entity_name: node.getAttribute("entity_name") || "",- entity_identifier: node.getAttribute("entity_identifier") || "",- project_identifier: node.getAttribute("project_identifier") || "",- sequence_id: node.getAttribute("sequence_id") || "",- };- },- },- ];- },- renderHTML({ HTMLAttributes }) {- return ["issue-embed-component", mergeAttributes(HTMLAttributes)];- },-});diff --git a/packages/editor/document-editor/src/ui/menu/icon.tsx b/packages/editor/document-editor/src/ui/menu/icon.tsxdeleted file mode 100644index 7ddc768436..0000000000--- a/packages/editor/document-editor/src/ui/menu/icon.tsx+++ /dev/null@@ -1,10 +0,0 @@-import React from "react";--type Props = {- iconName: string;- className?: string;-};--export const Icon: React.FC<Props> = ({ iconName, className = "" }) => (- <span className={`material-symbols-rounded text-sm font-light leading-5 ${className}`}>{iconName}</span>-);diff --git a/packages/editor/document-editor/src/ui/tooltip.tsx b/packages/editor/document-editor/src/ui/tooltip.tsxdeleted file mode 100644index 127efc7cbd..0000000000--- a/packages/editor/document-editor/src/ui/tooltip.tsx+++ /dev/null@@ -1,75 +0,0 @@-import * as React from "react";--// next-themes-import { useTheme } from "next-themes";-// tooltip2-import { Tooltip2 } from "@blueprintjs/popover2";--type Props = {- tooltipHeading?: string;- tooltipContent: string | React.ReactNode;- position?:- | "top"- | "right"- | "bottom"- | "left"- | "auto"- | "auto-end"- | "auto-start"- | "bottom-left"- | "bottom-right"- | "left-bottom"- | "left-top"- | "right-bottom"- | "right-top"- | "top-left"- | "top-right";- children: JSX.Element;- disabled?: boolean;- className?: string;- openDelay?: number;- closeDelay?: number;-};--export const Tooltip: React.FC<Props> = ({- tooltipHeading,- tooltipContent,- position = "top",- children,- disabled = false,- className = "",- openDelay = 200,- closeDelay,-}) => {- const { theme } = useTheme();-- return (- <Tooltip2- disabled={disabled}- hoverOpenDelay={openDelay}- hoverCloseDelay={closeDelay}- content={- <div- className={`relative z-50 max-w-xs gap-1 rounded-md p-2 text-xs shadow-md ${- theme === "custom" ? "bg-custom-background-100 text-custom-text-200" : "bg-black text-gray-400"- } overflow-hidden break-words ${className}`}- >- {tooltipHeading && (- <h5 className={`font-medium ${theme === "custom" ? "text-custom-text-100" : "text-white"}`}>- {tooltipHeading}- </h5>- )}- {tooltipContent}- </div>- }- position={position}- renderTarget={({ isOpen: isTooltipOpen, ref: eleReference, ...tooltipProps }) =>- React.cloneElement(children, {- ref: eleReference,- ...tooltipProps,- ...children.props,- })- }- />- );-};diff --git a/packages/editor/document-editor/src/utils/date-utils.ts b/packages/editor/document-editor/src/utils/date-utils.tsdeleted file mode 100644index 63c20a974f..0000000000--- a/packages/editor/document-editor/src/utils/date-utils.ts+++ /dev/null@@ -1,26 +0,0 @@-function isNumber(value: any) {- return typeof value === "number";-}--/**- * This method returns a date from string of type yyyy-mm-dd- * This method is recommended to use instead of new Date() as this does not introduce any timezone offsets- * @param date- * @returns date or undefined- */-export const getDate = (date: string | Date | undefined | null): Date | undefined => {- try {- if (!date || date === "") return;-- if (typeof date !== "string" && !(date instanceof String)) return date;- const [yearString, monthString, dayString] = date.substring(0, 10).split("-");- const year = parseInt(yearString);- const month = parseInt(monthString);- const day = parseInt(dayString);- if (!isNumber(year) || !isNumber(month) || !isNumber(day)) return;-- return new Date(year, month - 1, day);- } catch (e) {- return undefined;- }-};diff --git a/packages/editor/document-editor/src/utils/editor-summary-utils.ts b/packages/editor/document-editor/src/utils/editor-summary-utils.tsdeleted file mode 100644index b5160fddda..0000000000--- a/packages/editor/document-editor/src/utils/editor-summary-utils.ts+++ /dev/null@@ -1,34 +0,0 @@-import { Editor } from "@tiptap/react";-import { IMarking } from "src/types/editor-types";--function findNthH1(editor: Editor, n: number, level: number): number {- let count = 0;- let pos = 0;- editor.state.doc.descendants((node, position) => {- if (node.type.name === "heading" && node.attrs.level === level) {- count++;- if (count === n) {- pos = position;- return false;- }- }- });- return pos;-}--function scrollToNode(editor: Editor, pos: number): void {- const headingNode = editor.state.doc.nodeAt(pos);- if (headingNode) {- const headingDOM = editor.view.nodeDOM(pos);- if (headingDOM instanceof HTMLElement) {- headingDOM.scrollIntoView({ behavior: "smooth" });- }- }-}--export function scrollSummary(editor: Editor, marking: IMarking) {- if (editor) {- const pos = findNthH1(editor, marking.sequence, marking.level);- scrollToNode(editor, pos);- }-}diff --git a/packages/editor/document-editor/tailwind.config.js b/packages/editor/document-editor/tailwind.config.jsdeleted file mode 100644index f320631588..0000000000--- a/packages/editor/document-editor/tailwind.config.js+++ /dev/null@@ -1,6 +0,0 @@-const sharedConfig = require("tailwind-config-custom/tailwind.config.js");--module.exports = {- // prefix ui lib classes to avoid conflicting with the app- ...sharedConfig,-};diff --git a/packages/editor/document-editor/tsconfig.json b/packages/editor/document-editor/tsconfig.jsondeleted file mode 100644index c15534037a..0000000000--- a/packages/editor/document-editor/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "tsconfig/react-library.json",- "include": [- "src/**/*",- "index.d.ts"- ],- "exclude": [- "dist",- "build",- "node_modules"- ],- "compilerOptions": {- "baseUrl": "."- }-}diff --git a/packages/editor/document-editor/tsup.config.ts b/packages/editor/document-editor/tsup.config.tsdeleted file mode 100644index 5e89e04afa..0000000000--- a/packages/editor/document-editor/tsup.config.ts+++ /dev/null@@ -1,11 +0,0 @@-import { defineConfig, Options } from "tsup";--export default defineConfig((options: Options) => ({- entry: ["src/index.ts"],- format: ["cjs", "esm"],- dts: true,- clean: false,- external: ["react"],- injectStyle: true,- ...options,-}));diff --git a/packages/editor/extensions/.eslintrc.js b/packages/editor/extensions/.eslintrc.jsdeleted file mode 100644index c8df607506..0000000000--- a/packages/editor/extensions/.eslintrc.js+++ /dev/null@@ -1,4 +0,0 @@-module.exports = {- root: true,- extends: ["custom"],-};diff --git a/packages/editor/extensions/.prettierignore b/packages/editor/extensions/.prettierignoredeleted file mode 100644index 43e8a7b8ff..0000000000--- a/packages/editor/extensions/.prettierignore+++ /dev/null@@ -1,6 +0,0 @@-.next-.vercel-.tubro-out/-dis/-build/\ No newline at end of filediff --git a/packages/editor/extensions/.prettierrc b/packages/editor/extensions/.prettierrcdeleted file mode 100644index 87d988f1b2..0000000000--- a/packages/editor/extensions/.prettierrc+++ /dev/null@@ -1,5 +0,0 @@-{- "printWidth": 120,- "tabWidth": 2,- "trailingComma": "es5"-}diff --git a/packages/editor/extensions/Readme.md b/packages/editor/extensions/Readme.mddeleted file mode 100644index 39aca12265..0000000000--- a/packages/editor/extensions/Readme.md+++ /dev/null@@ -1,97 +0,0 @@-# @plane/editor-extensions--## Description--The `@plane/lite-text-editor` package extends from the `editor-core` package, inheriting its base functionality while adding its own unique features of Custom control over Enter key, etc.--## Key Features--- **Exported Components**: There are two components exported from the Lite text editor (with and without Ref), you can choose to use the `withRef` instance whenever you want to control the Editor’s state via a side effect of some external action from within the application code.-- `LiteTextEditor` & `LiteTextEditorWithRef`--- **Read Only Editor Instances**: We have added a really light weight _Read Only_ Editor instance for the Lite editor types (with and without Ref)- `LiteReadOnlyEditor` &`LiteReadOnlyEditorWithRef`--## LiteTextEditor--| Prop | Type | Description |-| ------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `uploadFile` | `(file: File) => Promise<string>` | A function that handles file upload. It takes a file as input and handles the process of uploading that file. |-| `deleteFile` | `(assetUrlWithWorkspaceId: string) => Promise<any>` | A function that handles deleting an image. It takes the asset url from your bucket and handles the process of deleting that image. |-| `value` | `html string` | The initial content of the editor. |-| `onEnterKeyPress` | `(e) => void` | The event that happens on Enter key press |-| `debouncedUpdatesEnabled` | `boolean` | If set to true, the `onChange` event handler is debounced, meaning it will only be invoked after the specified delay (default 1500ms) once the user has stopped typing. |-| `onChange` | `(json: any, html: string) => void` | This function is invoked whenever the content of the editor changes. It is passed the new content in both JSON and HTML formats. |-| `setIsSubmitting` | `(isSubmitting: "submitting" \| "submitted" \| "saved") => void` | This function is called to update the submission status. |-| `setShouldShowAlert` | `(showAlert: boolean) => void` | This function is used to show or hide an alert incase of content not being "saved". |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--1. Here is an example of how to use the `RichTextEditor` component--```tsx-<LiteTextEditor- onEnterKeyPress={handleSubmit(handleCommentUpdate)}- uploadFile={fileService.getUploadFileFunction(workspaceSlug)}- deleteFile={fileService.deleteImage}- value={value}- debouncedUpdatesEnabled={false}- customClassName="min-h-[50px] p-3 shadow-sm"- onChange={(comment_json: Object, comment_html: string) => {- onChange(comment_html);- }}-/>-```--2. Example of how to use the `LiteTextEditorWithRef` component--```tsx-const editorRef = useRef<any>(null);--// can use it to set the editor's value-editorRef.current?.setEditorValue(`${watch("description_html")}`);--// can use it to clear the editor-editorRef?.current?.clearEditor();--return (- <LiteTextEditorWithRef- onEnterKeyPress={handleSubmit(handleCommentUpdate)}- uploadFile={fileService.getUploadFileFunction(workspaceSlug)}- deleteFile={fileService.deleteImage}- ref={editorRef}- value={value}- debouncedUpdatesEnabled={false}- customClassName="min-h-[50px] p-3 shadow-sm"- onChange={(comment_json: Object, comment_html: string) => {- onChange(comment_html);- }}- />-);-```--## LiteReadOnlyEditor--| Prop | Type | Description |-| ------------------------------- | ------------- | --------------------------------------------------------------------- |-| `value` | `html string` | The initial content of the editor. |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--Here is an example of how to use the `RichReadOnlyEditor` component--```tsx-<LiteReadOnlyEditor- value={comment.comment_html}- customClassName="text-xs border border-custom-border-200 bg-custom-background-100"-/>-```diff --git a/packages/editor/extensions/package.json b/packages/editor/extensions/package.jsondeleted file mode 100644index 7a5d209336..0000000000--- a/packages/editor/extensions/package.json+++ /dev/null@@ -1,58 +0,0 @@-{- "name": "@plane/editor-extensions",- "version": "0.21.0",- "description": "Package that powers Plane's Editor with extensions",- "private": true,- "main": "./dist/index.mjs",- "module": "./dist/index.mjs",- "types": "./dist/index.d.mts",- "files": [- "dist/**/*"- ],- "exports": {- ".": {- "types": "./dist/index.d.mts",- "import": "./dist/index.mjs",- "module": "./dist/index.mjs"- }- },- "scripts": {- "build": "tsup --minify",- "dev": "tsup --watch",- "check-types": "tsc --noEmit"- },- "peerDependencies": {- "next": "12.3.2",- "next-themes": "^0.2.1",- "react": "^18.2.0",- "react-dom": "18.2.0"- },- "dependencies": {- "@plane/editor-core": "*",- "@plane/ui": "*",- "@tiptap/core": "^2.1.13",- "@tiptap/pm": "^2.1.13",- "@tiptap/react": "^2.1.13",- "@tiptap/suggestion": "^2.1.13",- "lucide-react": "^0.378.0",- "tippy.js": "^6.3.7"- },- "devDependencies": {- "@types/node": "18.15.3",- "@types/react": "^18.2.42",- "@types/react-dom": "^18.2.17",- "eslint-config-custom": "*",- "postcss": "^8.4.38",- "tailwind-config-custom": "*",- "tsconfig": "*",- "tsup": "^7.2.0",- "typescript": "4.9.5"- },- "keywords": [- "editor",- "rich-text",- "markdown",- "nextjs",- "react"- ]-}diff --git a/packages/editor/extensions/postcss.config.js b/packages/editor/extensions/postcss.config.jsdeleted file mode 100644index 07aa434b2b..0000000000--- a/packages/editor/extensions/postcss.config.js+++ /dev/null@@ -1,9 +0,0 @@-// If you want to use other PostCSS plugins, see the following:-// https://tailwindcss.com/docs/using-with-preprocessors--module.exports = {- plugins: {- tailwindcss: {},- autoprefixer: {},- },-};diff --git a/packages/editor/extensions/src/extensions/index.ts b/packages/editor/extensions/src/extensions/index.tsdeleted file mode 100644index 9ceeb64936..0000000000--- a/packages/editor/extensions/src/extensions/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from "./drag-drop";-export * from "./slash-commands";diff --git a/packages/editor/extensions/src/index.ts b/packages/editor/extensions/src/index.tsdeleted file mode 100644index 440de1351b..0000000000--- a/packages/editor/extensions/src/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import "src/styles/drag-drop.css";--export { DragAndDrop, SlashCommand } from "src/extensions";diff --git a/packages/editor/extensions/tailwind.config.js b/packages/editor/extensions/tailwind.config.jsdeleted file mode 100644index f320631588..0000000000--- a/packages/editor/extensions/tailwind.config.js+++ /dev/null@@ -1,6 +0,0 @@-const sharedConfig = require("tailwind-config-custom/tailwind.config.js");--module.exports = {- // prefix ui lib classes to avoid conflicting with the app- ...sharedConfig,-};diff --git a/packages/editor/extensions/tsconfig.json b/packages/editor/extensions/tsconfig.jsondeleted file mode 100644index c15534037a..0000000000--- a/packages/editor/extensions/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "tsconfig/react-library.json",- "include": [- "src/**/*",- "index.d.ts"- ],- "exclude": [- "dist",- "build",- "node_modules"- ],- "compilerOptions": {- "baseUrl": "."- }-}diff --git a/packages/editor/extensions/tsup.config.ts b/packages/editor/extensions/tsup.config.tsdeleted file mode 100644index 5e89e04afa..0000000000--- a/packages/editor/extensions/tsup.config.ts+++ /dev/null@@ -1,11 +0,0 @@-import { defineConfig, Options } from "tsup";--export default defineConfig((options: Options) => ({- entry: ["src/index.ts"],- format: ["cjs", "esm"],- dts: true,- clean: false,- external: ["react"],- injectStyle: true,- ...options,-}));diff --git a/packages/editor/lite-text-editor/.eslintrc.js b/packages/editor/lite-text-editor/.eslintrc.jsdeleted file mode 100644index c8df607506..0000000000--- a/packages/editor/lite-text-editor/.eslintrc.js+++ /dev/null@@ -1,4 +0,0 @@-module.exports = {- root: true,- extends: ["custom"],-};diff --git a/packages/editor/lite-text-editor/.prettierignore b/packages/editor/lite-text-editor/.prettierignoredeleted file mode 100644index 43e8a7b8ff..0000000000--- a/packages/editor/lite-text-editor/.prettierignore+++ /dev/null@@ -1,6 +0,0 @@-.next-.vercel-.tubro-out/-dis/-build/\ No newline at end of filediff --git a/packages/editor/lite-text-editor/.prettierrc b/packages/editor/lite-text-editor/.prettierrcdeleted file mode 100644index 87d988f1b2..0000000000--- a/packages/editor/lite-text-editor/.prettierrc+++ /dev/null@@ -1,5 +0,0 @@-{- "printWidth": 120,- "tabWidth": 2,- "trailingComma": "es5"-}diff --git a/packages/editor/lite-text-editor/Readme.md b/packages/editor/lite-text-editor/Readme.mddeleted file mode 100644index 1f10f5ff42..0000000000--- a/packages/editor/lite-text-editor/Readme.md+++ /dev/null@@ -1,97 +0,0 @@-# @plane/lite-text-editor--## Description--The `@plane/lite-text-editor` package extends from the `editor-core` package, inheriting its base functionality while adding its own unique features of Custom control over Enter key, etc.--## Key Features--- **Exported Components**: There are two components exported from the Lite text editor (with and without Ref), you can choose to use the `withRef` instance whenever you want to control the Editor’s state via a side effect of some external action from within the application code.-- `LiteTextEditor` & `LiteTextEditorWithRef`--- **Read Only Editor Instances**: We have added a really light weight _Read Only_ Editor instance for the Lite editor types (with and without Ref)- `LiteReadOnlyEditor` &`LiteReadOnlyEditorWithRef`--## LiteTextEditor--| Prop | Type | Description |-| ------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `uploadFile` | `(file: File) => Promise<string>` | A function that handles file upload. It takes a file as input and handles the process of uploading that file. |-| `deleteFile` | `(assetUrlWithWorkspaceId: string) => Promise<any>` | A function that handles deleting an image. It takes the asset url from your bucket and handles the process of deleting that image. |-| `value` | `html string` | The initial content of the editor. |-| `onEnterKeyPress` | `(e) => void` | The event that happens on Enter key press |-| `debouncedUpdatesEnabled` | `boolean` | If set to true, the `onChange` event handler is debounced, meaning it will only be invoked after the specified delay (default 1500ms) once the user has stopped typing. |-| `onChange` | `(json: any, html: string) => void` | This function is invoked whenever the content of the editor changes. It is passed the new content in both JSON and HTML formats. |-| `setIsSubmitting` | `(isSubmitting: "submitting" \| "submitted" \| "saved") => void` | This function is called to update the submission status. |-| `setShouldShowAlert` | `(showAlert: boolean) => void` | This function is used to show or hide an alert incase of content not being "saved". |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--1. Here is an example of how to use the `RichTextEditor` component--```tsx-<LiteTextEditor- onEnterKeyPress={handleSubmit(handleCommentUpdate)}- uploadFile={fileService.getUploadFileFunction(workspaceSlug)}- deleteFile={fileService.deleteImage}- value={value}- debouncedUpdatesEnabled={false}- customClassName="min-h-[50px] p-3 shadow-sm"- onChange={(comment_json: Object, comment_html: string) => {- onChange(comment_html);- }}-/>-```--2. Example of how to use the `LiteTextEditorWithRef` component--```tsx-const editorRef = useRef<any>(null);--// can use it to set the editor's value-editorRef.current?.setEditorValue(`${watch("description_html")}`);--// can use it to clear the editor-editorRef?.current?.clearEditor();--return (- <LiteTextEditorWithRef- onEnterKeyPress={handleSubmit(handleCommentUpdate)}- uploadFile={fileService.getUploadFileFunction(workspaceSlug)}- deleteFile={fileService.deleteImage}- ref={editorRef}- value={value}- debouncedUpdatesEnabled={false}- customClassName="min-h-[50px] p-3 shadow-sm"- onChange={(comment_json: Object, comment_html: string) => {- onChange(comment_html);- }}- />-);-```--## LiteReadOnlyEditor--| Prop | Type | Description |-| ------------------------------- | ------------- | --------------------------------------------------------------------- |-| `value` | `html string` | The initial content of the editor. |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--Here is an example of how to use the `RichReadOnlyEditor` component--```tsx-<LiteReadOnlyEditor- value={comment.comment_html}- customClassName="text-xs border border-custom-border-200 bg-custom-background-100"-/>-```diff --git a/packages/editor/lite-text-editor/package.json b/packages/editor/lite-text-editor/package.jsondeleted file mode 100644index 8e03e82acb..0000000000--- a/packages/editor/lite-text-editor/package.json+++ /dev/null@@ -1,53 +0,0 @@-{- "name": "@plane/lite-text-editor",- "version": "0.21.0",- "description": "Package that powers Plane's Comment Editor",- "private": true,- "main": "./dist/index.mjs",- "module": "./dist/index.mjs",- "types": "./dist/index.d.mts",- "files": [- "dist/**/*"- ],- "exports": {- ".": {- "types": "./dist/index.d.mts",- "import": "./dist/index.mjs",- "module": "./dist/index.mjs"- }- },- "scripts": {- "build": "tsup --minify",- "dev": "tsup --watch",- "check-types": "tsc --noEmit",- "format": "prettier --write \"**/*.{ts,tsx,md}\""- },- "peerDependencies": {- "next": "12.3.2",- "next-themes": "^0.2.1",- "react": "^18.2.0",- "react-dom": "18.2.0"- },- "dependencies": {- "@plane/editor-core": "*",- "@plane/ui": "*"- },- "devDependencies": {- "@types/node": "18.15.3",- "@types/react": "^18.2.42",- "@types/react-dom": "^18.2.17",- "eslint-config-custom": "*",- "postcss": "^8.4.38",- "tailwind-config-custom": "*",- "tsconfig": "*",- "tsup": "^7.2.0",- "typescript": "4.9.5"- },- "keywords": [- "editor",- "rich-text",- "markdown",- "nextjs",- "react"- ]-}diff --git a/packages/editor/lite-text-editor/postcss.config.js b/packages/editor/lite-text-editor/postcss.config.jsdeleted file mode 100644index 07aa434b2b..0000000000--- a/packages/editor/lite-text-editor/postcss.config.js+++ /dev/null@@ -1,9 +0,0 @@-// If you want to use other PostCSS plugins, see the following:-// https://tailwindcss.com/docs/using-with-preprocessors--module.exports = {- plugins: {- tailwindcss: {},- autoprefixer: {},- },-};diff --git a/packages/editor/lite-text-editor/src/index.ts b/packages/editor/lite-text-editor/src/index.tsdeleted file mode 100644index 3ca8c71db3..0000000000--- a/packages/editor/lite-text-editor/src/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export { LiteTextEditor, LiteTextEditorWithRef } from "src/ui";-export { LiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "src/ui/read-only";-export type { IMentionSuggestion, IMentionHighlight } from "@plane/editor-core";--export type { ILiteTextEditor } from "src/ui";-export type { ILiteTextReadOnlyEditor } from "src/ui/read-only";-export type { EditorRefApi, EditorReadOnlyRefApi, EditorMenuItem, EditorMenuItemNames } from "@plane/editor-core";diff --git a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx b/packages/editor/lite-text-editor/src/ui/extensions/index.tsxdeleted file mode 100644index c4b24d166a..0000000000--- a/packages/editor/lite-text-editor/src/ui/extensions/index.tsx+++ /dev/null@@ -1,3 +0,0 @@-import { EnterKeyExtension } from "src/ui/extensions/enter-key-extension";--export const LiteTextEditorExtensions = (onEnterKeyPress?: () => void) => [EnterKeyExtension(onEnterKeyPress)];diff --git a/packages/editor/lite-text-editor/src/ui/index.tsx b/packages/editor/lite-text-editor/src/ui/index.tsxdeleted file mode 100644index 77d3ca0ecf..0000000000--- a/packages/editor/lite-text-editor/src/ui/index.tsx+++ /dev/null@@ -1,87 +0,0 @@-import * as React from "react";-// editor-core-import {- IMentionSuggestion,- EditorContainer,- EditorContentWrapper,- getEditorClassNames,- useEditor,- IMentionHighlight,- EditorRefApi,- TFileHandler,-} from "@plane/editor-core";-// extensions-import { LiteTextEditorExtensions } from "src/ui/extensions";--export interface ILiteTextEditor {- initialValue: string;- value?: string | null;- fileHandler: TFileHandler;- containerClassName?: string;- editorClassName?: string;- onChange?: (json: object, html: string) => void;- forwardedRef?: React.MutableRefObject<EditorRefApi | null>;- onEnterKeyPress?: (e?: any) => void;- mentionHandler: {- highlights: () => Promise<IMentionHighlight[]>;- suggestions?: () => Promise<IMentionSuggestion[]>;- };- tabIndex?: number;- placeholder?: string | ((isFocused: boolean, value: string) => string);- id?: string;-}--const LiteTextEditor = (props: ILiteTextEditor) => {- const {- onChange,- initialValue,- fileHandler,- value,- containerClassName,- editorClassName = "",- forwardedRef,- onEnterKeyPress,- tabIndex,- mentionHandler,- placeholder = "Add comment...",- id = "",- } = props;-- const editor = useEditor({- onChange,- initialValue,- value,- id,- editorClassName,- fileHandler,- forwardedRef,- extensions: LiteTextEditorExtensions(onEnterKeyPress),- mentionHandler,- placeholder,- tabIndex,- });-- const editorContainerClassName = getEditorClassNames({- noBorder: true,- borderOnFocus: false,- containerClassName,- });-- if (!editor) return null;-- return (- <EditorContainer editor={editor} editorContainerClassName={editorContainerClassName}>- <div className="flex flex-col">- <EditorContentWrapper tabIndex={tabIndex} editor={editor} />- </div>- </EditorContainer>- );-};--const LiteTextEditorWithRef = React.forwardRef<EditorRefApi, ILiteTextEditor>((props, ref) => (- <LiteTextEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorRefApi | null>} />-));--LiteTextEditorWithRef.displayName = "LiteTextEditorWithRef";--export { LiteTextEditor, LiteTextEditorWithRef };diff --git a/packages/editor/lite-text-editor/src/ui/read-only/index.tsx b/packages/editor/lite-text-editor/src/ui/read-only/index.tsxdeleted file mode 100644index 5ceb6956ec..0000000000--- a/packages/editor/lite-text-editor/src/ui/read-only/index.tsx+++ /dev/null@@ -1,59 +0,0 @@-import * as React from "react";-import {- EditorContainer,- EditorContentWrapper,- EditorReadOnlyRefApi,- getEditorClassNames,- IMentionHighlight,- useReadOnlyEditor,-} from "@plane/editor-core";--export interface ILiteTextReadOnlyEditor {- initialValue: string;- borderOnFocus?: boolean;- containerClassName?: string;- editorClassName?: string;- forwardedRef?: React.MutableRefObject<EditorReadOnlyRefApi | null>;- mentionHandler: {- highlights: () => Promise<IMentionHighlight[]>;- };- tabIndex?: number;-}--const LiteTextReadOnlyEditor = ({- containerClassName,- editorClassName = "",- initialValue,- forwardedRef,- mentionHandler,- tabIndex,-}: ILiteTextReadOnlyEditor) => {- const editor = useReadOnlyEditor({- initialValue,- editorClassName,- forwardedRef,- mentionHandler,- });-- const editorContainerClassName = getEditorClassNames({- containerClassName,- });-- if (!editor) return null;-- return (- <EditorContainer editor={editor} editorContainerClassName={editorContainerClassName}>- <div className="flex flex-col">- <EditorContentWrapper tabIndex={tabIndex} editor={editor} />- </div>- </EditorContainer>- );-};--const LiteTextReadOnlyEditorWithRef = React.forwardRef<EditorReadOnlyRefApi, ILiteTextReadOnlyEditor>((props, ref) => (- <LiteTextReadOnlyEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorReadOnlyRefApi | null>} />-));--LiteTextReadOnlyEditorWithRef.displayName = "LiteReadOnlyEditorWithRef";--export { LiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef };diff --git a/packages/editor/lite-text-editor/tailwind.config.js b/packages/editor/lite-text-editor/tailwind.config.jsdeleted file mode 100644index f320631588..0000000000--- a/packages/editor/lite-text-editor/tailwind.config.js+++ /dev/null@@ -1,6 +0,0 @@-const sharedConfig = require("tailwind-config-custom/tailwind.config.js");--module.exports = {- // prefix ui lib classes to avoid conflicting with the app- ...sharedConfig,-};diff --git a/packages/editor/lite-text-editor/tsconfig.json b/packages/editor/lite-text-editor/tsconfig.jsondeleted file mode 100644index c15534037a..0000000000--- a/packages/editor/lite-text-editor/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "tsconfig/react-library.json",- "include": [- "src/**/*",- "index.d.ts"- ],- "exclude": [- "dist",- "build",- "node_modules"- ],- "compilerOptions": {- "baseUrl": "."- }-}diff --git a/packages/editor/lite-text-editor/tsup.config.ts b/packages/editor/lite-text-editor/tsup.config.tsdeleted file mode 100644index 5e89e04afa..0000000000--- a/packages/editor/lite-text-editor/tsup.config.ts+++ /dev/null@@ -1,11 +0,0 @@-import { defineConfig, Options } from "tsup";--export default defineConfig((options: Options) => ({- entry: ["src/index.ts"],- format: ["cjs", "esm"],- dts: true,- clean: false,- external: ["react"],- injectStyle: true,- ...options,-}));diff --git a/packages/editor/core/package.json b/packages/editor/package.jsonsimilarity index 88%rename from packages/editor/core/package.jsonrename to packages/editor/package.jsonindex d91758019e..ab3610131e 100644--- a/packages/editor/core/package.json+++ b/packages/editor/package.json@@ -1,5 +1,5 @@{- "name": "@plane/editor-core",+ "name": "@plane/editor","version": "0.21.0","description": "Core Editor that powers Plane","private": true,@@ -28,9 +28,11 @@"react-dom": "18.2.0"},"dependencies": {+ "@floating-ui/react": "^0.26.4","@plane/ui": "*","@tiptap/core": "^2.1.13","@tiptap/extension-blockquote": "^2.1.13",+ "@tiptap/extension-collaboration": "^2.3.2","@tiptap/extension-image": "^2.1.13","@tiptap/extension-list-item": "^2.1.13","@tiptap/extension-mention": "^2.1.13",@@ -54,7 +56,11 @@"react-moveable": "^0.54.2","tailwind-merge": "^1.14.0","tippy.js": "^6.3.7",- "tiptap-markdown": "^0.8.9"+ "tiptap-markdown": "^0.8.9",+ "y-indexeddb": "^9.0.12",+ "y-prosemirror": "^1.2.5",+ "y-protocols": "^1.0.6",+ "yjs": "^13.6.15"},"devDependencies": {"@types/node": "18.15.3",diff --git a/packages/editor/core/postcss.config.js b/packages/editor/postcss.config.jssimilarity index 100%rename from packages/editor/core/postcss.config.jsrename to packages/editor/postcss.config.jsdiff --git a/packages/editor/rich-text-editor/.eslintrc.js b/packages/editor/rich-text-editor/.eslintrc.jsdeleted file mode 100644index c8df607506..0000000000--- a/packages/editor/rich-text-editor/.eslintrc.js+++ /dev/null@@ -1,4 +0,0 @@-module.exports = {- root: true,- extends: ["custom"],-};diff --git a/packages/editor/rich-text-editor/.prettierignore b/packages/editor/rich-text-editor/.prettierignoredeleted file mode 100644index 43e8a7b8ff..0000000000--- a/packages/editor/rich-text-editor/.prettierignore+++ /dev/null@@ -1,6 +0,0 @@-.next-.vercel-.tubro-out/-dis/-build/\ No newline at end of filediff --git a/packages/editor/rich-text-editor/.prettierrc b/packages/editor/rich-text-editor/.prettierrcdeleted file mode 100644index 87d988f1b2..0000000000--- a/packages/editor/rich-text-editor/.prettierrc+++ /dev/null@@ -1,5 +0,0 @@-{- "printWidth": 120,- "tabWidth": 2,- "trailingComma": "es5"-}diff --git a/packages/editor/rich-text-editor/Readme.md b/packages/editor/rich-text-editor/Readme.mddeleted file mode 100644index 2e5662e306..0000000000--- a/packages/editor/rich-text-editor/Readme.md+++ /dev/null@@ -1,98 +0,0 @@-# @plane/rich-text-editor--## Description--The `@plane/rich-text-editor` package extends from the `editor-core` package, inheriting its base functionality while adding its own unique features of Slash Commands and many more.--## Key Features--- **Exported Components**: There are two components exported from the Rich text editor (with and without Ref), you can choose to use the `withRef` instance whenever you want to control the Editor’s state via a side effect of some external action from within the application code.-- `RichTextEditor` & `RichTextEditorWithRef`--- **Read Only Editor Instances**: We have added a really light weight _Read Only_ Editor instance for the Rich editor types (with and without Ref)- `RichReadOnlyEditor` &`RichReadOnlyEditorWithRef`--## RichTextEditor--| Prop | Type | Description |-| ------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `uploadFile` | `(file: File) => Promise<string>` | A function that handles file upload. It takes a file as input and handles the process of uploading that file. |-| `deleteFile` | `(assetUrlWithWorkspaceId: string) => Promise<any>` | A function that handles deleting an image. It takes the asset url from your bucket and handles the process of deleting that image. |-| `value` | `html string` | The initial content of the editor. |-| `debouncedUpdatesEnabled` | `boolean` | If set to true, the `onChange` event handler is debounced, meaning it will only be invoked after the specified delay (default 1500ms) once the user has stopped typing. |-| `onChange` | `(json: any, html: string) => void` | This function is invoked whenever the content of the editor changes. It is passed the new content in both JSON and HTML formats. |-| `setIsSubmitting` | `(isSubmitting: "submitting" \| "submitted" \| "saved") => void` | This function is called to update the submission status. |-| `setShouldShowAlert` | `(showAlert: boolean) => void` | This function is used to show or hide an alert incase of content not being "saved". |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--1. Here is an example of how to use the `RichTextEditor` component--```tsx-<RichTextEditor- uploadFile={fileService.getUploadFileFunction(workspaceSlug)}- deleteFile={fileService.deleteImage}- value={value}- debouncedUpdatesEnabled={true}- setShouldShowAlert={setShowAlert}- setIsSubmitting={setIsSubmitting}- customClassName={isAllowed ? "min-h-[150px] shadow-sm" : "!p-0 !pt-2 text-custom-text-200"}- noBorder={!isAllowed}- onChange={(description: Object, description_html: string) => {- setShowAlert(true);- setIsSubmitting("submitting");- onChange(description_html);- // custom stuff you want to do- }}-/>-```--2. Example of how to use the `RichTextEditorWithRef` component--```tsx-const editorRef = useRef<any>(null);--// can use it to set the editor's value-editorRef.current?.setEditorValue(`${watch("description_html")}`);--// can use it to clear the editor-editorRef?.current?.clearEditor();--return (- <RichTextEditorWithRef- uploadFile={fileService.getUploadFileFunction(workspaceSlug as string)}- deleteFile={fileService.deleteImage}- ref={editorRef}- debouncedUpdatesEnabled={false}- value={value}- customClassName="min-h-[150px]"- onChange={(description: Object, description_html: string) => {- onChange(description_html);- // custom stuff you want to do- }}- />-);-```--## RichReadOnlyEditor--| Prop | Type | Description |-| ------------------------------- | ------------- | --------------------------------------------------------------------- |-| `value` | `html string` | The initial content of the editor. |-| `noBorder` | `boolean` | If set to true, the editor will not have a border. |-| `borderOnFocus` | `boolean` | If set to true, the editor will show a border when it is focused. |-| `customClassName` | `string` | This is a custom CSS class that can be applied to the editor. |-| `editorContentCustomClassNames` | `string` | This is a custom CSS class that can be applied to the editor content. |--### Usage--Here is an example of how to use the `RichReadOnlyEditor` component--```tsx-<RichReadOnlyEditor value={issueDetails.description_html} customClassName="p-3 min-h-[50px] shadow-sm" />-```diff --git a/packages/editor/rich-text-editor/package.json b/packages/editor/rich-text-editor/package.jsondeleted file mode 100644index c0b3d28cc9..0000000000--- a/packages/editor/rich-text-editor/package.json+++ /dev/null@@ -1,56 +0,0 @@-{- "name": "@plane/rich-text-editor",- "version": "0.21.0",- "description": "Rich Text Editor that powers Plane",- "private": true,- "main": "./dist/index.mjs",- "module": "./dist/index.mjs",- "types": "./dist/index.d.mts",- "files": [- "dist/**/*"- ],- "exports": {- ".": {- "types": "./dist/index.d.mts",- "import": "./dist/index.mjs",- "module": "./dist/index.mjs"- }- },- "scripts": {- "build": "tsup --minify",- "dev": "tsup --watch",- "check-types": "tsc --noEmit",- "format": "prettier --write \"**/*.{ts,tsx,md}\""- },- "peerDependencies": {- "next": "12.3.2",- "next-themes": "^0.2.1",- "react": "^18.2.0",- "react-dom": "18.2.0"- },- "dependencies": {- "@plane/editor-core": "*",- "@plane/editor-extensions": "*",- "@tiptap/core": "^2.1.13",- "lucide-react": "^0.378.0"- },- "devDependencies": {- "@types/node": "18.15.3",- "@types/react": "^18.2.42",- "@types/react-dom": "^18.2.17",- "eslint-config-custom": "*",- "postcss": "^8.4.38",- "react": "^18.2.0",- "tailwind-config-custom": "*",- "tsconfig": "*",- "tsup": "^7.2.0",- "typescript": "4.9.5"- },- "keywords": [- "editor",- "rich-text",- "markdown",- "nextjs",- "react"- ]-}diff --git a/packages/editor/rich-text-editor/postcss.config.js b/packages/editor/rich-text-editor/postcss.config.jsdeleted file mode 100644index 07aa434b2b..0000000000--- a/packages/editor/rich-text-editor/postcss.config.js+++ /dev/null@@ -1,9 +0,0 @@-// If you want to use other PostCSS plugins, see the following:-// https://tailwindcss.com/docs/using-with-preprocessors--module.exports = {- plugins: {- tailwindcss: {},- autoprefixer: {},- },-};diff --git a/packages/editor/rich-text-editor/src/index.ts b/packages/editor/rich-text-editor/src/index.tsdeleted file mode 100644index ad6f043a19..0000000000--- a/packages/editor/rich-text-editor/src/index.ts+++ /dev/null@@ -1,8 +0,0 @@-export { RichTextEditor, RichTextEditorWithRef } from "src/ui";-export { RichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef } from "src/ui/read-only";--export type { IRichTextEditor } from "src/ui";--export type { IRichTextReadOnlyEditor } from "src/ui/read-only";-export type { IMentionSuggestion, IMentionHighlight } from "@plane/editor-core";-export type { EditorRefApi, EditorReadOnlyRefApi } from "@plane/editor-core";diff --git a/packages/editor/rich-text-editor/src/ui/extensions/enter-key-extension.tsx b/packages/editor/rich-text-editor/src/ui/extensions/enter-key-extension.tsxdeleted file mode 100644index 70037f0460..0000000000--- a/packages/editor/rich-text-editor/src/ui/extensions/enter-key-extension.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { Extension } from "@tiptap/core";--export const EnterKeyExtension = (onEnterKeyPress?: () => void) =>- Extension.create({- name: "enterKey",-- addKeyboardShortcuts(this) {- return {- Enter: () => {- if (onEnterKeyPress) {- onEnterKeyPress();- }- return true;- },- "Shift-Enter": ({ editor }) =>- editor.commands.first(({ commands }) => [- () => commands.newlineInCode(),- () => commands.splitListItem("listItem"),- () => commands.createParagraphNear(),- () => commands.liftEmptyBlock(),- () => commands.splitBlock(),- ]),- };- },- });diff --git a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx b/packages/editor/rich-text-editor/src/ui/extensions/index.tsxdeleted file mode 100644index 4face2cb72..0000000000--- a/packages/editor/rich-text-editor/src/ui/extensions/index.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { UploadImage } from "@plane/editor-core";-import { DragAndDrop, SlashCommand } from "@plane/editor-extensions";-import { EnterKeyExtension } from "./enter-key-extension";--type TArguments = {- uploadFile: UploadImage;- dragDropEnabled?: boolean;- setHideDragHandle?: (hideDragHandlerFromDragDrop: () => void) => void;- onEnterKeyPress?: () => void;-};--export const RichTextEditorExtensions = ({- uploadFile,- dragDropEnabled,- setHideDragHandle,- onEnterKeyPress,-}: TArguments) => [- SlashCommand(uploadFile),- dragDropEnabled === true && DragAndDrop(setHideDragHandle),- // TODO; add the extension conditionally for forms that don't require it- // EnterKeyExtension(onEnterKeyPress),-];diff --git a/packages/editor/rich-text-editor/src/ui/index.tsx b/packages/editor/rich-text-editor/src/ui/index.tsxdeleted file mode 100644index 2b8348a62d..0000000000--- a/packages/editor/rich-text-editor/src/ui/index.tsx+++ /dev/null@@ -1,113 +0,0 @@-"use client";-import * as React from "react";-// editor-core-import {- EditorContainer,- EditorContentWrapper,- getEditorClassNames,- IMentionHighlight,- IMentionSuggestion,- useEditor,- EditorRefApi,- TFileHandler,-} from "@plane/editor-core";-// extensions-import { RichTextEditorExtensions } from "src/ui/extensions";-// components-import { EditorBubbleMenu } from "src/ui/menus/bubble-menu";--export type IRichTextEditor = {- initialValue: string;- value?: string | null;- dragDropEnabled?: boolean;- fileHandler: TFileHandler;- id?: string;- containerClassName?: string;- editorClassName?: string;- onChange?: (json: object, html: string) => void;- forwardedRef?: React.MutableRefObject<EditorRefApi | null>;- debouncedUpdatesEnabled?: boolean;- mentionHandler: {- highlights: () => Promise<IMentionHighlight[]>;- suggestions: () => Promise<IMentionSuggestion[]>;- };- placeholder?: string | ((isFocused: boolean, value: string) => string);- tabIndex?: number;- onEnterKeyPress?: (e?: any) => void;-};--const RichTextEditor = (props: IRichTextEditor) => {- const {- onChange,- dragDropEnabled,- initialValue,- value,- fileHandler,- containerClassName,- editorClassName = "",- forwardedRef,- // rerenderOnPropsChange,- id = "",- placeholder,- tabIndex,- mentionHandler,- onEnterKeyPress,- } = props;-- const [hideDragHandleOnMouseLeave, setHideDragHandleOnMouseLeave] = React.useState<() => void>(() => {});-- // this essentially sets the hideDragHandle function from the DragAndDrop extension as the Plugin- // loads such that we can invoke it from react when the cursor leaves the container- const setHideDragHandleFunction = (hideDragHandlerFromDragDrop: () => void) => {- setHideDragHandleOnMouseLeave(() => hideDragHandlerFromDragDrop);- };-- const editor = useEditor({- id,- editorClassName,- fileHandler,- onChange,- initialValue,- value,- forwardedRef,- // rerenderOnPropsChange,- extensions: RichTextEditorExtensions({- uploadFile: fileHandler.upload,- dragDropEnabled,- setHideDragHandle: setHideDragHandleFunction,- onEnterKeyPress,- }),- tabIndex,- mentionHandler,- placeholder,- });-- const editorContainerClassName = getEditorClassNames({- noBorder: true,- borderOnFocus: false,- containerClassName,- });-- if (!editor) return null;-- return (- <EditorContainer- hideDragHandle={hideDragHandleOnMouseLeave}- editor={editor}- editorContainerClassName={editorContainerClassName}- >- {editor && <EditorBubbleMenu editor={editor} />}- <div className="flex flex-col">- <EditorContentWrapper tabIndex={tabIndex} editor={editor} />- </div>- </EditorContainer>- );-};--const RichTextEditorWithRef = React.forwardRef<EditorRefApi, IRichTextEditor>((props, ref) => (- <RichTextEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorRefApi | null>} />-));--RichTextEditorWithRef.displayName = "RichTextEditorWithRef";--export { RichTextEditor, RichTextEditorWithRef };diff --git a/packages/editor/rich-text-editor/src/ui/read-only/index.tsx b/packages/editor/rich-text-editor/src/ui/read-only/index.tsxdeleted file mode 100644index 3220c477ed..0000000000--- a/packages/editor/rich-text-editor/src/ui/read-only/index.tsx+++ /dev/null@@ -1,54 +0,0 @@-"use client";-import {- EditorReadOnlyRefApi,- EditorContainer,- EditorContentWrapper,- getEditorClassNames,- IMentionHighlight,- useReadOnlyEditor,-} from "@plane/editor-core";-import * as React from "react";--export interface IRichTextReadOnlyEditor {- initialValue: string;- containerClassName?: string;- editorClassName?: string;- tabIndex?: number;- forwardedRef?: React.MutableRefObject<EditorReadOnlyRefApi | null>;- mentionHandler: {- highlights: () => Promise<IMentionHighlight[]>;- };-}--const RichTextReadOnlyEditor = (props: IRichTextReadOnlyEditor) => {- const { containerClassName, editorClassName = "", initialValue, forwardedRef, mentionHandler } = props;-- const editor = useReadOnlyEditor({- initialValue,- editorClassName,- forwardedRef,- mentionHandler,- });-- const editorContainerClassName = getEditorClassNames({- containerClassName,- });-- if (!editor) return null;-- return (- <EditorContainer editor={editor} editorContainerClassName={editorContainerClassName}>- <div className="flex flex-col">- <EditorContentWrapper editor={editor} />- </div>- </EditorContainer>- );-};--const RichTextReadOnlyEditorWithRef = React.forwardRef<EditorReadOnlyRefApi, IRichTextReadOnlyEditor>((props, ref) => (- <RichTextReadOnlyEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorReadOnlyRefApi | null>} />-));--RichTextReadOnlyEditorWithRef.displayName = "RichReadOnlyEditorWithRef";--export { RichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef };diff --git a/packages/editor/rich-text-editor/tailwind.config.js b/packages/editor/rich-text-editor/tailwind.config.jsdeleted file mode 100644index f320631588..0000000000--- a/packages/editor/rich-text-editor/tailwind.config.js+++ /dev/null@@ -1,6 +0,0 @@-const sharedConfig = require("tailwind-config-custom/tailwind.config.js");--module.exports = {- // prefix ui lib classes to avoid conflicting with the app- ...sharedConfig,-};diff --git a/packages/editor/rich-text-editor/tsconfig.json b/packages/editor/rich-text-editor/tsconfig.jsondeleted file mode 100644index c15534037a..0000000000--- a/packages/editor/rich-text-editor/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "extends": "tsconfig/react-library.json",- "include": [- "src/**/*",- "index.d.ts"- ],- "exclude": [- "dist",- "build",- "node_modules"- ],- "compilerOptions": {- "baseUrl": "."- }-}diff --git a/packages/editor/rich-text-editor/tsup.config.ts b/packages/editor/rich-text-editor/tsup.config.tsdeleted file mode 100644index 5e89e04afa..0000000000--- a/packages/editor/rich-text-editor/tsup.config.ts+++ /dev/null@@ -1,11 +0,0 @@-import { defineConfig, Options } from "tsup";--export default defineConfig((options: Options) => ({- entry: ["src/index.ts"],- format: ["cjs", "esm"],- dts: true,- clean: false,- external: ["react"],- injectStyle: true,- ...options,-}));diff --git a/packages/editor/document-editor/src/providers/collaboration-provider.ts b/packages/editor/src/ce/providers/collaboration-provider.tssimilarity index 100%rename from packages/editor/document-editor/src/providers/collaboration-provider.tsrename to packages/editor/src/ce/providers/collaboration-provider.tsdiff --git a/packages/editor/src/ce/providers/index.ts b/packages/editor/src/ce/providers/index.tsnew file mode 100644index 0000000000..9ff7a505f2--- /dev/null+++ b/packages/editor/src/ce/providers/index.ts@@ -0,0 +1 @@+export * from "./collaboration-provider";diff --git a/packages/editor/src/ce/types/index.ts b/packages/editor/src/ce/types/index.tsnew file mode 100644index 0000000000..f30596cb00--- /dev/null+++ b/packages/editor/src/ce/types/index.ts@@ -0,0 +1 @@+export * from "./issue-embed";diff --git a/packages/editor/src/ce/types/issue-embed.ts b/packages/editor/src/ce/types/issue-embed.tsnew file mode 100644index 0000000000..d68d182a04--- /dev/null+++ b/packages/editor/src/ce/types/issue-embed.ts@@ -0,0 +1,17 @@+export type TEmbedConfig = {+ issue?: TIssueEmbedConfig;+};++export type TReadOnlyEmbedConfig = TEmbedConfig;++export type TIssueEmbedConfig = {+ widgetCallback: ({+ issueId,+ projectId,+ workspaceSlug,+ }: {+ issueId: string;+ projectId: string | undefined;+ workspaceSlug: string | undefined;+ }) => React.ReactNode;+};diff --git a/packages/editor/document-editor/src/ui/index.tsx b/packages/editor/src/core/components/editors/document/editor.tsxsimilarity index 81%rename from packages/editor/document-editor/src/ui/index.tsxrename to packages/editor/src/core/components/editors/document/editor.tsxindex 1cafe6de74..0684fb88cf 100644--- a/packages/editor/document-editor/src/ui/index.tsx+++ b/packages/editor/src/core/components/editors/document/editor.tsx@@ -1,47 +1,48 @@import React, { useState } from "react";-// editor-core-import {- getEditorClassNames,- EditorRefApi,- IMentionHighlight,- IMentionSuggestion,- TFileHandler,-} from "@plane/editor-core";// components-import { PageRenderer } from "src/ui/components/page-renderer";+import { PageRenderer } from "@/components/editors";+// helpers+import { getEditorClassNames } from "@/helpers/common";// hooks-import { useDocumentEditor } from "src/hooks/use-document-editor";+import { useDocumentEditor } from "@/hooks/use-document-editor";+import { TFileHandler } from "@/hooks/use-editor";+// plane editor types+import { TEmbedConfig } from "@/plane-editor/types";+// types+import { EditorRefApi, IMentionHighlight, IMentionSuggestion } from "@/types";interface IDocumentEditor {- id: string;- value: Uint8Array;- fileHandler: TFileHandler;- handleEditorReady?: (value: boolean) => void;containerClassName?: string;editorClassName?: string;- onChange: (updates: Uint8Array) => void;+ embedHandler: TEmbedConfig;+ fileHandler: TFileHandler;forwardedRef?: React.MutableRefObject<EditorRefApi | null>;+ handleEditorReady?: (value: boolean) => void;+ id: string;mentionHandler: {highlights: () => Promise<IMentionHighlight[]>;suggestions: () => Promise<IMentionSuggestion[]>;};- tabIndex?: number;+ onChange: (updates: Uint8Array) => void;placeholder?: string | ((isFocused: boolean, value: string) => string);+ tabIndex?: number;+ value: Uint8Array;}const DocumentEditor = (props: IDocumentEditor) => {const {- onChange,- id,- value,- fileHandler,containerClassName,editorClassName = "",- mentionHandler,- handleEditorReady,+ embedHandler,+ fileHandler,forwardedRef,- tabIndex,+ handleEditorReady,+ id,+ mentionHandler,+ onChange,placeholder,+ tabIndex,+ value,} = props;// statesconst [hideDragHandleOnMouseLeave, setHideDragHandleOnMouseLeave] = useState<() => void>(() => {});@@ -55,6 +56,7 @@ const DocumentEditor = (props: IDocumentEditor) => {const editor = useDocumentEditor({id,editorClassName,+ embedHandler,fileHandler,value,onChange,@@ -90,4 +92,4 @@ const DocumentEditorWithRef = React.forwardRef<EditorRefApi, IDocumentEditor>((pDocumentEditorWithRef.displayName = "DocumentEditorWithRef";-export { DocumentEditor, DocumentEditorWithRef };+export { DocumentEditorWithRef };diff --git a/packages/editor/src/core/components/editors/document/index.ts b/packages/editor/src/core/components/editors/document/index.tsnew file mode 100644index 0000000000..6c48975bd8--- /dev/null+++ b/packages/editor/src/core/components/editors/document/index.ts@@ -0,0 +1,3 @@+export * from "./editor";+export * from "./page-renderer";+export * from "./read-only-editor";diff --git a/packages/editor/document-editor/src/ui/components/page-renderer.tsx b/packages/editor/src/core/components/editors/document/page-renderer.tsxsimilarity index 95%rename from packages/editor/document-editor/src/ui/components/page-renderer.tsxrename to packages/editor/src/core/components/editors/document/page-renderer.tsxindex a6b5eb5e8a..5e1d1ef8a2 100644--- a/packages/editor/document-editor/src/ui/components/page-renderer.tsx+++ b/packages/editor/src/core/components/editors/document/page-renderer.tsx@@ -1,9 +1,4 @@import { useCallback, useRef, useState } from "react";-import { EditorContainer, EditorContentWrapper } from "@plane/editor-core";-import { Node } from "@tiptap/pm/model";-import { EditorView } from "@tiptap/pm/view";-import { Editor, ReactRenderer } from "@tiptap/react";-import { LinkView, LinkViewProps } from "./links/link-view";import {autoUpdate,computePosition,@@ -14,7 +9,13 @@ import {useFloating,useInteractions,} from "@floating-ui/react";-import BlockMenu from "../menu//block-menu";+import { Node } from "@tiptap/pm/model";+import { EditorView } from "@tiptap/pm/view";+import { Editor, ReactRenderer } from "@tiptap/react";+// components+import { EditorContainer, EditorContentWrapper } from "@/components/editors";+import { LinkView, LinkViewProps } from "@/components/links";+import { BlockMenu } from "@/components/menus";type IPageRenderer = {editor: Editor;diff --git a/packages/editor/document-editor/src/ui/readonly/index.tsx b/packages/editor/src/core/components/editors/document/read-only-editor.tsxsimilarity index 67%rename from packages/editor/document-editor/src/ui/readonly/index.tsxrename to packages/editor/src/core/components/editors/document/read-only-editor.tsxindex 0e75c2db49..9b91d9782e 100644--- a/packages/editor/document-editor/src/ui/readonly/index.tsx+++ b/packages/editor/src/core/components/editors/document/read-only-editor.tsx@@ -1,13 +1,22 @@import { forwardRef, MutableRefObject } from "react";-import { EditorReadOnlyRefApi, getEditorClassNames, IMentionHighlight, useReadOnlyEditor } from "@plane/editor-core";// components-import { PageRenderer } from "src/ui/components/page-renderer";-import { IssueWidgetPlaceholder } from "../extensions/widgets/issue-embed-widget";+import { PageRenderer } from "@/components/editors";+// extensions+import { IssueWidget } from "@/extensions";+// helpers+import { getEditorClassNames } from "@/helpers/common";+// hooks+import { useReadOnlyEditor } from "@/hooks/use-read-only-editor";+// plane web types+import { TEmbedConfig } from "@/plane-editor/types";+// types+import { EditorReadOnlyRefApi, IMentionHighlight } from "@/types";interface IDocumentReadOnlyEditor {initialValue: string;containerClassName: string;editorClassName?: string;+ embedHandler: TEmbedConfig;tabIndex?: number;handleEditorReady?: (value: boolean) => void;mentionHandler: {@@ -20,6 +29,7 @@ const DocumentReadOnlyEditor = (props: IDocumentReadOnlyEditor) => {const {containerClassName,editorClassName = "",+ embedHandler,initialValue,forwardedRef,tabIndex,@@ -32,7 +42,12 @@ const DocumentReadOnlyEditor = (props: IDocumentReadOnlyEditor) => {mentionHandler,forwardedRef,handleEditorReady,- extensions: [IssueWidgetPlaceholder()],+ extensions: [+ embedHandler?.issue &&+ IssueWidget({+ widgetCallback: embedHandler?.issue.widgetCallback,+ }),+ ],});if (!editor) {@@ -52,4 +67,4 @@ const DocumentReadOnlyEditorWithRef = forwardRef<EditorReadOnlyRefApi, IDocumentDocumentReadOnlyEditorWithRef.displayName = "DocumentReadOnlyEditorWithRef";-export { DocumentReadOnlyEditor, DocumentReadOnlyEditorWithRef };+export { DocumentReadOnlyEditorWithRef };diff --git a/packages/editor/core/src/ui/components/editor-container.tsx b/packages/editor/src/core/components/editors/editor-container.tsxsimilarity index 97%rename from packages/editor/core/src/ui/components/editor-container.tsxrename to packages/editor/src/core/components/editors/editor-container.tsxindex cfa80da905..7e515766b9 100644--- a/packages/editor/core/src/ui/components/editor-container.tsx+++ b/packages/editor/src/core/components/editors/editor-container.tsx@@ -1,6 +1,7 @@-import { Editor } from "@tiptap/react";import { FC, ReactNode } from "react";-import { cn } from "src/lib/utils";+import { Editor } from "@tiptap/react";+// helpers+import { cn } from "@/helpers/common";interface EditorContainerProps {editor: Editor | null;diff --git a/packages/editor/core/src/ui/components/editor-content.tsx b/packages/editor/src/core/components/editors/editor-content.tsxsimilarity index 89%rename from packages/editor/core/src/ui/components/editor-content.tsxrename to packages/editor/src/core/components/editors/editor-content.tsxindex a2427265c1..2a4eea7cbb 100644--- a/packages/editor/core/src/ui/components/editor-content.tsx+++ b/packages/editor/src/core/components/editors/editor-content.tsx@@ -1,6 +1,6 @@import { Editor, EditorContent } from "@tiptap/react";import { FC, ReactNode } from "react";-import { ImageResizer } from "src/ui/extensions/image/image-resize";+import { ImageResizer } from "src/core/extensions/image/image-resize";interface EditorContentProps {editor: Editor | null;diff --git a/packages/editor/src/core/components/editors/editor-wrapper.tsx b/packages/editor/src/core/components/editors/editor-wrapper.tsxnew file mode 100644index 0000000000..f583403772--- /dev/null+++ b/packages/editor/src/core/components/editors/editor-wrapper.tsx@@ -0,0 +1,69 @@+import { Editor, Extension } from "@tiptap/core";+// components+import { EditorContainer } from "@/components/editors";+// hooks+import { getEditorClassNames } from "@/helpers/common";+import { useEditor } from "@/hooks/use-editor";+// types+import { IEditorProps } from "@/types";+import { EditorContentWrapper } from "./editor-content";++type Props = IEditorProps & {+ children?: (editor: Editor) => React.ReactNode;+ extensions: Extension<any, any>[];+ hideDragHandleOnMouseLeave: () => void;+};++export const EditorWrapper: React.FC<Props> = (props) => {+ const {+ children,+ containerClassName,+ editorClassName = "",+ extensions,+ hideDragHandleOnMouseLeave,+ id = "",+ initialValue,+ fileHandler,+ forwardedRef,+ mentionHandler,+ onChange,+ placeholder,+ tabIndex,+ value,+ } = props;++ const editor = useEditor({+ editorClassName,+ extensions,+ fileHandler,+ forwardedRef,+ id,+ initialValue,+ mentionHandler,+ onChange,+ placeholder,+ tabIndex,+ value,+ });++ const editorContainerClassName = getEditorClassNames({+ noBorder: true,+ borderOnFocus: false,+ containerClassName,+ });++ if (!editor) return null;++ return (+ <EditorContainer+ hideDragHandle={hideDragHandleOnMouseLeave}+ editor={editor}+ editorContainerClassName={editorContainerClassName}+ >+ {children?.(editor)}+ <div className="flex flex-col">+ <EditorContentWrapper tabIndex={tabIndex} editor={editor} />+ </div>+ </EditorContainer>+ );+};diff --git a/packages/editor/src/core/components/editors/index.ts b/packages/editor/src/core/components/editors/index.tsnew file mode 100644index 0000000000..03ada4f726--- /dev/null+++ b/packages/editor/src/core/components/editors/index.ts@@ -0,0 +1,7 @@+export * from "./document";+export * from "./lite-text";+export * from "./rich-text";+export * from "./editor-container";+export * from "./editor-content";+export * from "./editor-wrapper";+export * from "./read-only-editor-wrapper";diff --git a/packages/editor/src/core/components/editors/lite-text/editor.tsx b/packages/editor/src/core/components/editors/lite-text/editor.tsxnew file mode 100644index 0000000000..0ef7080220--- /dev/null+++ b/packages/editor/src/core/components/editors/lite-text/editor.tsx@@ -0,0 +1,23 @@+import { forwardRef } from "react";+// components+import { EditorWrapper } from "@/components/editors/editor-wrapper";+// extensions+import { EnterKeyExtension } from "@/extensions";+// types+import { EditorRefApi, ILiteTextEditor } from "@/types";++const LiteTextEditor = (props: ILiteTextEditor) => {+ const { onEnterKeyPress } = props;++ const extensions = [EnterKeyExtension(onEnterKeyPress)];++ return <EditorWrapper {...props} extensions={extensions} hideDragHandleOnMouseLeave={() => {}} />;+};++const LiteTextEditorWithRef = forwardRef<EditorRefApi, ILiteTextEditor>((props, ref) => (+ <LiteTextEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorRefApi | null>} />+));++LiteTextEditorWithRef.displayName = "LiteTextEditorWithRef";++export { LiteTextEditorWithRef };diff --git a/packages/editor/src/core/components/editors/lite-text/index.ts b/packages/editor/src/core/components/editors/lite-text/index.tsnew file mode 100644index 0000000000..b2ba8682a3--- /dev/null+++ b/packages/editor/src/core/components/editors/lite-text/index.ts@@ -0,0 +1,2 @@+export * from "./editor";+export * from "./read-only-editor";diff --git a/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx b/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsxnew file mode 100644index 0000000000..b721c84c5d--- /dev/null+++ b/packages/editor/src/core/components/editors/lite-text/read-only-editor.tsx@@ -0,0 +1,13 @@+import { forwardRef } from "react";+// components+import { ReadOnlyEditorWrapper } from "@/components/editors";+// types+import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor } from "@/types";++const LiteTextReadOnlyEditorWithRef = forwardRef<EditorReadOnlyRefApi, ILiteTextReadOnlyEditor>((props, ref) => (+ <ReadOnlyEditorWrapper {...props} forwardedRef={ref as React.MutableRefObject<EditorReadOnlyRefApi | null>} />+));++LiteTextReadOnlyEditorWithRef.displayName = "LiteReadOnlyEditorWithRef";++export { LiteTextReadOnlyEditorWithRef };diff --git a/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx b/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsxnew file mode 100644index 0000000000..25da4d9afb--- /dev/null+++ b/packages/editor/src/core/components/editors/read-only-editor-wrapper.tsx@@ -0,0 +1,33 @@+// components+import { EditorContainer, EditorContentWrapper } from "@/components/editors";+// helpers+import { getEditorClassNames } from "@/helpers/common";+// hooks+import { useReadOnlyEditor } from "@/hooks/use-read-only-editor";+// types+import { IReadOnlyEditorProps } from "@/types";++export const ReadOnlyEditorWrapper = (props: IReadOnlyEditorProps) => {+ const { containerClassName, editorClassName = "", initialValue, forwardedRef, mentionHandler } = props;++ const editor = useReadOnlyEditor({+ initialValue,+ editorClassName,+ forwardedRef,+ mentionHandler,+ });++ const editorContainerClassName = getEditorClassNames({+ containerClassName,+ });++ if (!editor) return null;++ return (+ <EditorContainer editor={editor} editorContainerClassName={editorContainerClassName}>+ <div className="flex flex-col">+ <EditorContentWrapper editor={editor} />+ </div>+ </EditorContainer>+ );+};diff --git a/packages/editor/src/core/components/editors/rich-text/editor.tsx b/packages/editor/src/core/components/editors/rich-text/editor.tsxnew file mode 100644index 0000000000..069681dab3--- /dev/null+++ b/packages/editor/src/core/components/editors/rich-text/editor.tsx@@ -0,0 +1,46 @@+import { forwardRef, useCallback, useState } from "react";+// components+import { EditorWrapper } from "@/components/editors";+import { EditorBubbleMenu } from "@/components/menus";+// extensions+import { DragAndDrop, SlashCommand } from "@/extensions";+// types+import { EditorRefApi, IRichTextEditor } from "@/types";++const RichTextEditor = (props: IRichTextEditor) => {+ const { dragDropEnabled, fileHandler } = props;+ // states+ const [hideDragHandleOnMouseLeave, setHideDragHandleOnMouseLeave] = useState<() => void>(() => {});++ // this essentially sets the hideDragHandle function from the DragAndDrop extension as the Plugin+ // loads such that we can invoke it from react when the cursor leaves the container+ const setHideDragHandleFunction = (hideDragHandlerFromDragDrop: () => void) => {+ setHideDragHandleOnMouseLeave(() => hideDragHandlerFromDragDrop);+ };++ const getExtensions = useCallback(() => {+ const extensions = [+ SlashCommand(fileHandler.upload),+ // TODO; add the extension conditionally for forms that don't require it+ // EnterKeyExtension(onEnterKeyPress),+ ];++ if (dragDropEnabled) extensions.push(DragAndDrop(setHideDragHandleFunction));++ return extensions;+ }, [dragDropEnabled, fileHandler.upload]);++ return (+ <EditorWrapper {...props} extensions={getExtensions()} hideDragHandleOnMouseLeave={hideDragHandleOnMouseLeave}>+ {(editor) => <>{editor && <EditorBubbleMenu editor={editor} />}</>}+ </EditorWrapper>+ );+};++const RichTextEditorWithRef = forwardRef<EditorRefApi, IRichTextEditor>((props, ref) => (+ <RichTextEditor {...props} forwardedRef={ref as React.MutableRefObject<EditorRefApi | null>} />+));++RichTextEditorWithRef.displayName = "RichTextEditorWithRef";++export { RichTextEditorWithRef };diff --git a/packages/editor/src/core/components/editors/rich-text/index.ts b/packages/editor/src/core/components/editors/rich-text/index.tsnew file mode 100644index 0000000000..b2ba8682a3--- /dev/null+++ b/packages/editor/src/core/components/editors/rich-text/index.ts@@ -0,0 +1,2 @@+export * from "./editor";+export * from "./read-only-editor";diff --git a/packages/editor/src/core/components/editors/rich-text/read-only-editor.tsx b/packages/editor/src/core/components/editors/rich-text/read-only-editor.tsxnew file mode 100644index 0000000000..8bd7a837a5--- /dev/null+++ b/packages/editor/src/core/components/editors/rich-text/read-only-editor.tsx@@ -0,0 +1,12 @@+import { forwardRef } from "react";+// types+import { EditorReadOnlyRefApi, IRichTextReadOnlyEditor } from "@/types";+import { ReadOnlyEditorWrapper } from "../read-only-editor-wrapper";++const RichTextReadOnlyEditorWithRef = forwardRef<EditorReadOnlyRefApi, IRichTextReadOnlyEditor>((props, ref) => (+ <ReadOnlyEditorWrapper {...props} forwardedRef={ref as React.MutableRefObject<EditorReadOnlyRefApi | null>} />+));++RichTextReadOnlyEditorWithRef.displayName = "RichReadOnlyEditorWithRef";++export { RichTextReadOnlyEditorWithRef };diff --git a/packages/editor/src/core/components/links/index.ts b/packages/editor/src/core/components/links/index.tsnew file mode 100644index 0000000000..8e123098e8--- /dev/null+++ b/packages/editor/src/core/components/links/index.ts@@ -0,0 +1,4 @@+export * from "./link-edit-view";+export * from "./link-input-view";+export * from "./link-preview";+export * from "./link-view";diff --git a/packages/editor/document-editor/src/ui/components/links/link-edit-view.tsx b/packages/editor/src/core/components/links/link-edit-view.tsxsimilarity index 96%rename from packages/editor/document-editor/src/ui/components/links/link-edit-view.tsxrename to packages/editor/src/core/components/links/link-edit-view.tsxindex 0cee059dfe..ad8e9baeb8 100644--- a/packages/editor/document-editor/src/ui/components/links/link-edit-view.tsx+++ b/packages/editor/src/core/components/links/link-edit-view.tsx@@ -1,8 +1,10 @@-import { isValidHttpUrl } from "@plane/editor-core";+import { useEffect, useRef, useState } from "react";import { Node } from "@tiptap/pm/model";import { Link2Off } from "lucide-react";-import { useEffect, useRef, useState } from "react";-import { LinkViewProps } from "./link-view";+// components+import { LinkViewProps } from "@/components/links";+// helpers+import { isValidHttpUrl } from "@/helpers/common";const InputView = ({label,@@ -50,7 +52,7 @@ export const LinkEditView = ({};const isValidUrl = (urlString: string) => {- var urlPattern = new RegExp(+ const urlPattern = new RegExp("^(https?:\\/\\/)?" + // validate protocol"([\\w-]+\\.)+[\\w-]{2,}" + // validate domain name"|((\\d{1,3}\\.){3}\\d{1,3})" + // validate IP (v4) addressdiff --git a/packages/editor/document-editor/src/ui/components/links/link-input-view.tsx b/packages/editor/src/core/components/links/link-input-view.tsxsimilarity index 55%rename from packages/editor/document-editor/src/ui/components/links/link-input-view.tsxrename to packages/editor/src/core/components/links/link-input-view.tsxindex fa73adbe1b..a66d80e6d2 100644--- a/packages/editor/document-editor/src/ui/components/links/link-input-view.tsx+++ b/packages/editor/src/core/components/links/link-input-view.tsx@@ -1,9 +1,7 @@-import { LinkViewProps } from "./link-view";+// components+import { LinkViewProps } from "@/components/links";-export const LinkInputView = ({- viewProps,- switchView,-}: {+export const LinkInputView = ({}: {viewProps: LinkViewProps;switchView: (view: "LinkPreview" | "LinkEditView" | "LinkInputView") => void;}) => <p>LinkInputView</p>;diff --git a/packages/editor/document-editor/src/ui/components/links/link-preview.tsx b/packages/editor/src/core/components/links/link-preview.tsxsimilarity index 95%rename from packages/editor/document-editor/src/ui/components/links/link-preview.tsxrename to packages/editor/src/core/components/links/link-preview.tsxindex 0bb719d93a..1237c7c980 100644--- a/packages/editor/document-editor/src/ui/components/links/link-preview.tsx+++ b/packages/editor/src/core/components/links/link-preview.tsx@@ -1,5 +1,6 @@import { Copy, GlobeIcon, Link2Off, PencilIcon } from "lucide-react";-import { LinkViewProps } from "./link-view";+// components+import { LinkViewProps } from "@/components/links";export const LinkPreview = ({viewProps,diff --git a/packages/editor/document-editor/src/ui/components/links/link-view.tsx b/packages/editor/src/core/components/links/link-view.tsxsimilarity index 88%rename from packages/editor/document-editor/src/ui/components/links/link-view.tsxrename to packages/editor/src/core/components/links/link-view.tsxindex 9befc514cf..988250387f 100644--- a/packages/editor/document-editor/src/ui/components/links/link-view.tsx+++ b/packages/editor/src/core/components/links/link-view.tsx@@ -1,8 +1,7 @@-import { Editor } from "@tiptap/react";import { CSSProperties, useEffect, useState } from "react";-import { LinkEditView } from "./link-edit-view";-import { LinkInputView } from "./link-input-view";-import { LinkPreview } from "./link-preview";+import { Editor } from "@tiptap/react";+// components+import { LinkEditView, LinkInputView, LinkPreview } from "@/components/links";export interface LinkViewProps {view?: "LinkPreview" | "LinkEditView" | "LinkInputView";diff --git a/packages/editor/document-editor/src/ui/menu/block-menu.tsx b/packages/editor/src/core/components/menus/block-menu.tsxsimilarity index 98%rename from packages/editor/document-editor/src/ui/menu/block-menu.tsxrename to packages/editor/src/core/components/menus/block-menu.tsxindex 8a303809c5..8473f6c104 100644--- a/packages/editor/document-editor/src/ui/menu/block-menu.tsx+++ b/packages/editor/src/core/components/menus/block-menu.tsx@@ -1,13 +1,13 @@import { useCallback, useEffect, useRef } from "react";-import tippy, { Instance } from "tippy.js";import { Copy, LucideIcon, Trash2 } from "lucide-react";+import tippy, { Instance } from "tippy.js";import { Editor } from "@tiptap/react";interface BlockMenuProps {editor: Editor;}-export default function BlockMenu(props: BlockMenuProps) {+export const BlockMenu = (props: BlockMenuProps) => {const { editor } = props;const menuRef = useRef<HTMLDivElement>(null);const popup = useRef<Instance | null>(null);@@ -171,4 +171,4 @@ export default function BlockMenu(props: BlockMenuProps) {})}</div>);-}+};diff --git a/packages/editor/src/core/components/menus/bubble-menu/index.ts b/packages/editor/src/core/components/menus/bubble-menu/index.tsnew file mode 100644index 0000000000..71a98bada0--- /dev/null+++ b/packages/editor/src/core/components/menus/bubble-menu/index.ts@@ -0,0 +1,3 @@+export * from "./link-selector";+export * from "./node-selector";+export * from "./root";diff --git a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/link-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsxsimilarity index 92%rename from packages/editor/rich-text-editor/src/ui/menus/bubble-menu/link-selector.tsxrename to packages/editor/src/core/components/menus/bubble-menu/link-selector.tsxindex e45cfb3179..20335e8abb 100644--- a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/link-selector.tsx+++ b/packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx@@ -1,15 +1,17 @@+import { Dispatch, FC, SetStateAction, useCallback, useEffect, useRef } from "react";import { Editor } from "@tiptap/core";import { Check, Trash } from "lucide-react";-import { Dispatch, FC, SetStateAction, useCallback, useEffect, useRef } from "react";-import { cn, isValidHttpUrl, setLinkEditor, unsetLinkEditor } from "@plane/editor-core";+// helpers+import { cn, isValidHttpUrl } from "@/helpers/common";+import { setLinkEditor, unsetLinkEditor } from "@/helpers/editor-commands";-interface LinkSelectorProps {+type Props = {editor: Editor;isOpen: boolean;setIsOpen: Dispatch<SetStateAction<boolean>>;-}+};-export const LinkSelector: FC<LinkSelectorProps> = ({ editor, isOpen, setIsOpen }) => {+export const BubbleMenuLinkSelector: FC<Props> = ({ editor, isOpen, setIsOpen }) => {const inputRef = useRef<HTMLInputElement>(null);const onLinkSubmit = useCallback(() => {diff --git a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/node-selector.tsx b/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsxsimilarity index 92%rename from packages/editor/rich-text-editor/src/ui/menus/bubble-menu/node-selector.tsxrename to packages/editor/src/core/components/menus/bubble-menu/node-selector.tsxindex 5c1c8479f1..466d07c0db 100644--- a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/node-selector.tsx+++ b/packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx@@ -1,6 +1,9 @@+import { Dispatch, FC, SetStateAction } from "react";+import { Editor } from "@tiptap/react";+import { Check, ChevronDown } from "lucide-react";+// componentsimport {BulletListItem,- cn,HeadingOneItem,HeadingThreeItem,HeadingTwoItem,@@ -12,20 +15,18 @@ import {HeadingFourItem,HeadingFiveItem,HeadingSixItem,-} from "@plane/editor-core";-import { Editor } from "@tiptap/react";-import { Check, ChevronDown } from "lucide-react";-import { Dispatch, FC, SetStateAction } from "react";+ BubbleMenuItem,+} from "@/components/menus";+// helpers+import { cn } from "@/helpers/common";-import { BubbleMenuItem } from ".";--interface NodeSelectorProps {+type Props = {editor: Editor;isOpen: boolean;setIsOpen: Dispatch<SetStateAction<boolean>>;-}+};-export const NodeSelector: FC<NodeSelectorProps> = ({ editor, isOpen, setIsOpen }) => {+export const BubbleMenuNodeSelector: FC<Props> = ({ editor, isOpen, setIsOpen }) => {const items: BubbleMenuItem[] = [TextItem(editor),HeadingOneItem(editor),diff --git a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx b/packages/editor/src/core/components/menus/bubble-menu/root.tsxsimilarity index 91%rename from packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsxrename to packages/editor/src/core/components/menus/bubble-menu/root.tsxindex c11f0593d9..ec72f15408 100644--- a/packages/editor/rich-text-editor/src/ui/menus/bubble-menu/index.tsx+++ b/packages/editor/src/core/components/menus/bubble-menu/root.tsx@@ -1,25 +1,27 @@-import { BubbleMenu, BubbleMenuProps, isNodeSelection } from "@tiptap/react";import { FC, useEffect, useState } from "react";--import { NodeSelector } from "src/ui/menus/bubble-menu/node-selector";-import { LinkSelector } from "src/ui/menus/bubble-menu/link-selector";+import { BubbleMenu, BubbleMenuProps, isNodeSelection } from "@tiptap/react";+import { LucideIcon } from "lucide-react";+// componentsimport {BoldItem,- cn,+ BubbleMenuLinkSelector,+ BubbleMenuNodeSelector,CodeItem,- isCellSelection,ItalicItem,- LucideIconType,StrikeThroughItem,UnderLineItem,-} from "@plane/editor-core";+} from "@/components/menus";+// extensions+import { isCellSelection } from "@/extensions/table/table/utilities/is-cell-selection";+// helpers+import { cn } from "@/helpers/common";export interface BubbleMenuItem {key: string;name: string;isActive: () => boolean;command: () => void;- icon: LucideIconType;+ icon: LucideIcon;}type EditorBubbleMenuProps = Omit<BubbleMenuProps, "children">;@@ -105,7 +107,7 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props: any) => {{isSelecting ? null : (<>{!props.editor.isActive("table") && (- <NodeSelector+ <BubbleMenuNodeSelectoreditor={props.editor!}isOpen={isNodeSelectorOpen}setIsOpen={() => {@@ -115,7 +117,7 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props: any) => {/>)}{!props.editor.isActive("code") && (- <LinkSelector+ <BubbleMenuLinkSelectoreditor={props.editor}isOpen={isLinkSelectorOpen}setIsOpen={() => {diff --git a/packages/editor/src/core/components/menus/index.ts b/packages/editor/src/core/components/menus/index.tsnew file mode 100644index 0000000000..0c6964ea67--- /dev/null+++ b/packages/editor/src/core/components/menus/index.ts@@ -0,0 +1,3 @@+export * from "./bubble-menu";+export * from "./block-menu";+export * from "./menu-items";diff --git a/packages/editor/core/src/ui/menus/menu-items/index.ts b/packages/editor/src/core/components/menus/menu-items.tssimilarity index 97%rename from packages/editor/core/src/ui/menus/menu-items/index.tsrename to packages/editor/src/core/components/menus/menu-items.tsindex ab2ad8ed4a..d5c2316b91 100644--- a/packages/editor/core/src/ui/menus/menu-items/index.ts+++ b/packages/editor/src/core/components/menus/menu-items.ts@@ -17,8 +17,11 @@ import {Heading5,Heading6,CaseSensitive,+ LucideIcon,} from "lucide-react";+import { Selection } from "@tiptap/pm/state";import { Editor } from "@tiptap/react";+// helpersimport {insertImageCommand,insertTableCommand,@@ -38,17 +41,16 @@ import {toggleStrike,toggleTaskList,toggleUnderline,-} from "src/lib/editor-commands";-import { LucideIconType } from "src/types/lucide-icon";-import { UploadImage } from "src/types/upload-image";-import { Selection } from "@tiptap/pm/state";+} from "@/helpers/editor-commands";+// types+import { UploadImage } from "@/types";export interface EditorMenuItem {key: string;name: string;isActive: () => boolean;command: () => void;- icon: LucideIconType;+ icon: LucideIcon;}export const TextItem = (editor: Editor) =>diff --git a/packages/editor/core/src/ui/extensions/code-inline/index.tsx b/packages/editor/src/core/extensions/code-inline/index.tsxsimilarity index 96%rename from packages/editor/core/src/ui/extensions/code-inline/index.tsxrename to packages/editor/src/core/extensions/code-inline/index.tsxindex 60a12364ef..70270355d6 100644--- a/packages/editor/core/src/ui/extensions/code-inline/index.tsx+++ b/packages/editor/src/core/extensions/code-inline/index.tsx@@ -24,7 +24,7 @@ declare module "@tiptap/core" {}export const inputRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/;-export const pasteRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g;+const pasteRegex = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g;export const CustomCodeInlineExtension = Mark.create<CodeOptions>({name: "code",diff --git a/packages/editor/core/src/ui/extensions/code/code-block-lowlight.ts b/packages/editor/src/core/extensions/code/code-block-lowlight.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/code/code-block-lowlight.tsrename to packages/editor/src/core/extensions/code/code-block-lowlight.tsdiff --git a/packages/editor/core/src/ui/extensions/code/code-block-node-view.tsx b/packages/editor/src/core/extensions/code/code-block-node-view.tsxsimilarity index 97%rename from packages/editor/core/src/ui/extensions/code/code-block-node-view.tsxrename to packages/editor/src/core/extensions/code/code-block-node-view.tsxindex 57c6652312..2211fa2f4e 100644--- a/packages/editor/core/src/ui/extensions/code/code-block-node-view.tsx+++ b/packages/editor/src/core/extensions/code/code-block-node-view.tsx@@ -6,8 +6,10 @@ import { common, createLowlight } from "lowlight";import ts from "highlight.js/lib/languages/typescript";import { CopyIcon, CheckIcon } from "lucide-react";import { Node as ProseMirrorNode } from "@tiptap/pm/model";-import { cn } from "src/lib/utils";+// uiimport { Tooltip } from "@plane/ui";+// helpers+import { cn } from "@/helpers/common";// we just have ts support for nowconst lowlight = createLowlight(common);diff --git a/packages/editor/core/src/ui/extensions/code/code-block.ts b/packages/editor/src/core/extensions/code/code-block.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/code/code-block.tsrename to packages/editor/src/core/extensions/code/code-block.tsdiff --git a/packages/editor/core/src/ui/extensions/code/index.tsx b/packages/editor/src/core/extensions/code/index.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/code/index.tsxrename to packages/editor/src/core/extensions/code/index.tsxdiff --git a/packages/editor/core/src/ui/extensions/code/lowlight-plugin.ts b/packages/editor/src/core/extensions/code/lowlight-plugin.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/code/lowlight-plugin.tsrename to packages/editor/src/core/extensions/code/lowlight-plugin.tsdiff --git a/packages/editor/core/src/ui/extensions/code/utils/replace-code-block-with-text.ts b/packages/editor/src/core/extensions/code/utils/replace-code-block-with-text.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/code/utils/replace-code-block-with-text.tsrename to packages/editor/src/core/extensions/code/utils/replace-code-block-with-text.tsdiff --git a/packages/editor/core/src/ui/extensions/core-without-props.tsx b/packages/editor/src/core/extensions/core-without-props.tsxsimilarity index 68%rename from packages/editor/core/src/ui/extensions/core-without-props.tsxrename to packages/editor/src/core/extensions/core-without-props.tsxindex 3bb00010b5..a247173107 100644--- a/packages/editor/core/src/ui/extensions/core-without-props.tsx+++ b/packages/editor/src/core/extensions/core-without-props.tsx@@ -4,27 +4,26 @@ import TextStyle from "@tiptap/extension-text-style";import TiptapUnderline from "@tiptap/extension-underline";import Placeholder from "@tiptap/extension-placeholder";import { Markdown } from "tiptap-markdown";--import { Table } from "src/ui/extensions/table/table";-import { TableCell } from "src/ui/extensions/table/table-cell/table-cell";-import { TableHeader } from "src/ui/extensions/table/table-header/table-header";-import { TableRow } from "src/ui/extensions/table/table-row/table-row";--import { isValidHttpUrl } from "src/lib/utils";--import { CustomCodeBlockExtension } from "src/ui/extensions/code";-import { CustomKeymap } from "src/ui/extensions/keymap";-import { CustomQuoteExtension } from "src/ui/extensions/quote";--import { CustomLinkExtension } from "src/ui/extensions/custom-link";-import { CustomCodeInlineExtension } from "src/ui/extensions/code-inline";-import { CustomTypographyExtension } from "src/ui/extensions/typography";-import { CustomHorizontalRule } from "src/ui/extensions/horizontal-rule/horizontal-rule";-import { CustomCodeMarkPlugin } from "src/ui/extensions/custom-code-inline/inline-code-plugin";-import { MentionsWithoutProps } from "src/ui/mentions/mention-without-props";-import { ImageExtensionWithoutProps } from "src/ui/extensions/image/image-extension-without-props";-import StarterKit from "@tiptap/starter-kit";+// extensions+import {+ CustomCodeBlockExtension,+ CustomCodeInlineExtension,+ CustomCodeMarkPlugin,+ CustomHorizontalRule,+ CustomKeymap,+ CustomLinkExtension,+ CustomMentionWithoutProps,+ CustomQuoteExtension,+ CustomTypographyExtension,+ ImageExtensionWithoutProps,+ Table,+ TableCell,+ TableHeader,+ TableRow,+} from "@/extensions";+// helpers+import { isValidHttpUrl } from "@/helpers/common";export const CoreEditorExtensionsWithoutProps = () => [StarterKit.configure({@@ -105,7 +104,7 @@ export const CoreEditorExtensionsWithoutProps = () => [TableHeader,TableCell,TableRow,- MentionsWithoutProps(),+ CustomMentionWithoutProps(),Placeholder.configure({placeholder: ({ editor, node }) => {if (node.type.name === "heading") return `Heading ${node.attrs.level}`;diff --git a/packages/editor/core/src/ui/extensions/custom-code-inline/inline-code-plugin.ts b/packages/editor/src/core/extensions/custom-code-inline.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-code-inline/inline-code-plugin.tsrename to packages/editor/src/core/extensions/custom-code-inline.tsdiff --git a/packages/editor/core/src/ui/extensions/custom-link/index.ts b/packages/editor/src/core/extensions/custom-link/extension.tsxsimilarity index 97%rename from packages/editor/core/src/ui/extensions/custom-link/index.tsrename to packages/editor/src/core/extensions/custom-link/extension.tsxindex 88e7abfe57..e74916a8fc 100644--- a/packages/editor/core/src/ui/extensions/custom-link/index.ts+++ b/packages/editor/src/core/extensions/custom-link/extension.tsx@@ -10,9 +10,6 @@ export interface LinkProtocolOptions {optionalSlashes?: boolean;}-export const pasteRegex =- /https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;-export interface LinkOptions {/*** If enabled, it adds links as you type.diff --git a/packages/editor/core/src/ui/extensions/custom-link/helpers/autolink.ts b/packages/editor/src/core/extensions/custom-link/helpers/autolink.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-link/helpers/autolink.tsrename to packages/editor/src/core/extensions/custom-link/helpers/autolink.tsdiff --git a/packages/editor/core/src/ui/extensions/custom-link/helpers/clickHandler.ts b/packages/editor/src/core/extensions/custom-link/helpers/clickHandler.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-link/helpers/clickHandler.tsrename to packages/editor/src/core/extensions/custom-link/helpers/clickHandler.tsdiff --git a/packages/editor/core/src/ui/extensions/custom-link/helpers/pasteHandler.ts b/packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-link/helpers/pasteHandler.tsrename to packages/editor/src/core/extensions/custom-link/helpers/pasteHandler.tsdiff --git a/packages/editor/src/core/extensions/custom-link/index.ts b/packages/editor/src/core/extensions/custom-link/index.tsnew file mode 100644index 0000000000..2ce32da8ba--- /dev/null+++ b/packages/editor/src/core/extensions/custom-link/index.ts@@ -0,0 +1 @@+export * from "./extension";diff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/index.ts b/packages/editor/src/core/extensions/custom-list-keymap/index.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-list-keymap/index.tsrename to packages/editor/src/core/extensions/custom-list-keymap/index.tsdiff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers.ts b/packages/editor/src/core/extensions/custom-list-keymap/list-helpers.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/custom-list-keymap/list-helpers.tsrename to packages/editor/src/core/extensions/custom-list-keymap/list-helpers.tsdiff --git a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts b/packages/editor/src/core/extensions/custom-list-keymap/list-keymap.tssimilarity index 97%rename from packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.tsrename to packages/editor/src/core/extensions/custom-list-keymap/list-keymap.tsindex f2b6dd9995..b02517bab1 100644--- a/packages/editor/core/src/ui/extensions/custom-list-keymap/list-keymap.ts+++ b/packages/editor/src/core/extensions/custom-list-keymap/list-keymap.ts@@ -1,6 +1,6 @@import { Extension } from "@tiptap/core";-import { handleBackspace, handleDelete } from "src/ui/extensions/custom-list-keymap/list-helpers";+import { handleBackspace, handleDelete } from "src/core/extensions/custom-list-keymap/list-helpers";export type ListKeymapOptions = {listTypes: Array<{diff --git a/packages/editor/extensions/src/extensions/drag-drop.tsx b/packages/editor/src/core/extensions/drag-drop.tsxsimilarity index 99%rename from packages/editor/extensions/src/extensions/drag-drop.tsxrename to packages/editor/src/core/extensions/drag-drop.tsxindex 32867a5f17..a1496c47bf 100644--- a/packages/editor/extensions/src/extensions/drag-drop.tsx+++ b/packages/editor/src/core/extensions/drag-drop.tsx@@ -1,7 +1,6 @@import { Extension } from "@tiptap/core";--import { NodeSelection, Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";import { Fragment, Slice, Node } from "@tiptap/pm/model";+import { NodeSelection, Plugin, PluginKey, TextSelection } from "@tiptap/pm/state";// @ts-expect-error __serializeForClipboard's is not exportedimport { __serializeForClipboard, EditorView } from "@tiptap/pm/view";diff --git a/packages/editor/core/src/ui/extensions/drop.tsx b/packages/editor/src/core/extensions/drop.tsxsimilarity index 92%rename from packages/editor/core/src/ui/extensions/drop.tsxrename to packages/editor/src/core/extensions/drop.tsxindex 4bf4e2625d..d56f802d97 100644--- a/packages/editor/core/src/ui/extensions/drop.tsx+++ b/packages/editor/src/core/extensions/drop.tsx@@ -1,7 +1,9 @@import { Extension } from "@tiptap/core";import { Plugin, PluginKey } from "prosemirror-state";-import { UploadImage } from "src/types/upload-image";-import { startImageUpload } from "src/ui/plugins/image/image-upload-handler";+// plugins+import { startImageUpload } from "@/plugins/image";+// types+import { UploadImage } from "@/types";export const DropHandlerExtension = (uploadFile: UploadImage) =>Extension.create({diff --git a/packages/editor/lite-text-editor/src/ui/extensions/enter-key-extension.tsx b/packages/editor/src/core/extensions/enter-key-extension.tsxsimilarity index 100%rename from packages/editor/lite-text-editor/src/ui/extensions/enter-key-extension.tsxrename to packages/editor/src/core/extensions/enter-key-extension.tsxdiff --git a/packages/editor/core/src/ui/extensions/index.tsx b/packages/editor/src/core/extensions/extensions.tsxsimilarity index 71%rename from packages/editor/core/src/ui/extensions/index.tsxrename to packages/editor/src/core/extensions/extensions.tsxindex 2507aca36e..6094c94468 100644--- a/packages/editor/core/src/ui/extensions/index.tsx+++ b/packages/editor/src/core/extensions/extensions.tsx@@ -5,32 +5,29 @@ import TiptapUnderline from "@tiptap/extension-underline";import Placeholder from "@tiptap/extension-placeholder";import StarterKit from "@tiptap/starter-kit";import { Markdown } from "tiptap-markdown";--import { Table } from "src/ui/extensions/table/table";-import { TableCell } from "src/ui/extensions/table/table-cell/table-cell";-import { TableHeader } from "src/ui/extensions/table/table-header/table-header";-import { TableRow } from "src/ui/extensions/table/table-row/table-row";--import { ImageExtension } from "src/ui/extensions/image";--import { isValidHttpUrl } from "src/lib/utils";-import { Mentions } from "src/ui/mentions";--import { CustomCodeBlockExtension } from "src/ui/extensions/code";-import { ListKeymap } from "src/ui/extensions/custom-list-keymap";-import { CustomKeymap } from "src/ui/extensions/keymap";-import { CustomQuoteExtension } from "src/ui/extensions/quote";--import { DeleteImage } from "src/types/delete-image";-import { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion";-import { RestoreImage } from "src/types/restore-image";-import { CustomLinkExtension } from "src/ui/extensions/custom-link";-import { CustomCodeInlineExtension } from "src/ui/extensions/code-inline";-import { CustomTypographyExtension } from "src/ui/extensions/typography";-import { CustomHorizontalRule } from "src/ui/extensions/horizontal-rule/horizontal-rule";-import { CustomCodeMarkPlugin } from "src/ui/extensions/custom-code-inline/inline-code-plugin";-import { UploadImage } from "src/types/upload-image";-import { DropHandlerExtension } from "src/ui/extensions/drop";+// extensions+import {+ CustomCodeBlockExtension,+ CustomCodeInlineExtension,+ CustomCodeMarkPlugin,+ CustomHorizontalRule,+ CustomKeymap,+ CustomLinkExtension,+ CustomMention,+ CustomQuoteExtension,+ CustomTypographyExtension,+ DropHandlerExtension,+ ImageExtension,+ ListKeymap,+ Table,+ TableCell,+ TableHeader,+ TableRow,+} from "@/extensions";+// helpers+import { isValidHttpUrl } from "@/helpers/common";+// types+import { DeleteImage, IMentionHighlight, IMentionSuggestion, RestoreImage, UploadImage } from "@/types";type TArguments = {mentionConfig: {@@ -132,7 +129,7 @@ export const CoreEditorExtensions = ({TableHeader,TableCell,TableRow,- Mentions({+ CustomMention({mentionSuggestions: mentionConfig.mentionSuggestions,mentionHighlights: mentionConfig.mentionHighlights,readonly: false,diff --git a/packages/editor/core/src/ui/extensions/horizontal-rule/horizontal-rule.ts b/packages/editor/src/core/extensions/horizontal-rule.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/horizontal-rule/horizontal-rule.tsrename to packages/editor/src/core/extensions/horizontal-rule.tsdiff --git a/packages/editor/core/src/ui/extensions/image/index.tsx b/packages/editor/src/core/extensions/image/extension.tsxsimilarity index 77%rename from packages/editor/core/src/ui/extensions/image/index.tsxrename to packages/editor/src/core/extensions/image/extension.tsxindex 7ea12fb11c..7f4001dab4 100644--- a/packages/editor/core/src/ui/extensions/image/index.tsx+++ b/packages/editor/src/core/extensions/image/extension.tsx@@ -1,13 +1,12 @@-import { UploadImagesPlugin } from "src/ui/plugins/image/upload-image";+import { UploadImagesPlugin } from "src/core/plugins/image/upload-image";import ImageExt from "@tiptap/extension-image";-import { TrackImageDeletionPlugin } from "src/ui/plugins/image/delete-image";-import { DeleteImage } from "src/types/delete-image";-import { RestoreImage } from "src/types/restore-image";+import { TrackImageDeletionPlugin } from "src/core/plugins/image/delete-image";+import { DeleteImage, RestoreImage } from "@/types";import { insertLineBelowImageAction } from "./utilities/insert-line-below-image";import { insertLineAboveImageAction } from "./utilities/insert-line-above-image";-import { TrackImageRestorationPlugin } from "src/ui/plugins/image/restore-image";-import { IMAGE_NODE_TYPE } from "src/ui/plugins/image/constants";-import { ImageExtensionStorage } from "src/ui/plugins/image/types/image-node";+import { TrackImageRestorationPlugin } from "src/core/plugins/image/restore-image";+import { IMAGE_NODE_TYPE } from "src/core/plugins/image/constants";+import { ImageExtensionStorage } from "src/core/plugins/image/types/image-node";export const ImageExtension = (deleteImage: DeleteImage, restoreImage: RestoreImage, cancelUploadImage?: () => void) =>ImageExt.extend<any, ImageExtensionStorage>({diff --git a/packages/editor/core/src/ui/extensions/image/image-extension-without-props.tsx b/packages/editor/src/core/extensions/image/image-extension-without-props.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/image/image-extension-without-props.tsxrename to packages/editor/src/core/extensions/image/image-extension-without-props.tsxdiff --git a/packages/editor/core/src/ui/extensions/image/image-resize.tsx b/packages/editor/src/core/extensions/image/image-resize.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/image/image-resize.tsxrename to packages/editor/src/core/extensions/image/image-resize.tsxdiff --git a/packages/editor/src/core/extensions/image/index.ts b/packages/editor/src/core/extensions/image/index.tsnew file mode 100644index 0000000000..3e2f7518dd--- /dev/null+++ b/packages/editor/src/core/extensions/image/index.ts@@ -0,0 +1,4 @@+export * from "./extension";+export * from "./image-extension-without-props";+export * from "./image-resize";+export * from "./read-only-image";diff --git a/packages/editor/core/src/ui/extensions/image/read-only-image.tsx b/packages/editor/src/core/extensions/image/read-only-image.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/image/read-only-image.tsxrename to packages/editor/src/core/extensions/image/read-only-image.tsxdiff --git a/packages/editor/core/src/ui/extensions/image/utilities/insert-line-above-image.ts b/packages/editor/src/core/extensions/image/utilities/insert-line-above-image.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/image/utilities/insert-line-above-image.tsrename to packages/editor/src/core/extensions/image/utilities/insert-line-above-image.tsdiff --git a/packages/editor/core/src/ui/extensions/image/utilities/insert-line-below-image.ts b/packages/editor/src/core/extensions/image/utilities/insert-line-below-image.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/image/utilities/insert-line-below-image.tsrename to packages/editor/src/core/extensions/image/utilities/insert-line-below-image.tsdiff --git a/packages/editor/src/core/extensions/index.ts b/packages/editor/src/core/extensions/index.tsnew file mode 100644index 0000000000..2fb9d89743--- /dev/null+++ b/packages/editor/src/core/extensions/index.ts@@ -0,0 +1,20 @@+export * from "./code";+export * from "./code-inline";+export * from "./custom-link";+export * from "./custom-list-keymap";+export * from "./image";+export * from "./issue-embed";+export * from "./mentions";+export * from "./table";+export * from "./typography";+export * from "./core-without-props";+export * from "./custom-code-inline";+export * from "./drag-drop";+export * from "./drop";+export * from "./enter-key-extension";+export * from "./extensions";+export * from "./horizontal-rule";+export * from "./keymap";+export * from "./quote";+export * from "./read-only-extensions";+export * from "./slash-commands";diff --git a/packages/editor/src/core/extensions/issue-embed/index.ts b/packages/editor/src/core/extensions/issue-embed/index.tsnew file mode 100644index 0000000000..f6674719e4--- /dev/null+++ b/packages/editor/src/core/extensions/issue-embed/index.ts@@ -0,0 +1 @@+export * from "./widget-node";diff --git a/packages/editor/src/core/extensions/issue-embed/widget-node.tsx b/packages/editor/src/core/extensions/issue-embed/widget-node.tsxnew file mode 100644index 0000000000..a216ab6d92--- /dev/null+++ b/packages/editor/src/core/extensions/issue-embed/widget-node.tsx@@ -0,0 +1,66 @@+import { mergeAttributes, Node } from "@tiptap/core";+import { ReactNodeViewRenderer, NodeViewWrapper } from "@tiptap/react";++type Props = {+ widgetCallback: ({+ issueId,+ projectId,+ workspaceSlug,+ }: {+ issueId: string;+ projectId: string | undefined;+ workspaceSlug: string | undefined;+ }) => React.ReactNode;+};++export const IssueWidget = (props: Props) =>+ Node.create({+ name: "issue-embed-component",+ group: "block",+ atom: true,+ selectable: true,+ draggable: true,++ addAttributes() {+ return {+ entity_identifier: {+ default: undefined,+ },+ project_identifier: {+ default: undefined,+ },+ workspace_identifier: {+ default: undefined,+ },+ id: {+ default: undefined,+ },+ entity_name: {+ default: undefined,+ },+ };+ },++ addNodeView() {+ return ReactNodeViewRenderer((issueProps: any) => (+ <NodeViewWrapper>+ {props.widgetCallback({+ issueId: issueProps.node.attrs.entity_identifier,+ projectId: issueProps.node.attrs.project_identifier,+ workspaceSlug: issueProps.node.attrs.workspace_identifier,+ })}+ </NodeViewWrapper>+ ));+ },++ parseHTML() {+ return [+ {+ tag: "issue-embed-component",+ },+ ];+ },+ renderHTML({ HTMLAttributes }) {+ return ["issue-embed-component", mergeAttributes(HTMLAttributes)];+ },+ });diff --git a/packages/editor/core/src/ui/extensions/keymap.tsx b/packages/editor/src/core/extensions/keymap.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/keymap.tsxrename to packages/editor/src/core/extensions/keymap.tsxdiff --git a/packages/editor/core/src/ui/mentions/index.tsx b/packages/editor/src/core/extensions/mentions/extension.tsxsimilarity index 64%rename from packages/editor/core/src/ui/mentions/index.tsxrename to packages/editor/src/core/extensions/mentions/extension.tsxindex 838622cbba..f6777cafcd 100644--- a/packages/editor/core/src/ui/mentions/index.tsx+++ b/packages/editor/src/core/extensions/mentions/extension.tsx@@ -1,12 +1,18 @@-import { CustomMention } from "src/ui/mentions/custom";-import { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion";-import { ReactRenderer } from "@tiptap/react";-import { Editor } from "@tiptap/core";+import Mention, { MentionOptions } from "@tiptap/extension-mention";+import { ReactNodeViewRenderer, ReactRenderer } from "@tiptap/react";+import { Editor, mergeAttributes } from "@tiptap/core";import tippy from "tippy.js";+// extensions+import { MentionList, MentionNodeView } from "@/extensions";+// types+import { IMentionHighlight, IMentionSuggestion } from "@/types";-import { MentionList } from "src/ui/mentions/mention-list";+export interface CustomMentionOptions extends MentionOptions {+ mentionHighlights: () => Promise<IMentionHighlight[]>;+ readonly?: boolean;+}-export const Mentions = ({+export const CustomMention = ({mentionHighlights,mentionSuggestions,readonly,@@ -15,14 +21,58 @@ export const Mentions = ({mentionHighlights?: () => Promise<IMentionHighlight[]>;readonly: boolean;}) =>- CustomMention.configure({+ Mention.extend<CustomMentionOptions>({+ addStorage(this) {+ return {+ mentionsOpen: false,+ };+ },+ addAttributes() {+ return {+ id: {+ default: null,+ },+ label: {+ default: null,+ },+ target: {+ default: null,+ },+ self: {+ default: false,+ },+ redirect_uri: {+ default: "/",+ },+ entity_identifier: {+ default: null,+ },+ entity_name: {+ default: null,+ },+ };+ },++ addNodeView() {+ return ReactNodeViewRenderer(MentionNodeView);+ },++ parseHTML() {+ return [+ {+ tag: "mention-component",+ },+ ];+ },+ renderHTML({ HTMLAttributes }) {+ return ["mention-component", mergeAttributes(HTMLAttributes)];+ },HTMLAttributes: {class: "mention",},readonly: readonly,mentionHighlights: mentionHighlights,suggestion: {- // @ts-expect-error - Tiptap types are incorrectrender: () => {if (!mentionSuggestions) return;let component: ReactRenderer | null = null;diff --git a/packages/editor/src/core/extensions/mentions/index.ts b/packages/editor/src/core/extensions/mentions/index.tsnew file mode 100644index 0000000000..c7f2317a7b--- /dev/null+++ b/packages/editor/src/core/extensions/mentions/index.ts@@ -0,0 +1,4 @@+export * from "./extension";+export * from "./mention-node-view";+export * from "./mentions-list";+export * from "./mentions-without-props";diff --git a/packages/editor/core/src/ui/mentions/mention-node-view.tsx b/packages/editor/src/core/extensions/mentions/mention-node-view.tsxsimilarity index 92%rename from packages/editor/core/src/ui/mentions/mention-node-view.tsxrename to packages/editor/src/core/extensions/mentions/mention-node-view.tsxindex 2100bd24a4..87bdacfe81 100644--- a/packages/editor/core/src/ui/mentions/mention-node-view.tsx+++ b/packages/editor/src/core/extensions/mentions/mention-node-view.tsx@@ -1,9 +1,11 @@/* eslint-disable react/display-name */// @ts-nocheck-import { NodeViewWrapper } from "@tiptap/react";-import { cn } from "src/lib/utils";-import { IMentionHighlight } from "src/types/mention-suggestion";import { useEffect, useState } from "react";+import { NodeViewWrapper } from "@tiptap/react";+// helpers+import { cn } from "@/helpers/common";+// types+import { IMentionHighlight } from "@/types";// eslint-disable-next-line import/no-anonymous-default-exportexport const MentionNodeView = (props) => {diff --git a/packages/editor/core/src/ui/mentions/mention-list.tsx b/packages/editor/src/core/extensions/mentions/mentions-list.tsxsimilarity index 97%rename from packages/editor/core/src/ui/mentions/mention-list.tsxrename to packages/editor/src/core/extensions/mentions/mentions-list.tsxindex dc67d26aef..6ca6ba8eb1 100644--- a/packages/editor/core/src/ui/mentions/mention-list.tsx+++ b/packages/editor/src/core/extensions/mentions/mentions-list.tsx@@ -1,11 +1,14 @@"use client";-import { Editor } from "@tiptap/react";import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";-import { cn } from "src/lib/utils";-import { IMentionSuggestion } from "src/types/mention-suggestion";+import { Editor } from "@tiptap/react";import { v4 as uuidv4 } from "uuid";+// uiimport { Avatar } from "@plane/ui";+// helpers+import { cn } from "@/helpers/common";+// types+import { IMentionSuggestion } from "@/types";interface MentionListProps {command: (item: {diff --git a/packages/editor/src/core/extensions/mentions/mentions-without-props.tsx b/packages/editor/src/core/extensions/mentions/mentions-without-props.tsxnew file mode 100644index 0000000000..60a005bfd1--- /dev/null+++ b/packages/editor/src/core/extensions/mentions/mentions-without-props.tsx@@ -0,0 +1,50 @@+import Mention from "@tiptap/extension-mention";+import { ReactNodeViewRenderer } from "@tiptap/react";+import { mergeAttributes } from "@tiptap/core";+// extensions+import { CustomMentionOptions, MentionNodeView } from "@/extensions";++export const CustomMentionWithoutProps = () =>+ Mention.extend<CustomMentionOptions>({+ addAttributes() {+ return {+ id: {+ default: null,+ },+ label: {+ default: null,+ },+ target: {+ default: null,+ },+ self: {+ default: false,+ },+ redirect_uri: {+ default: "/",+ },+ entity_identifier: {+ default: null,+ },+ entity_name: {+ default: null,+ },+ };+ },+ addNodeView() {+ return ReactNodeViewRenderer(MentionNodeView);+ },+ parseHTML() {+ return [+ {+ tag: "mention-component",+ },+ ];+ },+ renderHTML({ HTMLAttributes }) {+ return ["mention-component", mergeAttributes(HTMLAttributes)];+ },+ HTMLAttributes: {+ class: "mention",+ },+ });diff --git a/packages/editor/core/src/ui/extensions/quote/index.tsx b/packages/editor/src/core/extensions/quote.tsxsimilarity index 100%rename from packages/editor/core/src/ui/extensions/quote/index.tsxrename to packages/editor/src/core/extensions/quote.tsxdiff --git a/packages/editor/core/src/ui/read-only/extensions.tsx b/packages/editor/src/core/extensions/read-only-extensions.tsxsimilarity index 68%rename from packages/editor/core/src/ui/read-only/extensions.tsxrename to packages/editor/src/core/extensions/read-only-extensions.tsxindex 3f0cd98c3c..88988e5cad 100644--- a/packages/editor/core/src/ui/read-only/extensions.tsx+++ b/packages/editor/src/core/extensions/read-only-extensions.tsx@@ -4,22 +4,25 @@ import TextStyle from "@tiptap/extension-text-style";import TaskItem from "@tiptap/extension-task-item";import TaskList from "@tiptap/extension-task-list";import { Markdown } from "tiptap-markdown";--import { TableHeader } from "src/ui/extensions/table/table-header/table-header";-import { Table } from "src/ui/extensions/table/table";-import { TableCell } from "src/ui/extensions/table/table-cell/table-cell";-import { TableRow } from "src/ui/extensions/table/table-row/table-row";--import { ReadOnlyImageExtension } from "src/ui/extensions/image/read-only-image";-import { isValidHttpUrl } from "src/lib/utils";-import { Mentions } from "src/ui/mentions";-import { IMentionHighlight } from "src/types/mention-suggestion";-import { CustomLinkExtension } from "src/ui/extensions/custom-link";-import { CustomHorizontalRule } from "src/ui/extensions/horizontal-rule/horizontal-rule";-import { CustomQuoteExtension } from "src/ui/extensions/quote";-import { CustomTypographyExtension } from "src/ui/extensions/typography";-import { CustomCodeBlockExtension } from "src/ui/extensions/code";-import { CustomCodeInlineExtension } from "src/ui/extensions/code-inline";+// helpers+import { isValidHttpUrl } from "@/helpers/common";+// extensions+import {+ CustomQuoteExtension,+ CustomHorizontalRule,+ CustomLinkExtension,+ CustomTypographyExtension,+ ReadOnlyImageExtension,+ CustomCodeBlockExtension,+ CustomCodeInlineExtension,+ TableHeader,+ TableCell,+ TableRow,+ Table,+ CustomMention,+} from "@/extensions";+// types+import { IMentionHighlight } from "@/types";export const CoreReadOnlyEditorExtensions = (mentionConfig: {mentionHighlights?: () => Promise<IMentionHighlight[]>;@@ -97,7 +100,7 @@ export const CoreReadOnlyEditorExtensions = (mentionConfig: {TableHeader,TableCell,TableRow,- Mentions({+ CustomMention({mentionHighlights: mentionConfig.mentionHighlights,readonly: true,}),diff --git a/packages/editor/extensions/src/extensions/slash-commands.tsx b/packages/editor/src/core/extensions/slash-commands.tsxsimilarity index 97%rename from packages/editor/extensions/src/extensions/slash-commands.tsxrename to packages/editor/src/core/extensions/slash-commands.tsxindex 7844700bf7..9f9abaee7f 100644--- a/packages/editor/extensions/src/extensions/slash-commands.tsx+++ b/packages/editor/src/core/extensions/slash-commands.tsx@@ -17,11 +17,9 @@ import {Quote,Table,} from "lucide-react";+// helpers+import { cn } from "@/helpers/common";import {- UploadImage,- ISlashCommandItem,- CommandProps,- cn,insertTableCommand,toggleBlockquote,toggleBulletList,@@ -31,7 +29,9 @@ import {toggleHeadingOne,toggleHeadingTwo,toggleHeadingThree,-} from "@plane/editor-core";+} from "@/helpers/editor-commands";+// types+import { CommandProps, ISlashCommandItem, UploadImage } from "@/types";interface CommandItemProps {key: string;@@ -183,9 +183,7 @@ const getSuggestionItems =description: "Capture a code snippet.",searchTerms: ["codeblock"],icon: <Code2 className="h-3.5 w-3.5" />,- command: ({ editor, range }: CommandProps) =>- // @ts-expect-error I have to move this to the core- editor.chain().focus().deleteRange(range).toggleCodeBlock().run(),+ command: ({ editor, range }: CommandProps) => editor.chain().focus().deleteRange(range).toggleCodeBlock().run(),},{key: "image",@@ -204,7 +202,6 @@ const getSuggestionItems =searchTerms: ["line", "divider", "horizontal", "rule", "separate"],icon: <MinusSquare className="h-3.5 w-3.5" />,command: ({ editor, range }: CommandProps) => {- // @ts-expect-error I have to move this to the coreeditor.chain().focus().deleteRange(range).setHorizontalRule().run();},},diff --git a/packages/editor/src/core/extensions/table/index.ts b/packages/editor/src/core/extensions/table/index.tsnew file mode 100644index 0000000000..2277e09ae4--- /dev/null+++ b/packages/editor/src/core/extensions/table/index.ts@@ -0,0 +1,4 @@+export * from "./table";+export * from "./table-cell";+export * from "./table-header";+export * from "./table-row";diff --git a/packages/editor/core/src/ui/extensions/table/table-cell/index.ts b/packages/editor/src/core/extensions/table/table-cell/index.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-cell/index.tsrename to packages/editor/src/core/extensions/table/table-cell/index.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table-cell/table-cell.ts b/packages/editor/src/core/extensions/table/table-cell/table-cell.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-cell/table-cell.tsrename to packages/editor/src/core/extensions/table/table-cell/table-cell.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table-header/index.ts b/packages/editor/src/core/extensions/table/table-header/index.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-header/index.tsrename to packages/editor/src/core/extensions/table/table-header/index.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table-header/table-header.ts b/packages/editor/src/core/extensions/table/table-header/table-header.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-header/table-header.tsrename to packages/editor/src/core/extensions/table/table-header/table-header.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table-row/index.ts b/packages/editor/src/core/extensions/table/table-row/index.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-row/index.tsrename to packages/editor/src/core/extensions/table/table-row/index.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table-row/table-row.ts b/packages/editor/src/core/extensions/table/table-row/table-row.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table-row/table-row.tsrename to packages/editor/src/core/extensions/table/table-row/table-row.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/icons.ts b/packages/editor/src/core/extensions/table/table/icons.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/icons.tsrename to packages/editor/src/core/extensions/table/table/icons.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/index.ts b/packages/editor/src/core/extensions/table/table/index.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/index.tsrename to packages/editor/src/core/extensions/table/table/index.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/table-controls.ts b/packages/editor/src/core/extensions/table/table/table-controls.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/table-controls.tsrename to packages/editor/src/core/extensions/table/table/table-controls.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/table-view.tsx b/packages/editor/src/core/extensions/table/table/table-view.tsxsimilarity index 99%rename from packages/editor/core/src/ui/extensions/table/table/table-view.tsxrename to packages/editor/src/core/extensions/table/table/table-view.tsxindex d4dfcf5c7c..347e82171c 100644--- a/packages/editor/core/src/ui/extensions/table/table/table-view.tsx+++ b/packages/editor/src/core/extensions/table/table/table-view.tsx@@ -6,7 +6,7 @@ import tippy, { Instance, Props } from "tippy.js";import { Editor } from "@tiptap/core";import { CellSelection, TableMap, updateColumnsOnResize } from "@tiptap/pm/tables";-import { icons } from "src/ui/extensions/table/table/icons";+import { icons } from "src/core/extensions/table/table/icons";type ToolboxItem = {label: string;diff --git a/packages/editor/core/src/ui/extensions/table/table/table.ts b/packages/editor/src/core/extensions/table/table/table.tssimilarity index 95%rename from packages/editor/core/src/ui/extensions/table/table/table.tsrename to packages/editor/src/core/extensions/table/table/table.tsindex c1f65feec3..4299ff2216 100644--- a/packages/editor/core/src/ui/extensions/table/table/table.ts+++ b/packages/editor/src/core/extensions/table/table/table.ts@@ -21,10 +21,10 @@ import {toggleHeaderCell,} from "@tiptap/pm/tables";-import { tableControls } from "src/ui/extensions/table/table/table-controls";-import { TableView } from "src/ui/extensions/table/table/table-view";-import { createTable } from "src/ui/extensions/table/table/utilities/create-table";-import { deleteTableWhenAllCellsSelected } from "src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected";+import { tableControls } from "src/core/extensions/table/table/table-controls";+import { TableView } from "src/core/extensions/table/table/table-view";+import { createTable } from "src/core/extensions/table/table/utilities/create-table";+import { deleteTableWhenAllCellsSelected } from "src/core/extensions/table/table/utilities/delete-table-when-all-cells-selected";import { insertLineBelowTableAction } from "./utilities/insert-line-below-table-action";import { insertLineAboveTableAction } from "./utilities/insert-line-above-table-action";diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/create-cell.ts b/packages/editor/src/core/extensions/table/table/utilities/create-cell.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/utilities/create-cell.tsrename to packages/editor/src/core/extensions/table/table/utilities/create-cell.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts b/packages/editor/src/core/extensions/table/table/utilities/create-table.tssimilarity index 84%rename from packages/editor/core/src/ui/extensions/table/table/utilities/create-table.tsrename to packages/editor/src/core/extensions/table/table/utilities/create-table.tsindex 7299dd442d..cede65cbc6 100644--- a/packages/editor/core/src/ui/extensions/table/table/utilities/create-table.ts+++ b/packages/editor/src/core/extensions/table/table/utilities/create-table.ts@@ -1,7 +1,7 @@import { Fragment, Node as ProsemirrorNode, Schema } from "@tiptap/pm/model";-import { createCell } from "src/ui/extensions/table/table/utilities/create-cell";-import { getTableNodeTypes } from "src/ui/extensions/table/table/utilities/get-table-node-types";+import { createCell } from "src/core/extensions/table/table/utilities/create-cell";+import { getTableNodeTypes } from "src/core/extensions/table/table/utilities/get-table-node-types";export function createTable(schema: Schema,diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts b/packages/editor/src/core/extensions/table/table/utilities/delete-table-when-all-cells-selected.tssimilarity index 89%rename from packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.tsrename to packages/editor/src/core/extensions/table/table/utilities/delete-table-when-all-cells-selected.tsindex c08228a002..f8f1312309 100644--- a/packages/editor/core/src/ui/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts+++ b/packages/editor/src/core/extensions/table/table/utilities/delete-table-when-all-cells-selected.ts@@ -1,6 +1,6 @@import { findParentNodeClosestToPos, KeyboardShortcutCommand } from "@tiptap/core";-import { isCellSelection } from "src/ui/extensions/table/table/utilities/is-cell-selection";+import { isCellSelection } from "src/core/extensions/table/table/utilities/is-cell-selection";export const deleteTableWhenAllCellsSelected: KeyboardShortcutCommand = ({ editor }) => {const { selection } = editor.state;diff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/get-table-node-types.ts b/packages/editor/src/core/extensions/table/table/utilities/get-table-node-types.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/utilities/get-table-node-types.tsrename to packages/editor/src/core/extensions/table/table/utilities/get-table-node-types.tsdiff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-above-table-action.ts b/packages/editor/src/core/extensions/table/table/utilities/insert-line-above-table-action.tssimilarity index 96%rename from packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-above-table-action.tsrename to packages/editor/src/core/extensions/table/table/utilities/insert-line-above-table-action.tsindex 865bce8b72..ca5ed3d7e8 100644--- a/packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-above-table-action.ts+++ b/packages/editor/src/core/extensions/table/table/utilities/insert-line-above-table-action.ts@@ -1,5 +1,6 @@import { KeyboardShortcutCommand } from "@tiptap/core";-import { findParentNodeOfType } from "src/lib/utils";+// helpers+import { findParentNodeOfType } from "@/helpers/common";export const insertLineAboveTableAction: KeyboardShortcutCommand = ({ editor }) => {// Check if the current selection or the closest node is a tablediff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-below-table-action.ts b/packages/editor/src/core/extensions/table/table/utilities/insert-line-below-table-action.tssimilarity index 96%rename from packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-below-table-action.tsrename to packages/editor/src/core/extensions/table/table/utilities/insert-line-below-table-action.tsindex 6ce0fa4c43..7edca9f30d 100644--- a/packages/editor/core/src/ui/extensions/table/table/utilities/insert-line-below-table-action.ts+++ b/packages/editor/src/core/extensions/table/table/utilities/insert-line-below-table-action.ts@@ -1,5 +1,6 @@import { KeyboardShortcutCommand } from "@tiptap/core";-import { findParentNodeOfType } from "src/lib/utils";+// helpers+import { findParentNodeOfType } from "@/helpers/common";export const insertLineBelowTableAction: KeyboardShortcutCommand = ({ editor }) => {// Check if the current selection or the closest node is a tablediff --git a/packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.ts b/packages/editor/src/core/extensions/table/table/utilities/is-cell-selection.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/table/table/utilities/is-cell-selection.tsrename to packages/editor/src/core/extensions/table/table/utilities/is-cell-selection.tsdiff --git a/packages/editor/core/src/ui/extensions/typography/index.ts b/packages/editor/src/core/extensions/typography/index.tssimilarity index 98%rename from packages/editor/core/src/ui/extensions/typography/index.tsrename to packages/editor/src/core/extensions/typography/index.tsindex 78af3c46e2..c752c64228 100644--- a/packages/editor/core/src/ui/extensions/typography/index.ts+++ b/packages/editor/src/core/extensions/typography/index.ts@@ -20,7 +20,7 @@ import {oneQuarter,threeQuarters,impliesArrowRight,-} from "src/ui/extensions/typography/inputRules";+} from "src/core/extensions/typography/inputRules";export const CustomTypographyExtension = Extension.create<TypographyOptions>({name: "typography",diff --git a/packages/editor/core/src/ui/extensions/typography/inputRules.ts b/packages/editor/src/core/extensions/typography/inputRules.tssimilarity index 100%rename from packages/editor/core/src/ui/extensions/typography/inputRules.tsrename to packages/editor/src/core/extensions/typography/inputRules.tsdiff --git a/packages/editor/core/src/lib/utils.ts b/packages/editor/src/core/helpers/common.tssimilarity index 96%rename from packages/editor/core/src/lib/utils.tsrename to packages/editor/src/core/helpers/common.tsindex 137c70c2e7..5fbff4510a 100644--- a/packages/editor/core/src/lib/utils.ts+++ b/packages/editor/src/core/helpers/common.ts@@ -1,8 +1,9 @@import { Extensions, generateJSON, getSchema } from "@tiptap/core";import { Selection } from "@tiptap/pm/state";import { clsx, type ClassValue } from "clsx";-import { CoreEditorExtensionsWithoutProps } from "src/ui/extensions/core-without-props";+import { CoreEditorExtensionsWithoutProps } from "src/core/extensions/core-without-props";import { twMerge } from "tailwind-merge";+interface EditorClassNames {noBorder?: boolean;borderOnFocus?: boolean;diff --git a/packages/editor/core/src/lib/editor-commands.ts b/packages/editor/src/core/helpers/editor-commands.tssimilarity index 95%rename from packages/editor/core/src/lib/editor-commands.tsrename to packages/editor/src/core/helpers/editor-commands.tsindex 6e05ff13df..a73769cf26 100644--- a/packages/editor/core/src/lib/editor-commands.ts+++ b/packages/editor/src/core/helpers/editor-commands.ts@@ -1,9 +1,10 @@import { Editor, Range } from "@tiptap/core";-import { startImageUpload } from "src/ui/plugins/image/image-upload-handler";-import { findTableAncestor } from "src/lib/utils";+import { startImageUpload } from "src/core/plugins/image/image-upload-handler";+import { findTableAncestor } from "@/helpers/common";import { Selection } from "@tiptap/pm/state";-import { UploadImage } from "src/types/upload-image";-import { replaceCodeWithText } from "src/ui/extensions/code/utils/replace-code-block-with-text";+import { replaceCodeWithText } from "@/extensions/code/utils/replace-code-block-with-text";+// types+import { UploadImage } from "@/types";export const setText = (editor: Editor, range?: Range) => {if (range) editor.chain().focus().deleteRange(range).clearNodes().run();diff --git a/packages/editor/core/src/helpers/insert-content-at-cursor-position.ts b/packages/editor/src/core/helpers/insert-content-at-cursor-position.tssimilarity index 100%rename from packages/editor/core/src/helpers/insert-content-at-cursor-position.tsrename to packages/editor/src/core/helpers/insert-content-at-cursor-position.tsdiff --git a/packages/editor/core/src/helpers/scroll-to-node.ts b/packages/editor/src/core/helpers/scroll-to-node.tssimilarity index 100%rename from packages/editor/core/src/helpers/scroll-to-node.tsrename to packages/editor/src/core/helpers/scroll-to-node.tsdiff --git a/packages/editor/document-editor/src/utils/yjs.ts b/packages/editor/src/core/helpers/yjs.tssimilarity index 100%rename from packages/editor/document-editor/src/utils/yjs.tsrename to packages/editor/src/core/helpers/yjs.tsdiff --git a/packages/editor/document-editor/src/hooks/use-document-editor.ts b/packages/editor/src/core/hooks/use-document-editor.tssimilarity index 59%rename from packages/editor/document-editor/src/hooks/use-document-editor.tsrename to packages/editor/src/core/hooks/use-document-editor.tsindex 47bd397f92..5ab5bc08fa 100644--- a/packages/editor/document-editor/src/hooks/use-document-editor.ts+++ b/packages/editor/src/core/hooks/use-document-editor.ts@@ -1,46 +1,55 @@import { useEffect, useLayoutEffect, useMemo } from "react";+import Collaboration from "@tiptap/extension-collaboration";import { EditorProps } from "@tiptap/pm/view";import { IndexeddbPersistence } from "y-indexeddb";import * as Y from "yjs";-// editor-core-import { EditorRefApi, IMentionHighlight, IMentionSuggestion, TFileHandler, useEditor } from "@plane/editor-core";-// custom provider-import { CollaborationProvider } from "src/providers/collaboration-provider";// extensions-import { DocumentEditorExtensions } from "src/ui/extensions";+import { DragAndDrop, IssueWidget, SlashCommand } from "@/extensions";+// hooks+import { TFileHandler, useEditor } from "@/hooks/use-editor";+// plane editor provider+import { CollaborationProvider } from "@/plane-editor/providers";+// plane editor types+import { TEmbedConfig } from "@/plane-editor/types";+// types+import { EditorRefApi, IMentionHighlight, IMentionSuggestion } from "@/types";type DocumentEditorProps = {- id: string;- fileHandler: TFileHandler;- value: Uint8Array;editorClassName: string;- onChange: (updates: Uint8Array) => void;editorProps?: EditorProps;+ embedHandler?: TEmbedConfig;+ fileHandler: TFileHandler;forwardedRef?: React.MutableRefObject<EditorRefApi | null>;+ handleEditorReady?: (value: boolean) => void;+ id: string;mentionHandler: {highlights: () => Promise<IMentionHighlight[]>;suggestions?: () => Promise<IMentionSuggestion[]>;};- handleEditorReady?: (value: boolean) => void;+ onChange: (updates: Uint8Array) => void;placeholder?: string | ((isFocused: boolean, value: string) => string);setHideDragHandleFunction: (hideDragHandlerFromDragDrop: () => void) => void;tabIndex?: number;+ value: Uint8Array;};-export const useDocumentEditor = ({- id,- editorProps = {},- value,- editorClassName,- fileHandler,- onChange,- forwardedRef,- tabIndex,- handleEditorReady,- mentionHandler,- placeholder,- setHideDragHandleFunction,-}: DocumentEditorProps) => {+export const useDocumentEditor = (props: DocumentEditorProps) => {+ const {+ editorClassName,+ editorProps = {},+ embedHandler,+ fileHandler,+ forwardedRef,+ handleEditorReady,+ id,+ mentionHandler,+ onChange,+ placeholder,+ setHideDragHandleFunction,+ tabIndex,+ value,+ } = props;+const provider = useMemo(() =>new CollaborationProvider({@@ -75,11 +84,17 @@ export const useDocumentEditor = ({handleEditorReady,forwardedRef,mentionHandler,- extensions: DocumentEditorExtensions({- uploadFile: fileHandler.upload,- setHideDragHandle: setHideDragHandleFunction,- provider,- }),+ extensions: [+ SlashCommand(fileHandler.upload),+ DragAndDrop(setHideDragHandleFunction),+ embedHandler?.issue &&+ IssueWidget({+ widgetCallback: embedHandler.issue.widgetCallback,+ }),+ Collaboration.configure({+ document: provider.document,+ }),+ ],placeholder,tabIndex,});diff --git a/packages/editor/document-editor/src/hooks/use-editor-markings.tsx b/packages/editor/src/core/hooks/use-editor-markings.tsxsimilarity index 90%rename from packages/editor/document-editor/src/hooks/use-editor-markings.tsxrename to packages/editor/src/core/hooks/use-editor-markings.tsxindex 88f125a269..76d02cd68e 100644--- a/packages/editor/document-editor/src/hooks/use-editor-markings.tsx+++ b/packages/editor/src/core/hooks/use-editor-markings.tsx@@ -1,5 +1,11 @@import { useCallback, useState } from "react";-import { IMarking } from "src/types/editor-types";++export interface IMarking {+ type: "heading";+ level: number;+ text: string;+ sequence: number;+}export const useEditorMarkings = () => {const [markings, setMarkings] = useState<IMarking[]>([]);diff --git a/packages/editor/core/src/hooks/use-editor.tsx b/packages/editor/src/core/hooks/use-editor.tssimilarity index 91%rename from packages/editor/core/src/hooks/use-editor.tsxrename to packages/editor/src/core/hooks/use-editor.tsindex 563cb5122e..7083354aca 100644--- a/packages/editor/core/src/hooks/use-editor.tsx+++ b/packages/editor/src/core/hooks/use-editor.ts@@ -1,17 +1,18 @@import { useEditor as useCustomEditor, Editor } from "@tiptap/react";import { useImperativeHandle, useRef, MutableRefObject, useState, useEffect } from "react";-import { CoreEditorProps } from "src/ui/props";-import { CoreEditorExtensions } from "src/ui/extensions";import { EditorProps } from "@tiptap/pm/view";-import { DeleteImage } from "src/types/delete-image";-import { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion";-import { RestoreImage } from "src/types/restore-image";-import { UploadImage } from "src/types/upload-image";import { Selection } from "@tiptap/pm/state";-import { insertContentAtSavedSelection } from "src/helpers/insert-content-at-cursor-position";-import { EditorMenuItemNames, getEditorMenuItems } from "src/ui/menus/menu-items";-import { EditorRefApi } from "src/types/editor-ref-api";-import { IMarking, scrollSummary } from "src/helpers/scroll-to-node";+// components+import { EditorMenuItemNames, getEditorMenuItems } from "@/components/menus";+// extensions+import { CoreEditorExtensions } from "@/extensions";+// helpers+import { insertContentAtSavedSelection } from "@/helpers/insert-content-at-cursor-position";+import { IMarking, scrollSummary } from "@/helpers/scroll-to-node";+// props+import { CoreEditorProps } from "@/props";+// types+import { DeleteImage, EditorRefApi, IMentionHighlight, IMentionSuggestion, RestoreImage, UploadImage } from "@/types";export type TFileHandler = {cancel: () => void;diff --git a/packages/editor/core/src/hooks/use-read-only-editor.tsx b/packages/editor/src/core/hooks/use-read-only-editor.tssimilarity index 87%rename from packages/editor/core/src/hooks/use-read-only-editor.tsxrename to packages/editor/src/core/hooks/use-read-only-editor.tsindex 8b16d1e766..fcaf0c6dd1 100644--- a/packages/editor/core/src/hooks/use-read-only-editor.tsx+++ b/packages/editor/src/core/hooks/use-read-only-editor.ts@@ -1,11 +1,14 @@-import { useEditor as useCustomEditor, Editor } from "@tiptap/react";import { useImperativeHandle, useRef, MutableRefObject, useEffect } from "react";-import { CoreReadOnlyEditorExtensions } from "src/ui/read-only/extensions";-import { CoreReadOnlyEditorProps } from "src/ui/read-only/props";import { EditorProps } from "@tiptap/pm/view";-import { EditorReadOnlyRefApi } from "src/types/editor-ref-api";-import { IMarking, scrollSummary } from "src/helpers/scroll-to-node";-import { IMentionHighlight } from "src/types/mention-suggestion";+import { useEditor as useCustomEditor, Editor } from "@tiptap/react";+// extensions+import { CoreReadOnlyEditorExtensions } from "@/extensions";+// helpers+import { IMarking, scrollSummary } from "@/helpers/scroll-to-node";+// props+import { CoreReadOnlyEditorProps } from "@/props";+// types+import { EditorReadOnlyRefApi, IMentionHighlight } from "@/types";interface CustomReadOnlyEditorProps {initialValue: string;diff --git a/packages/editor/core/src/ui/plugins/image/constants.ts b/packages/editor/src/core/plugins/image/constants.tssimilarity index 100%rename from packages/editor/core/src/ui/plugins/image/constants.tsrename to packages/editor/src/core/plugins/image/constants.tsdiff --git a/packages/editor/core/src/ui/plugins/image/delete-image.ts b/packages/editor/src/core/plugins/image/delete-image.tssimilarity index 89%rename from packages/editor/core/src/ui/plugins/image/delete-image.tsrename to packages/editor/src/core/plugins/image/delete-image.tsindex 645dda99eb..8dc1bf0722 100644--- a/packages/editor/core/src/ui/plugins/image/delete-image.ts+++ b/packages/editor/src/core/plugins/image/delete-image.ts@@ -1,9 +1,9 @@-import { EditorState, Plugin, Transaction } from "@tiptap/pm/state";-import { DeleteImage } from "src/types/delete-image";import { Editor } from "@tiptap/core";--import { type ImageNode } from "src/ui/plugins/image/types/image-node";-import { deleteKey, IMAGE_NODE_TYPE } from "src/ui/plugins/image/constants";+import { EditorState, Plugin, Transaction } from "@tiptap/pm/state";+// plugins+import { IMAGE_NODE_TYPE, deleteKey, type ImageNode } from "@/plugins/image";+// types+import { DeleteImage } from "@/types";export const TrackImageDeletionPlugin = (editor: Editor, deleteImage: DeleteImage): Plugin =>new Plugin({diff --git a/packages/editor/core/src/ui/plugins/image/image-upload-handler.ts b/packages/editor/src/core/plugins/image/image-upload-handler.tssimilarity index 93%rename from packages/editor/core/src/ui/plugins/image/image-upload-handler.tsrename to packages/editor/src/core/plugins/image/image-upload-handler.tsindex eb70218199..d0bd339dae 100644--- a/packages/editor/core/src/ui/plugins/image/image-upload-handler.ts+++ b/packages/editor/src/core/plugins/image/image-upload-handler.ts@@ -1,14 +1,10 @@-import { type UploadImage } from "src/types/upload-image";--// utilities-import { v4 as uuidv4 } from "uuid";--// types-import { isFileValid } from "src/ui/plugins/image/utils/validate-file";import { Editor } from "@tiptap/core";import { EditorView } from "@tiptap/pm/view";-import { uploadKey } from "./constants";-import { removePlaceholder, findPlaceholder } from "./utils/placeholder";+import { v4 as uuidv4 } from "uuid";+// plugins+import { findPlaceholder, isFileValid, removePlaceholder, uploadKey } from "@/plugins/image";+// types+import { UploadImage } from "@/types";export async function startImageUpload(editor: Editor,diff --git a/packages/editor/src/core/plugins/image/index.ts b/packages/editor/src/core/plugins/image/index.tsnew file mode 100644index 0000000000..e5a290abe8--- /dev/null+++ b/packages/editor/src/core/plugins/image/index.ts@@ -0,0 +1,7 @@+export * from "./types";+export * from "./utils";+export * from "./constants";+export * from "./delete-image";+export * from "./image-upload-handler";+export * from "./restore-image";+export * from "./upload-image";diff --git a/packages/editor/core/src/ui/plugins/image/restore-image.ts b/packages/editor/src/core/plugins/image/restore-image.tssimilarity index 92%rename from packages/editor/core/src/ui/plugins/image/restore-image.tsrename to packages/editor/src/core/plugins/image/restore-image.tsindex 61a7a7a34a..036df9b887 100644--- a/packages/editor/core/src/ui/plugins/image/restore-image.ts+++ b/packages/editor/src/core/plugins/image/restore-image.ts@@ -1,9 +1,9 @@import { Editor } from "@tiptap/core";import { EditorState, Plugin, Transaction } from "@tiptap/pm/state";-import { RestoreImage } from "src/types/restore-image";--import { restoreKey, IMAGE_NODE_TYPE } from "./constants";-import { type ImageNode } from "./types/image-node";+// plugins+import { IMAGE_NODE_TYPE, ImageNode, restoreKey } from "@/plugins/image";+// types+import { RestoreImage } from "@/types";export const TrackImageRestorationPlugin = (editor: Editor, restoreImage: RestoreImage): Plugin =>new Plugin({diff --git a/packages/editor/core/src/ui/plugins/image/types/image-node.ts b/packages/editor/src/core/plugins/image/types/image-node.tssimilarity index 100%rename from packages/editor/core/src/ui/plugins/image/types/image-node.tsrename to packages/editor/src/core/plugins/image/types/image-node.tsdiff --git a/packages/editor/src/core/plugins/image/types/index.ts b/packages/editor/src/core/plugins/image/types/index.tsnew file mode 100644index 0000000000..2fddf3bf64--- /dev/null+++ b/packages/editor/src/core/plugins/image/types/index.ts@@ -0,0 +1 @@+export * from "./image-node";diff --git a/packages/editor/core/src/ui/plugins/image/upload-image.ts b/packages/editor/src/core/plugins/image/upload-image.tssimilarity index 94%rename from packages/editor/core/src/ui/plugins/image/upload-image.tsrename to packages/editor/src/core/plugins/image/upload-image.tsindex 554e37de22..e3db70d136 100644--- a/packages/editor/core/src/ui/plugins/image/upload-image.ts+++ b/packages/editor/src/core/plugins/image/upload-image.ts@@ -1,12 +1,8 @@import { Editor } from "@tiptap/core";import { Plugin } from "@tiptap/pm/state";import { Decoration, DecorationSet, EditorView } from "@tiptap/pm/view";--// utils-import { removePlaceholder } from "src/ui/plugins/image/utils/placeholder";--// constants-import { uploadKey } from "src/ui/plugins/image/constants";+// plugins+import { removePlaceholder, uploadKey } from "@/plugins/image";export const UploadImagesPlugin = (editor: Editor, cancelUploadImage?: () => void) => {let currentView: EditorView | null = null;diff --git a/packages/editor/src/core/plugins/image/utils/index.ts b/packages/editor/src/core/plugins/image/utils/index.tsnew file mode 100644index 0000000000..217ec41176--- /dev/null+++ b/packages/editor/src/core/plugins/image/utils/index.ts@@ -0,0 +1,2 @@+export * from "./placeholder";+export * from "./validate-file";diff --git a/packages/editor/core/src/ui/plugins/image/utils/placeholder.ts b/packages/editor/src/core/plugins/image/utils/placeholder.tssimilarity index 91%rename from packages/editor/core/src/ui/plugins/image/utils/placeholder.tsrename to packages/editor/src/core/plugins/image/utils/placeholder.tsindex 9636da4a7d..e698823000 100644--- a/packages/editor/core/src/ui/plugins/image/utils/placeholder.ts+++ b/packages/editor/src/core/plugins/image/utils/placeholder.ts@@ -1,7 +1,7 @@import { Editor } from "@tiptap/core";import { EditorState } from "@tiptap/pm/state";import { DecorationSet, EditorView } from "@tiptap/pm/view";-import { uploadKey } from "src/ui/plugins/image/constants";+import { uploadKey } from "src/core/plugins/image/constants";export function findPlaceholder(state: EditorState, id: string): number | null {const decos = uploadKey.getState(state) as DecorationSet;diff --git a/packages/editor/core/src/ui/plugins/image/utils/validate-file.ts b/packages/editor/src/core/plugins/image/utils/validate-file.tssimilarity index 100%rename from packages/editor/core/src/ui/plugins/image/utils/validate-file.tsrename to packages/editor/src/core/plugins/image/utils/validate-file.tsdiff --git a/packages/editor/src/core/props/index.ts b/packages/editor/src/core/props/index.tsnew file mode 100644index 0000000000..eaa89f0591--- /dev/null+++ b/packages/editor/src/core/props/index.ts@@ -0,0 +1,2 @@+export * from "./props";+export * from "./read-only";diff --git a/packages/editor/core/src/ui/props.tsx b/packages/editor/src/core/props/props.tsxsimilarity index 93%rename from packages/editor/core/src/ui/props.tsxrename to packages/editor/src/core/props/props.tsxindex 32d1510c73..11e829162a 100644--- a/packages/editor/core/src/ui/props.tsx+++ b/packages/editor/src/core/props/props.tsx@@ -1,5 +1,6 @@import { EditorProps } from "@tiptap/pm/view";-import { cn } from "src/lib/utils";+// helpers+import { cn } from "@/helpers/common";export function CoreEditorProps(editorClassName: string): EditorProps {return {diff --git a/packages/editor/core/src/ui/read-only/props.tsx b/packages/editor/src/core/props/read-only.tsxsimilarity index 85%rename from packages/editor/core/src/ui/read-only/props.tsxrename to packages/editor/src/core/props/read-only.tsxindex bd9b6713bd..ea583938f7 100644--- a/packages/editor/core/src/ui/read-only/props.tsx+++ b/packages/editor/src/core/props/read-only.tsx@@ -1,5 +1,6 @@import { EditorProps } from "@tiptap/pm/view";-import { cn } from "src/lib/utils";+// helpers+import { cn } from "@/helpers/common";export const CoreReadOnlyEditorProps = (editorClassName: string): EditorProps => ({attributes: {diff --git a/packages/editor/src/core/types/editor.ts b/packages/editor/src/core/types/editor.tsnew file mode 100644index 0000000000..a7d167a3a7--- /dev/null+++ b/packages/editor/src/core/types/editor.ts@@ -0,0 +1,61 @@+// types+import { EditorMenuItemNames } from "@/components/menus";+import { IMarking } from "@/helpers/scroll-to-node";+import { TFileHandler } from "@/hooks/use-editor";+import { IMentionHighlight, IMentionSuggestion } from "@/types";++export type EditorReadOnlyRefApi = {+ getMarkDown: () => string;+ getHTML: () => string;+ clearEditor: () => void;+ setEditorValue: (content: string) => void;+ scrollSummary: (marking: IMarking) => void;+};++export interface EditorRefApi extends EditorReadOnlyRefApi {+ setEditorValueAtCursorPosition: (content: string) => void;+ executeMenuItemCommand: (itemName: EditorMenuItemNames) => void;+ isMenuItemActive: (itemName: EditorMenuItemNames) => boolean;+ onStateChange: (callback: () => void) => () => void;+ setFocusAtPosition: (position: number) => void;+ isEditorReadyToDiscard: () => boolean;+}++export interface IEditorProps {+ containerClassName?: string;+ editorClassName?: string;+ fileHandler: TFileHandler;+ forwardedRef?: React.MutableRefObject<EditorRefApi | null>;+ id?: string;+ initialValue: string;+ mentionHandler: {+ highlights: () => Promise<IMentionHighlight[]>;+ suggestions?: () => Promise<IMentionSuggestion[]>;+ };+ onChange?: (json: object, html: string) => void;+ onEnterKeyPress?: (e?: any) => void;+ placeholder?: string | ((isFocused: boolean, value: string) => string);+ tabIndex?: number;+ value?: string | null;+}++export interface ILiteTextEditor extends IEditorProps {}++export interface IRichTextEditor extends IEditorProps {+ dragDropEnabled?: boolean;+}++export interface IReadOnlyEditorProps {+ containerClassName?: string;+ editorClassName?: string;+ forwardedRef?: React.MutableRefObject<EditorReadOnlyRefApi | null>;+ initialValue: string;+ mentionHandler: {+ highlights: () => Promise<IMentionHighlight[]>;+ };+ tabIndex?: number;+}++export interface ILiteTextReadOnlyEditor extends IReadOnlyEditorProps {}++export interface IRichTextReadOnlyEditor extends IReadOnlyEditorProps {}diff --git a/packages/editor/src/core/types/embed.ts b/packages/editor/src/core/types/embed.tsnew file mode 100644index 0000000000..3acd662bec--- /dev/null+++ b/packages/editor/src/core/types/embed.ts@@ -0,0 +1,8 @@+export type TEmbedItem = {+ id: string;+ title: string;+ subTitle: string;+ icon: React.ReactNode;+ projectId: string;+ workspaceSlug: string;+};diff --git a/packages/editor/src/core/types/image.ts b/packages/editor/src/core/types/image.tsnew file mode 100644index 0000000000..c1b174a480--- /dev/null+++ b/packages/editor/src/core/types/image.ts@@ -0,0 +1,5 @@+export type DeleteImage = (assetUrlWithWorkspaceId: string) => Promise<any>;++export type RestoreImage = (assetUrlWithWorkspaceId: string) => Promise<any>;++export type UploadImage = (file: File) => Promise<string>;diff --git a/packages/editor/src/core/types/index.ts b/packages/editor/src/core/types/index.tsnew file mode 100644index 0000000000..f4dd894128--- /dev/null+++ b/packages/editor/src/core/types/index.ts@@ -0,0 +1,5 @@+export * from "./editor";+export * from "./embed";+export * from "./image";+export * from "./mention-suggestion";+export * from "./slash-commands-suggestion";diff --git a/packages/editor/core/src/types/mention-suggestion.ts b/packages/editor/src/core/types/mention-suggestion.tssimilarity index 67%rename from packages/editor/core/src/types/mention-suggestion.tsrename to packages/editor/src/core/types/mention-suggestion.tsindex aa2ad4ba29..a51bed7042 100644--- a/packages/editor/core/src/types/mention-suggestion.ts+++ b/packages/editor/src/core/types/mention-suggestion.ts@@ -1,4 +1,3 @@-import { Editor, Range } from "@tiptap/react";export type IMentionSuggestion = {id: string;type: string;@@ -10,9 +9,4 @@ export type IMentionSuggestion = {redirect_uri: string;};-export type CommandProps = {- editor: Editor;- range: Range;-};-export type IMentionHighlight = string;diff --git a/packages/editor/core/src/types/slash-commands-suggestion.ts b/packages/editor/src/core/types/slash-commands-suggestion.tssimilarity index 100%rename from packages/editor/core/src/types/slash-commands-suggestion.tsrename to packages/editor/src/core/types/slash-commands-suggestion.tsdiff --git a/packages/editor/src/ee/providers/index.ts b/packages/editor/src/ee/providers/index.tsnew file mode 100644index 0000000000..3f53c1e7a3--- /dev/null+++ b/packages/editor/src/ee/providers/index.ts@@ -0,0 +1 @@+export * from "src/ce/providers";diff --git a/packages/editor/src/ee/types/index.ts b/packages/editor/src/ee/types/index.tsnew file mode 100644index 0000000000..00cebc05e3--- /dev/null+++ b/packages/editor/src/ee/types/index.ts@@ -0,0 +1 @@+export * from "src/ce/types";diff --git a/packages/editor/src/index.ts b/packages/editor/src/index.tsnew file mode 100644index 0000000000..1dae4e8b37--- /dev/null+++ b/packages/editor/src/index.ts@@ -0,0 +1,37 @@+// styles+// import "./styles/tailwind.css";+import "src/styles/editor.css";+import "src/styles/table.css";+import "src/styles/github-dark.css";+import "src/styles/drag-drop.css";++// editors+export {+ DocumentEditorWithRef,+ DocumentReadOnlyEditorWithRef,+ LiteTextEditorWithRef,+ LiteTextReadOnlyEditorWithRef,+ RichTextEditorWithRef,+ RichTextReadOnlyEditorWithRef,+} from "@/components/editors";++export { isCellSelection } from "@/extensions/table/table/utilities/is-cell-selection";++// helpers+export * from "@/helpers/common";+export * from "@/helpers/editor-commands";+export * from "@/helpers/yjs";+export * from "@/extensions/table/table";+export { startImageUpload } from "@/plugins/image";++// components+export * from "@/components/menus";++// hooks+export { useEditor } from "@/hooks/use-editor";+export { type IMarking, useEditorMarkings } from "@/hooks/use-editor-markings";+export { useReadOnlyEditor } from "@/hooks/use-read-only-editor";++// types+export type { CustomEditorProps, TFileHandler } from "@/hooks/use-editor";+export * from "@/types";diff --git a/packages/editor/extensions/src/styles/drag-drop.css b/packages/editor/src/styles/drag-drop.csssimilarity index 100%rename from packages/editor/extensions/src/styles/drag-drop.cssrename to packages/editor/src/styles/drag-drop.cssdiff --git a/packages/editor/core/src/styles/editor.css b/packages/editor/src/styles/editor.csssimilarity index 100%rename from packages/editor/core/src/styles/editor.cssrename to packages/editor/src/styles/editor.cssdiff --git a/packages/editor/core/src/styles/github-dark.css b/packages/editor/src/styles/github-dark.csssimilarity index 100%rename from packages/editor/core/src/styles/github-dark.cssrename to packages/editor/src/styles/github-dark.cssdiff --git a/packages/editor/core/src/styles/table.css b/packages/editor/src/styles/table.csssimilarity index 100%rename from packages/editor/core/src/styles/table.cssrename to packages/editor/src/styles/table.cssdiff --git a/packages/editor/core/src/styles/tailwind.css b/packages/editor/src/styles/tailwind.csssimilarity index 100%rename from packages/editor/core/src/styles/tailwind.cssrename to packages/editor/src/styles/tailwind.cssdiff --git a/packages/editor/core/tailwind.config.js b/packages/editor/tailwind.config.jssimilarity index 100%rename from packages/editor/core/tailwind.config.jsrename to packages/editor/tailwind.config.jsdiff --git a/packages/editor/tsconfig.json b/packages/editor/tsconfig.jsonnew file mode 100644index 0000000000..cfe8401f6f--- /dev/null+++ b/packages/editor/tsconfig.json@@ -0,0 +1,13 @@+{+ "extends": "tsconfig/react-library.json",+ "include": ["src/**/*", "index.d.ts"],+ "exclude": ["dist", "build", "node_modules"],+ "compilerOptions": {+ "baseUrl": ".",+ "paths": {+ "@/*": ["src/core/*"],+ "@/styles/*": ["src/styles/*"],+ "@/plane-editor/*": ["src/ce/*"]+ }+ }+}diff --git a/packages/editor/core/tsup.config.ts b/packages/editor/tsup.config.tssimilarity index 100%rename from packages/editor/core/tsup.config.tsrename to packages/editor/tsup.config.tsdiff --git a/space/core/components/editor/lite-text-editor.tsx b/space/core/components/editor/lite-text-editor.tsxindex b911ebecb1..3cc8347a17 100644--- a/space/core/components/editor/lite-text-editor.tsx+++ b/space/core/components/editor/lite-text-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/lite-text-editor";+import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/editor";// componentsimport { IssueCommentToolbar } from "@/components/editor";// helpersdiff --git a/space/core/components/editor/lite-text-read-only-editor.tsx b/space/core/components/editor/lite-text-read-only-editor.tsxindex 6b16a0b074..0659939baa 100644--- a/space/core/components/editor/lite-text-read-only-editor.tsx+++ b/space/core/components/editor/lite-text-read-only-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/lite-text-editor";+import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/editor";// helpersimport { cn } from "@/helpers/common.helper";// hooksdiff --git a/space/core/components/editor/rich-text-read-only-editor.tsx b/space/core/components/editor/rich-text-read-only-editor.tsxindex 56694e91f7..3fd7cae57e 100644--- a/space/core/components/editor/rich-text-read-only-editor.tsx+++ b/space/core/components/editor/rich-text-read-only-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorReadOnlyRefApi, IRichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef } from "@plane/rich-text-editor";+import { EditorReadOnlyRefApi, IRichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef } from "@plane/editor";// helpersimport { cn } from "@/helpers/common.helper";// hooksdiff --git a/space/core/components/editor/toolbar.tsx b/space/core/components/editor/toolbar.tsxindex 0140a46b6c..f69ce7b3f6 100644--- a/space/core/components/editor/toolbar.tsx+++ b/space/core/components/editor/toolbar.tsx@@ -2,7 +2,7 @@import React, { useEffect, useState, useCallback } from "react";// editor-import { EditorMenuItemNames, EditorRefApi } from "@plane/lite-text-editor";+import { EditorMenuItemNames, EditorRefApi } from "@plane/editor";// uiimport { Button, Tooltip } from "@plane/ui";// constantsdiff --git a/space/core/components/issues/peek-overview/comment/add-comment.tsx b/space/core/components/issues/peek-overview/comment/add-comment.tsxindex 3e86a084f3..cf11aa333e 100644--- a/space/core/components/issues/peek-overview/comment/add-comment.tsx+++ b/space/core/components/issues/peek-overview/comment/add-comment.tsx@@ -4,7 +4,7 @@ import React, { useRef } from "react";import { observer } from "mobx-react";import { useForm, Controller } from "react-hook-form";// editor-import { EditorRefApi } from "@plane/lite-text-editor";+import { EditorRefApi } from "@plane/editor";// uiimport { TOAST_TYPE, setToast } from "@plane/ui";// editor componentsdiff --git a/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx b/space/core/components/issues/peek-overview/comment/comment-detail-card.tsxindex c065480e9a..2bdd8ca8f4 100644--- a/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx+++ b/space/core/components/issues/peek-overview/comment/comment-detail-card.tsx@@ -4,7 +4,7 @@ import { Controller, useForm } from "react-hook-form";import { Check, MessageSquare, MoreVertical, X } from "lucide-react";import { Menu, Transition } from "@headlessui/react";// components-import { EditorRefApi } from "@plane/lite-text-editor";+import { EditorRefApi } from "@plane/editor";import { LiteTextEditor, LiteTextReadOnlyEditor } from "@/components/editor";import { CommentReactions } from "@/components/issues/peek-overview";// helpersdiff --git a/space/core/constants/editor.ts b/space/core/constants/editor.tsindex eb8b994954..698faf8cb4 100644--- a/space/core/constants/editor.ts+++ b/space/core/constants/editor.ts@@ -19,7 +19,7 @@ import {Underline,} from "lucide-react";// editor-import { EditorMenuItemNames } from "@plane/lite-text-editor";+import { EditorMenuItemNames } from "@plane/editor";type TEditorTypes = "lite" | "document";diff --git a/space/core/store/mentions.store.ts b/space/core/store/mentions.store.tsindex 77228595c3..977df42213 100644--- a/space/core/store/mentions.store.ts+++ b/space/core/store/mentions.store.ts@@ -1,6 +1,6 @@import { computed, makeObservable } from "mobx";// editor-import { IMentionHighlight } from "@plane/lite-text-editor";+import { IMentionHighlight } from "@plane/editor";// storeimport { CoreRootStore } from "@/store/root.store";diff --git a/space/package.json b/space/package.jsonindex 0e2d62eabb..fdf156e9f3 100644--- a/space/package.json+++ b/space/package.json@@ -17,9 +17,7 @@"@emotion/styled": "^11.11.0","@headlessui/react": "^1.7.13","@mui/material": "^5.14.1",- "@plane/document-editor": "*",- "@plane/lite-text-editor": "*",- "@plane/rich-text-editor": "*",+ "@plane/editor": "*","@plane/types": "*","@plane/ui": "*","@sentry/nextjs": "^8",diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsxindex bbd3f4c06c..753b2ae58d 100644--- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx+++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/[pageId]/page.tsx@@ -6,7 +6,7 @@ import Link from "next/link";import { useParams } from "next/navigation";import useSWR from "swr";// document-editor-import { EditorRefApi, useEditorMarkings } from "@plane/document-editor";+import { EditorRefApi, useEditorMarkings } from "@plane/editor";// typesimport { TPage } from "@plane/types";// uidiff --git a/web/ce/components/pages/editor/embed/index.ts b/web/ce/components/pages/editor/embed/index.tsnew file mode 100644index 0000000000..f30596cb00--- /dev/null+++ b/web/ce/components/pages/editor/embed/index.ts@@ -0,0 +1 @@+export * from "./issue-embed";diff --git a/web/ce/components/pages/editor/embed/issue-embed.tsx b/web/ce/components/pages/editor/embed/issue-embed.tsxnew file mode 100644index 0000000000..dc06f4f9d8--- /dev/null+++ b/web/ce/components/pages/editor/embed/issue-embed.tsx@@ -0,0 +1,30 @@+import { Crown } from "lucide-react";+// ui+import { Button } from "@plane/ui";++export const IssueEmbedCard: React.FC<any> = (props) => (+ <div+ className={`${+ props.selected ? "border-custom-primary-200 border-[2px]" : ""+ } w-full h-[100px] cursor-pointer space-y-2 rounded-md border-[0.5px] border-custom-border-200 shadow-custom-shadow-2xs`}+ >+ <h5 className="h-[20%] text-xs text-custom-text-300 p-2">+ {props.node?.attrs?.project_identifier}-{props?.node?.attrs?.sequence_id}+ </h5>+ <div className="relative h-[71%]">+ <div className="h-full backdrop-filter backdrop-blur-[30px] bg-custom-background-80 bg-opacity-30 flex items-center w-full justify-between gap-5 mt-2.5 pl-4 pr-5 py-3 max-md:max-w-full max-md:flex-wrap relative">+ <div className="flex gap-2 items-center">+ <div className="rounded">+ <Crown className="m-2" size={16} color="#FFBA18" />+ </div>+ <div className="text-custom-text text-sm">+ Embed and access issues in pages seamlessly, upgrade to plane pro now.+ </div>+ </div>+ <a href="https://plane.so/pricing" target="_blank" rel="noopener noreferrer">+ <Button>Upgrade</Button>+ </a>+ </div>+ </div>+ </div>+);diff --git a/web/ce/components/pages/editor/index.ts b/web/ce/components/pages/editor/index.tsnew file mode 100644index 0000000000..12b3c5295b--- /dev/null+++ b/web/ce/components/pages/editor/index.ts@@ -0,0 +1 @@+export * from "./embed";diff --git a/web/ce/components/pages/index.ts b/web/ce/components/pages/index.tsindex 5ce39384e5..6f3d30c9a9 100644--- a/web/ce/components/pages/index.ts+++ b/web/ce/components/pages/index.ts@@ -1 +1,2 @@+export * from "./editor";export * from "./extra-actions";diff --git a/web/core/components/editor/lite-text-editor/lite-text-editor.tsx b/web/core/components/editor/lite-text-editor/lite-text-editor.tsxindex 6fde70d6e1..9f1608d5c8 100644--- a/web/core/components/editor/lite-text-editor/lite-text-editor.tsx+++ b/web/core/components/editor/lite-text-editor/lite-text-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/lite-text-editor";+import { EditorRefApi, ILiteTextEditor, LiteTextEditorWithRef } from "@plane/editor";// typesimport { IUserLite } from "@plane/types";// componentsdiff --git a/web/core/components/editor/lite-text-editor/lite-text-read-only-editor.tsx b/web/core/components/editor/lite-text-editor/lite-text-read-only-editor.tsxindex 8ee95b5854..5e8dfbd7a2 100644--- a/web/core/components/editor/lite-text-editor/lite-text-read-only-editor.tsx+++ b/web/core/components/editor/lite-text-editor/lite-text-read-only-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/lite-text-editor";+import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/editor";// helpersimport { cn } from "@/helpers/common.helper";// hooksdiff --git a/web/core/components/editor/lite-text-editor/toolbar.tsx b/web/core/components/editor/lite-text-editor/toolbar.tsxindex e053e9b0dc..69affb67ed 100644--- a/web/core/components/editor/lite-text-editor/toolbar.tsx+++ b/web/core/components/editor/lite-text-editor/toolbar.tsx@@ -3,8 +3,7 @@import React, { useEffect, useState, useCallback } from "react";import { Globe2, Lock, LucideIcon } from "lucide-react";// editor-import { EditorMenuItemNames } from "@plane/document-editor";-import { EditorRefApi } from "@plane/lite-text-editor";+import { EditorMenuItemNames, EditorRefApi } from "@plane/editor";// uiimport { Button, Tooltip } from "@plane/ui";// constantsdiff --git a/web/core/components/editor/rich-text-editor/rich-text-editor.tsx b/web/core/components/editor/rich-text-editor/rich-text-editor.tsxindex 0324d1f177..68adbb9fdf 100644--- a/web/core/components/editor/rich-text-editor/rich-text-editor.tsx+++ b/web/core/components/editor/rich-text-editor/rich-text-editor.tsx@@ -1,6 +1,6 @@import React, { forwardRef } from "react";// editor-import { EditorRefApi, IRichTextEditor, RichTextEditorWithRef } from "@plane/rich-text-editor";+import { EditorRefApi, IRichTextEditor, RichTextEditorWithRef } from "@plane/editor";// typesimport { IUserLite } from "@plane/types";// helpersdiff --git a/web/core/components/editor/rich-text-editor/rich-text-read-only-editor.tsx b/web/core/components/editor/rich-text-editor/rich-text-read-only-editor.tsxindex 4aead54699..d97eba98a2 100644--- a/web/core/components/editor/rich-text-editor/rich-text-read-only-editor.tsx+++ b/web/core/components/editor/rich-text-editor/rich-text-read-only-editor.tsx@@ -1,6 +1,6 @@import React from "react";// editor-import { EditorReadOnlyRefApi, IRichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef } from "@plane/rich-text-editor";+import { EditorReadOnlyRefApi, IRichTextReadOnlyEditor, RichTextReadOnlyEditorWithRef } from "@plane/editor";// helpersimport { cn } from "@/helpers/common.helper";// hooksdiff --git a/web/core/components/inbox/modals/create-edit-modal/create-root.tsx b/web/core/components/inbox/modals/create-edit-modal/create-root.tsxindex b6456bac1b..36574b5133 100644--- a/web/core/components/inbox/modals/create-edit-modal/create-root.tsx+++ b/web/core/components/inbox/modals/create-edit-modal/create-root.tsx@@ -4,7 +4,7 @@ import { FC, FormEvent, useCallback, useRef, useState } from "react";import { observer } from "mobx-react";import { usePathname } from "next/navigation";// editor-import { EditorRefApi } from "@plane/rich-text-editor";+import { EditorRefApi } from "@plane/editor";// typesimport { TIssue } from "@plane/types";import { Button, ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui";diff --git a/web/core/components/inbox/modals/create-edit-modal/edit-root.tsx b/web/core/components/inbox/modals/create-edit-modal/edit-root.tsxindex 000426b6c8..05ff4f1e50 100644--- a/web/core/components/inbox/modals/create-edit-modal/edit-root.tsx+++ b/web/core/components/inbox/modals/create-edit-modal/edit-root.tsx@@ -4,7 +4,7 @@ import { FC, useCallback, useEffect, useRef, useState } from "react";import { observer } from "mobx-react";import { usePathname } from "next/navigation";// editor-import { EditorRefApi } from "@plane/rich-text-editor";+import { EditorRefApi } from "@plane/editor";// typesimport { TIssue } from "@plane/types";// uidiff --git a/web/core/components/inbox/modals/create-edit-modal/issue-description.tsx b/web/core/components/inbox/modals/create-edit-modal/issue-description.tsxindex 1cbfaded56..7b9ef67497 100644--- a/web/core/components/inbox/modals/create-edit-modal/issue-description.tsx+++ b/web/core/components/inbox/modals/create-edit-modal/issue-description.tsx@@ -2,8 +2,11 @@import { FC, RefObject } from "react";import { observer } from "mobx-react";-import { EditorRefApi } from "@plane/rich-text-editor";+// editor+import { EditorRefApi } from "@plane/editor";+// typesimport { TIssue } from "@plane/types";+// uiimport { Loader } from "@plane/ui";// componentsimport { RichTextEditor } from "@/components/editor/rich-text-editor/rich-text-editor";diff --git a/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx b/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsxindex 7413edf084..29945dda9c 100644--- a/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx+++ b/web/core/components/issues/issue-detail/issue-activity/comments/comment-card.tsx@@ -4,7 +4,7 @@ import { FC, useEffect, useRef, useState } from "react";import { observer } from "mobx-react";import { useForm } from "react-hook-form";import { Check, Globe2, Lock, Pencil, Trash2, X } from "lucide-react";-import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/lite-text-editor";+import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor";import { TIssueComment } from "@plane/types";// uiimport { CustomMenu } from "@plane/ui";diff --git a/web/core/components/issues/issue-layouts/list/list-group.tsx b/web/core/components/issues/issue-layouts/list/list-group.tsxindex 0bca2a712e..fa49b79b8e 100644--- a/web/core/components/issues/issue-layouts/list/list-group.tsx+++ b/web/core/components/issues/issue-layouts/list/list-group.tsx@@ -4,7 +4,7 @@ import { MutableRefObject, useEffect, useRef, useState } from "react";import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";import { observer } from "mobx-react";-import { cn } from "@plane/editor-core";+import { cn } from "@plane/editor";// plane packagesimport {IGroupByColumn,@@ -59,7 +59,7 @@ interface Props {showEmptyGroup?: boolean;loadMoreIssues: (groupId?: string) => void;selectionHelpers: TSelectionHelper;-};+}export const ListGroup = observer((props: Props) => {const {diff --git a/web/core/components/issues/issue-modal/form.tsx b/web/core/components/issues/issue-modal/form.tsxindex 385dda43fa..990509e5e3 100644--- a/web/core/components/issues/issue-modal/form.tsx+++ b/web/core/components/issues/issue-modal/form.tsx@@ -5,7 +5,9 @@ import { observer } from "mobx-react";import { useParams } from "next/navigation";import { Controller, useForm } from "react-hook-form";import { LayoutPanelTop, Sparkle, X } from "lucide-react";-import { EditorRefApi } from "@plane/rich-text-editor";+// editor+import { EditorRefApi } from "@plane/editor";+// typesimport type { TIssue, ISearchIssueResponse } from "@plane/types";// hooksimport { Button, CustomMenu, Input, Loader, ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui";diff --git a/web/core/components/modules/module-view-header.tsx b/web/core/components/modules/module-view-header.tsxindex 71418a2cc4..3038f0bc7a 100644--- a/web/core/components/modules/module-view-header.tsx+++ b/web/core/components/modules/module-view-header.tsx@@ -6,7 +6,7 @@ import { useParams } from "next/navigation";// iconsimport { ListFilter, Search, X } from "lucide-react";// helpers-import { cn } from "@plane/editor-core";+import { cn } from "@plane/editor";// typesimport { TModuleFilters } from "@plane/types";// uidiff --git a/web/core/components/pages/editor/editor-body.tsx b/web/core/components/pages/editor/editor-body.tsxindex 3f859f1a2c..b0032c2a1d 100644--- a/web/core/components/pages/editor/editor-body.tsx+++ b/web/core/components/pages/editor/editor-body.tsx@@ -8,7 +8,7 @@ import {EditorReadOnlyRefApi,EditorRefApi,IMarking,-} from "@plane/document-editor";+} from "@plane/editor";// typesimport { IUserLite } from "@plane/types";// components@@ -19,6 +19,8 @@ import { cn } from "@/helpers/common.helper";import { useMember, useMention, useUser, useWorkspace } from "@/hooks/store";import { usePageDescription } from "@/hooks/use-page-description";import { usePageFilters } from "@/hooks/use-page-filters";+// plane web components+import { IssueEmbedCard } from "@/plane-web/components/pages";// servicesimport { FileService } from "@/services/file.service";// store@@ -138,6 +140,11 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {highlights: mentionHighlights,suggestions: mentionSuggestions,}}+ embedHandler={{+ issue: {+ widgetCallback: () => <IssueEmbedCard />,+ },+ }}/>) : (<DocumentReadOnlyEditorWithRef@@ -149,6 +156,11 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {mentionHandler={{highlights: mentionHighlights,}}+ embedHandler={{+ issue: {+ widgetCallback: () => <IssueEmbedCard />,+ },+ }}/>)}</div>diff --git a/web/core/components/pages/editor/header/extra-options.tsx b/web/core/components/pages/editor/header/extra-options.tsxindex 3a244b0749..bd022eed26 100644--- a/web/core/components/pages/editor/header/extra-options.tsx+++ b/web/core/components/pages/editor/header/extra-options.tsx@@ -4,7 +4,7 @@ import { useState } from "react";import { observer } from "mobx-react";import { Lock, Sparkle } from "lucide-react";// editor-import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor";// uiimport { ArchiveIcon } from "@plane/ui";// componentsdiff --git a/web/core/components/pages/editor/header/mobile-root.tsx b/web/core/components/pages/editor/header/mobile-root.tsxindex 4a73d0a55c..166a4b7dcf 100644--- a/web/core/components/pages/editor/header/mobile-root.tsx+++ b/web/core/components/pages/editor/header/mobile-root.tsx@@ -1,5 +1,5 @@import { observer } from "mobx-react";-import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/editor";// componentsimport { PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/pages";// hooksdiff --git a/web/core/components/pages/editor/header/options-dropdown.tsx b/web/core/components/pages/editor/header/options-dropdown.tsxindex 67a477e8be..0d0172e00c 100644--- a/web/core/components/pages/editor/header/options-dropdown.tsx+++ b/web/core/components/pages/editor/header/options-dropdown.tsx@@ -4,7 +4,7 @@ import { observer } from "mobx-react";import { useParams } from "next/navigation";import { ArchiveRestoreIcon, Clipboard, Copy, Link, Lock, LockOpen } from "lucide-react";// document editor-import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi } from "@plane/editor";// uiimport { ArchiveIcon, CustomMenu, TOAST_TYPE, ToggleSwitch, setToast } from "@plane/ui";// helpersdiff --git a/web/core/components/pages/editor/header/root.tsx b/web/core/components/pages/editor/header/root.tsxindex d8051a7d25..2b58e7c763 100644--- a/web/core/components/pages/editor/header/root.tsx+++ b/web/core/components/pages/editor/header/root.tsx@@ -1,5 +1,5 @@import { observer } from "mobx-react";-import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/editor";// componentsimport { PageEditorMobileHeaderRoot, PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/pages";// helpersdiff --git a/web/core/components/pages/editor/header/toolbar.tsx b/web/core/components/pages/editor/header/toolbar.tsxindex 4cbead1ab6..9ca72434c4 100644--- a/web/core/components/pages/editor/header/toolbar.tsx+++ b/web/core/components/pages/editor/header/toolbar.tsx@@ -3,7 +3,7 @@import React, { useEffect, useState, useCallback } from "react";import { Check, ChevronDown } from "lucide-react";// editor-import { EditorMenuItemNames, EditorRefApi } from "@plane/document-editor";+import { EditorMenuItemNames, EditorRefApi } from "@plane/editor";// uiimport { CustomMenu, Tooltip } from "@plane/ui";// constantsdiff --git a/web/core/components/pages/editor/summary/content-browser.tsx b/web/core/components/pages/editor/summary/content-browser.tsxindex 00fd06a667..7f7ad40532 100644--- a/web/core/components/pages/editor/summary/content-browser.tsx+++ b/web/core/components/pages/editor/summary/content-browser.tsx@@ -1,5 +1,5 @@// types-import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/editor";import { OutlineHeading1, OutlineHeading2, OutlineHeading3 } from "./heading-components";type Props = {diff --git a/web/core/components/pages/editor/summary/heading-components.tsx b/web/core/components/pages/editor/summary/heading-components.tsxindex 6807f36b79..5ed1752de0 100644--- a/web/core/components/pages/editor/summary/heading-components.tsx+++ b/web/core/components/pages/editor/summary/heading-components.tsx@@ -1,5 +1,5 @@// document editor-import { IMarking } from "@plane/document-editor";+import { IMarking } from "@plane/editor";type HeadingProps = {marking: IMarking;diff --git a/web/core/components/pages/editor/summary/popover.tsx b/web/core/components/pages/editor/summary/popover.tsxindex 4f9654c96e..ccb6b7b8c3 100644--- a/web/core/components/pages/editor/summary/popover.tsx+++ b/web/core/components/pages/editor/summary/popover.tsx@@ -2,7 +2,7 @@ import { useState } from "react";import { usePopper } from "react-popper";import { List } from "lucide-react";// document editor-import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor";+import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/editor";// helpersimport { cn } from "@/helpers/common.helper";// componentsdiff --git a/web/core/components/pages/editor/title.tsx b/web/core/components/pages/editor/title.tsxindex 85b7be22d3..59502ba817 100644--- a/web/core/components/pages/editor/title.tsx+++ b/web/core/components/pages/editor/title.tsx@@ -3,7 +3,7 @@import { useState } from "react";import { observer } from "mobx-react";// editor-import { EditorRefApi } from "@plane/document-editor";+import { EditorRefApi } from "@plane/editor";// uiimport { TextArea } from "@plane/ui";// helpersdiff --git a/web/core/constants/editor.ts b/web/core/constants/editor.tsindex 2247d9f5cb..ea52792333 100644--- a/web/core/constants/editor.ts+++ b/web/core/constants/editor.ts@@ -20,7 +20,7 @@ import {Underline,} from "lucide-react";// editor-import { EditorMenuItemNames } from "@plane/document-editor";+import { EditorMenuItemNames } from "@plane/editor";type TEditorTypes = "lite" | "document";diff --git a/web/core/hooks/use-page-description.ts b/web/core/hooks/use-page-description.tsindex 245d61395c..3c824b00de 100644--- a/web/core/hooks/use-page-description.ts+++ b/web/core/hooks/use-page-description.ts@@ -1,12 +1,18 @@import React, { useCallback, useEffect, useMemo, useState } from "react";import useSWR from "swr";// editor-import { applyUpdates, mergeUpdates, proseMirrorJSONToBinaryString } from "@plane/document-editor";-import { EditorRefApi, generateJSONfromHTML } from "@plane/editor-core";+import {+ EditorRefApi,+ applyUpdates,+ generateJSONfromHTML,+ mergeUpdates,+ proseMirrorJSONToBinaryString,+} from "@plane/editor";// hooksimport useReloadConfirmations from "@/hooks/use-reload-confirmation";// servicesimport { ProjectPageService } from "@/services/page";+// storeimport { IPage } from "@/store/pages/page";const projectPageService = new ProjectPageService();diff --git a/web/ee/components/pages/extra-actions.tsx b/web/ee/components/pages/extra-actions.tsxdeleted file mode 100644index 4e3c179684..0000000000--- a/web/ee/components/pages/extra-actions.tsx+++ /dev/null@@ -1 +0,0 @@-export * from "ce/components/pages/extra-actions";diff --git a/web/ee/components/pages/index.ts b/web/ee/components/pages/index.tsindex 5ce39384e5..06b9064283 100644--- a/web/ee/components/pages/index.ts+++ b/web/ee/components/pages/index.ts@@ -1 +1 @@-export * from "./extra-actions";+export * from "ce/components/pages";diff --git a/web/package.json b/web/package.jsonindex 177f4dcc7b..6e8c3c27a8 100644--- a/web/package.json+++ b/web/package.json@@ -24,9 +24,7 @@"@nivo/line": "0.80.0","@nivo/pie": "0.80.0","@nivo/scatterplot": "0.80.0",- "@plane/document-editor": "*",- "@plane/lite-text-editor": "*",- "@plane/rich-text-editor": "*",+ "@plane/editor": "*","@plane/types": "*","@plane/ui": "*","@popperjs/core": "^2.11.8",diff --git a/yarn.lock b/yarn.lockindex 2d6b2695e4..94630c5dff 100644--- a/yarn.lock+++ b/yarn.lock@@ -1587,9 +1587,9 @@"@floating-ui/dom" "^1.0.0""@floating-ui/react@^0.26.4":- version "0.26.16"- resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.26.16.tgz#3415a087f452165161c2d313d1d57e8142894679"- integrity sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==+ version "0.26.17"+ resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.26.17.tgz#efa2e1a0dea3d9d308965c5ccd49756bb64a883d"+ integrity sha512-ESD+jYWwqwVzaIgIhExrArdsCL1rOAzryG/Sjlu8yaD3Mtqi3uVyhbE2V7jD58Mo52qbzKz2eUY/Xgh5I86FCQ==dependencies:"@floating-ui/react-dom" "^2.1.0""@floating-ui/utils" "^0.2.0"@@ -3774,13 +3774,6 @@resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.2.tgz#db7257d727c891905947bd1c1a99da20e03c2ebd"integrity sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==-"@tippyjs/react@^4.2.6":- version "4.2.6"- resolved "https://registry.yarnpkg.com/@tippyjs/react/-/react-4.2.6.tgz#971677a599bf663f20bb1c60a62b9555b749cc71"- integrity sha512-91RicDR+H7oDSyPycI13q3b7o4O60wa2oRbjlz2fyRLmHImc4vyDwuUP8NtZaN0VARJY5hybvDYrFzhY9+Lbyw==- dependencies:- tippy.js "^6.3.1"-"@tiptap/core@^2.1.13", "@tiptap/core@^2.4.0":version "2.4.0"resolved "https://registry.yarnpkg.com/@tiptap/core/-/core-2.4.0.tgz#6f8eee8beb5b89363582366b201ccc4798ac98a9"@@ -3987,7 +3980,7 @@"@tiptap/extension-strike" "^2.4.0""@tiptap/extension-text" "^2.4.0"-"@tiptap/suggestion@^2.0.13", "@tiptap/suggestion@^2.1.13":+"@tiptap/suggestion@^2.0.13":version "2.4.0"resolved "https://registry.yarnpkg.com/@tiptap/suggestion/-/suggestion-2.4.0.tgz#1926cde5f197d116baf7794f55bd971245540e5c"integrity sha512-6dCkjbL8vIzcLWtS6RCBx0jlYPKf2Beuyq5nNLrDDZZuyJow5qJAY0eGu6Xomp9z0WDK/BYOxT4hHNoGMDkoAg==@@ -12795,7 +12788,7 @@ tinyspy@^2.2.0:resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.1.tgz#117b2342f1f38a0dbdcc73a50a454883adf861d1"integrity sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==-tippy.js@^6.3.1, tippy.js@^6.3.7:+tippy.js@^6.3.7:version "6.3.7"resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c"integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==@@ -13957,9 +13950,9 @@ y-indexeddb@^9.0.12:lib0 "^0.2.74"y-prosemirror@^1.2.5:- version "1.2.6"- resolved "https://registry.yarnpkg.com/y-prosemirror/-/y-prosemirror-1.2.6.tgz#a324991cc158a6ff3b3f5902111b3dbf8928e603"- integrity sha512-rGz8kX4v/uFJrLaqZvsezY1JGN/zTDSPMO76zRbNcpE63OEiw2PBCEQi9ZlfbEwgCMoeJLUT+otNyO/Oj73TGQ==+ version "1.2.9"+ resolved "https://registry.yarnpkg.com/y-prosemirror/-/y-prosemirror-1.2.9.tgz#0202b5f6b164fa35d80bdbcdc876d81fe6da7ac2"+ integrity sha512-fThGIVmSqrqnG/ckywEGlHM9ElfILC4TcMZd5zxWPe/i+UuP97TEr4swsopRKG3Y+KHBVt4Y/5NVBC3AAsUoUg==dependencies:lib0 "^0.2.42"@@ -14014,9 +14007,9 @@ yargs@^17.0.0:yargs-parser "^21.1.1"yjs@^13.6.15:- version "13.6.15"- resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.6.15.tgz#5a2402632aabf83e5baf56342b4c82fe40859306"- integrity sha512-moFv4uNYhp8BFxIk3AkpoAnnjts7gwdpiG8RtyFiKbMtxKCS0zVZ5wPaaGpwC3V2N/K8TK8MwtSI3+WO9CHWjQ==+ version "13.6.18"+ resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.6.18.tgz#d1575203478bc99ad1b89c098e7d4bacb7f91c3b"+ integrity sha512-GBTjO4QCmv2HFKFkYIJl7U77hIB1o22vSCSQD1Ge8ZxWbIbn8AltI4gyXbtL+g5/GJep67HCMq3Y5AmNwDSyEg==dependencies:lib0 "^0.2.86"