From ef23cea5772bf6370b1f44c13bdc22783ca07c14 Mon Sep 17 00:00:00 2001 From: Dmitri Pisarev Date: Tue, 26 Nov 2019 15:48:49 +0300 Subject: [PATCH] TASK: fix compatibility with CKE11 This is just a rebase of https://github.com/psmb/Psmb.Footnote/pull/3 --- .../Private/Footnotes/src/footnotePlugin.js | 23 +++++++++---------- .../Public/JavaScript/Footnote/Plugin.js | 3 +-- .../Public/JavaScript/Footnote/Plugin.js.map | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Resources/Private/Footnotes/src/footnotePlugin.js b/Resources/Private/Footnotes/src/footnotePlugin.js index 89cdc7b..34c484f 100644 --- a/Resources/Private/Footnotes/src/footnotePlugin.js +++ b/Resources/Private/Footnotes/src/footnotePlugin.js @@ -17,7 +17,6 @@ function _findBound(position, value, lookBack) { node = lookBack ? node.previousSibling : node.nextSibling; } - //old Position.createAt created an error, used a protected function, okay? return lastNode ? Position._createAt(lastNode, lookBack ? 'before' : 'after') : position; } @@ -66,7 +65,7 @@ class FootnoteCommand extends Command { attributes.set(this.attributeKey, value); const node = writer.createText(value, attributes); writer.insert(node, position); - writer.setSelection(Range.createOn(node)); + writer.setSelection(Range._createOn(node)); } } else { const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey); @@ -96,17 +95,17 @@ export default class Footnote extends Plugin { }); editor.conversion.for('upcast').elementToAttribute({ - view: { - name: 'span', - attributes: { - 'data-footnote': true - } - }, - model: { - key: FOOTNOTE, - value: viewElement => viewElement.getAttribute('data-footnote') + view: { + name: 'span', + attributes: { + 'data-footnote': true } - }); + }, + model: { + key: FOOTNOTE, + value: viewElement => viewElement.getAttribute('data-footnote') + } + }); editor.commands.add(FOOTNOTE, new FootnoteCommand(this.editor, FOOTNOTE)); } } diff --git a/Resources/Public/JavaScript/Footnote/Plugin.js b/Resources/Public/JavaScript/Footnote/Plugin.js index 50683de..043b9e0 100644 --- a/Resources/Public/JavaScript/Footnote/Plugin.js +++ b/Resources/Public/JavaScript/Footnote/Plugin.js @@ -293,7 +293,6 @@ function _findBound(position, value, lookBack) { node = lookBack ? node.previousSibling : node.nextSibling; } - //old Position.createAt created an error, used a protected function, okay? return lastNode ? _ckeditor5Exports.ModelPosition._createAt(lastNode, lookBack ? 'before' : 'after') : position; } @@ -372,7 +371,7 @@ var FootnoteCommand = function (_Command) { attributes.set(_this2.attributeKey, value); var node = writer.createText(value, attributes); writer.insert(node, position); - writer.setSelection(_ckeditor5Exports.ModelRange.createOn(node)); + writer.setSelection(_ckeditor5Exports.ModelRange._createOn(node)); } } else { var ranges = model.schema.getValidRanges(selection.getRanges(), _this2.attributeKey); diff --git a/Resources/Public/JavaScript/Footnote/Plugin.js.map b/Resources/Public/JavaScript/Footnote/Plugin.js.map index 13f4e86..9854c4c 100644 --- a/Resources/Public/JavaScript/Footnote/Plugin.js.map +++ b/Resources/Public/JavaScript/Footnote/Plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap f753c5be53c52468a478","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","webpack:///./src/index.js","webpack:///./src/manifest.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/package.json","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","webpack:///./src/footnotePlugin.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/isPlainObject.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/_getPrototype.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/_isHostObject.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/isObjectLike.js","webpack:///./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/ckeditor5-exports/index.js","webpack:///./src/FootnoteButton.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-ckeditor5-bindings/index.js","webpack:///./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","webpack:///./src/style.css?d2d8","webpack:///./src/style.css","webpack:///./node_modules/css-loader/lib/css-base.js","webpack:///./node_modules/style-loader/lib/addStyles.js","webpack:///./node_modules/style-loader/lib/urls.js"],"names":["readFromConsumerApi","key","window","Error","module","exports","plow","require","addPlugin","Plugin","isEnabled","ckEditorConfiguration","options","editorOptions","plugins","richtextToolbar","globalRegistry","get","set","component","FootnoteButton","isVisible","config","FootnotePlugin","createConsumerApi","createReadOnlyValue","value","writable","enumerable","configurable","manifests","exposureMap","api","Object","keys","forEach","defineProperty","version","identifier","bootstrap","push","FOOTNOTE","findFootnote","position","Range","_findBound","lookBack","node","textNode","nodeBefore","nodeAfter","lastNode","getAttribute","previousSibling","nextSibling","Position","_createAt","FootnoteCommand","editor","attributeKey","model","doc","document","selection","schema","checkAttributeInSelection","toggleMode","undefined","change","rangesToUnset","isCollapsed","getFirstPosition","getRanges","range","writer","removeAttribute","hasAttribute","footnoteRange","setAttribute","setSelection","attributes","getAttributes","createText","insert","createOn","ranges","getValidRanges","Command","Footnote","extend","allowAttributes","conversion","for","attributeToElement","view","footnote","createAttributeElement","elementToAttribute","name","viewElement","commands","add","toMap","data","Map","objectTag","objectProto","prototype","funcToString","Function","toString","hasOwnProperty","objectCtorString","call","objectToString","isPlainObject","proto","Ctor","constructor","nativeGetPrototype","getPrototypeOf","getPrototype","isHostObject","result","e","isObjectLike","objectToMap","obj","map","CkEditor5","formattingUnderCursor","selectors","UI","ContentCanvas","i18nRegistry","state","isOpen","handleFootnoteButtonClick","props","setState","nextProps","inlineEditorOptions","getFootnote","translate","Boolean","PureComponent","propTypes","PropTypes","objectOf","oneOfType","number","bool","string","object","isRequired","FootnoteTextField","style","flyout","footnoteValue","React","reactRedux","ReactUiComponents","NeosUiDecorators","CkEditorApi","NeosUiReduxStore"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC7DwBA,mB;AAAT,SAASA,mBAAT,CAA6BC,GAA7B,EAAkC;AAC7C,WAAO,YAAa;AAChB,YAAIC,OAAO,qBAAP,KAAiCA,OAAO,qBAAP,QAAkCD,GAAlC,CAArC,EAA+E;AAAA;;AAC3E,mBAAO,8BAAO,qBAAP,SAAkCA,GAAlC,uCAAP;AACH;;AAED,cAAM,IAAIE,KAAJ,iFAAN;AACH,KAND;AAOH,C;;;;;;;;;ACRD;;;;;;AAEAC,OAAOC,OAAP,GAAiB,mCAAoB,QAApB,IAAgCC,IAAjD,C;;;;;;;;;ACFA,mBAAAC,CAAQ,CAAR,E;;;;;;;;;ACAA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA,IAAMC,YA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AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA,mBAAmB,2BAA2B;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;;AAEA,iBAAiB,2BAA2B;AAC5C;AACA;;AAEA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd,kDAAkD,sBAAsB;AACxE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;;;;;;;;AC1XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW,EAAE;AACrD,wCAAwC,WAAW,EAAE;;AAErD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,sCAAsC;AACtC,GAAG;AACH;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA","file":"Plugin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f753c5be53c52468a478","export default function readFromConsumerApi(key) {\n return (...args) => {\n if (window['@Neos:HostPluginAPI'] && window['@Neos:HostPluginAPI'][`@${key}`]) {\n return window['@Neos:HostPluginAPI'][`@${key}`](...args);\n }\n\n throw new Error(`You are trying to read from a consumer api that hasn't been initialized yet!`);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().plow;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/plow-js/index.js","require('./manifest');\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import manifest from '@neos-project/neos-ui-extensibility';\nimport FootnotePlugin from './footnotePlugin';\nimport FootnoteButton from './FootnoteButton';\nimport {$add, $get} from 'plow-js'\n\nconst addPlugin = (Plugin, isEnabled) => (ckEditorConfiguration, options) => {\n if (!isEnabled || isEnabled(options.editorOptions, options)) {\n ckEditorConfiguration.plugins = ckEditorConfiguration.plugins || [];\n return $add('plugins', Plugin, ckEditorConfiguration);\n }\n return ckEditorConfiguration;\n};\n\nmanifest('Psmb.Footnote:Footnote', {}, globalRegistry => {\n const richtextToolbar = globalRegistry.get('ckEditor5').get('richtextToolbar');\n richtextToolbar.set('footnote', {\n component: FootnoteButton,\n isVisible: $get('formatting.footnote')\n }, 'before strong');\n\n const config = globalRegistry.get('ckEditor5').get('config');\n config.set('footnote', addPlugin(FootnotePlugin));\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/manifest.js","import createConsumerApi from './createConsumerApi';\nimport readFromConsumerApi from './readFromConsumerApi';\n\nexport default readFromConsumerApi('manifest');\n\nexport {\n createConsumerApi\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/index.js","import {version} from '../package.json';\nimport createManifestFunction from './manifest';\n\nconst createReadOnlyValue = value => ({\n value,\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nexport default function createConsumerApi(manifests, exposureMap) {\n const api = {};\n\n Object.keys(exposureMap).forEach(key => {\n Object.defineProperty(api, key, createReadOnlyValue(exposureMap[key]));\n });\n\n Object.defineProperty(api, '@manifest', createReadOnlyValue(\n createManifestFunction(manifests)\n ));\n\n Object.defineProperty(window, '@Neos:HostPluginAPI', createReadOnlyValue(api));\n Object.defineProperty(window['@Neos:HostPluginAPI'], 'VERSION', createReadOnlyValue(version));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/createConsumerApi.js","module.exports = {\"name\":\"@neos-project/neos-ui-extensibility\",\"version\":\"1.4.1\",\"description\":\"Extensibility mechanisms for the Neos CMS UI\",\"main\":\"./src/index.js\",\"scripts\":{\"prebuild\":\"check-dependencies && yarn clean\",\"test\":\"yarn jest -- -w 2 --coverage\",\"test:watch\":\"yarn jest -- --watch\",\"build\":\"exit 0\",\"build:watch\":\"exit 0\",\"clean\":\"rimraf ./lib ./dist\",\"lint\":\"eslint src\",\"jest\":\"NODE_ENV=test jest\"},\"devDependencies\":{\"@neos-project/babel-preset-neos-ui\":\"1.4.1\",\"@neos-project/jest-preset-neos-ui\":\"1.4.1\"},\"dependencies\":{\"@neos-project/build-essentials\":\"1.4.1\",\"@neos-project/positional-array-sorter\":\"1.4.1\",\"babel-core\":\"^6.13.2\",\"babel-eslint\":\"^7.1.1\",\"babel-loader\":\"^7.1.2\",\"babel-plugin-transform-decorators-legacy\":\"^1.3.4\",\"babel-plugin-transform-object-rest-spread\":\"^6.20.1\",\"babel-plugin-webpack-alias\":\"^2.1.1\",\"babel-preset-es2015\":\"^6.13.2\",\"babel-preset-react\":\"^6.3.13\",\"babel-preset-stage-0\":\"^6.3.13\",\"chalk\":\"^1.1.3\",\"css-loader\":\"^0.28.4\",\"file-loader\":\"^1.1.5\",\"json-loader\":\"^0.5.4\",\"postcss-loader\":\"^2.0.10\",\"react-dev-utils\":\"^0.5.0\",\"style-loader\":\"^0.21.0\"},\"bin\":{\"neos-react-scripts\":\"./bin/neos-react-scripts.js\"},\"jest\":{\"preset\":\"@neos-project/jest-preset-neos-ui\"}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/@neos-project/neos-ui-extensibility/package.json\n// module id = 6\n// module chunks = 0","export default manifests => {\n return function (identifier, options, bootstrap) {\n manifests.push({\n [identifier]: {\n options,\n bootstrap\n }\n });\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/manifest.js","import toMap from '@ckeditor/ckeditor5-utils/src/tomap';\nimport {Command, Plugin, ModelRange as Range, ModelPosition as Position} from 'ckeditor5-exports';\n\nconst FOOTNOTE = 'footnote';\n\nfunction findFootnote(position, value) {\n return new Range(_findBound(position, value, true), _findBound(position, value, false));\n}\n\nfunction _findBound(position, value, lookBack) {\n let node = position.textNode || (lookBack ? position.nodeBefore : position.nodeAfter);\n\n let lastNode = null;\n\n while (node && node.getAttribute(FOOTNOTE) === value) {\n lastNode = node;\n node = lookBack ? node.previousSibling : node.nextSibling;\n }\n\n //old Position.createAt created an error, used a protected function, okay?\n return lastNode ? Position._createAt(lastNode, lookBack ? 'before' : 'after') : position;\n}\n\nclass FootnoteCommand extends Command {\n constructor(editor, attributeKey) {\n super(editor);\n\n this.attributeKey = attributeKey;\n }\n\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n\n this.value = doc.selection.getAttribute(this.attributeKey);\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);\n }\n\n execute(value) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const toggleMode = value === undefined;\n value = toggleMode ? !this.value : value;\n\n model.change(writer => {\n if (toggleMode && !value) {\n const rangesToUnset = selection.isCollapsed ?\n [findFootnote(selection.getFirstPosition(), selection.getAttribute(FOOTNOTE))] : selection.getRanges();\n for (const range of rangesToUnset) {\n writer.removeAttribute(this.attributeKey, range);\n }\n } else if (selection.isCollapsed) {\n const position = selection.getFirstPosition();\n\n if (selection.hasAttribute(FOOTNOTE)) {\n const footnoteRange = findFootnote(selection.getFirstPosition(), selection.getAttribute(FOOTNOTE));\n if (value === false) {\n writer.removeAttribute(this.attributeKey, footnoteRange);\n } else {\n writer.setAttribute(this.attributeKey, value, footnoteRange);\n writer.setSelection(footnoteRange);\n }\n } else if (value !== '') {\n const attributes = toMap(selection.getAttributes());\n attributes.set(this.attributeKey, value);\n const node = writer.createText(value, attributes);\n writer.insert(node, position);\n writer.setSelection(Range.createOn(node));\n }\n } else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);\n\n for (const range of ranges) {\n if (value === false) {\n writer.removeAttribute(this.attributeKey, range);\n } else {\n writer.setAttribute(this.attributeKey, value, range);\n }\n }\n }\n });\n }\n}\n\nexport default class Footnote extends Plugin {\n static get pluginName() {\n return 'Footnote';\n }\n init() {\n const editor = this.editor;\n editor.model.schema.extend('$text', {allowAttributes: FOOTNOTE});\n editor.conversion.for('downcast').attributeToElement({\n model: FOOTNOTE,\n view: (footnote, writer) => writer.createAttributeElement('span', {'data-footnote': footnote})\n });\n\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'span',\n attributes: {\n 'data-footnote': true\n }\n },\n model: {\n key: FOOTNOTE,\n value: viewElement => viewElement.getAttribute('data-footnote')\n }\n });\n editor.commands.add(FOOTNOTE, new FootnoteCommand(this.editor, FOOTNOTE));\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/footnotePlugin.js","/**\n * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/tomap\n */\n\nimport isPlainObject from './lib/lodash/isPlainObject';\nimport objectToMap from './objecttomap';\n\n/**\n * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.\n *\n *\t\tmap = toMap( { 'foo': 1, 'bar': 2 } );\n *\t\tmap = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );\n *\t\tmap = toMap( anotherMap );\n *\n * @param {Object|Iterable} data Object or iterable to transform.\n * @returns {Map} Map created from data.\n */\nexport default function toMap( data ) {\n\tif ( isPlainObject( data ) ) {\n\t\treturn objectToMap( data );\n\t} else {\n\t\treturn new Map( data );\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js","import getPrototype from './_getPrototype';\nimport isHostObject from './_isHostObject';\nimport isObjectLike from './isObjectLike';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object,\n * else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\nexport default isPlainObject;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/isPlainObject.js","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\n}\n\nexport default getPrototype;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/_getPrototype.js","/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\nexport default isHostObject;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/_isHostObject.js","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/lib/lodash/isObjectLike.js","/**\n * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/objecttomap\n */\n\n/**\n * Transforms object to map.\n *\n *\t\tconst map = objectToMap( { 'foo': 1, 'bar': 2 } );\n *\t\tmap.get( 'foo' ); // 1\n *\n * @param {Object} obj Object to transform.\n * @returns {Map} Map created from object.\n */\nexport default function objectToMap( obj ) {\n\tconst map = new Map();\n\n\tfor ( const key in obj ) {\n\t\tmap.set( key, obj[ key ] );\n\t}\n\n\treturn map;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().CkEditor5;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/ckeditor5-exports/index.js","import React, {PureComponent, Fragment} from 'react';\nimport PropTypes from 'prop-types';\nimport {connect} from 'react-redux';\nimport {$get, $transform} from 'plow-js';\n\nimport {IconButton, TextArea} from '@neos-project/react-ui-components';\nimport {neos} from '@neos-project/neos-ui-decorators';\nimport {executeCommand} from '@neos-project/neos-ui-ckeditor5-bindings';\n\nimport {selectors} from '@neos-project/neos-ui-redux-store';\n\nimport style from './style.css';\n\n@connect($transform({\n formattingUnderCursor: selectors.UI.ContentCanvas.formattingUnderCursor\n}))\n@neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get('i18n')\n}))\nexport default class FootnoteButton extends PureComponent {\n static propTypes = {\n formattingUnderCursor: PropTypes.objectOf(PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.bool,\n PropTypes.string,\n PropTypes.object\n ])),\n inlineEditorOptions: PropTypes.object,\n i18nRegistry: PropTypes.object.isRequired\n };\n\n state = {\n isOpen: false\n };\n\n componentWillReceiveProps(nextProps) {\n // if new selection doesn't have a footnote, close the footnote dialog\n if (!$get('footnote', nextProps.formattingUnderCursor)) {\n this.setState({isOpen: false});\n }\n }\n\n handleFootnoteButtonClick = () => {\n if (this.isOpen()) {\n if ($get('footnote', this.props.formattingUnderCursor) !== undefined) {\n executeCommand('footnote');\n }\n this.setState({isOpen: false});\n } else {\n this.setState({isOpen: true});\n }\n }\n\n render() {\n const {i18nRegistry, formattingUnderCursor, inlineEditorOptions } = this.props;\n\n return (\n
\n \n {this.isOpen() ? : null}\n
\n );\n }\n\n isOpen() {\n return Boolean(this.state.isOpen || this.getFootnote());\n }\n\n getFootnote() {\n return $get('footnote', this.props.formattingUnderCursor) || '';\n }\n}\n\n@neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get('i18n')\n}))\nclass FootnoteTextField extends PureComponent {\n static propTypes = {\n i18nRegistry: PropTypes.object,\n footnoteValue: PropTypes.string,\n inlineEditorOptions: PropTypes.object\n };\n\n render() {\n return (\n
\n {\n executeCommand('footnote', value, false);\n }}\n />\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/FootnoteButton.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().React;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().PropTypes;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/prop-types/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('vendor')().reactRedux;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().ReactUiComponents;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiDecorators;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().CkEditorApi;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-ckeditor5-bindings/index.js","import readFromConsumerApi from '../../../readFromConsumerApi';\n\nmodule.exports = readFromConsumerApi('NeosProjectPackages')().NeosUiReduxStore;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js","\nvar content = require(\"!!../node_modules/css-loader/index.js??ref--7-2!../node_modules/postcss-loader/lib/index.js??ref--7-3!./style.css\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../node_modules/css-loader/index.js??ref--7-2!../node_modules/postcss-loader/lib/index.js??ref--7-3!./style.css\", function() {\n\t\tvar newContent = require(\"!!../node_modules/css-loader/index.js??ref--7-2!../node_modules/postcss-loader/lib/index.js??ref--7-3!./style.css\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/style.css\n// module id = 24\n// module chunks = 0","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".style__flyout___1vdkJ {\\n background-color: #222;\\n position: fixed;\\n z-index: 1;\\n width: 460px;\\n border: 8px solid #222;\\n}\\n\", \"\"]);\n\n// exports\nexports.locals = {\n\t\"flyout\": \"style__flyout___1vdkJ\"\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader??ref--7-2!./node_modules/postcss-loader/lib??ref--7-3!./src/style.css\n// module id = 25\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader/lib/css-base.js\n// module id = 26\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target) {\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of