diff --git a/src/bundle/Resources/encore/ibexa.webpack.custom.config.js b/src/bundle/Resources/encore/ibexa.webpack.custom.config.js index c866bdbb..098cfd2e 100644 --- a/src/bundle/Resources/encore/ibexa.webpack.custom.config.js +++ b/src/bundle/Resources/encore/ibexa.webpack.custom.config.js @@ -1,6 +1,5 @@ const Encore = require('@symfony/webpack-encore'); const path = require('path'); -const { styles } = require(path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor/ckeditor5-dev-utils')); const ibexaConfigManager = require(path.resolve('./ibexa.webpack.config.manager.js')); const configManagers = require(path.resolve('./var/encore/ibexa.richtext.config.manager.js')); @@ -9,11 +8,15 @@ Encore.setOutputPath('public/assets/richtext/build').setPublicPath('/assets/rich Encore.addEntry('ibexa-richtext-onlineeditor-js', [path.resolve(__dirname, '../public/js/CKEditor/core/base-ckeditor.js')]).addStyleEntry( 'ibexa-richtext-onlineeditor-css', - [path.resolve(__dirname, '../public/scss/ckeditor.scss')], + [ + path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5/dist/ckeditor5.css'), + path.resolve(__dirname, '../public/scss/ckeditor.scss'), + ], ); Encore.addAliases({ '@ckeditor': path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor'), + ckeditor5: path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5'), '@fieldtype-richtext': path.resolve('./vendor/ibexa/fieldtype-richtext'), '@ibexa-admin-ui': path.resolve('./vendor/ibexa/admin-ui'), }); @@ -25,43 +28,6 @@ customConfig.name = 'richtext'; customConfig.module.rules[4].oneOf[1].use[1].options.url = false; customConfig.module.rules[1].oneOf[1].use[1].options.url = false; -customConfig.module.rules.push({ - test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/, - use: ['raw-loader'], -}); - -customConfig.module.rules.push({ - test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/, - use: [ - { - loader: 'style-loader', - options: { - injectType: 'singletonStyleTag', - attributes: { - 'data-cke': true, - }, - }, - }, - 'css-loader', - { - loader: 'postcss-loader', - options: { - postcssOptions: styles.getPostCssConfig({ - themeImporter: { - themePath: require.resolve( - path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor/ckeditor5-theme-lark'), - ), - }, - minify: true, - }), - }, - }, - ], -}); - -customConfig.module.rules[1] = {}; -customConfig.module.rules[2] = {}; - configManagers.forEach((configManagerPath) => { const configManager = require(path.resolve(configManagerPath)); diff --git a/src/bundle/Resources/public/js/CKEditor/anchor/anchor-editing.js b/src/bundle/Resources/public/js/CKEditor/anchor/anchor-editing.js index 0806b736..6e963119 100644 --- a/src/bundle/Resources/public/js/CKEditor/anchor/anchor-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/anchor/anchor-editing.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, Widget } from 'ckeditor5'; class IbexaAnchorEditing extends Plugin { static get requires() { @@ -70,13 +69,21 @@ class IbexaAnchorEditing extends Plugin { }); this.editor.conversion.for('upcast').add((dispatcher) => { - dispatcher.on('element:li', (event, data, conversionApi) => { - const listParent = data.viewItem.parent; - const listItem = data.modelRange.start.nodeAfter ?? data.modelRange.end.nodeBefore; + const anchorUpcastConverter = (event, data, conversionApi) => { + if (!data.modelRange) { + Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor)); + } + + const listParent = data.viewItem; const id = listParent.getAttribute('id'); - conversionApi.writer.setAttribute('anchor', id, listItem); - }); + for (const listItem of data.modelRange.getItems({ shallow: true })) { + conversionApi.writer.setAttribute('anchor', id, listItem); + } + }; + + dispatcher.on('element:ul', anchorUpcastConverter); + dispatcher.on('element:ol', anchorUpcastConverter); }); } diff --git a/src/bundle/Resources/public/js/CKEditor/anchor/anchor-ui.js b/src/bundle/Resources/public/js/CKEditor/anchor/anchor-ui.js index e09c90bd..7a7b0683 100644 --- a/src/bundle/Resources/public/js/CKEditor/anchor/anchor-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/anchor/anchor-ui.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; +import { Plugin, clickOutsideHandler } from 'ckeditor5'; import IbexaAnchorFormView from './ui/anchor-form-view'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/anchor/anchor.js b/src/bundle/Resources/public/js/CKEditor/anchor/anchor.js index bc9d1ddf..1c1ddf1f 100644 --- a/src/bundle/Resources/public/js/CKEditor/anchor/anchor.js +++ b/src/bundle/Resources/public/js/CKEditor/anchor/anchor.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaAnchorUI from './anchor-ui'; import IbexaAnchorEditing from './anchor-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/anchor/ui/anchor-form-view.js b/src/bundle/Resources/public/js/CKEditor/anchor/ui/anchor-form-view.js index 9d39558a..b58d403c 100644 --- a/src/bundle/Resources/public/js/CKEditor/anchor/ui/anchor-form-view.js +++ b/src/bundle/Resources/public/js/CKEditor/anchor/ui/anchor-form-view.js @@ -1,7 +1,4 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; +import { View, ButtonView, LabeledFieldView, createLabeledInputText } from 'ckeditor5'; class IbexaLinkFormView extends View { constructor(props) { diff --git a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-command.js b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-command.js index 56bdfc34..32c017aa 100644 --- a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-command.js +++ b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaBlockAlignmentCommand extends Command { refresh() { diff --git a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-editing.js b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-editing.js index 6d0c161f..6b26256a 100644 --- a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-editing.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, Widget } from 'ckeditor5'; import IbexaBlockAlignmentCommand from './block-alignment-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-ui.js b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-ui.js index 9bf94df7..2cf44356 100644 --- a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-ui.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; +import { Plugin, ClickObserver } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment.js b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment.js index 83f1b15b..55b2f68f 100644 --- a/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment.js +++ b/src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaBlockAlignmentUI from './block-alignment-ui'; import IbexaBlockAlignmentEditing from './block-alignment-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/common/button-view/button-view.js b/src/bundle/Resources/public/js/CKEditor/common/button-view/button-view.js index 760dc56c..55b06d23 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/button-view/button-view.js +++ b/src/bundle/Resources/public/js/CKEditor/common/button-view/button-view.js @@ -1,4 +1,4 @@ -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { ButtonView } from 'ckeditor5'; import IbexaIconView from '../icon-view/icon-view'; @@ -7,5 +7,7 @@ export default class IbexaButtonView extends ButtonView { super(locale); this.iconView = new IbexaIconView(); + + this.iconView.bind('content').to(this, 'icon'); } } diff --git a/src/bundle/Resources/public/js/CKEditor/common/chips-button-view/chips-button-view.js b/src/bundle/Resources/public/js/CKEditor/common/chips-button-view/chips-button-view.js index 2a6b2417..80094f24 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/chips-button-view/chips-button-view.js +++ b/src/bundle/Resources/public/js/CKEditor/common/chips-button-view/chips-button-view.js @@ -1,4 +1,4 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5'; export default class IbexaChipsButtonView extends View { constructor() { diff --git a/src/bundle/Resources/public/js/CKEditor/common/icon-view/icon-view.js b/src/bundle/Resources/public/js/CKEditor/common/icon-view/icon-view.js index 6aa6cf20..f5021dab 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/icon-view/icon-view.js +++ b/src/bundle/Resources/public/js/CKEditor/common/icon-view/icon-view.js @@ -1,4 +1,4 @@ -import IconView from '@ckeditor/ckeditor5-ui/src/icon/iconview'; +import { IconView } from 'ckeditor5'; export default class IbexaIconView extends IconView { render() { diff --git a/src/bundle/Resources/public/js/CKEditor/common/input-number/input-number-view.js b/src/bundle/Resources/public/js/CKEditor/common/input-number/input-number-view.js index fe5217af..3dcc45e4 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/input-number/input-number-view.js +++ b/src/bundle/Resources/public/js/CKEditor/common/input-number/input-number-view.js @@ -1,4 +1,4 @@ -import InputTextView from '@ckeditor/ckeditor5-ui/src/inputtext/inputtextview'; +import { InputTextView } from 'ckeditor5'; export default class InputNumberView extends InputTextView { constructor(locale) { diff --git a/src/bundle/Resources/public/js/CKEditor/common/multivalue-dropdown/utils.js b/src/bundle/Resources/public/js/CKEditor/common/multivalue-dropdown/utils.js index 2c73d2c4..a141486b 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/multivalue-dropdown/utils.js +++ b/src/bundle/Resources/public/js/CKEditor/common/multivalue-dropdown/utils.js @@ -1,5 +1,4 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ListView from '@ckeditor/ckeditor5-ui/src/list/listview'; +import { View, ListView } from 'ckeditor5'; import ChipsButtonView from '../../common/chips-button-view/chips-button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/common/switch-button/utils.js b/src/bundle/Resources/public/js/CKEditor/common/switch-button/utils.js index c16e2388..f2729ba7 100644 --- a/src/bundle/Resources/public/js/CKEditor/common/switch-button/utils.js +++ b/src/bundle/Resources/public/js/CKEditor/common/switch-button/utils.js @@ -1,4 +1,4 @@ -import SwitchButtonView from '@ckeditor/ckeditor5-ui/src/button/switchbuttonview'; +import { SwitchButtonView } from 'ckeditor5'; export function createLabeledSwitchButton(labeledFieldView, viewUid, statusUid) { const switchButtonView = new SwitchButtonView(labeledFieldView.locale); diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 72677801..bb7b6c12 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -14,21 +14,23 @@ import IbexaRemoveElement from '../remove-element/remove-element'; import IbexaBlockAlignment from '../block-alignment/block-alignment'; import IbexaUploadImage from '../upload-image/upload-image'; -import CKEditor from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor'; -import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials'; -import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'; -import Heading from '@ckeditor/ckeditor5-heading/src/heading'; -import ListProperties from '@ckeditor/ckeditor5-list/src/listproperties'; -import Table from '@ckeditor/ckeditor5-table/src/table'; -import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'; -import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; -import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic'; -import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline'; -import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript'; -import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript'; -import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'; -import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote'; -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; +import { + InlineEditor, + Essentials, + Alignment, + Heading, + ListProperties, + Table, + TableToolbar, + Bold, + Italic, + Underline, + Subscript, + Superscript, + Strikethrough, + BlockQuote, + ContextualBalloon, +} from 'ckeditor5'; const VIEWPORT_TOP_OFFSET = 102; const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; @@ -156,6 +158,7 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; } const config = { + licenseKey: 'GPL', initialData: section.innerHTML, plugins: [ Essentials, @@ -242,7 +245,7 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; doc.body.dispatchEvent(customEvent); - CKEditor.create(container, config).then((editor) => { + InlineEditor.create(container, config).then((editor) => { this.editor = editor; const editableElement = this.editor.editing.view.getDomRoot(); diff --git a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-command.js b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-command.js index 20186ae4..9dc7add8 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-command.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; import { getCustomAttributesConfig, diff --git a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-editing.js b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-editing.js index 740829fd..c0435732 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-editing.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, Widget } from 'ckeditor5'; import IbexaCustomAttributesCommand from './custom-attributes-command'; import { getCustomAttributesConfig, getCustomClassesConfig } from './helpers/config-helper'; @@ -58,13 +57,21 @@ class IbexaCustomAttributesEditing extends Plugin { }); this.editor.conversion.for('upcast').add((dispatcher) => { - dispatcher.on('element:li', (event, data, conversionApi) => { - const listParent = data.viewItem.parent; - const listItem = data.modelRange.start.nodeAfter || data.modelRange.end.nodeBefore; + const customAttributeUpcastConverter = (event, data, conversionApi) => { + if (!data.modelRange) { + Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor)); + } + + const listParent = data.viewItem; const attributeValue = listParent.getAttribute(`data-ezattribute-${customAttributeName}`); - conversionApi.writer.setAttribute(`list-${customAttributeName}`, attributeValue, listItem); - }); + for (const listItem of data.modelRange.getItems({ shallow: true })) { + conversionApi.writer.setAttribute(`list-${customAttributeName}`, attributeValue, listItem); + } + }; + + dispatcher.on('element:ul', customAttributeUpcastConverter); + dispatcher.on('element:ol', customAttributeUpcastConverter); }); return; @@ -121,13 +128,21 @@ class IbexaCustomAttributesEditing extends Plugin { }); this.editor.conversion.for('upcast').add((dispatcher) => { - dispatcher.on('element:li', (event, data, conversionApi) => { - const listParent = data.viewItem.parent; - const listItem = data.modelRange.start.nodeAfter || data.modelRange.end.nodeBefore; + const customClassesUpcastConverter = (event, data, conversionApi) => { + if (!data.modelRange) { + Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor)); + } + + const listParent = data.viewItem; const classes = listParent.getAttribute('class'); - conversionApi.writer.setAttribute('list-custom-classes', classes, listItem); - }); + for (const listItem of data.modelRange.getItems({ shallow: true })) { + conversionApi.writer.setAttribute('list-custom-classes', classes, listItem); + } + }; + + dispatcher.on('element:ul', customClassesUpcastConverter); + dispatcher.on('element:ol', customClassesUpcastConverter); }); } diff --git a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-ui.js index 00a2b307..a14f3220 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes-ui.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; +import { Plugin, clickOutsideHandler } from 'ckeditor5'; import IbexaCustomAttributesFormView from './ui/custom-attributes-form-view'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes.js b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes.js index 3856a992..86a86335 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-attributes/custom-attributes.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaCustomAttributesUI from './custom-attributes-ui'; import IbexaCustomAttributesEditing from './custom-attributes-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-attributes/ui/custom-attributes-form-view.js b/src/bundle/Resources/public/js/CKEditor/custom-attributes/ui/custom-attributes-form-view.js index fa53c651..bc3fb83f 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-attributes/ui/custom-attributes-form-view.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-attributes/ui/custom-attributes-form-view.js @@ -1,11 +1,13 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; - -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import { createLabeledInputText, createLabeledDropdown } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import { addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { + View, + ButtonView, + LabeledFieldView, + ViewModel, + Collection, + createLabeledInputText, + createLabeledDropdown, + addListToDropdown, +} from 'ckeditor5'; import { getTranslator } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper'; @@ -203,7 +205,7 @@ class IbexaCustomAttributesFormView extends View { if (!config.multiple && !config.required) { itemsList.add({ type: 'button', - model: new Model({ + model: new ViewModel({ withText: true, label: Translator.trans(/*@Desc("None")*/ 'dropdown.none.label', {}, 'ck_editor'), value: null, @@ -214,7 +216,7 @@ class IbexaCustomAttributesFormView extends View { config.choices.forEach((choice) => { itemsList.add({ type: config.multiple ? 'switchbutton' : 'button', - model: new Model({ + model: new ViewModel({ withText: true, label: choice, value: choice, diff --git a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-command.js b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-command.js index 63c616e9..5f8a7e03 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-command.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; const { ibexa } = window; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-editing.js b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-editing.js index e80c0c8c..bcfab588 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-editing.js @@ -1,7 +1,5 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, Widget, AttributeCommand } from 'ckeditor5'; -import AttributeCommand from '@ckeditor/ckeditor5-basic-styles/src/attributecommand'; import IbexaCustomStyleInlineCommand from './custom-style-inline-command'; class IbexaCustomStyleInlineEditing extends Plugin { diff --git a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-ui.js index f1095f7e..fc7b05ec 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-style-inline-ui.js @@ -1,7 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin, createDropdown, addListToDropdown, ViewModel, Collection } from 'ckeditor5'; const { Translator, ibexa } = window; @@ -17,7 +14,7 @@ class IbexaCustomStyleInlineUI extends Plugin { const customStyleInlineCommand = editor.commands.get('ibexaCustomStyleInline'); const buttonDef = { type: 'button', - model: new Model({ + model: new ViewModel({ label: config.label, tooltip: true, isToggleable: true, diff --git a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-styles-inline.js b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-styles-inline.js index 37ef476d..c916cc9e 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-styles-inline.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-styles/inline/custom-styles-inline.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaCustomStylesInlineUI from './custom-style-inline-ui'; import IbexaCustomStylesInlineEditing from './custom-style-inline-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-command.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-command.js index 796f8354..7dc0e7ea 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-command.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaCustomTagCommand extends Command { execute(customTagData) { diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js index 9a2d2a00..386bc627 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-editing.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; -import { toWidget, toWidgetEditable } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Plugin, Widget, toWidget, toWidgetEditable } from 'ckeditor5'; import IbexaCustomTagCommand from './custom-tag-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-command.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-command.js index 1eb82fff..58e154ec 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-command.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; const { ibexa } = window; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-ui.js index 9f852ebc..922c8b49 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-settings-ui.js @@ -1,4 +1,5 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; + import IbexaButtonView from '../../common/button-view/button-view'; import IbexaCustomTagSettingsCommand from './custom-tag-settings-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-toolbar.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-toolbar.js index 8f711c2e..0451ea68 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-toolbar.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-toolbar.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolbarrepository'; +import { Plugin, WidgetToolbarRepository } from 'ckeditor5'; const { Translator } = window; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js index e7bbb18b..8392a173 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; +import { Plugin, clickOutsideHandler, ClickObserver } from 'ckeditor5'; import { setPanelContentMaxHeight } from '../../helpers/custom-panel-helper'; import IbexaCustomTagFormView from '../ui/custom-tag-form-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/custom-tags.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/custom-tags.js index c6287bf1..a5713707 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/custom-tags.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/custom-tags.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaCustomTagsUI from './block-custom-tag/custom-tag-ui'; import IbexaInlineCustomTagsUI from './inline-custom-tag/inline-custom-tag-ui'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-command.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-command.js index 885ada78..864723e2 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-command.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaInlineCustomTagCommand extends Command { execute(customTagData) { diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-editing.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-editing.js index f891517d..8c9418a5 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-editing.js @@ -1,7 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; -import Element from '@ckeditor/ckeditor5-engine/src/view/element'; +import { Plugin, Widget, toWidget, Element } from 'ckeditor5'; import IbexaInlineCustomTagCommand from './inline-custom-tag-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-ui.js index 4a1dd9bd..28ffdacc 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/inline-custom-tag/inline-custom-tag-ui.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; +import { Plugin, clickOutsideHandler, ClickObserver } from 'ckeditor5'; import IbexaCustomTagFormView from '../ui/custom-tag-form-view'; import IbexaButtonView from '../../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js index b597e281..0e959998 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js @@ -1,4 +1,5 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5'; + import IbexaButtonView from '../../common/button-view/button-view'; class IbexaCustomTagAttributesView extends View { diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-form-view.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-form-view.js index 7b4fc928..be682dab 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-form-view.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-form-view.js @@ -1,11 +1,13 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; - -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import { createLabeledInputText, createLabeledDropdown } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import { addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { + View, + ButtonView, + LabeledFieldView, + ViewModel, + Collection, + createLabeledInputText, + createLabeledDropdown, + addListToDropdown, +} from 'ckeditor5'; import { createLabeledInputNumber } from '../../common/input-number/utils'; import { createLabeledSwitchButton } from '../../common/switch-button/utils'; @@ -207,7 +209,7 @@ class IbexaCustomTagFormView extends View { config.choices.forEach((choice) => { itemsList.add({ type: 'button', - model: new Model({ + model: new ViewModel({ withText: true, label: config.choicesLabel[choice], value: choice, diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-command.js b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-command.js index 9cc52e7b..68d4e722 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-command.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaEmbedContentInlineCommand extends Command { execute(contentData) { diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js index cc176e8d..f6544c31 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, toWidget, Widget } from 'ckeditor5'; import IbexaEmbedContentInlineCommand from './embed-inline-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-command.js b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-command.js index 896b294e..c7f6b7a2 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-command.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaEmbedContentCommand extends Command { execute(contentData) { diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js index aec4eccc..bc741b7e 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, toWidget, Widget } from 'ckeditor5'; import IbexaEmbedContentCommand from './embed-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/embed-base-ui.js b/src/bundle/Resources/public/js/CKEditor/embed/embed-base-ui.js index 1db6d949..97fea6c3 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/embed-base-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/embed-base-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/embed.js b/src/bundle/Resources/public/js/CKEditor/embed/embed.js index 8d7a1182..668ce82b 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/embed.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/embed.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaEmbedContentEditing from './content/embed-editing'; import IbexaEmbedContentInlineEditing from './content-inline/embed-inline-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-command.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-command.js index 4833990f..3b6fbd7f 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-command.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaEmbedImageCommand extends Command { execute(contentData) { diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js index 9371fd7c..818a69f2 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js @@ -1,6 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, toWidget, Widget } from 'ckeditor5'; import IbexaEmbedImageCommand from './embed-image-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-toolbar.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-toolbar.js index b9f6bd04..24cab0cc 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-toolbar.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-toolbar.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolbarrepository'; +import { Plugin, WidgetToolbarRepository } from 'ckeditor5'; class IbexaEmbedImageToolbar extends Plugin { static get requires() { diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-variations-ui.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-variations-ui.js index e7b73bd3..2fd3b45c 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-variations-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-variations-ui.js @@ -1,7 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin, createDropdown, addListToDropdown, ViewModel, Collection } from 'ckeditor5'; class IbexaEmbedImageVariationsUI extends Plugin { constructor(props) { @@ -35,7 +32,7 @@ class IbexaEmbedImageVariationsUI extends Plugin { Object.keys(window.ibexa.adminUiConfig.imageVariations).forEach((variation) => { itemDefinitions.add({ type: 'button', - model: new Model({ + model: new ViewModel({ label: variation, variation: variation, withText: true, diff --git a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-command.js b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-command.js index 4415c038..c862e8a1 100644 --- a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-command.js +++ b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaFormattedCommand extends Command { execute() { diff --git a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-editing.js b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-editing.js index 561601d0..19c9dd3f 100644 --- a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-editing.js @@ -1,10 +1,23 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { rawSnippetTextToViewDocumentFragment } from '@ckeditor/ckeditor5-code-block/src/utils'; -import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, UpcastWriter, Widget } from 'ckeditor5'; import IbexaFormattedCommand from './formatted-command'; +// copied from ckeditor5-code-block/src/utils +// CKE does not provide a way to import it +function rawSnippetTextToViewDocumentFragment(writer, text) { + const fragment = writer.createDocumentFragment(); + const textLines = text.split('\n'); + const items = textLines.reduce((nodes, line, lineIndex) => { + nodes.push(line); + if (lineIndex < textLines.length - 1) { + nodes.push(writer.createElement('br')); + } + return nodes; + }, []); + writer.appendChild(items, fragment); + return fragment; +} + class IbexaFormattedEditing extends Plugin { static get requires() { return [Widget]; diff --git a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-ui.js b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-ui.js index 12801359..9d77cca2 100644 --- a/src/bundle/Resources/public/js/CKEditor/formatted/formatted-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/formatted/formatted-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/formatted/formatted.js b/src/bundle/Resources/public/js/CKEditor/formatted/formatted.js index 4229dcb4..dd878b03 100644 --- a/src/bundle/Resources/public/js/CKEditor/formatted/formatted.js +++ b/src/bundle/Resources/public/js/CKEditor/formatted/formatted.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaFormattedEditing from './formatted-editing'; import IbexaFormattedUI from './formatted-ui'; diff --git a/src/bundle/Resources/public/js/CKEditor/link/link-command.js b/src/bundle/Resources/public/js/CKEditor/link/link-command.js index a889b379..fa47a418 100644 --- a/src/bundle/Resources/public/js/CKEditor/link/link-command.js +++ b/src/bundle/Resources/public/js/CKEditor/link/link-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaLinkCommand extends Command { execute(linkData) { diff --git a/src/bundle/Resources/public/js/CKEditor/link/link-editing.js b/src/bundle/Resources/public/js/CKEditor/link/link-editing.js index 68621041..b106c492 100644 --- a/src/bundle/Resources/public/js/CKEditor/link/link-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/link/link-editing.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaLinkCommand from './link-command'; import { getCustomAttributesConfig, getCustomClassesConfig } from '../custom-attributes/helpers/config-helper'; diff --git a/src/bundle/Resources/public/js/CKEditor/link/link-ui.js b/src/bundle/Resources/public/js/CKEditor/link/link-ui.js index 4fb0efdc..1cd92054 100644 --- a/src/bundle/Resources/public/js/CKEditor/link/link-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/link/link-ui.js @@ -1,7 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; -import findAttributeRange from '@ckeditor/ckeditor5-typing/src/utils/findattributerange'; +import { Plugin, clickOutsideHandler, ClickObserver, findAttributeRange } from 'ckeditor5'; import IbexaLinkFormView from './ui/link-form-view'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/link/link.js b/src/bundle/Resources/public/js/CKEditor/link/link.js index 3de36b48..88fa43b5 100644 --- a/src/bundle/Resources/public/js/CKEditor/link/link.js +++ b/src/bundle/Resources/public/js/CKEditor/link/link.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaLinkUI from './link-ui'; import IbexaLinkEditing from './link-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/link/ui/link-form-view.js b/src/bundle/Resources/public/js/CKEditor/link/ui/link-form-view.js index 647046ed..5c18437b 100644 --- a/src/bundle/Resources/public/js/CKEditor/link/ui/link-form-view.js +++ b/src/bundle/Resources/public/js/CKEditor/link/ui/link-form-view.js @@ -1,10 +1,13 @@ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import { createLabeledInputText, createLabeledDropdown } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import { addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { + View, + ButtonView, + LabeledFieldView, + ViewModel, + Collection, + createLabeledInputText, + createLabeledDropdown, + addListToDropdown, +} from 'ckeditor5'; import { getTranslator } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper'; @@ -280,7 +283,7 @@ class IbexaLinkFormView extends View { if (!config.multiple && !config.required) { itemsList.add({ type: 'button', - model: new Model({ + model: new ViewModel({ withText: true, label: Translator.trans(/*@Desc("None")*/ 'dropdown.none.label', {}, 'ck_editor'), value: '', @@ -291,7 +294,7 @@ class IbexaLinkFormView extends View { config.choices.forEach((choice) => { itemsList.add({ type: config.multiple ? 'switchbutton' : 'button', - model: new Model({ + model: new ViewModel({ withText: true, label: choice, value: choice, diff --git a/src/bundle/Resources/public/js/CKEditor/move/move-command.js b/src/bundle/Resources/public/js/CKEditor/move/move-command.js index 694cea6f..d25ceccc 100644 --- a/src/bundle/Resources/public/js/CKEditor/move/move-command.js +++ b/src/bundle/Resources/public/js/CKEditor/move/move-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaMoveCommand extends Command { execute(moveData) { diff --git a/src/bundle/Resources/public/js/CKEditor/move/move-down-ui.js b/src/bundle/Resources/public/js/CKEditor/move/move-down-ui.js index 767c8385..a31acc34 100644 --- a/src/bundle/Resources/public/js/CKEditor/move/move-down-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/move/move-down-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/move/move-editing.js b/src/bundle/Resources/public/js/CKEditor/move/move-editing.js index 61c2e0ce..52fa09c7 100644 --- a/src/bundle/Resources/public/js/CKEditor/move/move-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/move/move-editing.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaMoveCommand from './move-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/move/move-up-ui.js b/src/bundle/Resources/public/js/CKEditor/move/move-up-ui.js index d5412134..953c457c 100644 --- a/src/bundle/Resources/public/js/CKEditor/move/move-up-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/move/move-up-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/move/move.js b/src/bundle/Resources/public/js/CKEditor/move/move.js index f01810d3..10dd7c59 100644 --- a/src/bundle/Resources/public/js/CKEditor/move/move.js +++ b/src/bundle/Resources/public/js/CKEditor/move/move.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaMoveUpUI from './move-up-ui'; import IbexaMoveDownUI from './move-down-ui'; diff --git a/src/bundle/Resources/public/js/CKEditor/plugins/character-counter.js b/src/bundle/Resources/public/js/CKEditor/plugins/character-counter.js index 54af54a7..98c9a68a 100644 --- a/src/bundle/Resources/public/js/CKEditor/plugins/character-counter.js +++ b/src/bundle/Resources/public/js/CKEditor/plugins/character-counter.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; const TEXT_NODE = 3; diff --git a/src/bundle/Resources/public/js/CKEditor/plugins/elements-path.js b/src/bundle/Resources/public/js/CKEditor/plugins/elements-path.js index b662af92..4acfaa0c 100644 --- a/src/bundle/Resources/public/js/CKEditor/plugins/elements-path.js +++ b/src/bundle/Resources/public/js/CKEditor/plugins/elements-path.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; const { Translator } = window; class IbexaElementsPath extends Plugin { diff --git a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js index 05387566..f91e81d4 100644 --- a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js +++ b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; class IbexaRemoveElementCommand extends Command { execute() { diff --git a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-editing.js b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-editing.js index 80716743..4b601958 100644 --- a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-editing.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaRemoveElementCommand from './remove-element-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-ui.js b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-ui.js index c2122a7e..9744ae4b 100644 --- a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element.js b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element.js index 34bc627f..c99241cb 100644 --- a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element.js +++ b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaRemoveElementUI from './remove-element-ui'; import IbexaRemoveElementEditing from './remove-element-editing'; diff --git a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-command.js b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-command.js index 0ecd1dd1..93ed5555 100644 --- a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-command.js +++ b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-command.js @@ -1,4 +1,4 @@ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5'; const { ibexa, Routing, Translator } = window; const { showErrorNotification } = ibexa.helpers.notification; diff --git a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-editing.js b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-editing.js index 3729f1a6..cee385a1 100644 --- a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-editing.js @@ -1,5 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin, Widget } from 'ckeditor5'; import IbexaUploadImageCommand from './upload-image-command'; diff --git a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-ui.js b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-ui.js index efc1d562..8241841f 100644 --- a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image-ui.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaButtonView from '../common/button-view/button-view'; diff --git a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image.js b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image.js index f302d247..70b1b437 100644 --- a/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image.js +++ b/src/bundle/Resources/public/js/CKEditor/upload-image/upload-image.js @@ -1,4 +1,4 @@ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5'; import IbexaUploadImageEditing from './upload-image-editing'; import IbexaUploadImageUI from './upload-image-ui'; diff --git a/src/bundle/Resources/public/scss/_balloon-form.scss b/src/bundle/Resources/public/scss/_balloon-form.scss index aaa8ba43..312042c0 100644 --- a/src/bundle/Resources/public/scss/_balloon-form.scss +++ b/src/bundle/Resources/public/scss/_balloon-form.scss @@ -236,10 +236,10 @@ } .ck-toolbar-container { - z-index: calc(var(--ck-z-modal) + 50); + z-index: calc(var(--ck-z-panel) + 50); &.ck-balloon-panel_with-arrow { - z-index: calc(var(--ck-z-modal) + 55); + z-index: calc(var(--ck-z-panel) + 55); } &.ck-balloon-panel { diff --git a/src/bundle/Resources/public/scss/_general.scss b/src/bundle/Resources/public/scss/_general.scss index 7a21e4d8..49ffeedb 100644 --- a/src/bundle/Resources/public/scss/_general.scss +++ b/src/bundle/Resources/public/scss/_general.scss @@ -291,7 +291,7 @@ } &.ck-toolbar-container.ck-balloon-panel { - z-index: var(--ck-z-modal) - 1; + z-index: var(--ck-z-panel) - 1; } &.ck-toolbar-container &.ck-toolbar { @@ -311,6 +311,6 @@ } .ck-body-wrapper &.ck-balloon-panel { - z-index: calc(var(--ck-z-modal) + 100); + z-index: calc(var(--ck-z-panel) + 100); } }