diff --git a/js/build/linkit.js b/js/build/linkit.js
index 558b152..868e80b 100644
--- a/js/build/linkit.js
+++ b/js/build/linkit.js
@@ -1 +1 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor5=e():(t.CKEditor5=t.CKEditor5||{},t.CKEditor5.linkit=e())}(self,(()=>(()=>{var t={"ckeditor5/src/core.js":(t,e,i)=>{t.exports=i("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/typing.js":(t,e,i)=>{t.exports=i("dll-reference CKEditor5.dll")("./src/typing.js")},"dll-reference CKEditor5.dll":t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};return(()=>{"use strict";i.d(n,{default:()=>u});var t=i("ckeditor5/src/core.js"),e=i("ckeditor5/src/typing.js");class o extends t.Plugin{init(){this.attrs=["data-entity-type","data-entity-uuid","data-entity-substitution"],this._allowAndConvertExtraAttributes(),this._removeExtraAttributesOnUnlinkCommandExecute(),this._refreshExtraAttributeValues(),this._addExtraAttributesOnLinkCommandExecute()}_allowAndConvertExtraAttributes(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:this.attrs}),this.attrs.forEach((e=>{t.conversion.for("downcast").attributeToElement({model:e,view:(t,{writer:i})=>{const n=i.createAttributeElement("a",{[e]:t},{priority:5});return i.setCustomProperty("link",!0,n),n}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{[e]:!0}},model:{key:e,value:t=>t.getAttribute(e)}})}))}_addExtraAttributesOnLinkCommandExecute(){const t=this.editor,e=t.commands.get("link");let i=!1;e.on("execute",((e,n)=>{if(n.length<3)return;if(i)return void(i=!1);e.stop(),i=!0;const o=n[n.length-1],s=this.editor.model,r=s.document.selection;s.change((e=>{t.execute("link",...n);const i=r.getFirstPosition();this.attrs.forEach((t=>{if(r.isCollapsed){const n=i.textNode||i.nodeBefore;o[t]?e.setAttribute(t,o[t],e.createRangeOn(n)):e.removeAttribute(t,e.createRangeOn(n)),e.removeSelectionAttribute(t)}else{const i=s.schema.getValidRanges(r.getRanges(),t);for(const n of i)o[t]?e.setAttribute(t,o[t],n):e.removeAttribute(t,n)}}))}))}),{priority:"high"})}_removeExtraAttributesOnUnlinkCommandExecute(){const t=this.editor,i=t.commands.get("unlink"),n=this.editor.model,o=n.document.selection;let s=!1;i.on("execute",(i=>{s||(i.stop(),n.change((()=>{s=!0,t.execute("unlink"),s=!1,n.change((t=>{let i;this.attrs.forEach((s=>{i=o.isCollapsed?[(0,e.findAttributeRange)(o.getFirstPosition(),s,o.getAttribute(s),n)]:n.schema.getValidRanges(o.getRanges(),s);for(const e of i)t.removeAttribute(s,e)}))}))})))}),{priority:"high"})}_refreshExtraAttributeValues(){const t=this.editor,e=this.attrs,i=t.commands.get("link"),n=this.editor.model,o=n.document.selection;e.forEach((t=>{i.set(t,null)})),n.document.on("change",(()=>{e.forEach((t=>{i[t]=o.getAttribute(t)}))}))}static get pluginName(){return"LinkitEditing"}}const s=jQuery;function r(t,e){var i=s("
").addClass("linkit-result-line"),n=s("").addClass("linkit-result-line-wrapper");return n.append(s("
").html(e.label).addClass("linkit-result-line--title")),e.hasOwnProperty("description")&&n.append(s("").html(e.description).addClass("linkit-result-line--description")),i.append(n).appendTo(t)}function a(t,e){var i=this.element.autocomplete("instance"),n=_.groupBy(e,(function(t){return t.hasOwnProperty("group")?t.group:""}));s.each(n,(function(e,n){e.length&&t.append('"),s.each(n,(function(e,n){i._renderItemData(t,n)}))}))}class l extends t.Plugin{static get requires(){return[o]}init(){this._state={};this.editor.config.get("linkit").enabled&&(this._enableLinkAutocomplete(),this._handleExtraFormFieldSubmit(),this._handleDataLoadingIntoExtraFormField())}_enableLinkAutocomplete(){const t=this.editor,e=t.config.get("linkit"),i=t.plugins.get("LinkUI").formView;let n=!1;i.extendTemplate({attributes:{class:["ck-vertical-form","ck-link-form_layout-vertical"]}}),t.plugins.get("ContextualBalloon")._rotatorView.content.on("add",((t,o)=>{o!==i||n||(!function(t,{autocompleteUrl:e,selectHandler:i}){const n={cache:{},ajax:{dataType:"json",jsonp:!1}},o=s(t),l={appendTo:t.closest(".ck-labeled-field-view"),source:function(t,i){const{cache:o}=n;var r=t.term;o.hasOwnProperty(r)?i(o[r]):s.ajax(e,{success:function(t){o[r]=t.suggestions,i(t.suggestions)},data:{q:r},...n.ajax})},select:i,focus:()=>!1,search:()=>!l.isComposing,minLength:1,isComposing:!1},u=o.autocomplete(l),d=u.data("ui-autocomplete");d.widget().menu("option","items","> :not(.linkit-result-line--group)"),d._renderMenu=a,d._renderItem=r,u.autocomplete("widget").addClass("linkit-ui-autocomplete"),u.on("click",(function(){u.autocomplete("search",u.val())})),u.on("compositionstart.autocomplete",(function(){l.isComposing=!0})),u.on("compositionend.autocomplete",(function(){l.isComposing=!1}))}(i.urlInputView.fieldView.element,{...e,selectHandler:(t,{item:e})=>{if(!e.path)throw"Missing path param."+JSON.stringify(e);if(e.entity_type_id||e.entity_uuid||e.substitution_id){if(!e.entity_type_id||!e.entity_uuid||!e.substitution_id)throw"Missing path param."+JSON.stringify(e);this.set("entityType",e.entity_type_id),this.set("entityUuid",e.entity_uuid),this.set("entitySubstitution",e.substitution_id)}return t.target.value=e.path,!1}}),n=!0)}))}_handleExtraFormFieldSubmit(){const t=this.editor,e=t.plugins.get("LinkUI").formView,i=t.commands.get("link");this.listenTo(e,"submit",(()=>{const t={"data-entity-type":this.entityType,"data-entity-uuid":this.entityUuid,"data-entity-substitution":this.entitySubstitution};i.once("execute",((e,i)=>{if(i.length<3)i.push(t);else{if(3!==i.length)throw Error("The link command has more than 3 arguments.");Object.assign(i[2],t)}}),{priority:"highest"})}),{priority:"high"})}_handleDataLoadingIntoExtraFormField(){const t=this.editor.commands.get("link");this.bind("entityType").to(t,"data-entity-type"),this.bind("entityUuid").to(t,"data-entity-uuid"),this.bind("entitySubstitution").to(t,"data-entity-substitution")}static get pluginName(){return"Linkit"}}const u={Linkit:l}})(),n=n.default})()));
\ No newline at end of file
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.linkit=t())}(self,(()=>(()=>{var __webpack_modules__={"./js/ckeditor5_plugins/linkit/src/autocomplete.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ initializeAutocomplete)\n/* harmony export */ });\nconst $ = jQuery;\n\n\n/**\n * Override jQuery UI _renderItem function to output HTML by default.\n *\n * @param {object} ul\n * The element that the newly created - element must be appended to.\n * @param {object} item\n * The list item to append.\n *\n * @return {object}\n * jQuery collection of the ul element.\n */\nfunction renderItem(ul, item) {\n var $line = $('
- ').addClass('linkit-result-line');\n var $wrapper = $('
').addClass('linkit-result-line-wrapper');\n $wrapper.append($('
').html(item.label).addClass('linkit-result-line--title'));\n\n if (item.hasOwnProperty('description')) {\n $wrapper.append($('').html(item.description).addClass('linkit-result-line--description'));\n }\n return $line.append($wrapper).appendTo(ul);\n}\n\n/**\n * Override jQuery UI _renderMenu function to handle groups.\n *\n * @param {object} ul\n * An empty element to use as the widget's menu.\n * @param {array} items\n * An Array of items that match the user typed term.\n */\nfunction renderMenu(ul, items) {\n var self = this.element.autocomplete('instance');\n\n var grouped_items = _.groupBy(items, function (item) {\n return item.hasOwnProperty('group') ? item.group : '';\n });\n\n $.each(grouped_items, function (group, items) {\n if (group.length) {\n ul.append('- ' + group + '
');\n }\n\n $.each(items, function (index, item) {\n self._renderItemData(ul, item);\n });\n });\n}\n\nfunction initializeAutocomplete(element, settings) {\n const { autocompleteUrl, selectHandler, closeHandler, openHandler } = settings;\n const autocomplete = {\n cache: {},\n ajax: {\n dataType: 'json',\n jsonp: false,\n },\n };\n\n /**\n * JQuery UI autocomplete source callback.\n *\n * @param {object} request\n * The request object.\n * @param {function} response\n * The function to call with the response.\n */\n function sourceData(request, response) {\n const { cache } = autocomplete;\n /**\n * Transforms the data object into an array and update autocomplete results.\n *\n * @param {object} data\n * The data sent back from the server.\n */\n function sourceCallbackHandler(data) {\n cache[term] = data.suggestions;\n response(data.suggestions);\n }\n\n // Get the desired term and construct the autocomplete URL for it.\n var term = request.term;\n\n // Check if the term is already cached.\n if (cache.hasOwnProperty(term)) {\n response(cache[term]);\n }\n else {\n $.ajax(autocompleteUrl, {\n success: sourceCallbackHandler,\n data: {q: term},\n ...autocomplete.ajax,\n });\n }\n }\n\n const options = {\n appendTo: element.closest('.ck-labeled-field-view'),\n source: sourceData,\n select: selectHandler,\n focus: () => false,\n search: () => !options.isComposing,\n close: closeHandler,\n open: openHandler,\n minLength: 1,\n isComposing: false,\n }\n const $auto = $(element).autocomplete(options);\n\n // Override a few things.\n const instance = $auto.data('ui-autocomplete');\n instance.widget().menu('option', 'items', '> :not(.linkit-result-line--group)');\n instance._renderMenu = renderMenu;\n instance._renderItem = renderItem;\n\n\n $auto.autocomplete('widget').addClass('linkit-ui-autocomplete');\n\n $auto.on('click', function () {\n $auto.autocomplete('search', $auto.val());\n });\n\n $auto.on('compositionstart.autocomplete', function () {\n options.isComposing = true;\n });\n $auto.on('compositionend.autocomplete', function () {\n options.isComposing = false;\n });\n\n return $auto;\n}\n\n\n\n\n//# sourceURL=webpack://CKEditor5.linkit/./js/ckeditor5_plugins/linkit/src/autocomplete.js?")},"./js/ckeditor5_plugins/linkit/src/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/* harmony import */ var _linkitediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkitediting */ \"./js/ckeditor5_plugins/linkit/src/linkitediting.js\");\n/* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./autocomplete */ \"./js/ckeditor5_plugins/linkit/src/autocomplete.js\");\n\n\n\n\nclass Linkit extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritdoc\n */\n static get requires() {\n return [_linkitediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"]];\n }\n\n init() {\n this._state = {};\n const editor = this.editor;\n const options = editor.config.get('linkit');\n // @todo figure out if the CKE plugin could marked as disabled based on this\n // configuration.\n if (!options.enabled) {\n return;\n }\n\n this._enableLinkAutocomplete();\n this._handleExtraFormFieldSubmit();\n this._handleDataLoadingIntoExtraFormField();\n }\n\n _enableLinkAutocomplete() {\n const editor = this.editor;\n const options = editor.config.get('linkit');\n const linkFormView = editor.plugins.get( 'LinkUI' ).formView;\n let wasAutocompleteAdded = false;\n\n linkFormView.extendTemplate( {\n attributes: {\n class: ['ck-vertical-form', 'ck-link-form_layout-vertical']\n }\n } );\n\n editor.plugins.get( 'ContextualBalloon' )._rotatorView.content.on('add', ( evt, view ) => {\n if ( view !== linkFormView || wasAutocompleteAdded ) {\n return;\n }\n\n /**\n * Used to know if a selection was made from the autocomplete results.\n *\n * @type {boolean}\n */\n let selected;\n\n (0,_autocomplete__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n linkFormView.urlInputView.fieldView.element,\n {\n ...options,\n selectHandler: (event, { item }) => {\n if (!item.path) {\n throw 'Missing path param.' + JSON.stringify(item);\n }\n\n if (item.entity_type_id || item.entity_uuid || item.substitution_id) {\n if (!item.entity_type_id || !item.entity_uuid || !item.substitution_id) {\n throw 'Missing path param.' + JSON.stringify(item);\n }\n\n this.set('entityType', item.entity_type_id);\n this.set('entityUuid', item.entity_uuid);\n this.set('entitySubstitution', item.substitution_id);\n }\n else {\n this.set('entityType', null);\n this.set('entityUuid', null);\n this.set('entitySubstitution', null);\n }\n\n event.target.value = item.path;\n selected = true;\n return false;\n },\n openHandler: (event) => {\n selected = false;\n },\n closeHandler: (event) => {\n if (!selected) {\n this.set('entityType', null);\n this.set('entityUuid', null);\n this.set('entitySubstitution', null);\n }\n selected = false;\n },\n },\n );\n\n wasAutocompleteAdded = true;\n });\n }\n\n _handleExtraFormFieldSubmit() {\n const editor = this.editor;\n const linkFormView = editor.plugins.get('LinkUI').formView;\n const linkCommand = editor.commands.get('link');\n\n this.listenTo(linkFormView, 'submit', () => {\n const values = {\n 'data-entity-type': this.entityType,\n 'data-entity-uuid': this.entityUuid,\n 'data-entity-substitution': this.entitySubstitution,\n }\n // Stop the execution of the link command caused by closing the form.\n // Inject the extra attribute value. The highest priority listener here\n // injects the argument (here below 👇).\n // - The high priority listener in\n // _addExtraAttributeOnLinkCommandExecute() gets that argument and sets\n // the extra attribute.\n // - The normal (default) priority listener in ckeditor5-link sets\n // (creates) the actual link.\n linkCommand.once('execute', (evt, args) => {\n if (args.length < 3) {\n args.push(values);\n } else if (args.length === 3) {\n Object.assign(args[2], values);\n } else {\n throw Error('The link command has more than 3 arguments.')\n }\n }, { priority: 'highest' });\n }, { priority: 'high' });\n }\n\n _handleDataLoadingIntoExtraFormField() {\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n\n this.bind('entityType').to(linkCommand, 'data-entity-type');\n this.bind('entityUuid').to(linkCommand, 'data-entity-uuid');\n this.bind('entitySubstitution').to(linkCommand, 'data-entity-substitution');\n }\n\n /**\n * @inheritdoc\n */\n static get pluginName() {\n return 'Linkit';\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n Linkit,\n});\n\n\n//# sourceURL=webpack://CKEditor5.linkit/./js/ckeditor5_plugins/linkit/src/index.js?")},"./js/ckeditor5_plugins/linkit/src/linkitediting.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ LinkitEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ \"ckeditor5/src/typing.js\");\n\n\n\nclass LinkitEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n this.attrs = ['data-entity-type', 'data-entity-uuid', 'data-entity-substitution'];\n this._allowAndConvertExtraAttributes();\n this._removeExtraAttributesOnUnlinkCommandExecute();\n this._refreshExtraAttributeValues();\n this._addExtraAttributesOnLinkCommandExecute();\n }\n\n _allowAndConvertExtraAttributes() {\n const editor = this.editor;\n\n editor.model.schema.extend('$text', { allowAttributes: this.attrs });\n\n // Model -> View (DOM)\n this.attrs.forEach((attribute) => {\n editor.conversion.for('downcast').attributeToElement({\n model: attribute,\n view: (value, { writer }) => {\n const linkViewElement = writer.createAttributeElement('a', {\n [attribute]: value\n }, { priority: 5 });\n\n // Without it the isLinkElement() will not recognize the link and the UI will not show up\n // when the user clicks a link.\n writer.setCustomProperty('link', true, linkViewElement);\n\n return linkViewElement;\n }\n });\n\n // View (DOM/DATA) -> Model\n editor.conversion.for('upcast')\n .elementToAttribute({\n view: {\n name: 'a',\n attributes: {\n [attribute]: true,\n }\n },\n model: {\n key: attribute,\n value: viewElement => viewElement.getAttribute(attribute),\n }\n });\n });\n }\n\n _addExtraAttributesOnLinkCommandExecute() {\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n let linkCommandExecuting = false;\n\n linkCommand.on('execute', (evt, args) => {\n // Custom handling is only required if an extra attribute was passed into\n // editor.execute( 'link', ... ).\n if (args.length < 3) {\n return;\n }\n if (linkCommandExecuting) {\n linkCommandExecuting = false;\n return;\n }\n\n // If the additional attribute was passed, we stop the default execution\n // of the LinkCommand. We're going to create Model#change() block for undo\n // and execute the LinkCommand together with setting the extra attribute.\n evt.stop();\n\n // Prevent infinite recursion by keeping records of when link command is\n // being executed by this function.\n linkCommandExecuting = true;\n const extraAttributeValues = args[args.length - 1];\n const model = this.editor.model;\n const selection = model.document.selection;\n\n // Wrapping the original command execution in a model.change() block to\n // make sure there's a single undo step when the extra attribute is added.\n model.change((writer) => {\n editor.execute('link', ...args);\n\n const firstPosition = selection.getFirstPosition();\n\n this.attrs.forEach((attribute) => {\n if (selection.isCollapsed) {\n const node = firstPosition.textNode || firstPosition.nodeBefore;\n\n if (extraAttributeValues[attribute]) {\n writer.setAttribute(attribute, extraAttributeValues[attribute], writer.createRangeOn(node));\n } else {\n writer.removeAttribute(attribute, writer.createRangeOn(node));\n }\n\n writer.removeSelectionAttribute(attribute);\n } else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), attribute);\n\n for (const range of ranges) {\n if (extraAttributeValues[attribute]) {\n writer.setAttribute(attribute, extraAttributeValues[attribute], range);\n } else {\n writer.removeAttribute(attribute, range);\n }\n }\n }\n });\n });\n }, { priority: 'high' } );\n }\n\n _removeExtraAttributesOnUnlinkCommandExecute() {\n const editor = this.editor;\n const unlinkCommand = editor.commands.get('unlink');\n const model = this.editor.model;\n const selection = model.document.selection;\n\n let isUnlinkingInProgress = false;\n\n // Make sure all changes are in a single undo step so cancel the original unlink first in the high priority.\n unlinkCommand.on('execute', evt => {\n if (isUnlinkingInProgress) {\n return;\n }\n\n evt.stop();\n\n // This single block wraps all changes that should be in a single undo step.\n model.change(() => {\n // Now, in this single \"undo block\" let the unlink command flow naturally.\n isUnlinkingInProgress = true;\n\n // Do the unlinking within a single undo step.\n editor.execute('unlink');\n\n // Let's make sure the next unlinking will also be handled.\n isUnlinkingInProgress = false;\n\n // The actual integration that removes the extra attribute.\n model.change(writer => {\n // Get ranges to unlink.\n let ranges;\n\n this.attrs.forEach((attribute) => {\n if (selection.isCollapsed) {\n ranges = [(0,ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__.findAttributeRange)(\n selection.getFirstPosition(),\n attribute,\n selection.getAttribute(attribute),\n model\n )];\n } else {\n ranges = model.schema.getValidRanges(selection.getRanges(), attribute);\n }\n\n // Remove the extra attribute from specified ranges.\n for (const range of ranges) {\n writer.removeAttribute(attribute, range);\n }\n });\n });\n });\n }, { priority: 'high' });\n }\n\n _refreshExtraAttributeValues() {\n const editor = this.editor;\n const attributes = this.attrs\n const linkCommand = editor.commands.get('link');\n const model = this.editor.model;\n const selection = model.document.selection;\n\n attributes.forEach((attribute) => {\n linkCommand.set(attribute, null);\n });\n model.document.on('change', () => {\n attributes.forEach((attribute) => {\n linkCommand[attribute] = selection.getAttribute(attribute);\n });\n });\n }\n\n /**\n * @inheritdoc\n */\n static get pluginName() {\n return 'LinkitEditing';\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.linkit/./js/ckeditor5_plugins/linkit/src/linkitediting.js?")},"ckeditor5/src/core.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/core.js");\n\n//# sourceURL=webpack://CKEditor5.linkit/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/typing.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/typing.js");\n\n//# sourceURL=webpack://CKEditor5.linkit/delegated_./typing.js_from_dll-reference_CKEditor5.dll?')},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./js/ckeditor5_plugins/linkit/src/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));
\ No newline at end of file
diff --git a/js/ckeditor5_plugins/linkit/src/autocomplete.js b/js/ckeditor5_plugins/linkit/src/autocomplete.js
index 4f44389..f44d2fb 100644
--- a/js/ckeditor5_plugins/linkit/src/autocomplete.js
+++ b/js/ckeditor5_plugins/linkit/src/autocomplete.js
@@ -49,7 +49,8 @@ function renderMenu(ul, items) {
});
}
-export default function initializeAutocomplete(element, { autocompleteUrl, selectHandler }) {
+export default function initializeAutocomplete(element, settings) {
+ const { autocompleteUrl, selectHandler, closeHandler, openHandler } = settings;
const autocomplete = {
cache: {},
ajax: {
@@ -95,17 +96,18 @@ export default function initializeAutocomplete(element, { autocompleteUrl, selec
}
}
- const $element = $(element);
const options = {
appendTo: element.closest('.ck-labeled-field-view'),
source: sourceData,
select: selectHandler,
focus: () => false,
search: () => !options.isComposing,
+ close: closeHandler,
+ open: openHandler,
minLength: 1,
isComposing: false,
}
- const $auto = $element.autocomplete(options);
+ const $auto = $(element).autocomplete(options);
// Override a few things.
const instance = $auto.data('ui-autocomplete');
diff --git a/js/ckeditor5_plugins/linkit/src/index.js b/js/ckeditor5_plugins/linkit/src/index.js
index 3360f9e..2f2238d 100644
--- a/js/ckeditor5_plugins/linkit/src/index.js
+++ b/js/ckeditor5_plugins/linkit/src/index.js
@@ -42,6 +42,13 @@ class Linkit extends Plugin {
return;
}
+ /**
+ * Used to know if a selection was made from the autocomplete results.
+ *
+ * @type {boolean}
+ */
+ let selected;
+
initializeAutocomplete(
linkFormView.urlInputView.fieldView.element,
{
@@ -51,8 +58,6 @@ class Linkit extends Plugin {
throw 'Missing path param.' + JSON.stringify(item);
}
- // $('input[name="href_dirty_check"]', $form).val(ui.item.path);
-
if (item.entity_type_id || item.entity_uuid || item.substitution_id) {
if (!item.entity_type_id || !item.entity_uuid || !item.substitution_id) {
throw 'Missing path param.' + JSON.stringify(item);
@@ -62,11 +67,27 @@ class Linkit extends Plugin {
this.set('entityUuid', item.entity_uuid);
this.set('entitySubstitution', item.substitution_id);
}
+ else {
+ this.set('entityType', null);
+ this.set('entityUuid', null);
+ this.set('entitySubstitution', null);
+ }
event.target.value = item.path;
-
+ selected = true;
return false;
- }
+ },
+ openHandler: (event) => {
+ selected = false;
+ },
+ closeHandler: (event) => {
+ if (!selected) {
+ this.set('entityType', null);
+ this.set('entityUuid', null);
+ this.set('entitySubstitution', null);
+ }
+ selected = false;
+ },
},
);