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.63k stars 3.71k forks source link

Full screen (distraction free) #1235

Open xiaosunJessica opened 6 years ago

xiaosunJessica commented 6 years ago

ckeditor 5 has give up the function about full screen(maximize)???? 


A quick update from the dev team 👋: since this issue gained popularity we'd like to know which kind of editing works best for you (fullscreen vs distraction-free). Please let us know by participating in the poll down below. Thanks 🙏

Reinmar commented 6 years ago

We didn't implement such a function yet. We may do that one day, but that'd be also possible as an integration feature (not part of CKEditor 5). In fact, it would be normally easier to implement that way because there's less assumption one will need to make compared to what we need to predict.

BTW, this could also be called a "distraction free mode".

Reinmar commented 6 years ago

I think that @oleq made some prototypes of a full-screen editing. Were there any problems with that in the past? I think that we'd have to take care of the balloons, am I right?

oleq commented 6 years ago

The topic is related to:

But for plain distraction mode (ignoring iOS) I suppose we could use the same approach as v4. The only difference would be the mode switcher moving the "body" collection containing balloons to the <div class="ck-editor"> container when the editor is full–screen and reverting this change when it gets back to normal.

Since the editor spans the entire viewport anyway we don't have to worry about overflow and cropped balloons.

I think the balloon positioning system is ready for that except that maybe if a balloon is already open when full–screen is requested, we need to re-position it as soon as the "body" element collection moves. But this should (?) be covered by editor.ui#update event which can be triggered manually using the corresponding EditorUI method.

oleq commented 6 years ago

Just FYI, Apple allowed native fullscreen mode on iPad in iOS 12 (checked, it's working). But not on the iPhone (why?) :(

image

If we had it on every device, it could be a huge step forward for us (as previously discussed).

leknoppix commented 4 years ago

Hello, I have to little plugin to include to have the fullscreen

https://github.com/leknoppix/ckeditor5-fullscreen

walidbagh commented 3 years ago

Any news on this?

gitmarcalinascris commented 3 years ago

Any UpdatE?

pradeepmanas commented 3 years ago

oleq commented 3 years ago

FYI I did some research on this topic and here are my findings.


Fullscreen mode (maximize)

UX perspective

Technical perspective

Distraction-free editing

UX perspective

Technical perspective

oleq commented 3 years ago

As a follow-up to my previous comment, here's a question to anyone watching this issue: which feature would you like to see developed?

Feel free to leave a comment if you had something else in mind. This will help us implement the feature you need the most. Thanks 🙏

Madejczyk commented 3 years ago

@oleq what do you think about maximize view with changing editor type and display mode - https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/annotations/annotations-display-mode.html#narrow-sidebar ? Example: as normal view, I have classic build https://ckeditor.com/ckeditor-5/demo/ and inline balloon comments display mode. And when I click on full screen button I would like to change view to Document with wide sidebar for comments. Similar approach to https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/annotations/annotations-display-mode.html#demo that I can jump between display modes.

oleq commented 3 years ago

 Thanks, @Madejczyk 🙏 We'll keep that in mind.

Madejczyk commented 3 years ago

@oleq when you will test above feature please check the tooltip of the first button. Probably the tooltip will be partially visible, but this is minor issue :)

M-hanif commented 2 years ago

strongly we need a maximize button in the editor UI.

lserwatka commented 2 years ago

Do you have any visibility when this feature could be available for CKEditor 5 users?

smileBeda commented 2 years ago

This is a must. maximize plugin

Following to get updates on this feature progress (it feels a bit as if it has been abandoned reading this thread.)

feaswcy commented 1 year ago

vote for maximize. @oleq

wimleers commented 1 year ago

This is technically a regression in Drupal since it moved from CKEditor 4 to 5 — since this is no longer available. It took >1.5 year for somebody to notice though.

We're tracking this in the following Drupal core issue: https://www.drupal.org/project/drupal/issues/3331158.

ssougnez commented 1 year ago

Is there any update on this feature? I've built a CMS app using TinyMCE and I'd like to replace it with CKEditor, however, the lack of Fullscreen feature is a deal breaker for our users. I would love having it.

noeGnh commented 1 year ago

You can try this. It comes from the code of the plugin in this reply https://github.com/ckeditor/ckeditor5/issues/1235#issuecomment-645512140 but I had to remove the icons in svg because it didn't work :

<script setup>
  import FullScreen from 'fullscreen.js'
  import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'

  const editorConfig = ref({
    ...
    plugins: [
      ...
      FullScreen,
      ...
    ],
    toolbar: {
      items: [
        ...
        'fullScreen',
        ...
      ],
    },
  })
  const val = ref('')
</script>

<template>
  <ckeditor
    :editor="ClassicEditor"
    tag-name="div"
    :config="editorConfig"
    :model-value="val">
  </ckeditor>
</template>

<style>
  .ck-editor__editable {
    min-height: 100px;
  }
