Skip to content

Commit

Permalink
TASK: Upgrade ckeditor5 packages to version 42.0.0 and fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
3m5/frohberg committed Oct 24, 2024
1 parent a5b7015 commit 1d31726
Show file tree
Hide file tree
Showing 5 changed files with 2,583 additions and 2,075 deletions.
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.0",
"@ckeditor/ckeditor5-basic-styles": "^42.0.0",
"@ckeditor/ckeditor5-core": "^42.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "^42.0.0",
"@ckeditor/ckeditor5-engine": "^42.0.0",
"@ckeditor/ckeditor5-essentials": "^42.0.0",
"@ckeditor/ckeditor5-heading": "^42.0.0",
"@ckeditor/ckeditor5-link": "^42.0.0",
"@ckeditor/ckeditor5-list": "^42.0.0",
"@ckeditor/ckeditor5-paragraph": "^42.0.0",
"@ckeditor/ckeditor5-remove-format": "^42.0.0",
"@ckeditor/ckeditor5-table": "^42.0.0",
"@ckeditor/ckeditor5-typing": "^42.0.0",
"@ckeditor/ckeditor5-utils": "^42.0.0",
"@ckeditor/ckeditor5-widget": "^42.0.0",
"@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.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
Expand Down
Loading

0 comments on commit 1d31726

Please sign in to comment.