-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LPS-130835 Create Balloon Editor Plugins #1070
Conversation
CI is automatically triggering the following test suites:
|
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPS-130835 1 Successful Jobs:For more details click here. |
Jenkins Build:test-portal-source-format#5868 Jenkins Report:jenkins-report.html Jenkins Suite:sf Pull Request:liferay-frontend#1070 Testray Routine:EE Pull Request Testray Importer:publish-testray-report#588 |
Jenkins Build:test-portal-acceptance-pullrequest(master)#7771 Jenkins Report:jenkins-report.html Jenkins Suite:relevant Pull Request:liferay-frontend#1070 Testray Routine:EE Pull Request Testray Build:[master] ci:test:relevant - julien > liferay-frontend - PR#1070 - 2021-05-18[04:36:07] Testray Importer:publish-testray-report#592 |
} | ||
|
||
if (y < editableClientRect.y) { | ||
y = clientRect.bottom + padding; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It solves:
Errors when positioning an image point 2
Misc points 1,2 and 3
Hey @diegonvs, please be explicit about the error even when including a link to a Slack thread (Misc points 1,2 and 3 is pretty vague even when viewing the thread) - I'll have a look at the suggested solution, but I don't understand how this could affect "pasting text" and the "image drag handle". We should discuss this, because I'm not seeing the same issues you mention
In this .gif, I'm pasting 15 paragraphs of "Lorem Ipsum" a couple of times (note that the issues are related to cookies and not the editor, no error is thrown)
In this .gif, I select 15 paragraphs of text and formatting it to bold, underline, italic and the removing the formatting: no errors are thrown
In this .gif, I'm resizing the image a few times using the "handle", as I said in the thread "it's not pixel perfect", but it's not so bad either. This plugin comes with CKEditor, we haven't done any modifications so far. I'm not trying to say that there are no errors, I'm not seeing what you described so if I didn't understand what you wrote, please include a .gif and the error itself. Thanks Since you mention "dragging an image around in the editor", here's another .gif of we doing just that Just to make things clear, even if this works, I'm assuming it could crash - this isn't a word processor, it's just a To avoid this being "committed" since I don't agree, I'm deleting your suggestion |
When checking the bugs described by @diegonvs, I did see something I wanted to fix, which can be seen in the following screenshot (I'm sure @dsanz will like this image 😄 ) I pushed another commit ( Here's a (slow) .gif of the result |
In Before After [EDIT] The message you'll see in the second .gif has not been added, it was temporary |
|
||
// Fix for BGColor button | ||
|
||
var originalShowBlockFn = CKEDITOR.ui.panel.prototype.showBlock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I like this Fn
suffix.
I was having trouble and some errors were thrown in console when executing these actions previously and I decided to investigate more about it. When debugging on console I notice a undefined value for When testing in other cases it worked. However, testing again it wasn't reproducible anymore but I found another issue and I think it doesn't have clear steps like: When playing around: Screen.Recording.2021-06-03.at.18.11.41.movAgain trying to find the clear steps: Screen.Recording.2021-06-03.at.18.18.30.movI wasn't able to repro anymore. :/// |
Probably these errors happened to me as a shown in last GIF :/ It is something intermittently(I don't like this word) |
@diegonvs looking at the videos you added it makes sense: the |
...r-ckeditor-web/src/main/resources/META-INF/resources/_diffs/plugins/toolbarbuttons/plugin.js
Outdated
Show resolved
Hide resolved
This: #1150 (comment) I think it only works the second time (because the focusable is registered in the onchange callback, it has to be executed once). I would register a global one selecting the whole plugin as I did in my example. There is a callback when the plugin has been loaded that could be useful. |
About ES6, #1150 (comment) @diegonvs I believe we can use template literals, and all other ES6+ goodies. I used it in addimages plugin. I don't think there is anything special about that plugin 🤔 Looking at #1150 (comment), @julien, were you maybe thinking about a plugin in ckeditor repo? On that repo we don't have babel integration, so something like liferay/liferay-ckeditor#114 makes sense to be in ES5. |
@markocikos yes exactly: I meant to say that we can use ES6 in dxp but not if the plugin is in CKEditor directly. |
It will look good then. I was understanding this plugin(on
Yes. Is there a place to write about it and prevent people to just use ES5 there? |
✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPS-130835 1 Successful Jobs:For more details click here. |
ci:forward |
CI is automatically triggering the following test suites:
The pull request will automatically be forwarded to the user
|
Skipping previously passed test suites: |
All required test suite(s) passed. |
Pull request has been successfully forwarded to brianchandotcom#104367 |
Jenkins Build:test-portal-acceptance-pullrequest(master)#254 Jenkins Report:jenkins-report.html Jenkins Suite:relevant Pull Request:liferay-frontend#1070 Testray Routine:EE Pull Request Testray Build:[master] ci:test:relevant - julien > liferay-frontend - PR#1070 - 2021-07-14[11:48:33] Testray Importer:publish-testray-report#48 |
This pull request provides the Balloon Editor React component,
as well as the required CKEditor plugins.
Here's the list of tasks that have been worked on:
liferay-ckeditor
BGColor
) pluginInstead of using the patch workflow available in
liferay-ckeditor
, aballooneditor
plugin has been created to override the default behavior of theballoonpanel
andballoontoolbar
plugins: but the end result is the same. Following the advice received here , all plugins have been create directly in DXP (in thefrontend-editor-ckeditor-web
module).Screenshots
Selecting text from top to bottom
![](https://user-images.githubusercontent.com/5572/118636596-24e77e00-b7d5-11eb-86fb-4301e86c16ce.png)
Selecting text from bottom to top
![](https://user-images.githubusercontent.com/5572/118636643-32046d00-b7d5-11eb-8a9f-bfd1986e3ae6.png)
Selecting images
![](https://user-images.githubusercontent.com/5572/118636673-392b7b00-b7d5-11eb-90aa-92d8b8d7bcd3.png)
Adding alternative text to an image
![](https://user-images.githubusercontent.com/5572/118636727-4a748780-b7d5-11eb-9cae-4ecc4e673fe0.png)
Adding a link to an image
![](https://user-images.githubusercontent.com/5572/118636772-57917680-b7d5-11eb-9880-8889c79eda6c.png)
Adding an image from the document library
![](https://user-images.githubusercontent.com/5572/118636856-6e37cd80-b7d5-11eb-9afa-e58a5da62440.png)
The plus button and it's toolbar (which allows adding images, videos, tables, and horizontal rules)
![](https://user-images.githubusercontent.com/5572/118636911-814a9d80-b7d5-11eb-9e43-73d447a82802.png)
Adding a table from the plus button
![](https://user-images.githubusercontent.com/5572/118637190-cf5fa100-b7d5-11eb-9336-1db88458a7bf.png)
Selecting a video
![](https://user-images.githubusercontent.com/5572/118665388-8ff37d80-b7f2-11eb-8702-27ffdb6661f6.png)
What's missing
Test plan
You'll need a local clone of theNot anymore, thanks to @markocikos who released a new version ofliferay-ckeditor
repository and these changesliferay-ckeditor
.frontend-editor-ckeditor-web
modulefrontend-editor-ckeditor-sample-web
moduleMisc
Naming is hard: I tried to come up with names that make sense for plugins, but there's always room for improvement
You'll probably notice that I've added some
eslint
andprettier
specific comments in some plugins (here's an example), this will need more investigation, but using the code below (as formatted by prettier) will not work as expected.