diff --git a/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.ckeditor5.yml b/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.ckeditor5.yml index f7d805e173..91da87d28b 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.ckeditor5.yml +++ b/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.ckeditor5.yml @@ -49,10 +49,10 @@ # # class: Optional PHP class that makes it possible for the plugin to provide # # dynamic values, or a configuration UI. -avoindata_ckeditor5_plugins_externallink: +avoindata_ckeditor5_plugins_avoindataexternallink: ckeditor5: plugins: - - externalLink.ExternalLink + - avoindataExternalLink.AvoindataExternalLink config: link: decorators: @@ -66,7 +66,7 @@ avoindata_ckeditor5_plugins_externallink: - 'external-link' drupal: label: Link - library: avoindata_ckeditor5_plugins/externalLink + library: avoindata_ckeditor5_plugins/avoindataExternalLink elements: - - diff --git a/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.libraries.yml b/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.libraries.yml index aa484a39cb..d61d5b4b90 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.libraries.yml +++ b/drupal/modules/avoindata-ckeditor5-plugins/avoindata_ckeditor5_plugins.libraries.yml @@ -1,8 +1,8 @@ # This adds the plugin JavaScript to the page. -externalLink: +avoindataExternalLink: js: - js/externalLink.js: { preprocess: false, minified: true } + js/avoindataExternalLink.js: { preprocess: false, minified: true } dependencies: - core/ckeditor5 diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExample.js b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExample.js index d60b4bf4f9..4029057341 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExample.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExample.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.CKEditor5=n():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.avoindataExample=n())}(self,(()=>(()=>{var __webpack_modules__={"./src/avoindataExample/avoindataExample.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 */ AvoindataExample)\n/* harmony export */ });\n/* harmony import */ var _avoindataExampleEditing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataExampleEditing */ "./src/avoindataExample/avoindataExampleEditing.js");\n/* harmony import */ var _avoindataExampleUI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avoindataExampleUI */ "./src/avoindataExample/avoindataExampleUI.js");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "ckeditor5/src/core.js");\n/**\n * @file This is what CKEditor refers to as a master (glue) plugin. Its role is\n * just to load the “editing” and “UI” components of this Plugin. Those\n * components could be included in this file, but\n *\n * I.e, this file\'s purpose is to integrate all the separate parts of the plugin\n * before it\'s made discoverable via index.js.\n */\n\n// The contents of AvoindataExampleUI and AvoindataExampleEditing could be included in this\n// file, but it is recommended to separate these concerns in different files.\n\n\n\n\nclass AvoindataExample extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__.Plugin {\n // Note that AvoindataExampleEditing and AvoindataExampleUI also extend `Plugin`, but these\n // are not seen as individual plugins by CKEditor 5. CKEditor 5 will only\n // discover the plugins explicitly exported in index.js.\n static get requires() {\n return [_avoindataExampleEditing__WEBPACK_IMPORTED_MODULE_0__["default"], _avoindataExampleUI__WEBPACK_IMPORTED_MODULE_1__["default"]];\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./src/avoindataExample/avoindataExample.js?')},"./src/avoindataExample/avoindataExampleEditing.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 */ AvoindataExampleEditing)\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_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ \"ckeditor5/src/widget.js\");\n/* harmony import */ var _insertAvoindataExampleCommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertAvoindataExampleCommand */ \"./src/avoindataExample/insertAvoindataExampleCommand.js\");\n\n\n\n\n\n/**\n * CKEditor 5 plugins do not work directly with the DOM. They are defined as\n * plugin-specific data models that are then converted to markup that\n * is inserted in the DOM.\n *\n * CKEditor 5 internally interacts with expander as this model:\n * \n * \n * \n * \n *\n * Which is converted for the browser/user as this markup\n *
\n *
\n *
Title
\n *
\n *
Content
\n *
\n *\n * This file has the logic for defining the avoindataExample model, and for how it is\n * converted to standard DOM markup.\n */\nclass AvoindataExampleEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.Widget];\n }\n\n init() {\n this._defineSchema();\n this._defineConverters();\n this.editor.commands.add(\n 'insertAvoindataExampleCommand',\n new _insertAvoindataExampleCommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.editor),\n );\n }\n\n /*\n * This registers the structure that will be seen by CKEditor 5 as\n * \n * \n * \n * \n *\n * The logic in _defineConverters() will determine how this is converted to\n * markup.\n */\n _defineSchema() {\n // Schemas are registered via the central `editor` object.\n const schema = this.editor.model.schema;\n\n schema.register('avoindataExample', {\n // Behaves like a self-contained object (e.g. an image).\n isObject: true,\n // Allow in places where other blocks are allowed (e.g. directly in the root).\n allowWhere: '$block',\n });\n\n schema.register('avoindataExampleTitle', {\n // This creates a boundary for external actions such as clicking and\n // and keypress. For example, when the cursor is inside this box, the\n // keyboard shortcut for \"select all\" will be limited to the contents of\n // the box.\n isLimit: true,\n // This is only to be used within avoindataExample.\n allowIn: 'avoindataExample',\n // Allow content that is allowed in blocks (e.g. text with attributes).\n allowContentOf: '$root',\n });\n\n schema.register('avoindataExampleContent', {\n isLimit: true,\n allowIn: 'avoindataExample',\n allowContentOf: '$root',\n });\n\n schema.addChildCheck((context, childDefinition) => {\n // Disallow avoindataExample inside avoindataExampleContent.\n if (\n (context.endsWith('avoindataExampleContent') || context.endsWith('avoindataExampleTitle')) &&\n childDefinition.name === 'avoindataExample'\n ) {\n return false;\n }\n });\n }\n\n /**\n * Converters determine how CKEditor 5 models are converted into markup and\n * vice-versa.\n */\n _defineConverters() {\n // Converters are registered via the central editor object.\n const { conversion } = this.editor;\n\n // Upcast Converters: determine how existing HTML is interpreted by the\n // editor. These trigger when an editor instance loads.\n //\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExample',\n view: {\n name: 'div',\n classes: 'avoindata-example',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of ,\n // as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExampleTitle',\n view: {\n name: 'div',\n classes: 'avoindata-example-title',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of\n // , as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExampleContent',\n view: {\n name: 'div',\n classes: 'avoindata-example-content',\n },\n });\n\n // Data Downcast Converters: converts stored model data into HTML.\n // These trigger when content is saved.\n //\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataExample',\n view: {\n name: 'div',\n classes: 'avoindata-example',\n },\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataExampleTitle',\n view: {\n name: 'div',\n classes: 'avoindata-example-title',\n },\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataExampleContent',\n view: {\n name: 'div',\n classes: 'avoindata-example-content',\n },\n });\n\n // Editing Downcast Converters. These render the content to the user for\n // editing, i.e. this determines what gets seen in the editor. These trigger\n // after the Data Upcast Converters, and are re-triggered any time there\n // are changes to any of the models' properties.\n //\n // Convert the model into a container widget in the editor UI.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExample',\n view: (modelElement, { writer: viewWriter }) => {\n const section = viewWriter.createContainerElement('div', {\n class: 'avoindata-example',\n });\n\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidget)(section, viewWriter, { label: 'Avoindata Example widget' });\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExampleTitle',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-example-title',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExampleContent',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-example-content',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./src/avoindataExample/avoindataExampleEditing.js?")},"./src/avoindataExample/avoindataExampleUI.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 */ AvoindataExampleUI)\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_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var _icons_icon_example_svg_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icons/icon-example.svg?source */ \"./icons/icon-example.svg?source\");\n/**\n * @file registers the avoindataExample toolbar button and binds functionality to it.\n */\n\n\n\n\n\nclass AvoindataExampleUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n const editor = this.editor;\n\n // This will register the avoindataExample toolbar button.\n editor.ui.componentFactory.add('avoindataExample', (locale) => {\n const command = editor.commands.get('insertAvoindataExampleCommand');\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n\n // Create the toolbar button.\n buttonView.set({\n label: editor.t('Avoindata Example widget'),\n icon: _icons_icon_example_svg_source__WEBPACK_IMPORTED_MODULE_2__,\n tooltip: true,\n });\n\n // Bind the state of the button to the command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n\n // Execute the command when the button is clicked (executed).\n this.listenTo(buttonView, 'execute', () =>\n editor.execute('insertAvoindataExampleCommand'),\n );\n\n return buttonView;\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./src/avoindataExample/avoindataExampleUI.js?")},"./src/avoindataExample/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 _avoindataExample__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataExample */ "./src/avoindataExample/avoindataExample.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n AvoindataExample: _avoindataExample__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./src/avoindataExample/index.js?')},"./src/avoindataExample/insertAvoindataExampleCommand.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 */ InsertAvoindataExampleCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/**\n * @file defines InsertAvoindataExampleCommand, which is executed when the avoindataExample\n * toolbar button is pressed.\n */\n\n\n\nclass InsertAvoindataExampleCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n execute() {\n const { model } = this.editor;\n\n model.change((writer) => {\n // Insert * at the current selection position\n // in a way that will result in creating a valid model structure.\n model.insertContent(createAvoindataExample(writer));\n });\n }\n\n refresh() {\n const { model } = this.editor;\n const { selection } = model.document;\n\n // Determine if the cursor (selection) is in a position where adding a\n // avoindataExample is permitted. This is based on the schema of the model(s)\n // currently containing the cursor.\n const allowedIn = model.schema.findAllowedParent(\n selection.getFirstPosition(),\n 'avoindataExample',\n );\n\n // If the cursor is not in a location where a avoindataExample can be added, return\n // null so the addition doesn't happen.\n this.isEnabled = allowedIn !== null;\n }\n}\n\nfunction createAvoindataExample(writer) {\n // Create instances of the elements registered with the editor in\n // avoindataexpanderediting.js.\n const avoindataExample = writer.createElement('avoindataExample');\n const avoindataExampleTitle = writer.createElement('avoindataExampleTitle');\n const avoindataExampleContent = writer.createElement('avoindataExampleContent');\n\n // Append the title and content elements to the avoindataExample, which matches\n // the parent/child relationship as defined in their schemas.\n writer.append(avoindataExampleTitle, avoindataExample);\n writer.append(avoindataExampleContent, avoindataExample);\n\n // The text content will automatically be wrapped in a\n // `

`.\n writer.appendElement('paragraph', avoindataExampleTitle);\n writer.appendElement('paragraph', avoindataExampleContent);\n\n // Return the element to be added to the editor.\n return avoindataExample;\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./src/avoindataExample/insertAvoindataExampleCommand.js?")},"./icons/icon-example.svg?source":module=>{"use strict";eval('module.exports = "\\n \\n \\n \\n \\n\\n";\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/./icons/icon-example.svg?')},"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.avoindataExample/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/ui.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/ui.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/delegated_./ui.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/widget.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/widget.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataExample/delegated_./widget.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 n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__("./src/avoindataExample/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ 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.avoindataExample=t())}(self,(()=>(()=>{var e={"ckeditor5/src/core.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/widget.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,a),i.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";a.d(n,{default:()=>s});var e=a("ckeditor5/src/core.js"),t=a("ckeditor5/src/widget.js");class o extends e.Command{execute(){const{model:e}=this.editor;e.change((t=>{const a=function(e){const t=e.createElement("avoindataExample"),a=e.createElement("avoindataExampleTitle"),n=e.createElement("avoindataExampleContent");e.append(a,t),e.append(n,t);const o=e.createElement("paragraph");e.insertText("Title",o,0),e.append(o,a);const i=e.createElement("paragraph");return e.insertText("Content",i,0),e.append(i,n),t}(t);e.insertContent(a)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,a=e.schema.findAllowedParent(t.getFirstPosition(),"avoindataExample");this.isEnabled=null!==a}}class i extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertAvoindataExampleCommand",new o(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("avoindataExample",{isObject:!0,allowWhere:"$block"}),e.register("avoindataExampleTitle",{isLimit:!0,allowIn:"avoindataExample",allowContentOf:"$root"}),e.register("avoindataExampleContent",{isLimit:!0,allowIn:"avoindataExample",allowContentOf:"$root"}),e.addChildCheck(((e,t)=>{if((e.endsWith("avoindataExampleContent")||e.endsWith("avoindataExampleTitle"))&&"avoindataExample"===t.name)return!1}))}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"avoindataExample",view:{name:"div",classes:"avoindata-example"}}),e.for("upcast").elementToElement({model:"avoindataExampleTitle",view:{name:"div",classes:"avoindata-example-title"}}),e.for("upcast").elementToElement({model:"avoindataExampleContent",view:{name:"div",classes:"avoindata-example-content"}}),e.for("dataDowncast").elementToElement({model:"avoindataExample",view:{name:"div",classes:"avoindata-example"}}),e.for("dataDowncast").elementToElement({model:"avoindataExampleTitle",view:{name:"div",classes:"avoindata-example-title"}}),e.for("dataDowncast").elementToElement({model:"avoindataExampleContent",view:{name:"div",classes:"avoindata-example-content"}}),e.for("editingDowncast").elementToElement({model:"avoindataExample",view:(e,{writer:a})=>{const n=a.createContainerElement("div",{class:"avoindata-example"});return(0,t.toWidget)(n,a,{label:"Avoindata Example"})}}),e.for("editingDowncast").elementToElement({model:"avoindataExampleTitle",view:(e,{writer:a})=>{const n=a.createEditableElement("div",{class:"avoindata-example-title"});return(0,t.toWidgetEditable)(n,a)}}),e.for("editingDowncast").elementToElement({model:"avoindataExampleContent",view:(e,{writer:a})=>{const n=a.createEditableElement("div",{class:"avoindata-example-content"});return(0,t.toWidgetEditable)(n,a)}})}}var l=a("ckeditor5/src/ui.js");class d extends e.Plugin{init(){const e=this.editor;e.ui.componentFactory.add("avoindataExample",(t=>{const a=e.commands.get("insertAvoindataExampleCommand"),n=new l.ButtonView(t);return n.set({label:e.t("Avoindata Example"),icon:'\n \n \n \n \n\n',tooltip:!0}),n.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(n,"execute",(()=>e.execute("insertAvoindataExampleCommand"))),n}))}}class r extends e.Plugin{static get requires(){return[i,d]}}const s={AvoindataExample:r}})(),n=n.default})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExpander.js b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExpander.js index 22b9460c48..05768e133e 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExpander.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataExpander.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.CKEditor5=n():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.avoindataExpander=n())}(self,(()=>(()=>{var __webpack_modules__={"./src/avoindataExpander/avoindataExpander.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 */ AvoindataExpander)\n/* harmony export */ });\n/* harmony import */ var _avoindataExpanderEditing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataExpanderEditing */ "./src/avoindataExpander/avoindataExpanderEditing.js");\n/* harmony import */ var _avoindataExpanderUI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avoindataExpanderUI */ "./src/avoindataExpander/avoindataExpanderUI.js");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "ckeditor5/src/core.js");\n/**\n * @file This is what CKEditor refers to as a master (glue) plugin. Its role is\n * just to load the “editing” and “UI” components of this Plugin. Those\n * components could be included in this file, but\n *\n * I.e, this file\'s purpose is to integrate all the separate parts of the plugin\n * before it\'s made discoverable via index.js.\n */\n\n// The contents of AvoindataExpanderUI and AvoindataExpanderEditing could be included in this\n// file, but it is recommended to separate these concerns in different files.\n\n\n\n\nclass AvoindataExpander extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__.Plugin {\n // Note that ExpanderEditing and ExpanderUI also extend `Plugin`, but these\n // are not seen as individual plugins by CKEditor 5. CKEditor 5 will only\n // discover the plugins explicitly exported in index.js.\n static get requires() {\n return [_avoindataExpanderEditing__WEBPACK_IMPORTED_MODULE_0__["default"], _avoindataExpanderUI__WEBPACK_IMPORTED_MODULE_1__["default"]];\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./src/avoindataExpander/avoindataExpander.js?')},"./src/avoindataExpander/avoindataExpanderEditing.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 */ AvoindataExpanderEditing)\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_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ \"ckeditor5/src/widget.js\");\n/* harmony import */ var _insertAvoindataExpanderCommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertAvoindataExpanderCommand */ \"./src/avoindataExpander/insertAvoindataExpanderCommand.js\");\n\n\n\n\n\n/**\n * CKEditor 5 plugins do not work directly with the DOM. They are defined as\n * plugin-specific data models that are then converted to markup that\n * is inserted in the DOM.\n *\n * CKEditor 5 internally interacts with expander as this model:\n * \n * \n * \n * \n *\n * Which is converted for the browser/user as this markup\n *

\n
\n
Title
\n \n
\n
Content
\n
\n *\n * This file has the logic for defining the avoindataExpander model, and for how it is\n * converted to standard DOM markup.\n */\nclass AvoindataExpanderEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.Widget];\n }\n\n init() {\n this._defineSchema();\n this._defineConverters();\n this.editor.commands.add(\n 'insertAvoindataExpanderCommand',\n new _insertAvoindataExpanderCommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.editor),\n );\n }\n\n /*\n * This registers the structure that will be seen by CKEditor 5 as\n * \n * \n * \n * \n *\n * The logic in _defineConverters() will determine how this is converted to\n * markup.\n */\n _defineSchema() {\n // Schemas are registered via the central `editor` object.\n const schema = this.editor.model.schema;\n\n schema.register('avoindataExpander', {\n // Behaves like a self-contained object (e.g. an image).\n isObject: true,\n // Allow in places where other blocks are allowed (e.g. directly in the root).\n allowWhere: '$block',\n });\n\n schema.register('avoindataExpanderTitle', {\n // This creates a boundary for external actions such as clicking and\n // and keypress. For example, when the cursor is inside this box, the\n // keyboard shortcut for \"select all\" will be limited to the contents of\n // the box.\n isLimit: true,\n // This is only to be used within simpleBox.\n allowIn: 'avoindataExpander',\n // Allow content that is allowed in blocks (e.g. text with attributes).\n allowContentOf: '$root',\n });\n\n schema.register('avoindataExpanderContent', {\n isLimit: true,\n allowIn: 'avoindataExpander',\n allowContentOf: '$root',\n });\n\n schema.addChildCheck((context, childDefinition) => {\n // Disallow avoindataExpander inside avoindataExpanderContent.\n if (\n (context.endsWith('avoindataExpanderContent') || context.endsWith('avoindataExpanderTitle')) &&\n childDefinition.name === 'avoindataExpander'\n ) {\n return false;\n }\n });\n }\n\n /**\n * Converters determine how CKEditor 5 models are converted into markup and\n * vice-versa.\n */\n _defineConverters() {\n // Converters are registered via the central editor object.\n const { conversion } = this.editor;\n\n // Upcast Converters: determine how existing HTML is interpreted by the\n // editor. These trigger when an editor instance loads.\n //\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExpander',\n view: {\n name: 'div',\n classes: 'avoindata-expander',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of ,\n // as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExpanderTitle',\n view: {\n name: 'div',\n classes: 'avoindata-expander-title',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of\n // , as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataExpanderContent',\n view: {\n name: 'div',\n classes: 'avoindata-expander-content',\n },\n });\n\n // Data Downcast Converters: converts stored model data into HTML.\n // These trigger when content is saved.\n //\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataExpander',\n view: {\n name: 'div',\n classes: 'avoindata-expander',\n },\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToStructure({\n model: 'avoindataExpanderTitle',\n view: (modelElement, { writer }) => {\n return writer.createContainerElement('div', { class: 'avoindata-expander-header' }, [\n writer.createContainerElement('div', { class: 'avoindata-expander-title' }, [\n writer.createSlot()\n ]),\n writer.createContainerElement('span', { class: 'icon-wrapper pull-right' }, [\n writer.createEmptyElement('i', { class: 'fas fa-angle-down' })\n ])\n ])\n }\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataExpanderContent',\n view: {\n name: 'div',\n classes: 'avoindata-expander-content',\n },\n });\n\n // Editing Downcast Converters. These render the content to the user for\n // editing, i.e. this determines what gets seen in the editor. These trigger\n // after the Data Upcast Converters, and are re-triggered any time there\n // are changes to any of the models' properties.\n //\n // Convert the model into a container widget in the editor UI.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExpander',\n view: (modelElement, { writer: viewWriter }) => {\n const section = viewWriter.createContainerElement('div', {\n class: 'avoindata-expander',\n });\n\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidget)(section, viewWriter, { label: 'Avoindata Expander widget' });\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExpanderTitle',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-expander-title',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataExpanderContent',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-expander-content',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./src/avoindataExpander/avoindataExpanderEditing.js?")},"./src/avoindataExpander/avoindataExpanderUI.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 */ AvoindataExpanderUI)\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_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var _icons_icon_expander_svg_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icons/icon-expander.svg?source */ \"./icons/icon-expander.svg?source\");\n/**\n * @file registers the avoindataExpander toolbar button and binds functionality to it.\n */\n\n\n\n\n\nclass AvoindataExpanderUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n const editor = this.editor;\n\n // This will register the avoindataExpander toolbar button.\n editor.ui.componentFactory.add('avoindataExpander', (locale) => {\n const command = editor.commands.get('insertAvoindataExpanderCommand');\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n\n // Create the toolbar button.\n buttonView.set({\n label: editor.t('Avoindata Expander widget'),\n icon: _icons_icon_expander_svg_source__WEBPACK_IMPORTED_MODULE_2__,\n tooltip: true,\n });\n\n // Bind the state of the button to the command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n\n // Execute the command when the button is clicked (executed).\n this.listenTo(buttonView, 'execute', () =>\n editor.execute('insertAvoindataExpanderCommand'),\n );\n\n return buttonView;\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./src/avoindataExpander/avoindataExpanderUI.js?")},"./src/avoindataExpander/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 _avoindataExpander__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataExpander */ "./src/avoindataExpander/avoindataExpander.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n AvoindataExpander: _avoindataExpander__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./src/avoindataExpander/index.js?')},"./src/avoindataExpander/insertAvoindataExpanderCommand.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 */ InsertAvoindataExpanderCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/**\n * @file defines InsertAvoindataExpanderCommand, which is executed when the avoindataExpander\n * toolbar button is pressed.\n */\n\n\n\nclass InsertAvoindataExpanderCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n execute() {\n const { model } = this.editor;\n\n model.change((writer) => {\n // Insert * at the current selection position\n // in a way that will result in creating a valid model structure.\n model.insertContent(createAvoindataExpander(writer));\n });\n }\n\n refresh() {\n const { model } = this.editor;\n const { selection } = model.document;\n\n // Determine if the cursor (selection) is in a position where adding a\n // avoindataExpander is permitted. This is based on the schema of the model(s)\n // currently containing the cursor.\n const allowedIn = model.schema.findAllowedParent(\n selection.getFirstPosition(),\n 'avoindataExpander',\n );\n\n // If the cursor is not in a location where a avoindataExpander can be added, return\n // null so the addition doesn't happen.\n this.isEnabled = allowedIn !== null;\n }\n}\n\nfunction createAvoindataExpander(writer) {\n // Create instances of the three elements registered with the editor in\n // avoindataexpanderediting.js.\n const avoindataExpander = writer.createElement('avoindataExpander');\n const avoindataExpanderTitle = writer.createElement('avoindataExpanderTitle');\n const avoindataExpanderContent = writer.createElement('avoindataExpanderContent');\n\n // Append the title and content elements to the avoindataExpander, which matches\n // the parent/child relationship as defined in their schemas.\n writer.append(avoindataExpanderTitle, avoindataExpander);\n writer.append(avoindataExpanderContent, avoindataExpander);\n\n // The text content will automatically be wrapped in a\n // `

`.\n writer.appendElement('paragraph', avoindataExpanderTitle);\n writer.appendElement('paragraph', avoindataExpanderContent);\n\n // Return the element to be added to the editor.\n return avoindataExpander;\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./src/avoindataExpander/insertAvoindataExpanderCommand.js?")},"./icons/icon-expander.svg?source":module=>{"use strict";eval('module.exports = "\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\n\\n";\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/./icons/icon-expander.svg?')},"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.avoindataExpander/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/ui.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/ui.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/delegated_./ui.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/widget.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/widget.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataExpander/delegated_./widget.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 n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__("./src/avoindataExpander/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ 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.avoindataExpander=t())}(self,(()=>(()=>{var e={"ckeditor5/src/core.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/widget.js":(e,t,a)=>{e.exports=a("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";a.d(n,{default:()=>l});var e=a("ckeditor5/src/core.js"),t=a("ckeditor5/src/widget.js");class o extends e.Command{execute(){const{model:e}=this.editor;e.change((t=>{const a=function(e){const t=e.createElement("avoindataExpander"),a=e.createElement("avoindataExpanderTitle"),n=e.createElement("avoindataExpanderContent");e.append(a,t),e.append(n,t);const o=e.createElement("paragraph");e.insertText("Title",o,0),e.append(o,a);const r=e.createElement("paragraph");return e.insertText("Content",r,0),e.append(r,n),t}(t);e.insertContent(a)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,a=e.schema.findAllowedParent(t.getFirstPosition(),"avoindataExpander");this.isEnabled=null!==a}}class r extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertAvoindataExpanderCommand",new o(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("avoindataExpander",{isObject:!0,allowWhere:"$block"}),e.register("avoindataExpanderTitle",{isLimit:!0,allowIn:"avoindataExpander",allowContentOf:"$root"}),e.register("avoindataExpanderContent",{isLimit:!0,allowIn:"avoindataExpander",allowContentOf:"$root"}),e.addChildCheck(((e,t)=>{if((e.endsWith("avoindataExpanderContent")||e.endsWith("avoindataExpanderTitle"))&&"avoindataExpander"===t.name)return!1}))}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"avoindataExpander",view:{name:"div",classes:"avoindata-expander"}}),e.for("upcast").elementToElement({model:"avoindataExpanderTitle",view:{name:"div",classes:"avoindata-expander-title"}}),e.for("upcast").elementToElement({model:"avoindataExpanderContent",view:{name:"div",classes:"avoindata-expander-content"}}),e.for("dataDowncast").elementToElement({model:"avoindataExpander",view:{name:"div",classes:"avoindata-expander"}}),e.for("dataDowncast").elementToStructure({model:"avoindataExpanderTitle",view:(e,{writer:t})=>t.createContainerElement("div",{class:"avoindata-expander-header"},[t.createContainerElement("div",{class:"avoindata-expander-title"},[t.createSlot()]),t.createContainerElement("span",{class:"icon-wrapper pull-right"},[t.createEmptyElement("i",{class:"fas fa-angle-down"})])])}),e.for("dataDowncast").elementToElement({model:"avoindataExpanderContent",view:{name:"div",classes:"avoindata-expander-content"}}),e.for("editingDowncast").elementToElement({model:"avoindataExpander",view:(e,{writer:a})=>{const n=a.createContainerElement("div",{class:"avoindata-expander"});return(0,t.toWidget)(n,a,{label:"Avoindata Expander"})}}),e.for("editingDowncast").elementToElement({model:"avoindataExpanderTitle",view:(e,{writer:a})=>{const n=a.createEditableElement("div",{class:"avoindata-expander-title"});return(0,t.toWidgetEditable)(n,a)}}),e.for("editingDowncast").elementToElement({model:"avoindataExpanderContent",view:(e,{writer:a})=>{const n=a.createEditableElement("div",{class:"avoindata-expander-content"});return(0,t.toWidgetEditable)(n,a)}})}}var d=a("ckeditor5/src/ui.js");class i extends e.Plugin{init(){const e=this.editor;e.ui.componentFactory.add("avoindataExpander",(t=>{const a=e.commands.get("insertAvoindataExpanderCommand"),n=new d.ButtonView(t);return n.set({label:e.t("Avoindata Expander"),icon:'\n\t\n\t\t\n\t\t\n\t\n\n',tooltip:!0}),n.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(n,"execute",(()=>e.execute("insertAvoindataExpanderCommand"))),n}))}}class s extends e.Plugin{static get requires(){return[r,i]}}const l={AvoindataExpander:s}})(),n=n.default})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataHint.js b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataHint.js index 3c5763d288..24903a02b8 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataHint.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataHint.js @@ -1 +1 @@ -!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor5=e():(n.CKEditor5=n.CKEditor5||{},n.CKEditor5.avoindataHint=e())}(self,(()=>(()=>{var __webpack_modules__={"./src/avoindataHint/avoindataHint.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 */ AvoindataHint)\n/* harmony export */ });\n/* harmony import */ var _avoindataHintEditing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataHintEditing */ "./src/avoindataHint/avoindataHintEditing.js");\n/* harmony import */ var _avoindataHintUI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avoindataHintUI */ "./src/avoindataHint/avoindataHintUI.js");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "ckeditor5/src/core.js");\n/**\n * @file This is what CKEditor refers to as a master (glue) plugin. Its role is\n * just to load the “editing” and “UI” components of this Plugin. Those\n * components could be included in this file, but\n *\n * I.e, this file\'s purpose is to integrate all the separate parts of the plugin\n * before it\'s made discoverable via index.js.\n */\n\n// The contents of AvoindataHintUI and AvoindataHintEditing could be included in this\n// file, but it is recommended to separate these concerns in different files.\n\n\n\n\nclass AvoindataHint extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__.Plugin {\n // Note that AvoindataHintEditing and AvoindataHintUI also extend `Plugin`, but these\n // are not seen as individual plugins by CKEditor 5. CKEditor 5 will only\n // discover the plugins explicitly exported in index.js.\n static get requires() {\n return [_avoindataHintEditing__WEBPACK_IMPORTED_MODULE_0__["default"], _avoindataHintUI__WEBPACK_IMPORTED_MODULE_1__["default"]];\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./src/avoindataHint/avoindataHint.js?')},"./src/avoindataHint/avoindataHintEditing.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 */ AvoindataHintEditing)\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_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ \"ckeditor5/src/widget.js\");\n/* harmony import */ var _insertAvoindataHintCommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertAvoindataHintCommand */ \"./src/avoindataHint/insertAvoindataHintCommand.js\");\n\n\n\n\n\n/**\n * CKEditor 5 plugins do not work directly with the DOM. They are defined as\n * plugin-specific data models that are then converted to markup that\n * is inserted in the DOM.\n *\n * CKEditor 5 internally interacts with expander as this model:\n * \n * \n * \n * \n * \n * \n * \n *\n * Which is converted for the browser/user as this markup\n *

\n *
\n * \n *
Title
\n *
\n *
Content
\n *
\n *\n * This file has the logic for defining the avoindataHint model, and for how it is\n * converted to standard DOM markup.\n */\nclass AvoindataHintEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.Widget];\n }\n\n init() {\n this._defineSchema();\n this._defineConverters();\n this.editor.commands.add(\n 'insertAvoindataHintCommand',\n new _insertAvoindataHintCommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.editor),\n );\n }\n\n /*\n * This registers the structure that will be seen by CKEditor 5 as\n * \n * \n * \n * \n * \n * \n *\n * The logic in _defineConverters() will determine how this is converted to\n * markup.\n */\n _defineSchema() {\n // Schemas are registered via the central `editor` object.\n const schema = this.editor.model.schema;\n\n schema.register('avoindataHint', {\n // Behaves like a self-contained object (e.g. an image).\n isObject: true,\n // Allow in places where other blocks are allowed (e.g. directly in the root).\n allowWhere: '$block',\n });\n\n schema.register('avoindataHintIcon', {\n isObject: true,\n isContent: true,\n isInline: true,\n isBlock: false,\n isSelectable: false,\n isLimit: false,\n // This is only to be used within avoindataHint.\n allowIn: 'avoindataHint',\n allowAttributes: ['src', 'alt', 'class']\n });\n\n schema.register('avoindataHintContent', {\n isLimit: true,\n allowIn: 'avoindataHint',\n allowContentOf: '$root',\n });\n\n schema.addChildCheck((context, childDefinition) => {\n // Disallow avoindataHint inside avoindataHintContent.\n if (\n context.endsWith('avoindataHintContent') &&\n childDefinition.name === 'avoindataHint'\n ) {\n return false;\n }\n });\n }\n\n /**\n * Converters determine how CKEditor 5 models are converted into markup and\n * vice-versa.\n */\n _defineConverters() {\n // Converters are registered via the central editor object.\n const { conversion } = this.editor;\n\n // Upcast Converters: determine how existing HTML is interpreted by the\n // editor. These trigger when an editor instance loads.\n //\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model.\n conversion.for('upcast').elementToElement({\n model: 'avoindataHint',\n view: {\n name: 'div',\n classes: 'avoindata-hint',\n },\n });\n\n conversion.for('upcast').elementToElement({\n model: 'avoindataHintIcon',\n view: {\n name: 'img',\n classes: 'avoindata-hint-icon',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of\n // , as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataHintContent',\n view: {\n name: 'div',\n classes: 'avoindata-hint-content',\n },\n });\n\n // Data Downcast Converters: converts stored model data into HTML.\n // These trigger when content is saved.\n //\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataHint',\n view: {\n name: 'div',\n classes: 'avoindata-hint',\n },\n });\n\n // Instances of are saved as\n // \"Avoindata
.\n conversion.for('downcast').elementToElement({\n model: 'avoindataHintIcon',\n view: (modelElement, { writer }) => {\n return writer.createEmptyElement('img', { class: \"avoindata-hint-icon\", src: '/themes/avoindata/images/avoindata-hint-icon.svg' })\n }\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataHintContent',\n view: {\n name: 'div',\n classes: 'avoindata-hint-content',\n },\n });\n\n // Editing Downcast Converters. These render the content to the user for\n // editing, i.e. this determines what gets seen in the editor. These trigger\n // after the Data Upcast Converters, and are re-triggered any time there\n // are changes to any of the models' properties.\n //\n // Convert the model into a container widget in the editor UI.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataHint',\n view: (modelElement, { writer: viewWriter }) => {\n const section = viewWriter.createContainerElement('div', {\n class: 'avoindata-hint',\n });\n\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidget)(section, viewWriter, { label: 'Avoindata Hint widget' });\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataHintContent',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-hint-content',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n conversion.for('upcast').elementToElement({\n model: 'avoindataHintIcon',\n view: {\n name: 'img',\n classes: 'avoindata-hint-image',\n },\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./src/avoindataHint/avoindataHintEditing.js?")},"./src/avoindataHint/avoindataHintUI.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 */ AvoindataHintUI)\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_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var _icons_icon_hint_svg_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icons/icon-hint.svg?source */ \"./icons/icon-hint.svg?source\");\n/**\n * @file registers the avoindataHint toolbar button and binds functionality to it.\n */\n\n\n\n\n\nclass AvoindataHintUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n const editor = this.editor;\n\n // This will register the avoindataHint toolbar button.\n editor.ui.componentFactory.add('avoindataHint', (locale) => {\n const command = editor.commands.get('insertAvoindataHintCommand');\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n\n // Create the toolbar button.\n buttonView.set({\n label: editor.t('Avoindata Hint widget'),\n icon: _icons_icon_hint_svg_source__WEBPACK_IMPORTED_MODULE_2__,\n tooltip: true,\n });\n\n // Bind the state of the button to the command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n\n // Execute the command when the button is clicked (executed).\n this.listenTo(buttonView, 'execute', () =>\n editor.execute('insertAvoindataHintCommand'),\n );\n\n return buttonView;\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./src/avoindataHint/avoindataHintUI.js?")},"./src/avoindataHint/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 _avoindataHint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataHint */ "./src/avoindataHint/avoindataHint.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n AvoindataHint: _avoindataHint__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./src/avoindataHint/index.js?')},"./src/avoindataHint/insertAvoindataHintCommand.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 */ InsertAvoindataHintCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/**\n * @file defines InsertAvoindataHintCommand, which is executed when the avoindataHint\n * toolbar button is pressed.\n */\n\n\n\nclass InsertAvoindataHintCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n execute() {\n const { model } = this.editor;\n\n model.change((writer) => {\n // Insert * at the current selection position\n // in a way that will result in creating a valid model structure.\n model.insertContent(createAvoindataHint(writer));\n });\n }\n\n refresh() {\n const { model } = this.editor;\n const { selection } = model.document;\n\n // Determine if the cursor (selection) is in a position where adding a\n // avoindataHint is permitted. This is based on the schema of the model(s)\n // currently containing the cursor.\n const allowedIn = model.schema.findAllowedParent(\n selection.getFirstPosition(),\n 'avoindataHint',\n );\n\n // If the cursor is not in a location where a avoindataHint can be added, return\n // null so the addition doesn't happen.\n this.isEnabled = allowedIn !== null;\n }\n}\n\nfunction createAvoindataHint(writer) {\n // Create instances of the elements registered with the editor in\n // avoindataexpanderediting.js.\n const avoindataHint = writer.createElement('avoindataHint');\n const avoindataHintIcon = writer.createElement('avoindataHintIcon');\n const avoindataHintContent = writer.createElement('avoindataHintContent');\n\n // Append the title and content elements to the avoindataHint, which matches\n // the parent/child relationship as defined in their schemas.\n writer.append(avoindataHintIcon, avoindataHint);\n writer.append(avoindataHintContent, avoindataHint);\n\n // The text content will automatically be wrapped in a\n // `

`.\n writer.appendElement('paragraph', avoindataHintContent);\n\n // Return the element to be added to the editor.\n return avoindataHint;\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./src/avoindataHint/insertAvoindataHintCommand.js?")},"./icons/icon-hint.svg?source":module=>{"use strict";eval('module.exports = "\\n \\n \\n \\n\\n";\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/./icons/icon-hint.svg?')},"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.avoindataHint/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/ui.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/ui.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/delegated_./ui.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/widget.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/widget.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataHint/delegated_./widget.js_from_dll-reference_CKEditor5.dll?')},"dll-reference CKEditor5.dll":n=>{"use strict";n.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(n){var e=__webpack_module_cache__[n];if(void 0!==e)return e.exports;var t=__webpack_module_cache__[n]={exports:{}};return __webpack_modules__[n](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(n,e)=>{for(var t in e)__webpack_require__.o(e,t)&&!__webpack_require__.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},__webpack_require__.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),__webpack_require__.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/avoindataHint/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ No newline at end of file +!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.avoindataHint=e())}(self,(()=>(()=>{var t={"ckeditor5/src/core.js":(t,e,n)=>{t.exports=n("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":(t,e,n)=>{t.exports=n("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/widget.js":(t,e,n)=>{t.exports=n("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":t=>{"use strict";t.exports=CKEditor5.dll}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");if(i.length)for(var o=i.length-1;o>-1&&!t;)t=i[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})();var i={};return(()=>{"use strict";n.d(i,{default:()=>l});var t=n("ckeditor5/src/core.js"),e=n("ckeditor5/src/widget.js");class o extends t.Command{execute(){const{model:t}=this.editor;t.change((e=>{const n=function(t){const e=t.createElement("avoindataHint"),n=t.createElement("avoindataHintIcon"),i=t.createElement("avoindataHintContent");t.append(n,e),t.append(i,e);const o=t.createElement("paragraph");return t.insertText("Content",o,0),t.append(o,i),e}(e);t.insertContent(n)}))}refresh(){const{model:t}=this.editor,{selection:e}=t.document,n=t.schema.findAllowedParent(e.getFirstPosition(),"avoindataHint");this.isEnabled=null!==n}}const a=n.p+"../icons/icon-hint.svg";class r extends t.Plugin{static get requires(){return[e.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertAvoindataHintCommand",new o(this.editor))}_defineSchema(){const t=this.editor.model.schema;t.register("avoindataHint",{isObject:!0,allowWhere:"$block"}),t.register("avoindataHintIcon",{isObject:!0,isContent:!0,isInline:!0,isBlock:!1,isSelectable:!1,isLimit:!1,allowIn:"avoindataHint",allowAttributes:["src","alt","class"]}),t.register("avoindataHintContent",{isLimit:!0,allowIn:"avoindataHint",allowContentOf:"$root"}),t.addChildCheck(((t,e)=>{if(t.endsWith("avoindataHintContent")&&"avoindataHint"===e.name)return!1}))}_defineConverters(){const{conversion:t}=this.editor;t.for("upcast").elementToElement({model:"avoindataHint",view:{name:"div",classes:"avoindata-hint"}}),t.for("upcast").elementToElement({model:"avoindataHintIcon",view:{name:"img",classes:"avoindata-hint-icon"}}),t.for("upcast").elementToElement({model:"avoindataHintContent",view:{name:"div",classes:"avoindata-hint-content"}}),t.for("dataDowncast").elementToElement({model:"avoindataHint",view:{name:"div",classes:"avoindata-hint"}}),t.for("downcast").elementToElement({model:"avoindataHintIcon",view:(t,{writer:e})=>e.createEmptyElement("img",{class:"avoindata-hint-icon",src:a})}),t.for("dataDowncast").elementToElement({model:"avoindataHintContent",view:{name:"div",classes:"avoindata-hint-content"}}),t.for("editingDowncast").elementToElement({model:"avoindataHint",view:(t,{writer:n})=>{const i=n.createContainerElement("div",{class:"avoindata-hint"});return(0,e.toWidget)(i,n,{label:"Avoindata Hint"})}}),t.for("editingDowncast").elementToElement({model:"avoindataHintContent",view:(t,{writer:n})=>{const i=n.createEditableElement("div",{class:"avoindata-hint-content"});return(0,e.toWidgetEditable)(i,n)}}),t.for("upcast").elementToElement({model:"avoindataHintIcon",view:{name:"img",classes:"avoindata-hint-image"}})}}var s=n("ckeditor5/src/ui.js");class d extends t.Plugin{init(){const t=this.editor;t.ui.componentFactory.add("avoindataHint",(e=>{const n=t.commands.get("insertAvoindataHintCommand"),i=new s.ButtonView(e);return i.set({label:t.t("Avoindata Hint"),icon:'\n \n \n \n\n',tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",(()=>t.execute("insertAvoindataHintCommand"))),i}))}}class c extends t.Plugin{static get requires(){return[r,d]}}const l={AvoindataHint:c}})(),i=i.default})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataNote.js b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataNote.js index 63f09b5469..2e54a2dcf6 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataNote.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataNote.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.CKEditor5=n():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.avoindataNote=n())}(self,(()=>(()=>{var __webpack_modules__={"./src/avoindataNote/avoindataNote.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 */ AvoindataNote)\n/* harmony export */ });\n/* harmony import */ var _avoindataNoteEditing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataNoteEditing */ "./src/avoindataNote/avoindataNoteEditing.js");\n/* harmony import */ var _avoindataNoteUI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avoindataNoteUI */ "./src/avoindataNote/avoindataNoteUI.js");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "ckeditor5/src/core.js");\n/**\n * @file This is what CKEditor refers to as a master (glue) plugin. Its role is\n * just to load the “editing” and “UI” components of this Plugin. Those\n * components could be included in this file, but\n *\n * I.e, this file\'s purpose is to integrate all the separate parts of the plugin\n * before it\'s made discoverable via index.js.\n */\n\n// The contents of AvoindataNoteUI and AvoindataNoteEditing could be included in this\n// file, but it is recommended to separate these concerns in different files.\n\n\n\n\nclass AvoindataNote extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__.Plugin {\n // Note that AvoindataNoteEditing and AvoindataNoteUI also extend `Plugin`, but these\n // are not seen as individual plugins by CKEditor 5. CKEditor 5 will only\n // discover the plugins explicitly exported in index.js.\n static get requires() {\n return [_avoindataNoteEditing__WEBPACK_IMPORTED_MODULE_0__["default"], _avoindataNoteUI__WEBPACK_IMPORTED_MODULE_1__["default"]];\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./src/avoindataNote/avoindataNote.js?')},"./src/avoindataNote/avoindataNoteEditing.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 */ AvoindataNoteEditing)\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_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ \"ckeditor5/src/widget.js\");\n/* harmony import */ var _insertAvoindataNoteCommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertAvoindataNoteCommand */ \"./src/avoindataNote/insertAvoindataNoteCommand.js\");\n/* harmony import */ var _icons_icon_note_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../icons/icon-note.svg */ \"./icons/icon-note.svg\");\n\n\n\n\n\n\n\n/**\n * CKEditor 5 plugins do not work directly with the DOM. They are defined as\n * plugin-specific data models that are then converted to markup that\n * is inserted in the DOM.\n *\n * CKEditor 5 internally interacts with expander as this model:\n * \n * \n * \n * \n * \n * \n * \n *\n * Which is converted for the browser/user as this markup\n *

\n *
\n * \n *
Title
\n *
\n *
Content
\n *
\n *\n * This file has the logic for defining the avoindataNote model, and for how it is\n * converted to standard DOM markup.\n */\nclass AvoindataNoteEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.Widget];\n }\n\n init() {\n this._defineSchema();\n this._defineConverters();\n this.editor.commands.add(\n 'insertAvoindataNoteCommand',\n new _insertAvoindataNoteCommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.editor),\n );\n }\n\n /*\n * This registers the structure that will be seen by CKEditor 5 as\n * \n * \n * \n * \n * \n * \n * \n *\n * The logic in _defineConverters() will determine how this is converted to\n * markup.\n */\n _defineSchema() {\n // Schemas are registered via the central `editor` object.\n const schema = this.editor.model.schema;\n\n schema.register('avoindataNote', {\n // Behaves like a self-contained object (e.g. an image).\n isObject: true,\n // Allow in places where other blocks are allowed (e.g. directly in the root).\n allowWhere: '$block',\n });\n\n schema.register('avoindataNoteIcon', {\n isObject: true,\n isContent: true,\n isInline: true,\n isBlock: false,\n isSelectable: false,\n isLimit: false,\n // This is only to be used within avoindataNote.\n allowIn: 'avoindataNote',\n allowAttributes: ['src', 'alt', 'class']\n });\n\n schema.register('avoindataNoteTitle', {\n // This creates a boundary for external actions such as clicking and\n // and keypress. For example, when the cursor is inside this box, the\n // keyboard shortcut for \"select all\" will be limited to the contents of\n // the box.\n isLimit: true,\n // This is only to be used within avoindataNote.\n allowIn: 'avoindataNote',\n // Allow content that is allowed in blocks (e.g. text with attributes).\n allowContentOf: '$root',\n });\n\n schema.register('avoindataNoteContent', {\n isLimit: true,\n allowIn: 'avoindataNote',\n allowContentOf: '$root',\n });\n\n schema.addChildCheck((context, childDefinition) => {\n // Disallow avoindataNote inside avoindataNoteContent.\n if (\n (context.endsWith('avoindataNoteContent') || context.endsWith('avoindataNoteTitle')) &&\n childDefinition.name === 'avoindataNote'\n ) {\n return false;\n }\n });\n }\n\n /**\n * Converters determine how CKEditor 5 models are converted into markup and\n * vice-versa.\n */\n _defineConverters() {\n // Converters are registered via the central editor object.\n const { conversion } = this.editor;\n\n // Upcast Converters: determine how existing HTML is interpreted by the\n // editor. These trigger when an editor instance loads.\n //\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model.\n conversion.for('upcast').elementToElement({\n model: 'avoindataNote',\n view: {\n name: 'div',\n classes: 'avoindata-note',\n },\n });\n\n conversion.for('upcast').elementToElement({\n model: 'avoindataNoteIcon',\n view: {\n name: 'img',\n classes: 'avoindata-note-icon'\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of ,\n // as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataNoteTitle',\n view: {\n name: 'div',\n classes: 'avoindata-note-title',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of\n // , as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataNoteContent',\n view: {\n name: 'div',\n classes: 'avoindata-note-content',\n },\n });\n\n // Data Downcast Converters: converts stored model data into HTML.\n // These trigger when content is saved.\n //\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataNote',\n view: {\n name: 'div',\n classes: 'avoindata-note',\n },\n });\n\n // Instances of are saved as\n // \"Avoindata
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataNoteIcon',\n view: (modelElement, { writer }) => {\n return writer.createUIElement('img', { class: 'avoindata-note-icon', src: _icons_icon_note_svg__WEBPACK_IMPORTED_MODULE_3__, alt: \"Avoindata Note icon\" });\n }\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataNoteTitle',\n view: {\n name: 'div',\n classes: 'avoindata-note-title',\n },\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataNoteContent',\n view: {\n name: 'div',\n classes: 'avoindata-note-content',\n },\n });\n\n // Editing Downcast Converters. These render the content to the user for\n // editing, i.e. this determines what gets seen in the editor. These trigger\n // after the Data Upcast Converters, and are re-triggered any time there\n // are changes to any of the models' properties.\n //\n // Convert the model into a container widget in the editor UI.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataNote',\n view: (modelElement, { writer: viewWriter }) => {\n const section = viewWriter.createContainerElement('div', {\n class: 'avoindata-note',\n });\n\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidget)(section, viewWriter, { label: 'Avoindata Note widget' });\n },\n });\n\n // Convert the model into an UI element in the editor UI.\n conversion.for('editingDowncast').elementToStructure({\n model: 'avoindataNoteIcon',\n view: (modelElement, { writer }) => {\n return writer.createUIElement('img', { class: 'avoindata-note-icon', src: _icons_icon_note_svg__WEBPACK_IMPORTED_MODULE_3__, alt: \"Avoindata Note icon\" });\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataNoteTitle',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-note-title',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataNoteContent',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-note-content',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n conversion.for('upcast').elementToElement({\n model: 'avoindataNoteIcon',\n view: {\n name: 'img',\n classes: 'avoindata-note-header-image'\n },\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./src/avoindataNote/avoindataNoteEditing.js?")},"./src/avoindataNote/avoindataNoteUI.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 */ AvoindataNoteUI)\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_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var _icons_icon_note_svg_source__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icons/icon-note.svg?source */ \"./icons/icon-note.svg?source\");\n/**\n * @file registers the avoindataNote toolbar button and binds functionality to it.\n */\n\n\n\n\n\nclass AvoindataNoteUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n const editor = this.editor;\n\n // This will register the avoindataNote toolbar button.\n editor.ui.componentFactory.add('avoindataNote', (locale) => {\n const command = editor.commands.get('insertAvoindataNoteCommand');\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n\n // Create the toolbar button.\n buttonView.set({\n label: editor.t('Avoindata Note'),\n icon: _icons_icon_note_svg_source__WEBPACK_IMPORTED_MODULE_2__,\n tooltip: true,\n });\n\n // Bind the state of the button to the command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n\n // Execute the command when the button is clicked (executed).\n this.listenTo(buttonView, 'execute', () =>\n editor.execute('insertAvoindataNoteCommand'),\n );\n\n return buttonView;\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./src/avoindataNote/avoindataNoteUI.js?")},"./src/avoindataNote/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 _avoindataNote__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataNote */ "./src/avoindataNote/avoindataNote.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n AvoindataNote: _avoindataNote__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./src/avoindataNote/index.js?')},"./src/avoindataNote/insertAvoindataNoteCommand.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 */ InsertAvoindataNoteCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/**\n * @file defines InsertAvoindataNoteCommand, which is executed when the avoindataNote\n * toolbar button is pressed.\n */\n\n\n\nclass InsertAvoindataNoteCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n execute() {\n const { model } = this.editor;\n\n model.change((writer) => {\n // Insert * at the current selection position\n // in a way that will result in creating a valid model structure.\n model.insertContent(createAvoindataNote(writer));\n });\n }\n\n refresh() {\n const { model } = this.editor;\n const { selection } = model.document;\n\n // Determine if the cursor (selection) is in a position where adding a\n // avoindataNote is permitted. This is based on the schema of the model(s)\n // currently containing the cursor.\n const allowedIn = model.schema.findAllowedParent(\n selection.getFirstPosition(),\n 'avoindataNote',\n );\n\n // If the cursor is not in a location where a avoindataNote can be added, return\n // null so the addition doesn't happen.\n this.isEnabled = allowedIn !== null;\n }\n}\n\nfunction createAvoindataNote(writer) {\n // Create instances of the elements registered with the editor in\n // avoindataexpanderediting.js.\n const avoindataNote = writer.createElement('avoindataNote');\n const avoindataNoteIcon = writer.createElement('avoindataNoteIcon');\n const avoindataNoteTitle = writer.createElement('avoindataNoteTitle');\n const avoindataNoteContent = writer.createElement('avoindataNoteContent');\n\n // Append the title and content elements to the avoindataNote, which matches\n // the parent/child relationship as defined in their schemas.\n writer.append(avoindataNoteIcon, avoindataNote);\n writer.append(avoindataNoteTitle, avoindataNote);\n writer.append(avoindataNoteContent, avoindataNote);\n\n // The text content will automatically be wrapped in a\n // `

`.\n writer.appendElement('paragraph', avoindataNoteTitle);\n writer.appendElement('paragraph', avoindataNoteContent);\n\n // Return the element to be added to the editor.\n return avoindataNote;\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./src/avoindataNote/insertAvoindataNoteCommand.js?")},"./icons/icon-note.svg":module=>{"use strict";eval('module.exports = "data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRTk3MDI1IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBpZD0iSWNvbnMvQmFzaWMtaWNvbnMvaW5mbyIgZmlsbD0iI0U5NzAyNSIgc3Ryb2tlLXdpZHRoPSIxIiA+CiAgICAgICAgPHBhdGggZD0iTTEyLC0xLjI0MzQ0OTc5ZS0xNCBDMTguNjE3LC0xLjI0MzQ0OTc5ZS0xNCAyNCw1LjM4MyAyNCwxMiBDMjQsMTguNjE3IDE4LjYxNywyNCAxMiwyNCBDNS4zODMsMjQgMi4xMzE2MjgyMWUtMTQsMTguNjE3IDIuMTMxNjI4MjFlLTE0LDEyIEMyLjEzMTYyODIxZS0xNCw1LjM4MyA1LjM4MywtMS4yNDM0NDk3OWUtMTQgMTIsLTEuMjQzNDQ5NzllLTE0IFogTTEyLDIgQzYuNDg2LDIgMiw2LjQ4NiAyLDEyIEMyLDE3LjUxNCA2LjQ4NiwyMiAxMiwyMiBDMTcuNTE0LDIyIDIyLDE3LjUxNCAyMiwxMiBDMjIsNi40ODYgMTcuNTE0LDIgMTIsMiBaIE0xMi4wMDI4NzUsMTAuMDAwMzY0NiBDMTIuNTU0ODY5MiwxMC4wMDAzNjQ2IDEzLjAwMjg2NDYsMTAuNDQ4MzU5OSAxMy4wMDI4NjQ2LDExLjAwMDM1NDIgTDEzLjAwMjg2NDYsMTcuMDAwMjkxNyBMMTQuMDAyODU0MSwxNy4wMDAyOTE3IEMxNC41NTQ4NDg0LDE3LjAwMDI5MTcgMTUuMDAyODQzNywxNy40NDgyODcgMTUuMDAyODQzNywxOC4wMDAyODEzIEMxNS4wMDI4NDM3LDE4LjU1MjI3NTUgMTQuNTU0ODQ4NCwxOS4wMDAyNzA4IDE0LjAwMjg1NDEsMTkuMDAwMjcwOCBMOS45OTk4OTU4MywxOS4wMDAyNzA4IEM5LjQ0NzkwMTU4LDE5LjAwMDI3MDggOC45OTk5MDYyNSwxOC41NTIyNzU1IDguOTk5OTA2MjUsMTguMDAwMjgxMyBDOC45OTk5MDYyNSwxNy40NDgyODcgOS40NDc5MDE1OCwxNy4wMDAyOTE3IDkuOTk5ODk1ODMsMTcuMDAwMjkxNyBMMTAuOTk5ODg1NCwxNy4wMDAyOTE3IEwxMC45OTk4ODU0LDEyLjAwMDM0MzggTDkuOTk5ODk1ODMsMTIuMDAwMzQzOCBDOS40NDc5MDE1OCwxMi4wMDAzNDM4IDguOTk5OTA2MjUsMTEuNTUyMzQ4NCA4Ljk5OTkwNjI1LDExLjAwMDM1NDIgQzguOTk5OTA2MjUsMTAuNDQ4MzU5OSA5LjQ0NzkwMTU4LDEwLjAwMDM2NDYgOS45OTk4OTU4MywxMC4wMDAzNjQ2IEwxMi4wMDI4NzUsMTAuMDAwMzY0NiBaIE0xMS41MDE4ODAyLDUuMDAwNDE2NjcgQzEyLjMzMTg3MTUsNS4wMDA0MTY2NyAxMy4wMDI4NjQ2LDUuNjcyNDA5NjcgMTMuMDAyODY0Niw2LjUwMDQwMTA0IEMxMy4wMDI4NjQ2LDcuMjc5Njg3MDQgMTIuNDA4NDkwMSw3LjkyMDc4NzYzIDExLjY0NjU5NDUsNy45OTM1MTQ3NCBMMTEuNTAxNzU1Miw4LjAwMDM4NTQyIEwxMS41MDE3NTUyLDguMDAwMzg1NDIgTDExLjQ5OTg4MDIsOC4wMDAzODU0MiBDMTAuNjcwODg4OCw4LjAwMDM4NTQyIDkuOTk5ODk1ODMsNy4zMjgzOTI0MiA5Ljk5OTg5NTgzLDYuNTAwNDAxMDQgQzkuOTk5ODk1ODMsNS42NzI0MDk2NyAxMC42NzA4ODg4LDUuMDAwNDE2NjcgMTEuNDk5ODgwMiw1LjAwMDQxNjY3IEwxMS41MDE4ODAyLDUuMDAwNDE2NjcgWiIgaWQ9InBhdGgiIGZpbGw9IiNFOTcwMjUiPjwvcGF0aD4KICAgIDwvZz4KPC9zdmc+Cg==";\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./icons/icon-note.svg?')},"./icons/icon-note.svg?source":module=>{"use strict";eval('module.exports = "\\n \\n \\n \\n\\n";\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/./icons/icon-note.svg?')},"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.avoindataNote/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/ui.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/ui.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/delegated_./ui.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/widget.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/widget.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataNote/delegated_./widget.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 n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__("./src/avoindataNote/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ 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.avoindataNote=t())}(self,(()=>(()=>{var e={"ckeditor5/src/core.js":(e,t,o)=>{e.exports=o("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":(e,t,o)=>{e.exports=o("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/widget.js":(e,t,o)=>{e.exports=o("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&!e;)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var n={};return(()=>{"use strict";o.d(n,{default:()=>c});var e=o("ckeditor5/src/core.js"),t=o("ckeditor5/src/widget.js");class a extends e.Command{execute(){const{model:e}=this.editor;e.change((t=>{const o=function(e){const t=e.createElement("avoindataNote"),o=e.createElement("avoindataNoteIcon"),n=e.createElement("avoindataNoteTitle"),a=e.createElement("avoindataNoteContent");e.append(o,t),e.append(n,t),e.append(a,t);const i=e.createElement("paragraph");e.insertText("Title",i,0),e.append(i,n);const r=e.createElement("paragraph");return e.insertText("Content",r,0),e.append(r,a),t}(t);e.insertContent(o)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,o=e.schema.findAllowedParent(t.getFirstPosition(),"avoindataNote");this.isEnabled=null!==o}}const i=o.p+"../icons/icon-note.svg";class r extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertAvoindataNoteCommand",new a(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("avoindataNote",{isObject:!0,allowWhere:"$block"}),e.register("avoindataNoteIcon",{isObject:!0,isContent:!0,isInline:!0,isBlock:!1,isSelectable:!1,isLimit:!1,allowIn:"avoindataNote",allowAttributes:["src","alt","class"]}),e.register("avoindataNoteTitle",{isLimit:!0,allowIn:"avoindataNote",allowContentOf:"$root"}),e.register("avoindataNoteContent",{isLimit:!0,allowIn:"avoindataNote",allowContentOf:"$root"}),e.addChildCheck(((e,t)=>{if((e.endsWith("avoindataNoteContent")||e.endsWith("avoindataNoteTitle"))&&"avoindataNote"===t.name)return!1}))}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"avoindataNote",view:{name:"div",classes:"avoindata-note"}}),e.for("upcast").elementToElement({model:"avoindataNoteIcon",view:{name:"img",classes:"avoindata-note-icon"}}),e.for("upcast").elementToElement({model:"avoindataNoteTitle",view:{name:"div",classes:"avoindata-note-title"}}),e.for("upcast").elementToElement({model:"avoindataNoteContent",view:{name:"div",classes:"avoindata-note-content"}}),e.for("dataDowncast").elementToElement({model:"avoindataNote",view:{name:"div",classes:"avoindata-note"}}),e.for("dataDowncast").elementToElement({model:"avoindataNoteIcon",view:(e,{writer:t})=>t.createUIElement("img",{class:"avoindata-note-icon",src:i,alt:"Avoindata Note icon"})}),e.for("dataDowncast").elementToElement({model:"avoindataNoteTitle",view:{name:"div",classes:"avoindata-note-title"}}),e.for("dataDowncast").elementToElement({model:"avoindataNoteContent",view:{name:"div",classes:"avoindata-note-content"}}),e.for("editingDowncast").elementToElement({model:"avoindataNote",view:(e,{writer:o})=>{const n=o.createContainerElement("div",{class:"avoindata-note"});return(0,t.toWidget)(n,o,{label:"Avoindata Note"})}}),e.for("editingDowncast").elementToStructure({model:"avoindataNoteIcon",view:(e,{writer:t})=>t.createUIElement("img",{class:"avoindata-note-icon",src:i,alt:"Avoindata Note icon"})}),e.for("editingDowncast").elementToElement({model:"avoindataNoteTitle",view:(e,{writer:o})=>{const n=o.createEditableElement("div",{class:"avoindata-note-title"});return(0,t.toWidgetEditable)(n,o)}}),e.for("editingDowncast").elementToElement({model:"avoindataNoteContent",view:(e,{writer:o})=>{const n=o.createEditableElement("div",{class:"avoindata-note-content"});return(0,t.toWidgetEditable)(n,o)}}),e.for("upcast").elementToElement({model:"avoindataNoteIcon",view:{name:"img",classes:"avoindata-note-header-image"}})}}var s=o("ckeditor5/src/ui.js");class d extends e.Plugin{init(){const e=this.editor;e.ui.componentFactory.add("avoindataNote",(t=>{const o=e.commands.get("insertAvoindataNoteCommand"),n=new s.ButtonView(t);return n.set({label:e.t("Avoindata Note"),icon:'\n \n \n \n\n',tooltip:!0}),n.bind("isOn","isEnabled").to(o,"value","isEnabled"),this.listenTo(n,"execute",(()=>e.execute("insertAvoindataNoteCommand"))),n}))}}class l extends e.Plugin{static get requires(){return[r,d]}}const c={AvoindataNote:l}})(),n=n.default})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataSection.js b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataSection.js index efd16c8fcd..fbe056a10b 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataSection.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/js/avoindataSection.js @@ -1 +1 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.CKEditor5=n():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.avoindataSection=n())}(self,(()=>(()=>{var __webpack_modules__={"./src/avoindataSection/avoindataSection.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 */ AvoindataSection)\n/* harmony export */ });\n/* harmony import */ var _avoindataSectionEditing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataSectionEditing */ "./src/avoindataSection/avoindataSectionEditing.js");\n/* harmony import */ var _avoindataSectionUI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./avoindataSectionUI */ "./src/avoindataSection/avoindataSectionUI.js");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "ckeditor5/src/core.js");\n/**\n * @file This is what CKEditor refers to as a master (glue) plugin. Its role is\n * just to load the “editing” and “UI” components of this Plugin. Those\n * components could be included in this file, but\n *\n * I.e, this file\'s purpose is to integrate all the separate parts of the plugin\n * before it\'s made discoverable via index.js.\n */\n\n// The contents of AvoindataSectionUI and AvoindataSectionEditing could be included in this\n// file, but it is recommended to separate these concerns in different files.\n\n\n\n\nclass AvoindataSection extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__.Plugin {\n // Note that AvoindataSectionEditing and AvoindataSectionUI also extend `Plugin`, but these\n // are not seen as individual plugins by CKEditor 5. CKEditor 5 will only\n // discover the plugins explicitly exported in index.js.\n static get requires() {\n return [_avoindataSectionEditing__WEBPACK_IMPORTED_MODULE_0__["default"], _avoindataSectionUI__WEBPACK_IMPORTED_MODULE_1__["default"]];\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/avoindataSection.js?')},"./src/avoindataSection/avoindataSectionEditing.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 */ AvoindataSectionEditing)\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_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ \"ckeditor5/src/widget.js\");\n/* harmony import */ var _insertAvoindataSectionCommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertAvoindataSectionCommand */ \"./src/avoindataSection/insertAvoindataSectionCommand.js\");\n\n\n\n\n\n/**\n * CKEditor 5 plugins do not work directly with the DOM. They are defined as\n * plugin-specific data models that are then converted to markup that\n * is inserted in the DOM.\n *\n * CKEditor 5 internally interacts with section as this model:\n * \n * \n * \n * \n *\n * Which is converted for the browser/user as this markup\n *

\n *
Title
\n *
Content
\n *
\n *\n * This file has the logic for defining the avoindataSection model, and for how it is\n * converted to standard DOM markup.\n */\nclass AvoindataSectionEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.Widget];\n }\n\n init() {\n this._defineSchema();\n this._defineConverters();\n this.editor.commands.add(\n 'insertAvoindataSectionCommand',\n new _insertAvoindataSectionCommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.editor),\n );\n }\n\n /*\n * This registers the structure that will be seen by CKEditor 5 as\n * \n * \n * \n * \n *\n * The logic in _defineConverters() will determine how this is converted to\n * markup.\n */\n _defineSchema() {\n // Schemas are registered via the central `editor` object.\n const schema = this.editor.model.schema;\n\n schema.register('avoindataSection', {\n // Behaves like a self-contained object (e.g. an image).\n isObject: true,\n // Allow in places where other blocks are allowed (e.g. directly in the root).\n allowWhere: '$block',\n allowAttributes: ['avoindataSectionId'],\n allowContentOf: '$block',\n });\n\n schema.register('avoindataSectionTitle', {\n // This creates a boundary for external actions such as clicking and\n // and keypress. For section, when the cursor is inside this box, the\n // keyboard shortcut for \"select all\" will be limited to the contents of\n // the box.\n isLimit: true,\n // This is only to be used within avoindataSection.\n allowIn: 'avoindataSection',\n // Allow content that is allowed in blocks (e.g. text with attributes).\n allowContentOf: '$root',\n });\n\n schema.register('avoindataSectionContent', {\n isLimit: true,\n allowIn: 'avoindataSection',\n allowContentOf: '$root',\n });\n\n schema.addChildCheck((context, childDefinition) => {\n // Disallow avoindataSection inside avoindataSectionContent.\n if (\n (context.endsWith('avoindataSectionContent') || context.endsWith('avoindataSectionTitle')) &&\n childDefinition.name === 'avoindataSection'\n ) {\n return false;\n }\n });\n }\n\n /**\n * Converters determine how CKEditor 5 models are converted into markup and\n * vice-versa.\n */\n _defineConverters() {\n // Converters are registered via the central editor object.\n const { conversion } = this.editor;\n\n // Upcast Converters: determine how existing HTML is interpreted by the\n // editor. These trigger when an editor instance loads.\n //\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model.\n conversion.for('upcast').elementToElement({\n model: (viewElement, { writer }) => {\n return writer.createElement('avoindataSection', { avoindataSectionId: viewElement.getAttribute('id') });\n },\n view: {\n name: 'div',\n classes: 'avoindata-section',\n attributes: ['id']\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of ,\n // as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataSectionTitle',\n view: {\n name: 'div',\n classes: 'avoindata-section-title',\n },\n });\n\n // If
is present in the existing markup\n // processed by CKEditor, then CKEditor recognizes and loads it as a\n // model, provided it is a child element of\n // , as required by the schema.\n conversion.for('upcast').elementToElement({\n model: 'avoindataSectionContent',\n view: {\n name: 'div',\n classes: 'avoindata-section-content',\n },\n });\n\n // Data Downcast Converters: converts stored model data into HTML.\n // These trigger when content is saved.\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: {\n name: 'avoindataSection',\n attributes: ['avoindataSectionId']\n },\n view: (modelElement, { writer }) => {\n return writer.createContainerElement(\n 'div', { class: 'avoindata-section', id: modelElement.getAttribute('avoindataSectionId') }\n );\n }\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataSectionTitle',\n view: {\n name: 'div',\n classes: 'avoindata-section-title',\n },\n });\n\n // Instances of are saved as\n //
{{inner content}}
.\n conversion.for('dataDowncast').elementToElement({\n model: 'avoindataSectionContent',\n view: {\n name: 'div',\n classes: 'avoindata-section-content',\n },\n });\n\n // Editing Downcast Converters. These render the content to the user for\n // editing, i.e. this determines what gets seen in the editor. These trigger\n // after the Data Upcast Converters, and are re-triggered any time there\n // are changes to any of the models' properties.\n //\n // Convert the model into a container widget in the editor UI.\n conversion.for('editingDowncast').elementToElement({\n model: {\n name: 'avoindataSection',\n attributes: ['avoindataSectionId']\n },\n view: (modelElement, { writer: viewWriter }) => {\n const section = viewWriter.createContainerElement('div', {\n class: 'avoindata-section',\n id: modelElement.getAttribute('avoindataSectionId')\n });\n\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidget)(section, viewWriter, { label: 'Avoindata Section widget' });\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataSectionTitle',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-section-title',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n // Convert the model into an editable
widget.\n conversion.for('editingDowncast').elementToElement({\n model: 'avoindataSectionContent',\n view: (modelElement, { writer: viewWriter }) => {\n const div = viewWriter.createEditableElement('div', {\n class: 'avoindata-section-content',\n });\n return (0,ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__.toWidgetEditable)(div, viewWriter);\n },\n });\n\n\n\n // Extra converters for the older format ckeditor4 plugins\n conversion.for('upcast').elementToElement({\n model: 'avoindataSectionTitle',\n view: {\n name: 'h3',\n classes: 'avoindata-section__title',\n },\n });\n\n conversion.for('upcast').elementToElement({\n model: 'avoindataSectionContent',\n view: {\n name: 'div',\n classes: 'avoindata-section__content',\n },\n });\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/avoindataSectionEditing.js?")},"./src/avoindataSection/avoindataSectionUI.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 */ AvoindataSectionUI)\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_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var _avoindataSectionView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./avoindataSectionView */ \"./src/avoindataSection/avoindataSectionView.js\");\n/* harmony import */ var _icons_icon_section_svg_source__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../icons/icon-section.svg?source */ \"./icons/icon-section.svg?source\");\n/**\n * @file registers the avoindataSection toolbar button and binds functionality to it.\n */\n\n\n\n\n\n\nclass AvoindataSectionUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n static get requires() {\n return [ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ContextualBalloon];\n }\n\n init() {\n const editor = this.editor;\n // Create the balloon and the form view.\n this._balloon = editor.plugins.get(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ContextualBalloon);\n this.formView = this._createFormView();\n const command = editor.commands.get('insertAvoindataSectionCommand');\n\n // This will register the avoindataSection toolbar button.\n editor.ui.componentFactory.add('avoindataSection', (locale) => {\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n\n // Create the toolbar button.\n buttonView.set({\n label: editor.t('Avoindata Section widget'),\n icon: _icons_icon_section_svg_source__WEBPACK_IMPORTED_MODULE_3__,\n tooltip: true\n });\n\n // Bind the state of the button to the command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n\n // Execute the command when the button is clicked (executed).\n /* this.listenTo(buttonView, 'execute', () =>\n editor.execute('insertAvoindataSectionCommand'),\n ); */\n\n // Show the UI on button click.\n this.listenTo(buttonView, 'execute', () => {\n this._showUI();\n });\n\n return buttonView;\n });\n }\n\n _createFormView() {\n const editor = this.editor;\n const formView = new _avoindataSectionView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](editor.locale);\n\n // Execute the command after clicking the \"Save\" button.\n this.listenTo(formView, 'submit', () => {\n // Grab values from the input fields.\n const id = formView.idInputView.fieldView.element.value;\n\n editor.model.change(writer => {\n editor.execute('insertAvoindataSectionCommand', id);\n });\n\n // Hide the form view after submit.\n this._hideUI();\n });\n\n // Hide the form view after clicking the \"Cancel\" button.\n this.listenTo(formView, 'cancel', () => {\n this._hideUI();\n });\n\n // Hide the form view when clicking outside the balloon.\n (0,ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.clickOutsideHandler)({\n emitter: formView,\n activator: () => this._balloon.visibleView === formView,\n contextElements: [this._balloon.view.element],\n callback: () => this._hideUI()\n });\n\n return formView;\n }\n\n _showUI() {\n const selection = this.editor.model.document.selection;\n\n this._balloon.add({\n view: this.formView,\n position: this._getBalloonPositionData()\n });\n\n const id = selection.getSelectedElement()?.getAttribute('avoindataSectionId') || '';\n this.formView.idInputView.fieldView.value = id;\n\n this.formView.focus();\n }\n\n _hideUI() {\n // Clear the input field values and reset the form.\n this.formView.idInputView.fieldView.value = '';\n this.formView.element.reset();\n\n this._balloon.remove(this.formView);\n\n // Focus the editing view after inserting the abbreviation so the user can start typing the content\n // right away and keep the editor focused.\n this.editor.editing.view.focus();\n }\n\n _getBalloonPositionData() {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n let target = null;\n\n // Set a target position by converting view selection range to DOM\n target = () => view.domConverter.viewRangeToDom(viewDocument.selection.getFirstRange());\n\n return {\n target\n };\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/avoindataSectionUI.js?")},"./src/avoindataSection/avoindataSectionView.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 */ FormView)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ \"ckeditor5/src/ui.js\");\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n\n\n\nclass FormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.View {\n constructor(locale) {\n super(locale);\n\n this.heading = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.LabelView(this.locale);\n this.heading.setTemplate({\n tag: 'div',\n attributes: {\n class: ['title']\n },\n children: ['Avoindata section']\n })\n\n this.idInputView = this._createInput('Id');\n\n this.saveButtonView = this._createButton('Save', null, 'btn btn-primary');\n // Submit type of the button will trigger the submit event on entire form when clicked\n // (see submitHandler() in render() below).\n this.saveButtonView.type = 'submit';\n\n this.cancelButtonView = this._createButton('Cancel', null, 'btn btn-secondary');\n\n // Delegate ButtonView#execute to FormView#cancel\n this.cancelButtonView.delegate('execute').to(this, 'cancel');\n\n this.childViews = this.createCollection([\n this.heading,\n this.idInputView,\n this.saveButtonView,\n this.cancelButtonView\n ]);\n\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: ['ck', 'ck-reset_all-excluded', 'avoindata-section-id-form'],\n tabindex: '-1'\n },\n children: this.childViews\n });\n }\n\n render() {\n super.render();\n\n // Submit the form when the user clicked the save button or pressed enter in the input.\n (0,ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.submitHandler)({\n view: this\n });\n }\n\n focus() {\n this.childViews.get(1).focus();\n }\n\n _createInput(label) {\n const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.LabeledFieldView(this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.createLabeledInputText);\n\n labeledInput.label = label;\n\n return labeledInput;\n }\n\n _createButton(label, icon, className) {\n const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__.ButtonView();\n\n button.set({\n label,\n icon,\n tooltip: true,\n class: className,\n withText: true,\n });\n\n return button;\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/avoindataSectionView.js?")},"./src/avoindataSection/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 _avoindataSection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./avoindataSection */ "./src/avoindataSection/avoindataSection.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n AvoindataSection: _avoindataSection__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/index.js?')},"./src/avoindataSection/insertAvoindataSectionCommand.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 */ InsertAvoindataSectionCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n/**\n * @file defines InsertAvoindataSectionCommand, which is executed when the avoindataSection\n * toolbar button is pressed.\n */\n\n\n\nclass InsertAvoindataSectionCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n execute(id) {\n const { model } = this.editor;\n\n model.change((writer) => {\n const existingElement = writer.model.document.selection?.getSelectedElement();\n\n if (existingElement && existingElement.name == 'avoindataSection') {\n writer.setAttribute('avoindataSectionId', id, existingElement);\n } else {\n // Insert * at the current selection position\n // in a way that will result in creating a valid model structure.\n const avoindataSection = createAvoindataSection(writer, id);\n model.insertContent(avoindataSection);\n const selection = writer.createSelection(avoindataSection.getChild(0), 'in');\n writer.setSelection(selection)\n }\n });\n }\n\n refresh() {\n const { model } = this.editor;\n const { selection } = model.document;\n\n // Determine if the cursor (selection) is in a position where adding a\n // avoindataSection is permitted. This is based on the schema of the model(s)\n // currently containing the cursor.\n const allowedIn = model.schema.findAllowedParent(\n selection.getFirstPosition(),\n 'avoindataSection',\n );\n\n // If the cursor is not in a location where a avoindataSection can be added, return\n // null so the addition doesn't happen.\n this.isEnabled = allowedIn !== null;\n }\n}\n\nfunction createAvoindataSection(writer, id) {\n // Create instances of the elements registered with the editor in avoindataexpanderediting.js.\n const avoindataSection = writer.createElement('avoindataSection', { avoindataSectionId: id });\n const avoindataSectionTitle = writer.createElement('avoindataSectionTitle');\n const avoindataSectionContent = writer.createElement('avoindataSectionContent');\n\n // Append the title and content elements to the avoindataSection, which matches\n // the parent/child relationship as defined in their schemas.\n writer.append(avoindataSectionTitle, avoindataSection);\n writer.append(avoindataSectionContent, avoindataSection);\n\n // The text content will automatically be wrapped in a\n // `

`.\n const title = writer.createElement('paragraph');\n writer.insertText('Title', title, 0);\n writer.append(title, avoindataSectionTitle);\n const content = writer.createElement('paragraph');\n writer.insertText('Content', content, 0);\n writer.append(content, avoindataSectionContent);\n\n // Return the element to be added to the editor.\n return avoindataSection;\n}\n\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./src/avoindataSection/insertAvoindataSectionCommand.js?")},"./icons/icon-section.svg?source":module=>{"use strict";eval('module.exports = "\\n \\n \\n \\n \\n\\n";\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/./icons/icon-section.svg?')},"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.avoindataSection/delegated_./core.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/ui.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/ui.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/delegated_./ui.js_from_dll-reference_CKEditor5.dll?')},"ckeditor5/src/widget.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ "dll-reference CKEditor5.dll"))("./src/widget.js");\n\n//# sourceURL=webpack://CKEditor5.avoindataSection/delegated_./widget.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 n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__("./src/avoindataSection/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ 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.avoindataSection=t())}(self,(()=>(()=>{var e={"ckeditor5/src/core.js":(e,t,i)=>{e.exports=i("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/ui.js":(e,t,i)=>{e.exports=i("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/widget.js":(e,t,i)=>{e.exports=i("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";i.d(n,{default:()=>r});var e=i("ckeditor5/src/core.js"),t=i("ckeditor5/src/widget.js");class o extends e.Command{execute(e){const{model:t}=this.editor;t.change((i=>{const n=i.model.document.selection?.getSelectedElement();if(n&&"avoindataSection"==n.name)i.setAttribute("avoindataSectionId",e,n);else{const n=function(e,t){const i=e.createElement("avoindataSection",{avoindataSectionId:t}),n=e.createElement("avoindataSectionTitle"),o=e.createElement("avoindataSectionContent");e.append(n,i),e.append(o,i);const a=e.createElement("paragraph");e.insertText("Title",a,0),e.append(a,n);const s=e.createElement("paragraph");return e.insertText("Content",s,0),e.append(s,o),i}(i,e);t.insertContent(n);const o=i.createSelection(n.getChild(0),"in");i.setSelection(o)}}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,i=e.schema.findAllowedParent(t.getFirstPosition(),"avoindataSection");this.isEnabled=null!==i}}class a extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertAvoindataSectionCommand",new o(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("avoindataSection",{isObject:!0,allowWhere:"$block",allowAttributes:["avoindataSectionId"],allowContentOf:"$block"}),e.register("avoindataSectionTitle",{isLimit:!0,allowIn:"avoindataSection",allowContentOf:"$root"}),e.register("avoindataSectionContent",{isLimit:!0,allowIn:"avoindataSection",allowContentOf:"$root"}),e.addChildCheck(((e,t)=>{if((e.endsWith("avoindataSectionContent")||e.endsWith("avoindataSectionTitle"))&&"avoindataSection"===t.name)return!1}))}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:(e,{writer:t})=>t.createElement("avoindataSection",{avoindataSectionId:e.getAttribute("id")}),view:{name:"div",classes:"avoindata-section",attributes:["id"]}}),e.for("upcast").elementToElement({model:"avoindataSectionTitle",view:{name:"div",classes:"avoindata-section-title"}}),e.for("upcast").elementToElement({model:"avoindataSectionContent",view:{name:"div",classes:"avoindata-section-content"}}),e.for("dataDowncast").elementToElement({model:{name:"avoindataSection",attributes:["avoindataSectionId"]},view:(e,{writer:t})=>t.createContainerElement("div",{class:"avoindata-section",id:e.getAttribute("avoindataSectionId")})}),e.for("dataDowncast").elementToElement({model:"avoindataSectionTitle",view:{name:"div",classes:"avoindata-section-title"}}),e.for("dataDowncast").elementToElement({model:"avoindataSectionContent",view:{name:"div",classes:"avoindata-section-content"}}),e.for("editingDowncast").elementToElement({model:{name:"avoindataSection",attributes:["avoindataSectionId"]},view:(e,{writer:i})=>{const n=i.createContainerElement("div",{class:"avoindata-section",id:e.getAttribute("avoindataSectionId")});return(0,t.toWidget)(n,i,{label:"Avoindata Section widget"})}}),e.for("editingDowncast").elementToElement({model:"avoindataSectionTitle",view:(e,{writer:i})=>{const n=i.createEditableElement("div",{class:"avoindata-section-title"});return(0,t.toWidgetEditable)(n,i)}}),e.for("editingDowncast").elementToElement({model:"avoindataSectionContent",view:(e,{writer:i})=>{const n=i.createEditableElement("div",{class:"avoindata-section-content"});return(0,t.toWidgetEditable)(n,i)}}),e.for("upcast").elementToElement({model:"avoindataSectionTitle",view:{name:"h3",classes:"avoindata-section__title"}}),e.for("upcast").elementToElement({model:"avoindataSectionContent",view:{name:"div",classes:"avoindata-section__content"}})}}var s=i("ckeditor5/src/ui.js");class d extends s.View{constructor(e){super(e),this.heading=new s.LabelView(this.locale),this.heading.setTemplate({tag:"div",attributes:{class:["title"]},children:["Avoindata section"]}),this.idInputView=this._createInput("Id"),this.saveButtonView=this._createButton("Save",null,"btn btn-primary"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton("Cancel",null,"btn btn-secondary"),this.cancelButtonView.delegate("execute").to(this,"cancel"),this.childViews=this.createCollection([this.heading,this.idInputView,this.saveButtonView,this.cancelButtonView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-reset_all-excluded","avoindata-section-id-form"],tabindex:"-1"},children:this.childViews})}render(){super.render(),(0,s.submitHandler)({view:this})}focus(){this.childViews.get(1).focus()}_createInput(e){const t=new s.LabeledFieldView(this.locale,s.createLabeledInputText);return t.label=e,t}_createButton(e,t,i){const n=new s.ButtonView;return n.set({label:e,icon:t,tooltip:!0,class:i,withText:!0}),n}}class l extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor;this._balloon=e.plugins.get(s.ContextualBalloon),this.formView=this._createFormView();const t=e.commands.get("insertAvoindataSectionCommand");e.ui.componentFactory.add("avoindataSection",(i=>{const n=new s.ButtonView(i);return n.set({label:e.t("Avoindata Section"),icon:'\n \n \n \n \n\n',tooltip:!0}),n.bind("isOn","isEnabled").to(t,"value","isEnabled"),this.listenTo(n,"execute",(()=>{this._showUI()})),n}))}_createFormView(){const e=this.editor,t=new d(e.locale);return this.listenTo(t,"submit",(()=>{const i=t.idInputView.fieldView.element.value;e.model.change((t=>{e.execute("insertAvoindataSectionCommand",i)})),this._hideUI()})),this.listenTo(t,"cancel",(()=>{this._hideUI()})),(0,s.clickOutsideHandler)({emitter:t,activator:()=>this._balloon.visibleView===t,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()}),t}_showUI(){const e=this.editor.model.document.selection;this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});const t=e.getSelectedElement()?.getAttribute("avoindataSectionId")||"";this.formView.idInputView.fieldView.value=t,this.formView.focus()}_hideUI(){this.formView.idInputView.fieldView.value="",this.formView.element.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus()}_getBalloonPositionData(){const e=this.editor.editing.view,t=e.document;let i=null;return i=()=>e.domConverter.viewRangeToDom(t.selection.getFirstRange()),{target:i}}}class c extends e.Plugin{static get requires(){return[a,l]}}const r={AvoindataSection:c}})(),n=n.default})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/js/externalLink.js b/drupal/modules/avoindata-ckeditor5-plugins/js/externalLink.js deleted file mode 100644 index 8ae19068f8..0000000000 --- a/drupal/modules/avoindata-ckeditor5-plugins/js/externalLink.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.CKEditor5=n():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.externalLink=n())}(self,(()=>(()=>{var __webpack_modules__={"./src/externalLink/externalLink.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 */ ExternalLink)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"ckeditor5/src/core.js\");\n\n\nclass ExternalLink extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n init() {\n const { conversion } = this.editor;\n\n // Upcast Converter for the old ckeditor4 plugin format\n conversion.for('upcast').elementToAttribute({\n model: 'linkIsExternal',\n view: {\n name: 'a',\n classes: ['external'],\n attributes: ['aria-label', 'target'],\n },\n });\n\n // Extra consumption for the leftover svg icon\n conversion.for('upcast').add(dispatcher => {\n // Look for every view svg element.\n dispatcher.on('element:svg', (evt, data, conversionApi) => {\n // Get all the necessary items from the conversion API object.\n const {\n consumable\n } = conversionApi;\n\n // Get view item from data object.\n const { viewItem } = data;\n\n // Define elements consumables.\n const svg = { name: 'svg', attributes: ['viewBox'] };\n const use = { name: 'use', attributes: ['href'] };\n\n // Tests if the view element can be consumed.\n if (!consumable.test(viewItem, svg)) {\n return;\n }\n\n // Check if there is only one child.\n if (viewItem.childCount !== 1) {\n return;\n }\n\n // Get the first child element.\n const firstChildItem = viewItem.getChild(0);\n\n // Check if the first element is a div.\n if (!firstChildItem.is('element', 'use')) {\n return;\n }\n\n // Tests if the first child element can be consumed.\n if (!consumable.test(firstChildItem, use)) {\n return;\n }\n\n // If a use tag inside a svg has the string 'avoindata_external-link' within the href\n // we can assume it's the old ckeditor4 plugin format and simply get rid of them\n if (firstChildItem?.getAttribute('href')?.includes('avoindata_external-link')) {\n // Consume the main outer wrapper element.\n consumable.consume(viewItem, svg);\n // Consume the inner wrapper element.\n consumable.consume(firstChildItem, use);\n }\n });\n });\n /*\n const editor = this.editor;\n\n // `listenTo()` and `editor` are available thanks to `Plugin`.\n // By using `listenTo()` you will ensure that the listener is removed when\n // the plugin is destroyed.\n this.listenTo(editor.data, 'ready', () => {\n const linkCommand = editor.commands.get('link');\n const { selection } = editor.model.document;\n\n let linkCommandExecuting = false;\n\n linkCommand.on('execute', (evt, args) => {\n const linkIsExternal = args[1]['linkIsExternal']\n\n if (linkIsExternal) {\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\n // Wrapping the original command execution in a model.change() block to make sure there's a single undo step\n // when the extra attribute is added.\n\n editor.model.change(writer => {\n editor.execute('link', ...args);\n const link = selection.getLastPosition().nodeBefore;\n // writer.insertElement('avoindataExternalLink', selection.getLastPosition())\n });\n }\n })\n });\n */\n }\n\n static get pluginName() {\n return 'ExternalLink';\n }\n}\n\n\n//# sourceURL=webpack://CKEditor5.externalLink/./src/externalLink/externalLink.js?")},"./src/externalLink/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 _externalLink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./externalLink */ "./src/externalLink/externalLink.js");\n/**\n * @file The build process always expects an index.js file. Anything exported\n * here will be recognized by CKEditor 5 as an available plugin. Multiple\n * plugins can be exported in this one file.\n *\n * I.e. this file\'s purpose is to make plugin(s) discoverable.\n */\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n ExternalLink: _externalLink__WEBPACK_IMPORTED_MODULE_0__["default"],\n});\n\n\n//# sourceURL=webpack://CKEditor5.externalLink/./src/externalLink/index.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.externalLink/delegated_./core.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 n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__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__("./src/externalLink/index.js");return __webpack_exports__=__webpack_exports__.default,__webpack_exports__})())); \ No newline at end of file diff --git a/drupal/modules/avoindata-ckeditor5-plugins/package-lock.json b/drupal/modules/avoindata-ckeditor5-plugins/package-lock.json index e7f18df65b..5693d663b9 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/package-lock.json +++ b/drupal/modules/avoindata-ckeditor5-plugins/package-lock.json @@ -10,7 +10,6 @@ "license": "GPL-2.0-or-later", "devDependencies": { "@ckeditor/ckeditor5-dev-utils": "^30.0.0", - "@ckeditor/ckeditor5-link": "^39.0.1", "ckeditor5": "~34.1.0", "file-loader": "^6.2.0", "raw-loader": "^4.0.2", @@ -385,21 +384,6 @@ "npm": ">=5.7.1" } }, - "node_modules/@ckeditor/ckeditor5-core": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-core/-/ckeditor5-core-39.0.1.tgz", - "integrity": "sha512-3hva3sRdDS2TLDhQNKgnJmpdXhuaod5tooDI/vnaiK+kduqy3nPuWI0qHtFpMhe7dlQWPZSI9ZhS/7cfFQ4CUg==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, "node_modules/@ckeditor/ckeditor5-dev-utils": { "version": "30.5.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-dev-utils/-/ckeditor5-dev-utils-30.5.0.tgz", @@ -551,20 +535,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@ckeditor/ckeditor5-engine": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-engine/-/ckeditor5-engine-39.0.1.tgz", - "integrity": "sha512-QWyx1vO7+UO3rVIx9o1M7q05ghu1T+E4ugnzlcjLx+TiRLBH280M5RmxZ5gE8HjTSIabGDK1M0kmskL+wl2nDw==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, "node_modules/@ckeditor/ckeditor5-enter": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-enter/-/ckeditor5-enter-34.2.0.tgz", @@ -638,174 +608,6 @@ "npm": ">=5.7.1" } }, - "node_modules/@ckeditor/ckeditor5-link": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-link/-/ckeditor5-link-39.0.1.tgz", - "integrity": "sha512-P9ZO7JihRhVUKyvE0rcBjEwlN4ZKFpBCeWimL5yM05L047FNb5yXQecmQfMDDpgYQl3Ggsm07QuWo/uG/0j/mQ==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-ui": "39.0.1", - "ckeditor5": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-clipboard": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-clipboard/-/ckeditor5-clipboard-39.0.1.tgz", - "integrity": "sha512-OIlIvsiz6YTZM8o1Y1zG9eW9rUx06Bs3rMbMv37kNN1vq145D9h0OQt0iPKw1eXAG387Sk+SWZhO+Um+/O3eGw==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "@ckeditor/ckeditor5-widget": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-enter": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-enter/-/ckeditor5-enter-39.0.1.tgz", - "integrity": "sha512-4gF0CFbEgZowQGmcyKP9KKBKOk67bdQIP5y71QvDgP6rUdbOQ5NDAS3FKis6a2Aubhtg92BO4QC6tZADPiW3hA==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-paragraph": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-paragraph/-/ckeditor5-paragraph-39.0.1.tgz", - "integrity": "sha512-zKYtpka2X8uR6bTiCXecwl86XKQ8ngk7Hm3UkmptDSfBDOp9PpFCeA3i8m1soFvT2OcdxQYbuAcd9TwoV/HY0g==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-select-all": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-select-all/-/ckeditor5-select-all-39.0.1.tgz", - "integrity": "sha512-Q4BwezfYmZEwODecoxXc2+2UNUkx/Gu5n7jZH/2kKNBVFwb3iVIun9tj5Q1+093FKjmLA46maYsG5HIG6eArTg==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-typing": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-typing/-/ckeditor5-typing-39.0.1.tgz", - "integrity": "sha512-bfMGH3IKj8LdhzfMpfOFUlnCPkpGQhl1HN2oF2g7EViOfuDKM4A2GboUIEqRP2C3tkwtHK5zM55Rdbd71DAQPQ==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-undo": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-undo/-/ckeditor5-undo-39.0.1.tgz", - "integrity": "sha512-fgI5zNylzuiT2EitHm9ZVaAXB27JxOmONe51tSe9aUQoUkFLHau0HJfTNpKgHQTEPXMxhUPzH09xvj7QEc94Pg==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-upload": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-upload/-/ckeditor5-upload-39.0.1.tgz", - "integrity": "sha512-VVVWErIHRnw5kw00t8OYLxHDgSE1ywtoy/Zih0GJVxe882jIfajPj7KdZUjylfZuPeQnp1kAIpoe+WX3scvxFQ==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/@ckeditor/ckeditor5-widget": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-widget/-/ckeditor5-widget-39.0.1.tgz", - "integrity": "sha512-rd4ojJcdZQJttrrDogycDa+sb/rtKu9sU7G0+QEoJZXD25WjxIEgjyOoIqfv2UZZrZDX/0u8dviGhPbcbQEEnw==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-enter": "39.0.1", - "@ckeditor/ckeditor5-typing": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-link/node_modules/ckeditor5": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/ckeditor5/-/ckeditor5-39.0.1.tgz", - "integrity": "sha512-KU6P0U9HQdsj7YBNZyG72ii+LNjIuWqxwdhlcd+QN11urQSDzoC6OjnqtDZ2Q3dQvwYf2aN9kDwUA9ElQ1krIg==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-clipboard": "39.0.1", - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-enter": "39.0.1", - "@ckeditor/ckeditor5-paragraph": "39.0.1", - "@ckeditor/ckeditor5-select-all": "39.0.1", - "@ckeditor/ckeditor5-typing": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-undo": "39.0.1", - "@ckeditor/ckeditor5-upload": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "@ckeditor/ckeditor5-watchdog": "39.0.1", - "@ckeditor/ckeditor5-widget": "39.0.1" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, "node_modules/@ckeditor/ckeditor5-paragraph": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-paragraph/-/ckeditor5-paragraph-34.2.0.tgz", @@ -1026,24 +828,6 @@ "npm": ">=5.7.1" } }, - "node_modules/@ckeditor/ckeditor5-ui": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-ui/-/ckeditor5-ui-39.0.1.tgz", - "integrity": "sha512-6mBZNfMVSjyNb3HHyjJFwrR2rvmTuH1JSc+ebuulw5knYQmDaeCaS4tiYmOVcGGz/WcrAYRQAtSGrfZmuLesMQ==", - "dev": true, - "dependencies": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "color-convert": "2.0.1", - "color-parse": "1.4.2", - "lodash-es": "4.17.21", - "vanilla-colorful": "0.7.2" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, "node_modules/@ckeditor/ckeditor5-undo": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-undo/-/ckeditor5-undo-34.2.0.tgz", @@ -1190,32 +974,6 @@ "npm": ">=5.7.1" } }, - "node_modules/@ckeditor/ckeditor5-utils": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-utils/-/ckeditor5-utils-39.0.1.tgz", - "integrity": "sha512-lQ+1h4FgUScEdk547uCzfdvajFigVt4u0mRw1m9TtJ3B2GiatwRvst8TZEuWl8aFrIHjQ/gho66QIElJi/6+CA==", - "dev": true, - "dependencies": { - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, - "node_modules/@ckeditor/ckeditor5-watchdog": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-watchdog/-/ckeditor5-watchdog-39.0.1.tgz", - "integrity": "sha512-f5Uo0RdcbeKGs0gmBm8Y8c+Z9YgcjqX7ai4vdcw8HIEc0vCeEanPt816V53nLZ3LbPgez8LeWluR7VlzoxKO+g==", - "dev": true, - "dependencies": { - "lodash-es": "4.17.21" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=5.7.1" - } - }, "node_modules/@ckeditor/ckeditor5-widget": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-widget/-/ckeditor5-widget-34.2.0.tgz", @@ -2140,15 +1898,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/color-parse": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.2.tgz", - "integrity": "sha512-RI7s49/8yqDj3fECFZjUI1Yi0z/Gq1py43oNJivAIIDSyJiOZLfYCRQEgn8HEVAj++PcRe8AnL2XF0fRJ3BTnA==", - "dev": true, - "dependencies": { - "color-name": "^1.0.0" - } - }, "node_modules/colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", @@ -5057,12 +4806,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/vanilla-colorful": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/vanilla-colorful/-/vanilla-colorful-0.7.2.tgz", - "integrity": "sha512-z2YZusTFC6KnLERx1cgoIRX2CjPRP0W75N+3CC6gbvdX5Ch47rZkEMGO2Xnf+IEmi3RiFLxS18gayMA27iU7Kg==", - "dev": true - }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -5577,17 +5320,6 @@ } } }, - "@ckeditor/ckeditor5-core": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-core/-/ckeditor5-core-39.0.1.tgz", - "integrity": "sha512-3hva3sRdDS2TLDhQNKgnJmpdXhuaod5tooDI/vnaiK+kduqy3nPuWI0qHtFpMhe7dlQWPZSI9ZhS/7cfFQ4CUg==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - } - }, "@ckeditor/ckeditor5-dev-utils": { "version": "30.5.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-dev-utils/-/ckeditor5-dev-utils-30.5.0.tgz", @@ -5703,16 +5435,6 @@ } } }, - "@ckeditor/ckeditor5-engine": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-engine/-/ckeditor5-engine-39.0.1.tgz", - "integrity": "sha512-QWyx1vO7+UO3rVIx9o1M7q05ghu1T+E4ugnzlcjLx+TiRLBH280M5RmxZ5gE8HjTSIabGDK1M0kmskL+wl2nDw==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - } - }, "@ckeditor/ckeditor5-enter": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-enter/-/ckeditor5-enter-34.2.0.tgz", @@ -5768,136 +5490,6 @@ } } }, - "@ckeditor/ckeditor5-link": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-link/-/ckeditor5-link-39.0.1.tgz", - "integrity": "sha512-P9ZO7JihRhVUKyvE0rcBjEwlN4ZKFpBCeWimL5yM05L047FNb5yXQecmQfMDDpgYQl3Ggsm07QuWo/uG/0j/mQ==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-ui": "39.0.1", - "ckeditor5": "39.0.1", - "lodash-es": "4.17.21" - }, - "dependencies": { - "@ckeditor/ckeditor5-clipboard": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-clipboard/-/ckeditor5-clipboard-39.0.1.tgz", - "integrity": "sha512-OIlIvsiz6YTZM8o1Y1zG9eW9rUx06Bs3rMbMv37kNN1vq145D9h0OQt0iPKw1eXAG387Sk+SWZhO+Um+/O3eGw==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "@ckeditor/ckeditor5-widget": "39.0.1", - "lodash-es": "4.17.21" - } - }, - "@ckeditor/ckeditor5-enter": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-enter/-/ckeditor5-enter-39.0.1.tgz", - "integrity": "sha512-4gF0CFbEgZowQGmcyKP9KKBKOk67bdQIP5y71QvDgP6rUdbOQ5NDAS3FKis6a2Aubhtg92BO4QC6tZADPiW3hA==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - } - }, - "@ckeditor/ckeditor5-paragraph": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-paragraph/-/ckeditor5-paragraph-39.0.1.tgz", - "integrity": "sha512-zKYtpka2X8uR6bTiCXecwl86XKQ8ngk7Hm3UkmptDSfBDOp9PpFCeA3i8m1soFvT2OcdxQYbuAcd9TwoV/HY0g==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - } - }, - "@ckeditor/ckeditor5-select-all": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-select-all/-/ckeditor5-select-all-39.0.1.tgz", - "integrity": "sha512-Q4BwezfYmZEwODecoxXc2+2UNUkx/Gu5n7jZH/2kKNBVFwb3iVIun9tj5Q1+093FKjmLA46maYsG5HIG6eArTg==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - } - }, - "@ckeditor/ckeditor5-typing": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-typing/-/ckeditor5-typing-39.0.1.tgz", - "integrity": "sha512-bfMGH3IKj8LdhzfMpfOFUlnCPkpGQhl1HN2oF2g7EViOfuDKM4A2GboUIEqRP2C3tkwtHK5zM55Rdbd71DAQPQ==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - } - }, - "@ckeditor/ckeditor5-undo": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-undo/-/ckeditor5-undo-39.0.1.tgz", - "integrity": "sha512-fgI5zNylzuiT2EitHm9ZVaAXB27JxOmONe51tSe9aUQoUkFLHau0HJfTNpKgHQTEPXMxhUPzH09xvj7QEc94Pg==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1" - } - }, - "@ckeditor/ckeditor5-upload": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-upload/-/ckeditor5-upload-39.0.1.tgz", - "integrity": "sha512-VVVWErIHRnw5kw00t8OYLxHDgSE1ywtoy/Zih0GJVxe882jIfajPj7KdZUjylfZuPeQnp1kAIpoe+WX3scvxFQ==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1" - } - }, - "@ckeditor/ckeditor5-widget": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-widget/-/ckeditor5-widget-39.0.1.tgz", - "integrity": "sha512-rd4ojJcdZQJttrrDogycDa+sb/rtKu9sU7G0+QEoJZXD25WjxIEgjyOoIqfv2UZZrZDX/0u8dviGhPbcbQEEnw==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-enter": "39.0.1", - "@ckeditor/ckeditor5-typing": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "lodash-es": "4.17.21" - } - }, - "ckeditor5": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/ckeditor5/-/ckeditor5-39.0.1.tgz", - "integrity": "sha512-KU6P0U9HQdsj7YBNZyG72ii+LNjIuWqxwdhlcd+QN11urQSDzoC6OjnqtDZ2Q3dQvwYf2aN9kDwUA9ElQ1krIg==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-clipboard": "39.0.1", - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-engine": "39.0.1", - "@ckeditor/ckeditor5-enter": "39.0.1", - "@ckeditor/ckeditor5-paragraph": "39.0.1", - "@ckeditor/ckeditor5-select-all": "39.0.1", - "@ckeditor/ckeditor5-typing": "39.0.1", - "@ckeditor/ckeditor5-ui": "39.0.1", - "@ckeditor/ckeditor5-undo": "39.0.1", - "@ckeditor/ckeditor5-upload": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "@ckeditor/ckeditor5-watchdog": "39.0.1", - "@ckeditor/ckeditor5-widget": "39.0.1" - } - } - } - }, "@ckeditor/ckeditor5-paragraph": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-paragraph/-/ckeditor5-paragraph-34.2.0.tgz", @@ -6064,20 +5656,6 @@ } } }, - "@ckeditor/ckeditor5-ui": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-ui/-/ckeditor5-ui-39.0.1.tgz", - "integrity": "sha512-6mBZNfMVSjyNb3HHyjJFwrR2rvmTuH1JSc+ebuulw5knYQmDaeCaS4tiYmOVcGGz/WcrAYRQAtSGrfZmuLesMQ==", - "dev": true, - "requires": { - "@ckeditor/ckeditor5-core": "39.0.1", - "@ckeditor/ckeditor5-utils": "39.0.1", - "color-convert": "2.0.1", - "color-parse": "1.4.2", - "lodash-es": "4.17.21", - "vanilla-colorful": "0.7.2" - } - }, "@ckeditor/ckeditor5-undo": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-undo/-/ckeditor5-undo-34.2.0.tgz", @@ -6188,24 +5766,6 @@ } } }, - "@ckeditor/ckeditor5-utils": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-utils/-/ckeditor5-utils-39.0.1.tgz", - "integrity": "sha512-lQ+1h4FgUScEdk547uCzfdvajFigVt4u0mRw1m9TtJ3B2GiatwRvst8TZEuWl8aFrIHjQ/gho66QIElJi/6+CA==", - "dev": true, - "requires": { - "lodash-es": "4.17.21" - } - }, - "@ckeditor/ckeditor5-watchdog": { - "version": "39.0.1", - "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-watchdog/-/ckeditor5-watchdog-39.0.1.tgz", - "integrity": "sha512-f5Uo0RdcbeKGs0gmBm8Y8c+Z9YgcjqX7ai4vdcw8HIEc0vCeEanPt816V53nLZ3LbPgez8LeWluR7VlzoxKO+g==", - "dev": true, - "requires": { - "lodash-es": "4.17.21" - } - }, "@ckeditor/ckeditor5-widget": { "version": "34.2.0", "resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-widget/-/ckeditor5-widget-34.2.0.tgz", @@ -6938,15 +6498,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "color-parse": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.2.tgz", - "integrity": "sha512-RI7s49/8yqDj3fECFZjUI1Yi0z/Gq1py43oNJivAIIDSyJiOZLfYCRQEgn8HEVAj++PcRe8AnL2XF0fRJ3BTnA==", - "dev": true, - "requires": { - "color-name": "^1.0.0" - } - }, "colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", @@ -8955,12 +8506,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "vanilla-colorful": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/vanilla-colorful/-/vanilla-colorful-0.7.2.tgz", - "integrity": "sha512-z2YZusTFC6KnLERx1cgoIRX2CjPRP0W75N+3CC6gbvdX5Ch47rZkEMGO2Xnf+IEmi3RiFLxS18gayMA27iU7Kg==", - "dev": true - }, "watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleEditing.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleEditing.js index 394b0cac1c..1c1778821b 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleEditing.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleEditing.js @@ -181,7 +181,7 @@ export default class AvoindataExampleEditing extends Plugin { class: 'avoindata-example', }); - return toWidget(section, viewWriter, { label: 'Avoindata Example widget' }); + return toWidget(section, viewWriter, { label: 'Avoindata Example' }); }, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleUI.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleUI.js index 1f119ef030..16db40f14b 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleUI.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/avoindataExampleUI.js @@ -17,7 +17,7 @@ export default class AvoindataExampleUI extends Plugin { // Create the toolbar button. buttonView.set({ - label: editor.t('Avoindata Example widget'), + label: editor.t('Avoindata Example'), icon, tooltip: true, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/insertAvoindataExampleCommand.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/insertAvoindataExampleCommand.js index 14ead525cb..7f65c6462c 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/insertAvoindataExampleCommand.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExample/insertAvoindataExampleCommand.js @@ -12,7 +12,8 @@ export default class InsertAvoindataExampleCommand extends Command { model.change((writer) => { // Insert * at the current selection position // in a way that will result in creating a valid model structure. - model.insertContent(createAvoindataExample(writer)); + const avoindataExample = createAvoindataExample(writer); + model.insertContent(avoindataExample); }); } @@ -48,8 +49,12 @@ function createAvoindataExample(writer) { // The text content will automatically be wrapped in a // `

`. - writer.appendElement('paragraph', avoindataExampleTitle); - writer.appendElement('paragraph', avoindataExampleContent); + const title = writer.createElement('paragraph'); + writer.insertText('Title', title, 0); + writer.append(title, avoindataExampleTitle); + const content = writer.createElement('paragraph'); + writer.insertText('Content', content, 0); + writer.append(content, avoindataExampleContent); // Return the element to be added to the editor. return avoindataExample; diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderEditing.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderEditing.js index d47aeb3e74..d28ee28b93 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderEditing.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderEditing.js @@ -188,7 +188,7 @@ export default class AvoindataExpanderEditing extends Plugin { class: 'avoindata-expander', }); - return toWidget(section, viewWriter, { label: 'Avoindata Expander widget' }); + return toWidget(section, viewWriter, { label: 'Avoindata Expander' }); }, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderUI.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderUI.js index fdd778d37a..76821a6c2f 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderUI.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/avoindataExpanderUI.js @@ -17,7 +17,7 @@ export default class AvoindataExpanderUI extends Plugin { // Create the toolbar button. buttonView.set({ - label: editor.t('Avoindata Expander widget'), + label: editor.t('Avoindata Expander'), icon, tooltip: true, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/insertAvoindataExpanderCommand.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/insertAvoindataExpanderCommand.js index 44e7656db6..9fff3f65b4 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/insertAvoindataExpanderCommand.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataExpander/insertAvoindataExpanderCommand.js @@ -12,7 +12,8 @@ export default class InsertAvoindataExpanderCommand extends Command { model.change((writer) => { // Insert * at the current selection position // in a way that will result in creating a valid model structure. - model.insertContent(createAvoindataExpander(writer)); + const avoindataExpander = createAvoindataExpander(writer); + model.insertContent(avoindataExpander); }); } @@ -48,8 +49,12 @@ function createAvoindataExpander(writer) { // The text content will automatically be wrapped in a // `

`. - writer.appendElement('paragraph', avoindataExpanderTitle); - writer.appendElement('paragraph', avoindataExpanderContent); + const title = writer.createElement('paragraph'); + writer.insertText('Title', title, 0); + writer.append(title, avoindataExpanderTitle); + const content = writer.createElement('paragraph'); + writer.insertText('Content', content, 0); + writer.append(content, avoindataExpanderContent); // Return the element to be added to the editor. return avoindataExpander; diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintEditing.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintEditing.js index c40e0d5e90..9197d6f08d 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintEditing.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintEditing.js @@ -2,6 +2,7 @@ import { Plugin } from 'ckeditor5/src/core'; import { toWidget, toWidgetEditable } from 'ckeditor5/src/widget'; import { Widget } from 'ckeditor5/src/widget'; import InsertAvoindataHintCommand from './insertAvoindataHintCommand'; +import icon from '../../icons/icon-hint.svg' /** * CKEditor 5 plugins do not work directly with the DOM. They are defined as @@ -155,7 +156,7 @@ export default class AvoindataHintEditing extends Plugin { conversion.for('downcast').elementToElement({ model: 'avoindataHintIcon', view: (modelElement, { writer }) => { - return writer.createEmptyElement('img', { class: "avoindata-hint-icon", src: '/themes/avoindata/images/avoindata-hint-icon.svg' }) + return writer.createEmptyElement('img', { class: "avoindata-hint-icon", src: icon }) } }); @@ -182,7 +183,7 @@ export default class AvoindataHintEditing extends Plugin { class: 'avoindata-hint', }); - return toWidget(section, viewWriter, { label: 'Avoindata Hint widget' }); + return toWidget(section, viewWriter, { label: 'Avoindata Hint' }); }, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintUI.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintUI.js index 76d44236fb..35d8f477b3 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintUI.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/avoindataHintUI.js @@ -17,7 +17,7 @@ export default class AvoindataHintUI extends Plugin { // Create the toolbar button. buttonView.set({ - label: editor.t('Avoindata Hint widget'), + label: editor.t('Avoindata Hint'), icon, tooltip: true, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/insertAvoindataHintCommand.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/insertAvoindataHintCommand.js index 7af54eae12..aa3094f046 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/insertAvoindataHintCommand.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataHint/insertAvoindataHintCommand.js @@ -12,7 +12,8 @@ export default class InsertAvoindataHintCommand extends Command { model.change((writer) => { // Insert * at the current selection position // in a way that will result in creating a valid model structure. - model.insertContent(createAvoindataHint(writer)); + const avoindataHint = createAvoindataHint(writer); + model.insertContent(avoindataHint); }); } @@ -48,7 +49,9 @@ function createAvoindataHint(writer) { // The text content will automatically be wrapped in a // `

`. - writer.appendElement('paragraph', avoindataHintContent); + const content = writer.createElement('paragraph'); + writer.insertText('Content', content, 0); + writer.append(content, avoindataHintContent); // Return the element to be added to the editor. return avoindataHint; diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/avoindataNoteEditing.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/avoindataNoteEditing.js index 0fca5d1797..3727233b2a 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/avoindataNoteEditing.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/avoindataNoteEditing.js @@ -219,7 +219,7 @@ export default class AvoindataNoteEditing extends Plugin { class: 'avoindata-note', }); - return toWidget(section, viewWriter, { label: 'Avoindata Note widget' }); + return toWidget(section, viewWriter, { label: 'Avoindata Note' }); }, }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/insertAvoindataNoteCommand.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/insertAvoindataNoteCommand.js index f220b4b9b0..0cb1625243 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/insertAvoindataNoteCommand.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataNote/insertAvoindataNoteCommand.js @@ -12,7 +12,8 @@ export default class InsertAvoindataNoteCommand extends Command { model.change((writer) => { // Insert * at the current selection position // in a way that will result in creating a valid model structure. - model.insertContent(createAvoindataNote(writer)); + const avoindataNote = createAvoindataNote(writer); + model.insertContent(avoindataNote); }); } @@ -50,8 +51,12 @@ function createAvoindataNote(writer) { // The text content will automatically be wrapped in a // `

`. - writer.appendElement('paragraph', avoindataNoteTitle); - writer.appendElement('paragraph', avoindataNoteContent); + const title = writer.createElement('paragraph'); + writer.insertText('Title', title, 0); + writer.append(title, avoindataNoteTitle); + const content = writer.createElement('paragraph'); + writer.insertText('Content', content, 0); + writer.append(content, avoindataNoteContent); // Return the element to be added to the editor. return avoindataNote; diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataSection/avoindataSectionUI.js b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataSection/avoindataSectionUI.js index 2c557b8626..64857dec06 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataSection/avoindataSectionUI.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/src/avoindataSection/avoindataSectionUI.js @@ -25,7 +25,7 @@ export default class AvoindataSectionUI extends Plugin { // Create the toolbar button. buttonView.set({ - label: editor.t('Avoindata Section widget'), + label: editor.t('Avoindata Section'), icon, tooltip: true }); diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/externalLink.js b/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/externalLink.js deleted file mode 100644 index fb75e9d64b..0000000000 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/externalLink.js +++ /dev/null @@ -1,113 +0,0 @@ -import { Plugin } from 'ckeditor5/src/core'; - -export default class ExternalLink extends Plugin { - init() { - const { conversion } = this.editor; - - // Upcast Converter for the old ckeditor4 plugin format - conversion.for('upcast').elementToAttribute({ - model: 'linkIsExternal', - view: { - name: 'a', - classes: ['external'], - attributes: ['aria-label', 'target'], - }, - }); - - // Extra consumption for the leftover svg icon - conversion.for('upcast').add(dispatcher => { - // Look for every view svg element. - dispatcher.on('element:svg', (evt, data, conversionApi) => { - // Get all the necessary items from the conversion API object. - const { - consumable - } = conversionApi; - - // Get view item from data object. - const { viewItem } = data; - - // Define elements consumables. - const svg = { name: 'svg', attributes: ['viewBox'] }; - const use = { name: 'use', attributes: ['href'] }; - - // Tests if the view element can be consumed. - if (!consumable.test(viewItem, svg)) { - return; - } - - // Check if there is only one child. - if (viewItem.childCount !== 1) { - return; - } - - // Get the first child element. - const firstChildItem = viewItem.getChild(0); - - // Check if the first element is a div. - if (!firstChildItem.is('element', 'use')) { - return; - } - - // Tests if the first child element can be consumed. - if (!consumable.test(firstChildItem, use)) { - return; - } - - // If a use tag inside a svg has the string 'avoindata_external-link' within the href - // we can assume it's the old ckeditor4 plugin format and simply get rid of them - if (firstChildItem?.getAttribute('href')?.includes('avoindata_external-link')) { - // Consume the main outer wrapper element. - consumable.consume(viewItem, svg); - // Consume the inner wrapper element. - consumable.consume(firstChildItem, use); - } - }); - }); - /* - const editor = this.editor; - - // `listenTo()` and `editor` are available thanks to `Plugin`. - // By using `listenTo()` you will ensure that the listener is removed when - // the plugin is destroyed. - this.listenTo(editor.data, 'ready', () => { - const linkCommand = editor.commands.get('link'); - const { selection } = editor.model.document; - - let linkCommandExecuting = false; - - linkCommand.on('execute', (evt, args) => { - const linkIsExternal = args[1]['linkIsExternal'] - - if (linkIsExternal) { - if (linkCommandExecuting) { - linkCommandExecuting = false; - return; - } - - // If the additional attribute was passed, we stop the default execution - // of the LinkCommand. We're going to create Model#change() block for undo - // and execute the LinkCommand together with setting the extra attribute. - evt.stop(); - - // Prevent infinite recursion by keeping records of when link command is - // being executed by this function. - linkCommandExecuting = true; - - // Wrapping the original command execution in a model.change() block to make sure there's a single undo step - // when the extra attribute is added. - - editor.model.change(writer => { - editor.execute('link', ...args); - const link = selection.getLastPosition().nodeBefore; - // writer.insertElement('avoindataExternalLink', selection.getLastPosition()) - }); - } - }) - }); - */ - } - - static get pluginName() { - return 'ExternalLink'; - } -} diff --git a/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/index.js b/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/index.js deleted file mode 100644 index b0e2d65cb1..0000000000 --- a/drupal/modules/avoindata-ckeditor5-plugins/src/externalLink/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @file The build process always expects an index.js file. Anything exported - * here will be recognized by CKEditor 5 as an available plugin. Multiple - * plugins can be exported in this one file. - * - * I.e. this file's purpose is to make plugin(s) discoverable. - */ - -import ExternalLink from './externalLink'; - -export default { - ExternalLink, -}; diff --git a/drupal/modules/avoindata-ckeditor5-plugins/webpack.config.js b/drupal/modules/avoindata-ckeditor5-plugins/webpack.config.js index b8badd640f..86eb697773 100644 --- a/drupal/modules/avoindata-ckeditor5-plugins/webpack.config.js +++ b/drupal/modules/avoindata-ckeditor5-plugins/webpack.config.js @@ -69,11 +69,17 @@ getDirectories('./src').forEach((dir) => { }, { test: /\.svg$/, - type: "asset/inline", + type: "asset/resource", + generator: { + filename: '../icons/[base]' + } }, { test: /\.css$/, - type: 'asset' + type: "asset/resource", + generator: { + filename: '../css/[base]' + } } ] }]