ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.59k stars 3.7k forks source link

Impossible to build CKEditor without UI #14115

Open Inviz opened 1 year ago

Inviz commented 1 year ago

📝 Provide detailed reproduction steps (if any)

I'm trying to use CKEditor as a framework, and not the UI kit. I'm really struggling in ditching the Widget/UI modules.

  1. Anything that depends on clipboard (e.g. linkediting) pulls in clipboard, which pulls widget which pulls UI
  2. Because i want to avoid loading UI parts of the commands/plugins, I need to use files directly. There're issues with importing classes in typescript. E.g. importing from engine/src/editor/editor doesnt allow to instantiate the Editor.

here's an example of workaround i have to do to import a class not fron entry point of a package

import { default as OriginalRenderer } from '@ckeditor/ckeditor5-engine/src/view/renderer.js'
import type { Renderer as OriginaRendererConstructor } from '@ckeditor/ckeditor5-engine'
export const Renderer = OriginalRenderer as unknown as typeof OriginaRendererConstructor
  1. CSS/Icons is loaded in many places unconditionally
  2. Modules internally pull from each other's entry point, making them load eveyrthing. Example:
import {
    DomEventData,
    Observer,
    type View,
    type ViewDocumentCompositionEndEvent,
    type ViewDocumentInputEvent,
    type ViewDocumentSelection,
    type ViewRange,
    type ViewSelection
} from '@ckeditor/ckeditor5-engine'; 

in ckeditor5-typing, forces loading of css/icons

  1. Some modules are importuing ui casually in utils files: https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-list/src/list/utils.ts

✔️ Expected result

It should be possible to have basic functionality

❌ Actual result

One way or another we're back to build that includes UI, css, svg icons, Widget, etc.

❓ Possible solution

Clear up some unnecessary dependencies

Witoso commented 1 year ago

Hey @Inviz! This is a very interesting use case, and it got us thinking internally! Would you be willing to jump on a call with me and couple of devs? I can follow up to your email from the profile.

Inviz commented 1 year ago

@Witoso

Definitely i'd love to jump on a call, i think my email aliases to invizko@gmail.com - you can reach me there. Let's do it today soon?

Inviz commented 1 year ago

Here're some examples of what i've been doing with ckeditor. Container-level "cursor", real inline elements inside text elements, themes, css grid editor, multi-row flexbox drag and drop, data mapping/repeating, linked duplicate, external css customization, custom elements, web components, responsive designs, to name a few.

Screen Shot 2023-05-12 at 19 05 51 Screen Shot 2023-05-12 at 19 05 57 Screen Shot 2023-05-12 at 19 05 36 Screen Shot 2023-05-12 at 19 06 15 Screen Shot 2023-05-12 at 19 17 24
CKEditorBot commented 6 months ago

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.