Skip to content
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

WIP: Ckeditor5 upgrade #3863

Draft
wants to merge 2 commits into
base: 9.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29 changes: 15 additions & 14 deletions packages/neos-ui-ckeditor5-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
"private": true,
"main": "./src/manifest.js",
"dependencies": {
"@ckeditor/ckeditor5-alignment": "^16.0.0",
"@ckeditor/ckeditor5-basic-styles": "^16.0.0",
"@ckeditor/ckeditor5-core": "^16.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "^16.0.0",
"@ckeditor/ckeditor5-engine": "^16.0.0",
"@ckeditor/ckeditor5-essentials": "^16.0.0",
"@ckeditor/ckeditor5-heading": "^16.0.0",
"@ckeditor/ckeditor5-link": "^16.0.0",
"@ckeditor/ckeditor5-list": "^16.0.0",
"@ckeditor/ckeditor5-paragraph": "^16.0.0",
"@ckeditor/ckeditor5-remove-format": "^16.0.0",
"@ckeditor/ckeditor5-table": "^16.0.0",
"@ckeditor/ckeditor5-utils": "^16.0.0",
"@ckeditor/ckeditor5-widget": "^16.0.0",
"@ckeditor/ckeditor5-alignment": "^42.0.2",
"@ckeditor/ckeditor5-basic-styles": "^42.0.2",
"@ckeditor/ckeditor5-core": "^42.0.2",
"@ckeditor/ckeditor5-editor-decoupled": "^42.0.2",
"@ckeditor/ckeditor5-engine": "^42.0.2",
"@ckeditor/ckeditor5-essentials": "^42.0.2",
"@ckeditor/ckeditor5-heading": "^42.0.2",
"@ckeditor/ckeditor5-link": "^42.0.2",
"@ckeditor/ckeditor5-list": "^42.0.2",
"@ckeditor/ckeditor5-paragraph": "^42.0.2",
"@ckeditor/ckeditor5-remove-format": "^42.0.2",
"@ckeditor/ckeditor5-table": "^42.0.2",
"@ckeditor/ckeditor5-typing": "^42.0.2",
"@ckeditor/ckeditor5-utils": "^42.0.2",
"@ckeditor/ckeditor5-widget": "^42.0.2",
"@neos-project/neos-ui-decorators": "workspace:*",
"@neos-project/neos-ui-editors": "workspace:*",
"@neos-project/neos-ui-extensibility": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import Command from '@ckeditor/ckeditor5-core/src/command';
import {findAncestor} from '@ckeditor/ckeditor5-table/src/commands/utils';

class InsideTableCommand extends Command {
refresh() {
const {selection} = this.editor.model.document;
const tableParent = findAncestor('table', selection.getFirstPosition());
const tableParent = selection.getFirstPosition().findAncestor('table');

this.value = Boolean(tableParent);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Command from '@ckeditor/ckeditor5-core/src/command';
import findLinkRange from '@ckeditor/ckeditor5-link/src/findlinkrange';
import findAttributeRange from '@ckeditor/ckeditor5-typing/src/utils/findattributerange'
import toMap from '@ckeditor/ckeditor5-utils/src/tomap';

export default class LinkAttributeCommand extends Command {
Expand Down Expand Up @@ -27,15 +27,15 @@ export default class LinkAttributeCommand extends Command {
model.change(writer => {
if (toggleMode && !value) {
const rangesToUnset = selection.isCollapsed ?
[findLinkRange(selection.getFirstPosition(), selection.getAttribute('linkHref'), model)] : selection.getRanges();
[findAttributeRange(selection.getFirstPosition(), selection.getAttribute('linkHref'), model)] : selection.getRanges();
for (const range of rangesToUnset) {
writer.removeAttribute(this.attributeKey, range);
}
} else if (selection.isCollapsed) {
const position = selection.getFirstPosition();

if (selection.hasAttribute('linkHref')) {
const linkRange = findLinkRange(selection.getFirstPosition(), selection.getAttribute('linkHref'), model);
const linkRange = findAttributeRange(selection.getFirstPosition(), selection.getAttribute('linkHref'), model);
if (value === false) {
writer.removeAttribute(this.attributeKey, linkRange);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/neos-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"typescript": "^4.6.4"
},
"dependencies": {
"@ckeditor/ckeditor5-highlight": "16.0.0",
"@ckeditor/ckeditor5-highlight": "42.0.2",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-brands-svg-icons": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2",
Expand Down
Loading
Loading