</style>
// fullscreen.js

import Plugin from '@ckeditor/ckeditor5-core/src/plugin'
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'

import 'style.css'

export default class FullScreen extends Plugin {
  init() {
    const editor = this.editor

    editor.ui.componentFactory.add('fullScreen', (locale) => {
      const view = new ButtonView(locale)
      let state = 0
      view.set({
        label: 'Fullscreen',
        withText: true,
        tooltip: true,
      })

      view.on('execute', () => {
        if (state == 1) {
          editor.sourceElement.nextElementSibling.removeAttribute('id')
          document.body.removeAttribute('id')
          view.set({
            label: 'Fullscreen',
            withText: true,
            tooltip: true,
          })
          state = 0
        } else {
          editor.sourceElement.nextElementSibling.setAttribute(
            'id',
            'fullscreeneditor'
          )
          document.body.setAttribute('id', 'fullscreenoverlay')
          view.set({
            label: 'Normal Size',
            withText: true,
            tooltip: true,
          })
          state = 1
        }
      })

      return view
    })
  }
}
// style.css

#fullscreenoverlay {
  overflow: hidden;
}

#fullscreeneditor {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
}

#fullscreeneditor
  .ck-editor__editable.ck-rounded-corners.ck-editor__editable_inline,
#fullscreeneditor .ck.ck-editor__main {
  height: 100%;
}
ssougnez commented 1 year ago

I created my own plugin to do so but still, I think that this should be part of core plugins maintained by the CKEditor tool.

Witoso commented 1 year ago

@ssougnez thanks for the comments! Yes, this is in our plans but I don't have a specific ETA yet. Interestingly, this is actually a quite tricky feature to develop as we don't know everything about the surroundings of the editor, and at the same time, we need to make it pretty generic.

ssougnez commented 1 year ago

In the plugin I created, I did it like this:

For the style, I used a position "fixed". This way, the surrounding of the editor should not matter very much as this removes it from the normal flow of the document. The other overrides are mainly cosmetic and maybe the CSS in the post above works better than what's below (but the goal was to leave other HTML element than CKEditor's one untouched):

.ck-editor.ck-editor__fs {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;

    .ck-editor__top {
        border-bottom: 1px solid var(--ck-color-toolbar-border);
    }

    .ck-editor__main {
        flex-grow: 1;
        overflow: auto;
    }

    .ck-content {
        border-top: 0;
    }
}

And for the Typescript:

this.editor.ui.componentFactory.add('timestamp', () => {
    const button = new ButtonView();

    button.set({
        ...
    });

    button.on('execute', () => {
        if (element) {
            if (element.classList.contains('ck-editor__fs')) {
                element.classList.remove('ck-editor__fs');
            }
            else {
                element.classList.add('ck-editor__fs')
            }
        }
    })

    return button;
});

I don't have much expertise with ckeditor but does it need to be more complicated than this?

bskibinski commented 1 year ago

I would recommend to start "quick and easy", you will probably see a surge of people requesting this feature because of Drupal 10 migration coming month.

There are a 1000 use-cases you could try to cover in one go, but just start with a 'simple' "position fixed, z-index over 9000, width/height 100%" kinda solution :) you'll probably have over 80% coverage of use cases. Then it's easier to gather any bug reports, and if it's actually worth the effort to support iphone mobile screens or not. The fullscreen api is not meant for this, you don't want to hijack the start bar or other things.

A lot of people have small screens, and admin environments make the ckeditor fields even smaller, they just want a bit more space. The 'max-width text-length' problem should be addressed by your own custom CSS, set a max-width that approximates your site.

The municipalities of the Netherlands will be gratefull for this plugin! ;-)

Witoso commented 1 year ago

We are very unlikely to introduce "quick and easy" (and dirty :wink:). We need to be thoughtful of integrators implementing the editor in various environments, and sticking to a specific version for years, in an ever-changing browser/js environments.

That said, for Drupal, as this is a known platform, we actually provide a Full-screen plugin as a part of our premium module. It is free-to-use! :)

pikulinpw commented 1 year ago

Following the discussion about the feature to maximize the editor to full screen, I developed a plugin that solves this problem. I would appreciate it if you tried it and share your experience using it. Any additions, suggestions or questions are welcome. Your feedback will help make the plugin even better!

https://github.com/pikulinpw/ckeditor5-fullscreen

queenielow commented 11 months ago

Following

Jeff-Tian commented 6 months ago

Now it's 2024. Do we have updates on the (full screen/maximize) feature (officially)?

I am using https://github.com/ckeditor/strapi-plugin-ckeditor inside the strapi CMS, a custom field. Although it's automatically growing in height, the width is too narrow. The fullscreen/maximize helps when writing stuff.

sathya2015 commented 6 months ago

We are using ckeditor5 that came with DLL compatible packages in PeopleSoft, Hope to see this Maximize/full screen option in core plugins. Any help on how to implement the plug-ins where dll builds are used.