refactor: flatten editor package folder structure (#9719)

Remove the ce/ee split in @plane/editor and consolidate everything under
src/core, matching the layout used in the enterprise repository.

- Move ce components, constants, extensions, helpers, and types into core
- Rename ce/extensions/slash-commands.tsx to additional-slash-command-options.tsx
  to avoid clashing with the existing slash-commands/ directory
- Merge ce type stubs and parser helpers into their core counterparts
- Drop the ee re-export shim (no consumers)
- Rewrite @/plane-editor/* imports to @/* and trim tsconfig path aliases
This commit is contained in:
sriram veeraghanta
2026-08-31 14:06:41 +05:30
committed by GitHub
parent effd0c5719
commit fd4110e8aa
44 changed files with 46 additions and 102 deletions

View File

@@ -1,9 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "./core";
export * from "./document-extensions";
export * from "./slash-commands";

View File

@@ -1,25 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
/**
* @description function to extract all additional assets from HTML content
* @param htmlContent
* @returns {string[]} array of additional asset sources
*/
export const extractAdditionalAssetsFromHTMLContent = (_htmlContent: string): string[] => [];
/**
* @description function to replace additional assets in HTML content with new IDs
* @param props
* @returns {string} HTML content with replaced additional assets
*/
export const replaceAdditionalAssetsInHTMLContent = (props: {
htmlContent: string;
assetMap: Record<string, string>;
}): string => {
const { htmlContent } = props;
return htmlContent;
};

View File

@@ -1,7 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export type TAdditionalEditorAsset = never;

View File

@@ -1,7 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export type TExtendedFileHandler = object;

View File

@@ -1,9 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "./issue-embed";
export * from "./editor-extended";
export * from "./config";

View File

@@ -20,7 +20,7 @@ import { getEditorClassNames } from "@/helpers/common";
// hooks
import { useEditor } from "@/hooks/use-editor";
// plane editor extensions
import { DocumentEditorAdditionalExtensions } from "@/plane-editor/extensions";
import { DocumentEditorAdditionalExtensions } from "@/extensions/document-extensions";
// types
import type { EditorRefApi, IDocumentEditorProps } from "@/types";

View File

@@ -15,7 +15,7 @@ import { DEFAULT_DISPLAY_CONFIG } from "@/constants/config";
import { CORE_EXTENSIONS } from "@/constants/extension";
// components
import type { TCollabValue } from "@/contexts";
import { LinkContainer } from "@/plane-editor/components/link-container";
import { LinkContainer } from "@/components/link-container";
// plugins
import { nodeHighlightPluginKey } from "@/plugins/highlight";
// types

View File

@@ -11,7 +11,7 @@ import { BlockMenu, EditorBubbleMenu } from "@/components/menus";
// extensions
import { SideMenuExtension } from "@/extensions";
// plane editor imports
import { RichTextEditorAdditionalExtensions } from "@/plane-editor/extensions/rich-text-extensions";
import { RichTextEditorAdditionalExtensions } from "@/extensions/rich-text-extensions";
// types
import type { EditorRefApi, IRichTextEditorProps } from "@/types";

View File

@@ -8,7 +8,7 @@
import type { ADDITIONAL_EXTENSIONS } from "@plane/utils";
import { CORE_EXTENSIONS } from "@plane/utils";
// plane editor imports
import type { ExtensionFileSetStorageKey } from "@/plane-editor/types/storage";
import type { ExtensionFileSetStorageKey } from "@/types/storage";
export type NodeFileMapType = Partial<
Record<

View File

@@ -9,7 +9,7 @@ import TaskList from "@tiptap/extension-task-list";
import { TextStyle } from "@tiptap/extension-text-style";
import { Underline } from "@tiptap/extension-underline";
// plane editor imports
import { CoreEditorAdditionalExtensionsWithoutProps } from "@/plane-editor/extensions/core/without-props";
import { CoreEditorAdditionalExtensionsWithoutProps } from "@/extensions/core/without-props";
// extensions
import { CustomCalloutExtensionConfig } from "./callout/extension-config";
import { CustomCodeBlockExtensionWithoutProps } from "./code/without-props";

View File

@@ -34,7 +34,7 @@ import {
UtilityExtension,
} from "@/extensions";
// plane editor extensions
import { CoreEditorAdditionalExtensions } from "@/plane-editor/extensions";
import { CoreEditorAdditionalExtensions } from "@/extensions/core";
// types
import type { IEditorProps } from "@/types";
// local imports

View File

@@ -26,3 +26,6 @@ export * from "./quote";
export * from "./side-menu";
export * from "./text-align";
export * from "./utility";
export * from "./core";
export * from "./document-extensions";
export * from "./additional-slash-command-options";

View File

@@ -42,7 +42,7 @@ import {
openEmojiPicker,
} from "@/helpers/editor-commands";
// plane editor extensions
import { coreEditorAdditionalSlashCommandOptions } from "@/plane-editor/extensions";
import { coreEditorAdditionalSlashCommandOptions } from "@/extensions/additional-slash-command-options";
// types
import type { CommandProps, ISlashCommandItem, TSlashCommandSectionKeys } from "@/types";
// local types

View File

@@ -11,7 +11,7 @@ import type { Transaction } from "@tiptap/pm/state";
import { v4 as uuidv4 } from "uuid";
// constants
import { CORE_EXTENSIONS, BLOCK_NODE_TYPES } from "@/constants/extension";
import { ADDITIONAL_BLOCK_NODE_TYPES } from "@/plane-editor/constants/extensions";
import { ADDITIONAL_BLOCK_NODE_TYPES } from "@/constants/extensions";
import { createUniqueIDPlugin } from "./plugin";
import { createIdsForView } from "./utils";
// plane imports

View File

@@ -10,7 +10,7 @@ import codemark from "prosemirror-codemark";
import { CORE_EXTENSIONS } from "@/constants/extension";
import { restorePublicImages } from "@/helpers/image-helpers";
// plugins
import type { TAdditionalActiveDropbarExtensions } from "@/plane-editor/types/utils";
import type { TAdditionalActiveDropbarExtensions } from "@/types/utils";
import { DropHandlerPlugin } from "@/plugins/drop";
import { FilePlugins } from "@/plugins/file/root";
import { MarkdownClipboardPlugin } from "@/plugins/markdown-clipboard";

View File

@@ -11,7 +11,7 @@ import { CORE_EXTENSIONS } from "@plane/utils";
// extensions
import { getImageBlockId } from "@/extensions/custom-image/utils";
// plane editor imports
import { ADDITIONAL_ASSETS_META_DATA_RECORD } from "@/plane-editor/constants/assets";
import { ADDITIONAL_ASSETS_META_DATA_RECORD } from "@/constants/assets";
// types
import type { TEditorAsset } from "@/types";

View File

@@ -6,14 +6,29 @@
// plane imports
import type { TDocumentPayload, TDuplicateAssetData, TDuplicateAssetResponse, TEditorAssetType } from "@plane/types";
// plane web imports
import {
extractAdditionalAssetsFromHTMLContent,
replaceAdditionalAssetsInHTMLContent,
} from "@/plane-editor/helpers/parser";
// local imports
import { convertHTMLDocumentToAllFormats } from "./yjs-utils";
/**
* @description function to extract all additional assets from HTML content
* @param htmlContent
* @returns {string[]} array of additional asset sources
*/
export const extractAdditionalAssetsFromHTMLContent = (_htmlContent: string): string[] => [];
/**
* @description function to replace additional assets in HTML content with new IDs
* @param props
* @returns {string} HTML content with replaced additional assets
*/
export const replaceAdditionalAssetsInHTMLContent = (props: {
htmlContent: string;
assetMap: Record<string, string>;
}): string => {
const { htmlContent } = props;
return htmlContent;
};
/**
* @description function to extract all assets from HTML content
* @param htmlContent

View File

@@ -4,7 +4,7 @@
* See the LICENSE file for details.
*/
import { assetDuplicationHandlers } from "@/plane-editor/helpers/asset-duplication";
import { assetDuplicationHandlers } from "@/helpers/asset-duplication";
// Utility function to process HTML content with all registered handlers
export const processAssetDuplication = (htmlContent: string): { processedHtml: string } => {

View File

@@ -15,7 +15,7 @@ import { HeadingListExtension, SideMenuExtension } from "@/extensions";
// hooks
import { useEditor } from "@/hooks/use-editor";
// plane editor extensions
import { DocumentEditorAdditionalExtensions } from "@/plane-editor/extensions";
import { DocumentEditorAdditionalExtensions } from "@/extensions/document-extensions";
// types
import type {
TCollaborativeEditorHookProps,

View File

@@ -10,11 +10,11 @@ import type { EditorState, Transaction } from "@tiptap/pm/state";
// constants
import { CORE_EDITOR_META } from "@/constants/meta";
// plane editor imports
import { NODE_FILE_MAP } from "@/plane-editor/constants/utility";
import { NODE_FILE_MAP } from "@/constants/utility";
// types
import type { TFileHandler } from "@/types";
// local imports
import type { NodeFileMapType } from "../../../ce/constants/utility";
import type { NodeFileMapType } from "../../constants/utility";
import type { TFileNode } from "./types";
const DELETE_PLUGIN_KEY = new PluginKey("delete-utility");

View File

@@ -12,11 +12,11 @@ import { CORE_EXTENSIONS } from "@plane/utils";
// helpers
import { CORE_ASSETS_META_DATA_RECORD } from "@/helpers/assets";
// plane editor imports
import { NODE_FILE_MAP } from "@/plane-editor/constants/utility";
import { NODE_FILE_MAP } from "@/constants/utility";
// types
import type { TFileHandler } from "@/types";
// local imports
import type { NodeFileMapType } from "../../../ce/constants/utility";
import type { NodeFileMapType } from "../../constants/utility";
import type { TFileNode } from "./types";
const RESTORE_PLUGIN_KEY = new PluginKey("restore-utility");

View File

@@ -6,8 +6,8 @@
// constants
import type { CORE_EXTENSIONS } from "@/constants/extension";
// plane editor imports
import type { TAdditionalEditorAsset } from "@/plane-editor/types/asset";
export type TAdditionalEditorAsset = never;
export type TEditorImageAsset = {
href: string;

View File

@@ -4,8 +4,7 @@
* See the LICENSE file for details.
*/
// plane imports
import type { TExtendedFileHandler } from "@/plane-editor/types/config";
export type TExtendedFileHandler = object;
export type TFileHandler = {
assetsUploadStatus: Record<string, number>; // blockId => progress percentage

View File

@@ -18,7 +18,7 @@ import type {
IEditorPropsExtended,
TExtendedEditorCommands,
ICollaborativeDocumentEditorPropsExtended,
} from "@/plane-editor/types/editor-extended";
} from "@/types/editor-extended";
// types
import type {
IMarking,

View File

@@ -15,5 +15,5 @@ export * from "./hook";
export * from "./mention";
export * from "./slash-commands-suggestion";
export * from "./document-collaborative-events";
export * from "@/plane-editor/types";
export * from "./issue-embed";
export * from "./editor-extended";

View File

@@ -1,7 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "src/ce/extensions";

View File

@@ -1,7 +0,0 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "src/ce/types";

View File

@@ -20,7 +20,7 @@ export * from "@/helpers/common";
export * from "@/helpers/yjs-utils";
export { CORE_EXTENSIONS } from "@/constants/extension";
export { ADDITIONAL_EXTENSIONS } from "@/plane-editor/constants/extensions";
export { ADDITIONAL_EXTENSIONS } from "@/constants/extensions";
// types
export * from "@/types";

View File

@@ -6,9 +6,7 @@
"noUnusedLocals": false,
"noUnusedParameters": false,
"paths": {
"src/*": ["./src/*"],
"@/*": ["./src/core/*"],
"@/plane-editor/*": ["./src/ce/*"],
"@/styles/*": ["./src/styles/*"]
}
},