@ckeditor/ckeditor5-highlight 39.0.2 → 40.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/highlight.js.map +1 -0
- package/build/translations/pt-br.js +1 -1
- package/lang/translations/pt-br.po +3 -3
- package/package.json +2 -2
- package/src/augmentation.d.ts +23 -23
- package/src/augmentation.js +5 -5
- package/src/highlight.d.ts +28 -28
- package/src/highlight.js +32 -32
- package/src/highlightcommand.d.ts +45 -45
- package/src/highlightcommand.js +91 -91
- package/src/highlightconfig.d.ts +171 -171
- package/src/highlightconfig.js +5 -5
- package/src/highlightediting.d.ts +28 -28
- package/src/highlightediting.js +109 -109
- package/src/highlightui.d.ts +73 -73
- package/src/highlightui.js +216 -216
- package/src/index.d.ts +13 -13
- package/src/index.js +11 -11
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["webpack://CKEditor5.highlight/./theme/highlight.css","webpack://CKEditor5.highlight/../node_modules/css-loader/dist/runtime/api.js","webpack://CKEditor5.highlight/../node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack://CKEditor5.highlight/./theme/icons/marker.svg","webpack://CKEditor5.highlight/./theme/icons/pen.svg","webpack://CKEditor5.highlight/./theme/highlight.css?1049","webpack://CKEditor5.highlight/../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://CKEditor5.highlight/./src/highlight.js","webpack://CKEditor5.highlight/./src/highlightcommand.js","webpack://CKEditor5.highlight/./src/highlightediting.js","webpack://CKEditor5.highlight/./src/highlightui.js","webpack://CKEditor5.highlight/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.highlight/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.highlight/external var \"CKEditor5.dll\"","webpack://CKEditor5.highlight/webpack/bootstrap","webpack://CKEditor5.highlight/webpack/runtime/compat get default export","webpack://CKEditor5.highlight/webpack/runtime/define property getters","webpack://CKEditor5.highlight/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.highlight/webpack/runtime/make namespace object","webpack://CKEditor5.highlight/webpack/runtime/nonce","webpack://CKEditor5.highlight/./src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAC4H;AAC7B;AAC/F,8BAA8B,mFAA2B,CAAC,wGAAqC;AAC/F;AACA,gDAAgD,qCAAqC,oCAAoC,mCAAmC,mCAAmC,+BAA+B,iCAAiC,2BAA2B,mDAAmD,0BAA0B,kDAAkD,yBAAyB,iDAAiD,yBAAyB,iDAAiD,qBAAqB,6BAA6B,kCAAkC,uBAAuB,6BAA6B,oCAAoC,OAAO,2eAA2e,oDAAoD,oDAAoD,mDAAmD,mDAAmD,6CAA6C,kDAAkD,GAAG,iDAAiD,gCAAgC,0DAA0D,KAAK,GAAG,8CAA8C,6BAA6B,4CAA4C,2HAA2H,KAAK,GAAG,yCAAyC,sCAAsC,qCAAqC,qCAAqC,mCAAmC,mCAAmC,qBAAqB;AAC5nE;AACA,iEAAe,uBAAuB,EAAC;;;;;;;;;;;;ACP1B;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;;AAEA;AACA,KAAK;AACL,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,sBAAsB,iBAAiB;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,qBAAqB;AAC1C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;ACjEa;;AAEb,kCAAkC;;AAElC,8BAA8B;;AAE9B,kDAAkD,gBAAgB,gEAAgE,wDAAwD,6DAA6D,sDAAsD;;AAE7S,uCAAuC,uDAAuD,uCAAuC,SAAS,OAAO,oBAAoB;;AAEzK,yCAAyC,8FAA8F,wBAAwB,eAAe,eAAe,gBAAgB,YAAY,MAAM,wBAAwB,+BAA+B,aAAa,qBAAqB,uCAAuC,cAAc,WAAW,YAAY,UAAU,MAAM,mDAAmD,UAAU,sBAAsB;;AAEve,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,uDAAuD,cAAc;AACrE;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;;;;;;;;;;;;;;ACnCA,iEAAe,k0BAAk0B;;;;;;;;;;;;;;;ACAj1B,iEAAe,yrBAAyrB;;;;;;;;;;;;;;;;;;ACAzmB;AAC/F,YAA8K;;AAE9K,eAAe,+CAA+C;;AAE9D;AACA;;AAEA,aAAa,0GAAG,CAAC,0JAAO;;;;AAIxB,iEAAe,iKAAc,MAAM;;;;;;;;;;;ACZtB;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;;AAEA,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,KAAwC,GAAG,sBAAiB,GAAG,CAAI;;AAEnF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,qEAAqE,qBAAqB,cAAc;;AAExG;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA,yDAAyD;AACzD,IAAI;;AAEJ;;;AAGA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;;AAEA;;AAEA,qBAAqB,6BAA6B;AAClD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;AC5QA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEM;AACV;;AAExC;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA,4CAA4C,0DAA0D;AACtG,IAAI,gDAAgD;AACpD;AACA;AACA;AACe,wBAAwB,sDAAM;AAC7C;AACA;AACA;AACA;AACA,WAAW,yDAAgB,EAAE,oDAAW;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,kDAAkD;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B;AACA,wBAAwB;AACxB,qBAAqB;AACrB;;AAEA;AACA,6BAA6B,4CAA4C;AACzE;AACA,iBAAiB,iDAAiD;AAClE;AACA,YAAY,4CAA4C;AACxD;;AAEA;AACA,6BAA6B,6DAA6D;AAC1F;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,QAAQ,sEAAsE;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,oBAAoB;AACpB,mBAAmB;AACnB,mBAAmB;AACnB,eAAe;AACf,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,YAAY,oDAAoD;AAChE;;;;;;;;;;;;;;;;;AChMA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE6C;;AAE7C;AACA,6CAA6C;AAC7C;AACA;AACA,mCAAmC,uBAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACe,+BAA+B,uDAAO;AACrD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iFAAiF,wBAAwB;AACzG;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;;;;;;;;;;;;;;;;;AC9GA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEM;;AAElD;AACA,qDAAqD,kEAAkE;AACvH,qBAAqB,6CAA6C,sBAAsB;AACxF;AACA,WAAW,+DAA+D;AAC1E;AACA;AACA;AACe,+BAA+B,sDAAM;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAyC,+BAA+B;;AAExE;;AAEA;AACA;;AAEA,wCAAwC,yDAAgB;AACxD;AACA;;AAEA;AACA;AACA,WAAW,oDAAoD;AAC/D,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;AC3HA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEmD;AACwE;;AAEtE;AACN;;AAEb;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,wEAAwE;AACpF;AACA;AACA;AACA;AACe,0BAA0B,sDAAM;AAC/C;AACA;AACA;AACA;AACA,KAAK,0DAA0D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+DAA+D,4DAAY;AAC3E;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,4CAA4C;AACxD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,GAAG;AACf,YAAY,UAAU;AACtB;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,wDAAU;;AAEpC;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,mCAAmC,QAAQ;AAC3C;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,oDAAoD;AAChE;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,GAAG,KAAK;;AAER;AACA;AACA,wBAAwB,gEAAc,UAAU,6DAAe;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,6BAA6B;AACjE,MAAM;;AAEN;AACA,KAAK;;AAEL;AACA;;AAEA;AACA,qBAAqB,kEAAoB;AACzC;;AAEA,GAAG,sEAAoB,2BAA2B,4CAA4C;AAC9F;;AAEA;;AAEA;AACA;AACA,mCAAmC,sCAAsC;AACzE,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4BAA4B,+DAAU,GAAG,4DAAO;AAChD;;;;;;;;;;;ACxQA;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEmD;AACc;AACV","file":"highlight.js","sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{background-color:transparent;color:var(--ck-highlight-pen-red)}.ck-content .pen-green{background-color:transparent;color:var(--ck-highlight-pen-green)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./theme/highlight.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oCAA+C,CAC/C,mCAA+C,CAC/C,kCAA8C,CAC9C,kCAA8C,CAC9C,8BAAwC,CACxC,gCACD,CAGC,2BACC,kDACD,CAFA,0BACC,iDACD,CAFA,yBACC,gDACD,CAFA,yBACC,gDACD,CAIA,qBAIC,4BAA6B,CAH7B,iCAID,CALA,uBAIC,4BAA6B,CAH7B,mCAID\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-highlight-marker-yellow: hsl(60, 97%, 73%);\\n\\t--ck-highlight-marker-green: hsl(120, 93%, 68%);\\n\\t--ck-highlight-marker-pink: hsl(345, 96%, 73%);\\n\\t--ck-highlight-marker-blue: hsl(201, 97%, 72%);\\n\\t--ck-highlight-pen-red: hsl(0, 85%, 49%);\\n\\t--ck-highlight-pen-green: hsl(112, 100%, 27%);\\n}\\n\\n@define-mixin highlight-marker-color $color {\\n\\t.ck-content .marker-$color {\\n\\t\\tbackground-color: var(--ck-highlight-marker-$color);\\n\\t}\\n}\\n\\n@define-mixin highlight-pen-color $color {\\n\\t.ck-content .pen-$color {\\n\\t\\tcolor: var(--ck-highlight-pen-$color);\\n\\n\\t\\t/* Override default yellow background of `<mark>` from user agent stylesheet */\\n\\t\\tbackground-color: transparent;\\n\\t}\\n}\\n\\n@mixin highlight-marker-color yellow;\\n@mixin highlight-marker-color green;\\n@mixin highlight-marker-color pink;\\n@mixin highlight-marker-color blue;\\n\\n@mixin highlight-pen-color red;\\n@mixin highlight-pen-color green;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M10.798 1.59 3.002 12.875l1.895 1.852 2.521 1.402 6.997-12.194z\\\"/><path d=\\\"m2.556 16.727.234-.348c-.297-.151-.462-.293-.498-.426-.036-.137.002-.416.115-.837.094-.25.15-.449.169-.595a4.495 4.495 0 0 0 0-.725c-.209-.621-.303-1.041-.284-1.26.02-.218.178-.506.475-.862l6.77-9.414c.539-.91 1.605-.85 3.199.18 1.594 1.032 2.188 1.928 1.784 2.686l-5.877 10.36c-.158.412-.333.673-.526.782-.193.108-.604.179-1.232.21-.362.131-.608.237-.738.318-.13.081-.305.238-.526.47-.293.265-.504.397-.632.397-.096 0-.27-.075-.524-.226l-.31.41-1.6-1.12zm-.279.415 1.575 1.103-.392.515H1.19l1.087-1.618zm8.1-13.656-4.953 6.9L8.75 12.57l4.247-7.574c.175-.25-.188-.647-1.092-1.192-.903-.546-1.412-.652-1.528-.32zM8.244 18.5 9.59 17h9.406v1.5H8.245z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M10.126 2.268 2.002 13.874l1.895 1.852 2.521 1.402L14.47 5.481l-1.543-2.568-2.801-.645z\\\"/><path d=\\\"m4.5 18.088-2.645-1.852-.04-2.95-.006-.005.006-.008v-.025l.011.008L8.73 2.97c.165-.233.356-.417.567-.557l-1.212.308L4.604 7.9l-.83-.558 3.694-5.495 2.708-.69 1.65 1.145.046.018.85-1.216 2.16 1.512-.856 1.222c.828.967 1.144 2.141.432 3.158L7.55 17.286l.006.005-3.055.797H4.5zm-.634.166-1.976.516-.026-1.918 2.002 1.402zM9.968 3.817l-.006-.004-6.123 9.184 3.277 2.294 6.108-9.162.005.003c.317-.452-.16-1.332-1.064-1.966-.891-.624-1.865-.776-2.197-.349zM8.245 18.5 9.59 17h9.406v1.5H8.245z\\\"/></svg>\";","import api from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./highlight.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module highlight/highlight\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport HighlightEditing from './highlightediting';\nimport HighlightUI from './highlightui';\n\n/**\n * The highlight plugin.\n *\n * For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.\n *\n * This is a \"glue\" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and\n * {@link module:highlight/highlightui~HighlightUI} plugins.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Highlight extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ HighlightEditing, HighlightUI ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'Highlight';\n\t}\n}\n\n/**\n * The highlight option descriptor. See {@link module:highlight/highlight~HighlightConfig} to learn more.\n *\n *\t\t{\n *\t\t\tmodel: 'pinkMarker',\n *\t\t\tclass: 'marker-pink',\n *\t\t\ttitle: 'Pink Marker',\n *\t\t\tcolor: 'var(--ck-highlight-marker-pink)',\n *\t\t\ttype: 'marker'\n *\t\t}\n *\n * @typedef {Object} module:highlight/highlight~HighlightOption\n * @property {String} title The user-readable title of the option.\n * @property {String} model The unique attribute value in the model.\n * @property {String} color The CSS `var()` used for the highlighter. The color is used in the user interface to represent the highlighter.\n * There is a possibility to use the default color format like rgb, hex or hsl, but you need to care about the color of `<mark>`\n * by adding CSS classes definition.\n * @property {String} class The CSS class used on the `<mark>` element in the view. It should match the `color` setting.\n * @property {'marker'|'pen'} type The type of highlighter:\n *\n * * `'marker'` – Uses the `color` as the `background-color` style,\n * * `'pen'` – Uses the `color` as the font `color` style.\n */\n\n/**\n * The configuration of the {@link module:highlight/highlight~Highlight} feature.\n *\n * Read more in {@link module:highlight/highlight~HighlightConfig}.\n *\n * @member {module:highlight/highlight~HighlightConfig} module:core/editor/editorconfig~EditorConfig#highlight\n */\n\n/**\n * The configuration of the {@link module:highlight/highlight~Highlight highlight feature}.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\thighlight: ... // Highlight feature configuration.\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n *\n * @interface HighlightConfig\n */\n\n/**\n * The available highlight options. The default value is:\n *\n *\t\toptions: [\n *\t\t\t{\n *\t\t\t\tmodel: 'yellowMarker',\n *\t\t\t\tclass: 'marker-yellow',\n *\t\t\t\ttitle: 'Yellow marker',\n *\t\t\t\tcolor: 'var(--ck-highlight-marker-yellow)',\n *\t\t\t\ttype: 'marker'\n *\t\t\t},\n *\t\t\t{\n *\t\t\t\tmodel: 'greenMarker',\n *\t\t\t\tclass: 'marker-green',\n *\t\t\t\ttitle: 'Green marker',\n *\t\t\t\tcolor: 'var(--ck-highlight-marker-green)',\n *\t\t\t\ttype: 'marker'\n *\t\t\t},\n *\t\t\t{\n *\t\t\t\tmodel: 'pinkMarker',\n *\t\t\t\tclass: 'marker-pink',\n *\t\t\t\ttitle: 'Pink marker',\n *\t\t\t\tcolor: 'var(--ck-highlight-marker-pink)',\n *\t\t\t\ttype: 'marker'\n *\t\t\t},\n *\t\t\t{\n *\t\t\t\tmodel: 'blueMarker',\n *\t\t\t\tclass: 'marker-blue',\n *\t\t\t\ttitle: 'Blue marker',\n *\t\t\t\tcolor: 'var(--ck-highlight-marker-blue)',\n *\t\t\t\ttype: 'marker'\n *\t\t\t},\n *\t\t\t{\n *\t\t\t\tmodel: 'redPen',\n *\t\t\t\tclass: 'pen-red',\n *\t\t\t\ttitle: 'Red pen',\n *\t\t\t\tcolor: 'var(--ck-highlight-pen-red)',\n *\t\t\t\ttype: 'pen'\n *\t\t\t},\n *\t\t\t{\n *\t\t\t\tmodel: 'greenPen',\n *\t\t\t\tclass: 'pen-green',\n *\t\t\t\ttitle: 'Green pen',\n *\t\t\t\tcolor: 'var(--ck-highlight-pen-green)',\n *\t\t\t\ttype: 'pen'\n *\t\t\t}\n *\t\t]\n *\n * There are two types of highlighters available:\n *\n * * `'marker'` – Rendered as a `<mark>` element, styled with the `background-color`.\n * * `'pen'` – Rendered as a `<mark>` element, styled with the font `color`.\n *\n * **Note**: The highlight feature provides a stylesheet with the CSS classes and corresponding colors defined\n * as CSS variables.\n *\n *\t\t:root {\n *\t\t\t--ck-highlight-marker-yellow: #fdfd77;\n *\t\t\t--ck-highlight-marker-green: #63f963;\n *\t\t\t--ck-highlight-marker-pink: #fc7999;\n *\t\t\t--ck-highlight-marker-blue: #72cdfd;\n *\t\t\t--ck-highlight-pen-red: #e91313;\n *\t\t\t--ck-highlight-pen-green: #118800;\n *\t\t}\n *\n *\t\t.marker-yellow { ... }\n *\t\t.marker-green { ... }\n *\t\t.marker-pink { ... }\n *\t\t.marker-blue { ... }\n *\t\t.pen-red { ... }\n *\t\t.pen-green { ... }\n *\n * It is possible to define the `color` property directly as `rgba(R, G, B, A)`,\n * `#RRGGBB[AA]` or `hsla(H, S, L, A)`. In such situation, the color will **only** apply to the UI of\n * the editor and the `<mark>` elements in the content must be styled by custom classes provided by\n * a dedicated stylesheet.\n *\n * **Note**: It is recommended for the `color` property to correspond to the class in the content\n * stylesheet because it represents the highlighter in the user interface of the editor.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\thighlight: {\n *\t\t\t\t\toptions: [\n *\t\t\t\t\t\t{\n *\t\t\t\t\t\t\tmodel: 'pinkMarker',\n *\t\t\t\t\t\t\tclass: 'marker-pink',\n *\t\t\t\t\t\t\ttitle: 'Pink Marker',\n *\t\t\t\t\t\t\tcolor: 'var(--ck-highlight-marker-pink)',\n *\t\t\t\t\t\t\ttype: 'marker'\n *\t\t\t\t\t\t},\n *\t\t\t\t\t\t{\n *\t\t\t\t\t\t\tmodel: 'redPen',\n *\t\t\t\t\t\t\tclass: 'pen-red',\n *\t\t\t\t\t\t\ttitle: 'Red Pen',\n *\t\t\t\t\t\t\tcolor: 'var(--ck-highlight-pen-red)',\n *\t\t\t\t\t\t\ttype: 'pen'\n *\t\t\t\t\t\t},\n *\t\t\t\t\t]\n *\t\t\t\t}\n *\t\t} )\n *\t\t.then( ... )\n *\t\t.catch( ... );\n *\n * @member {Array.<module:highlight/highlight~HighlightOption>} module:highlight/highlight~HighlightConfig#options\n */\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module highlight/highlightcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\n\n/**\n * The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}\n * to apply the text highlighting.\n *\n *\t\teditor.execute( 'highlight', { value: 'greenMarker' } );\n *\n * **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed\n * inside a text with the highlight attribute, the command will remove the attribute from the entire range\n * of that text.\n *\n * @extends module:core/command~Command\n */\nexport default class HighlightCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst model = this.editor.model;\n\t\tconst doc = model.document;\n\n\t\t/**\n\t\t * A value indicating whether the command is active. If the selection has some highlight attribute,\n\t\t * it corresponds to the value of that attribute.\n\t\t *\n\t\t * @observable\n\t\t * @readonly\n\t\t * @member {undefined|String} module:highlight/highlightcommand~HighlightCommand#value\n\t\t */\n\t\tthis.value = doc.selection.getAttribute( 'highlight' );\n\t\tthis.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'highlight' );\n\t}\n\n\t/**\n\t * Executes the command.\n\t *\n\t * @param {Object} [options] Options for the executed command.\n\t * @param {String} [options.value] The value to apply.\n\t *\n\t * @fires execute\n\t */\n\texecute( options = {} ) {\n\t\tconst model = this.editor.model;\n\t\tconst document = model.document;\n\t\tconst selection = document.selection;\n\n\t\tconst highlighter = options.value;\n\n\t\tmodel.change( writer => {\n\t\t\tif ( selection.isCollapsed ) {\n\t\t\t\tconst position = selection.getFirstPosition();\n\n\t\t\t\t// When selection is inside text with `highlight` attribute.\n\t\t\t\tif ( selection.hasAttribute( 'highlight' ) ) {\n\t\t\t\t\t// Find the full highlighted range.\n\t\t\t\t\tconst isSameHighlight = value => {\n\t\t\t\t\t\treturn value.item.hasAttribute( 'highlight' ) && value.item.getAttribute( 'highlight' ) === this.value;\n\t\t\t\t\t};\n\n\t\t\t\t\tconst highlightStart = position.getLastMatchingPosition( isSameHighlight, { direction: 'backward' } );\n\t\t\t\t\tconst highlightEnd = position.getLastMatchingPosition( isSameHighlight );\n\n\t\t\t\t\tconst highlightRange = writer.createRange( highlightStart, highlightEnd );\n\n\t\t\t\t\t// Then depending on current value...\n\t\t\t\t\tif ( !highlighter || this.value === highlighter ) {\n\t\t\t\t\t\t// ...remove attribute when passing highlighter different then current or executing \"eraser\".\n\n\t\t\t\t\t\t// If we're at the end of the highlighted range, we don't want to remove highlight of the range.\n\t\t\t\t\t\tif ( !position.isEqual( highlightEnd ) ) {\n\t\t\t\t\t\t\twriter.removeAttribute( 'highlight', highlightRange );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twriter.removeSelectionAttribute( 'highlight' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// ...update `highlight` value.\n\n\t\t\t\t\t\t// If we're at the end of the highlighted range, we don't want to change the highlight of the range.\n\t\t\t\t\t\tif ( !position.isEqual( highlightEnd ) ) {\n\t\t\t\t\t\t\twriter.setAttribute( 'highlight', highlighter, highlightRange );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twriter.setSelectionAttribute( 'highlight', highlighter );\n\t\t\t\t\t}\n\t\t\t\t} else if ( highlighter ) {\n\t\t\t\t\twriter.setSelectionAttribute( 'highlight', highlighter );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst ranges = model.schema.getValidRanges( selection.getRanges(), 'highlight' );\n\n\t\t\t\tfor ( const range of ranges ) {\n\t\t\t\t\tif ( highlighter ) {\n\t\t\t\t\t\twriter.setAttribute( 'highlight', highlighter, range );\n\t\t\t\t\t} else {\n\t\t\t\t\t\twriter.removeAttribute( 'highlight', range );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module highlight/highlightediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport HighlightCommand from './highlightcommand';\n\n/**\n * The highlight editing feature. It introduces the {@link module:highlight/highlightcommand~HighlightCommand command} and the `highlight`\n * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}\n * as a `<mark>` element with a `class` attribute (`<mark class=\"marker-green\">...</mark>`) depending\n * on the {@link module:highlight/highlight~HighlightConfig configuration}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class HighlightEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'HighlightEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\teditor.config.define( 'highlight', {\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tmodel: 'yellowMarker',\n\t\t\t\t\tclass: 'marker-yellow',\n\t\t\t\t\ttitle: 'Yellow marker',\n\t\t\t\t\tcolor: 'var(--ck-highlight-marker-yellow)',\n\t\t\t\t\ttype: 'marker'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodel: 'greenMarker',\n\t\t\t\t\tclass: 'marker-green',\n\t\t\t\t\ttitle: 'Green marker',\n\t\t\t\t\tcolor: 'var(--ck-highlight-marker-green)',\n\t\t\t\t\ttype: 'marker'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodel: 'pinkMarker',\n\t\t\t\t\tclass: 'marker-pink',\n\t\t\t\t\ttitle: 'Pink marker',\n\t\t\t\t\tcolor: 'var(--ck-highlight-marker-pink)',\n\t\t\t\t\ttype: 'marker'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodel: 'blueMarker',\n\t\t\t\t\tclass: 'marker-blue',\n\t\t\t\t\ttitle: 'Blue marker',\n\t\t\t\t\tcolor: 'var(--ck-highlight-marker-blue)',\n\t\t\t\t\ttype: 'marker'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodel: 'redPen',\n\t\t\t\t\tclass: 'pen-red',\n\t\t\t\t\ttitle: 'Red pen',\n\t\t\t\t\tcolor: 'var(--ck-highlight-pen-red)',\n\t\t\t\t\ttype: 'pen'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodel: 'greenPen',\n\t\t\t\t\tclass: 'pen-green',\n\t\t\t\t\ttitle: 'Green pen',\n\t\t\t\t\tcolor: 'var(--ck-highlight-pen-green)',\n\t\t\t\t\ttype: 'pen'\n\t\t\t\t}\n\t\t\t]\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\t// Allow highlight attribute on text nodes.\n\t\teditor.model.schema.extend( '$text', { allowAttributes: 'highlight' } );\n\n\t\tconst options = editor.config.get( 'highlight.options' );\n\n\t\t// Set-up the two-way conversion.\n\t\teditor.conversion.attributeToElement( _buildDefinition( options ) );\n\n\t\teditor.commands.add( 'highlight', new HighlightCommand( editor ) );\n\t}\n}\n\n// Converts the options array to a converter definition.\n//\n// @param {Array.<module:highlight/highlight~HighlightOption>} options An array with configured options.\n// @returns {module:engine/conversion/conversion~ConverterDefinition}\nfunction _buildDefinition( options ) {\n\tconst definition = {\n\t\tmodel: {\n\t\t\tkey: 'highlight',\n\t\t\tvalues: []\n\t\t},\n\t\tview: {}\n\t};\n\n\tfor ( const option of options ) {\n\t\tdefinition.model.values.push( option.model );\n\t\tdefinition.view[ option.model ] = {\n\t\t\tname: 'mark',\n\t\t\tclasses: option.class\n\t\t};\n\t}\n\n\treturn definition;\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module highlight/highlightui\n */\n\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView, SplitButtonView, ToolbarSeparatorView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';\n\nimport markerIcon from './../theme/icons/marker.svg';\nimport penIcon from './../theme/icons/pen.svg';\n\nimport './../theme/highlight.css';\n\n/**\n * The default highlight UI plugin. It introduces:\n *\n * * The `'highlight'` dropdown,\n * * The `'removeHighlight'` and `'highlight:*'` buttons.\n *\n * The default configuration includes the following buttons:\n *\n * * `'highlight:yellowMarker'`\n * * `'highlight:greenMarker'`\n * * `'highlight:pinkMarker'`\n * * `'highlight:blueMarker'`\n * * `'highlight:redPen'`\n * * `'highlight:greenPen'`\n *\n * See the {@link module:highlight/highlight~HighlightConfig#options configuration} to learn more\n * about the defaults.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class HighlightUI extends Plugin {\n\t/**\n\t * Returns the localized option titles provided by the plugin.\n\t *\n\t * The following localized titles corresponding with default\n\t * {@link module:highlight/highlight~HighlightConfig#options} are available:\n\t *\n\t * * `'Yellow marker'`,\n\t * * `'Green marker'`,\n\t * * `'Pink marker'`,\n\t * * `'Blue marker'`,\n\t * * `'Red pen'`,\n\t * * `'Green pen'`.\n\t *\n\t * @readonly\n\t * @type {Object.<String,String>}\n\t */\n\tget localizedOptionTitles() {\n\t\tconst t = this.editor.t;\n\n\t\treturn {\n\t\t\t'Yellow marker': t( 'Yellow marker' ),\n\t\t\t'Green marker': t( 'Green marker' ),\n\t\t\t'Pink marker': t( 'Pink marker' ),\n\t\t\t'Blue marker': t( 'Blue marker' ),\n\t\t\t'Red pen': t( 'Red pen' ),\n\t\t\t'Green pen': t( 'Green pen' )\n\t\t};\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'HighlightUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst options = this.editor.config.get( 'highlight.options' );\n\n\t\tfor ( const option of options ) {\n\t\t\tthis._addHighlighterButton( option );\n\t\t}\n\n\t\tthis._addRemoveHighlightButton();\n\n\t\tthis._addDropdown( options );\n\t}\n\n\t/**\n\t * Creates the \"Remove highlight\" button.\n\t *\n\t * @private\n\t */\n\t_addRemoveHighlightButton() {\n\t\tconst t = this.editor.t;\n\t\tconst command = this.editor.commands.get( 'highlight' );\n\n\t\tthis._addButton( 'removeHighlight', t( 'Remove highlight' ), icons.eraser, null, button => {\n\t\t\tbutton.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\t\t} );\n\t}\n\n\t/**\n\t * Creates a toolbar button from the provided highlight option.\n\t *\n\t * @param {module:highlight/highlight~HighlightOption} option\n\t * @private\n\t */\n\t_addHighlighterButton( option ) {\n\t\tconst command = this.editor.commands.get( 'highlight' );\n\n\t\t// TODO: change naming\n\t\tthis._addButton( 'highlight:' + option.model, option.title, getIconForType( option.type ), option.model, decorateHighlightButton );\n\n\t\tfunction decorateHighlightButton( button ) {\n\t\t\tbutton.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\t\t\tbutton.bind( 'isOn' ).to( command, 'value', value => value === option.model );\n\t\t\tbutton.iconView.fillColor = option.color;\n\t\t\tbutton.isToggleable = true;\n\t\t}\n\t}\n\n\t/**\n\t * Internal method for creating highlight buttons.\n\t *\n\t * @param {String} name The name of the button.\n\t * @param {String} label The label for the button.\n\t * @param {String} icon The button icon.\n\t * @param {*} value The `value` property passed to the executed command.\n\t * @param {Function} decorateButton A callback getting ButtonView instance so that it can be further customized.\n\t * @private\n\t */\n\t_addButton( name, label, icon, value, decorateButton ) {\n\t\tconst editor = this.editor;\n\n\t\teditor.ui.componentFactory.add( name, locale => {\n\t\t\tconst buttonView = new ButtonView( locale );\n\n\t\t\tconst localized = this.localizedOptionTitles[ label ] ? this.localizedOptionTitles[ label ] : label;\n\n\t\t\tbuttonView.set( {\n\t\t\t\tlabel: localized,\n\t\t\t\ticon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tbuttonView.on( 'execute', () => {\n\t\t\t\teditor.execute( 'highlight', { value } );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\t// Add additional behavior for buttonView.\n\t\t\tdecorateButton( buttonView );\n\n\t\t\treturn buttonView;\n\t\t} );\n\t}\n\n\t/**\n\t * Creates the split button dropdown UI from the provided highlight options.\n\t *\n\t * @param {Array.<module:highlight/highlight~HighlightOption>} options\n\t * @private\n\t */\n\t_addDropdown( options ) {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\t\tconst componentFactory = editor.ui.componentFactory;\n\n\t\tconst startingHighlighter = options[ 0 ];\n\n\t\tconst optionsMap = options.reduce( ( retVal, option ) => {\n\t\t\tretVal[ option.model ] = option;\n\n\t\t\treturn retVal;\n\t\t}, {} );\n\n\t\tcomponentFactory.add( 'highlight', locale => {\n\t\t\tconst command = editor.commands.get( 'highlight' );\n\t\t\tconst dropdownView = createDropdown( locale, SplitButtonView );\n\t\t\tconst splitButtonView = dropdownView.buttonView;\n\n\t\t\tsplitButtonView.set( {\n\t\t\t\tlabel: t( 'Highlight' ),\n\t\t\t\ttooltip: true,\n\t\t\t\t// Holds last executed highlighter.\n\t\t\t\tlastExecuted: startingHighlighter.model,\n\t\t\t\t// Holds current highlighter to execute (might be different then last used).\n\t\t\t\tcommandValue: startingHighlighter.model,\n\t\t\t\tisToggleable: true\n\t\t\t} );\n\n\t\t\t// Dropdown button changes to selection (command.value):\n\t\t\t// - If selection is in highlight it get active highlight appearance (icon, color) and is activated.\n\t\t\t// - Otherwise it gets appearance (icon, color) of last executed highlight.\n\t\t\tsplitButtonView.bind( 'icon' ).to( command, 'value', value => getIconForType( getActiveOption( value, 'type' ) ) );\n\t\t\tsplitButtonView.bind( 'color' ).to( command, 'value', value => getActiveOption( value, 'color' ) );\n\t\t\tsplitButtonView.bind( 'commandValue' ).to( command, 'value', value => getActiveOption( value, 'model' ) );\n\t\t\tsplitButtonView.bind( 'isOn' ).to( command, 'value', value => !!value );\n\n\t\t\tsplitButtonView.delegate( 'execute' ).to( dropdownView );\n\n\t\t\t// Create buttons array.\n\t\t\tconst buttons = options.map( option => {\n\t\t\t\t// Get existing highlighter button.\n\t\t\t\tconst buttonView = componentFactory.create( 'highlight:' + option.model );\n\n\t\t\t\t// Update lastExecutedHighlight on execute.\n\t\t\t\tthis.listenTo( buttonView, 'execute', () => {\n\t\t\t\t\tdropdownView.buttonView.set( { lastExecuted: option.model } );\n\t\t\t\t} );\n\n\t\t\t\treturn buttonView;\n\t\t\t} );\n\n\t\t\t// Make toolbar button enabled when any button in dropdown is enabled before adding separator and eraser.\n\t\t\tdropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );\n\n\t\t\t// Add separator and eraser buttons to dropdown.\n\t\t\tbuttons.push( new ToolbarSeparatorView() );\n\t\t\tbuttons.push( componentFactory.create( 'removeHighlight' ) );\n\n\t\t\taddToolbarToDropdown( dropdownView, buttons, { enableActiveItemFocusOnDropdownOpen: true } );\n\t\t\tbindToolbarIconStyleToActiveColor( dropdownView );\n\n\t\t\tdropdownView.toolbarView.ariaLabel = t( 'Text highlight toolbar' );\n\n\t\t\t// Execute current action from dropdown's split button action button.\n\t\t\tsplitButtonView.on( 'execute', () => {\n\t\t\t\teditor.execute( 'highlight', { value: splitButtonView.commandValue } );\n\t\t\t} );\n\n\t\t\t// Focus the editable after executing the command.\n\t\t\t// It overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n\t\t\tthis.listenTo( dropdownView, 'execute', () => {\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\t// Returns active highlighter option depending on current command value.\n\t\t\t// If current is not set or it is the same as last execute this method will return the option key (like icon or color)\n\t\t\t// of last executed highlighter. Otherwise it will return option key for current one.\n\t\t\tfunction getActiveOption( current, key ) {\n\t\t\t\tconst whichHighlighter = !current ||\n\t\t\t\tcurrent === splitButtonView.lastExecuted ? splitButtonView.lastExecuted : current;\n\n\t\t\t\treturn optionsMap[ whichHighlighter ][ key ];\n\t\t\t}\n\n\t\t\treturn dropdownView;\n\t\t} );\n\t}\n}\n\n// Extends split button icon style to reflect last used button style.\nfunction bindToolbarIconStyleToActiveColor( dropdownView ) {\n\tconst actionView = dropdownView.buttonView.actionView;\n\n\tactionView.iconView.bind( 'fillColor' ).to( dropdownView.buttonView, 'color' );\n}\n\n// Returns icon for given highlighter type.\nfunction getIconForType( type ) {\n\treturn type === 'marker' ? markerIcon : penIcon;\n}\n","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = CKEditor5.dll;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nc = undefined;","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module highlight\n */\n\nexport { default as Highlight } from './highlight';\nexport { default as HighlightEditing } from './highlightediting';\nexport { default as HighlightUI } from './highlightui';\n"],"sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
!function(
|
1
|
+
!function(r){const a=r["pt-br"]=r["pt-br"]||{};a.dictionary=Object.assign(a.dictionary||{},{"Blue marker":"Marcador azul","Green marker":"Marcador verde","Green pen":"Caneta verde",Highlight:"Marcador","Pink marker":"Marcador rosa","Red pen":"Caneta vermelha","Remove highlight":"Remover marcação","Text highlight toolbar":"Ferramentas de marcação","Yellow marker":"Marcador amarelo"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -43,12 +43,12 @@ msgstr "Caneta verde"
|
|
43
43
|
|
44
44
|
msgctxt "Toolbar button tooltip for removing text highlight."
|
45
45
|
msgid "Remove highlight"
|
46
|
-
msgstr "Remover
|
46
|
+
msgstr "Remover marcação"
|
47
47
|
|
48
48
|
msgctxt "Toolbar button tooltip for the text highlight feature."
|
49
49
|
msgid "Highlight"
|
50
|
-
msgstr "
|
50
|
+
msgstr "Marcador"
|
51
51
|
|
52
52
|
msgctxt "Label used by assistive technologies describing the highlight feature toolbar."
|
53
53
|
msgid "Text highlight toolbar"
|
54
|
-
msgstr "Ferramentas de
|
54
|
+
msgstr "Ferramentas de marcação"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-highlight",
|
3
|
-
"version": "
|
3
|
+
"version": "40.0.0",
|
4
4
|
"description": "Highlight feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
],
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"ckeditor5": "
|
15
|
+
"ckeditor5": "40.0.0"
|
16
16
|
},
|
17
17
|
"author": "CKSource (http://cksource.com/)",
|
18
18
|
"license": "GPL-2.0-or-later",
|
package/src/augmentation.d.ts
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
import type { Highlight, HighlightCommand, HighlightConfig, HighlightEditing, HighlightUI } from './index';
|
6
|
-
declare module '@ckeditor/ckeditor5-core' {
|
7
|
-
interface EditorConfig {
|
8
|
-
/**
|
9
|
-
* The configuration of the {@link module:highlight/highlight~Highlight} feature.
|
10
|
-
*
|
11
|
-
* Read more in {@link module:highlight/highlightconfig~HighlightConfig}.
|
12
|
-
*/
|
13
|
-
highlight?: HighlightConfig;
|
14
|
-
}
|
15
|
-
interface PluginsMap {
|
16
|
-
[Highlight.pluginName]: Highlight;
|
17
|
-
[HighlightEditing.pluginName]: HighlightEditing;
|
18
|
-
[HighlightUI.pluginName]: HighlightUI;
|
19
|
-
}
|
20
|
-
interface CommandsMap {
|
21
|
-
highlight: HighlightCommand;
|
22
|
-
}
|
23
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
import type { Highlight, HighlightCommand, HighlightConfig, HighlightEditing, HighlightUI } from './index';
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
7
|
+
interface EditorConfig {
|
8
|
+
/**
|
9
|
+
* The configuration of the {@link module:highlight/highlight~Highlight} feature.
|
10
|
+
*
|
11
|
+
* Read more in {@link module:highlight/highlightconfig~HighlightConfig}.
|
12
|
+
*/
|
13
|
+
highlight?: HighlightConfig;
|
14
|
+
}
|
15
|
+
interface PluginsMap {
|
16
|
+
[Highlight.pluginName]: Highlight;
|
17
|
+
[HighlightEditing.pluginName]: HighlightEditing;
|
18
|
+
[HighlightUI.pluginName]: HighlightUI;
|
19
|
+
}
|
20
|
+
interface CommandsMap {
|
21
|
+
highlight: HighlightCommand;
|
22
|
+
}
|
23
|
+
}
|
package/src/augmentation.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
export {};
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
export {};
|
package/src/highlight.d.ts
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module highlight/highlight
|
7
|
-
*/
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
9
|
-
import HighlightEditing from './highlightediting';
|
10
|
-
import HighlightUI from './highlightui';
|
11
|
-
/**
|
12
|
-
* The highlight plugin.
|
13
|
-
*
|
14
|
-
* For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.
|
15
|
-
*
|
16
|
-
* This is a "glue" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and
|
17
|
-
* {@link module:highlight/highlightui~HighlightUI} plugins.
|
18
|
-
*/
|
19
|
-
export default class Highlight extends Plugin {
|
20
|
-
/**
|
21
|
-
* @inheritDoc
|
22
|
-
*/
|
23
|
-
static get requires(): readonly [typeof HighlightEditing, typeof HighlightUI];
|
24
|
-
/**
|
25
|
-
* @inheritDoc
|
26
|
-
*/
|
27
|
-
static get pluginName(): "Highlight";
|
28
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module highlight/highlight
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
9
|
+
import HighlightEditing from './highlightediting';
|
10
|
+
import HighlightUI from './highlightui';
|
11
|
+
/**
|
12
|
+
* The highlight plugin.
|
13
|
+
*
|
14
|
+
* For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.
|
15
|
+
*
|
16
|
+
* This is a "glue" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and
|
17
|
+
* {@link module:highlight/highlightui~HighlightUI} plugins.
|
18
|
+
*/
|
19
|
+
export default class Highlight extends Plugin {
|
20
|
+
/**
|
21
|
+
* @inheritDoc
|
22
|
+
*/
|
23
|
+
static get requires(): readonly [typeof HighlightEditing, typeof HighlightUI];
|
24
|
+
/**
|
25
|
+
* @inheritDoc
|
26
|
+
*/
|
27
|
+
static get pluginName(): "Highlight";
|
28
|
+
}
|
package/src/highlight.js
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module highlight/highlight
|
7
|
-
*/
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
9
|
-
import HighlightEditing from './highlightediting';
|
10
|
-
import HighlightUI from './highlightui';
|
11
|
-
/**
|
12
|
-
* The highlight plugin.
|
13
|
-
*
|
14
|
-
* For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.
|
15
|
-
*
|
16
|
-
* This is a "glue" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and
|
17
|
-
* {@link module:highlight/highlightui~HighlightUI} plugins.
|
18
|
-
*/
|
19
|
-
export default class Highlight extends Plugin {
|
20
|
-
/**
|
21
|
-
* @inheritDoc
|
22
|
-
*/
|
23
|
-
static get requires() {
|
24
|
-
return [HighlightEditing, HighlightUI];
|
25
|
-
}
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
static get pluginName() {
|
30
|
-
return 'Highlight';
|
31
|
-
}
|
32
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module highlight/highlight
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
9
|
+
import HighlightEditing from './highlightediting';
|
10
|
+
import HighlightUI from './highlightui';
|
11
|
+
/**
|
12
|
+
* The highlight plugin.
|
13
|
+
*
|
14
|
+
* For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.
|
15
|
+
*
|
16
|
+
* This is a "glue" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and
|
17
|
+
* {@link module:highlight/highlightui~HighlightUI} plugins.
|
18
|
+
*/
|
19
|
+
export default class Highlight extends Plugin {
|
20
|
+
/**
|
21
|
+
* @inheritDoc
|
22
|
+
*/
|
23
|
+
static get requires() {
|
24
|
+
return [HighlightEditing, HighlightUI];
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
static get pluginName() {
|
30
|
+
return 'Highlight';
|
31
|
+
}
|
32
|
+
}
|
@@ -1,45 +1,45 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module highlight/highlightcommand
|
7
|
-
*/
|
8
|
-
import { Command } from 'ckeditor5/src/core';
|
9
|
-
/**
|
10
|
-
* The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
|
11
|
-
* to apply the text highlighting.
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* editor.execute( 'highlight', { value: 'greenMarker' } );
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed
|
18
|
-
* inside a text with the highlight attribute, the command will remove the attribute from the entire range
|
19
|
-
* of that text.
|
20
|
-
*/
|
21
|
-
export default class HighlightCommand extends Command {
|
22
|
-
/**
|
23
|
-
* A value indicating whether the command is active. If the selection has some highlight attribute,
|
24
|
-
* it corresponds to the value of that attribute.
|
25
|
-
*
|
26
|
-
* @observable
|
27
|
-
* @readonly
|
28
|
-
*/
|
29
|
-
value: string | undefined;
|
30
|
-
/**
|
31
|
-
* @inheritDoc
|
32
|
-
*/
|
33
|
-
refresh(): void;
|
34
|
-
/**
|
35
|
-
* Executes the command.
|
36
|
-
*
|
37
|
-
* @param options Options for the executed command.
|
38
|
-
* @param options.value The value to apply.
|
39
|
-
*
|
40
|
-
* @fires execute
|
41
|
-
*/
|
42
|
-
execute(options?: {
|
43
|
-
value?: string | null;
|
44
|
-
}): void;
|
45
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module highlight/highlightcommand
|
7
|
+
*/
|
8
|
+
import { Command } from 'ckeditor5/src/core';
|
9
|
+
/**
|
10
|
+
* The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
|
11
|
+
* to apply the text highlighting.
|
12
|
+
*
|
13
|
+
* ```ts
|
14
|
+
* editor.execute( 'highlight', { value: 'greenMarker' } );
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed
|
18
|
+
* inside a text with the highlight attribute, the command will remove the attribute from the entire range
|
19
|
+
* of that text.
|
20
|
+
*/
|
21
|
+
export default class HighlightCommand extends Command {
|
22
|
+
/**
|
23
|
+
* A value indicating whether the command is active. If the selection has some highlight attribute,
|
24
|
+
* it corresponds to the value of that attribute.
|
25
|
+
*
|
26
|
+
* @observable
|
27
|
+
* @readonly
|
28
|
+
*/
|
29
|
+
value: string | undefined;
|
30
|
+
/**
|
31
|
+
* @inheritDoc
|
32
|
+
*/
|
33
|
+
refresh(): void;
|
34
|
+
/**
|
35
|
+
* Executes the command.
|
36
|
+
*
|
37
|
+
* @param options Options for the executed command.
|
38
|
+
* @param options.value The value to apply.
|
39
|
+
*
|
40
|
+
* @fires execute
|
41
|
+
*/
|
42
|
+
execute(options?: {
|
43
|
+
value?: string | null;
|
44
|
+
}): void;
|
45
|
+
}
|
package/src/highlightcommand.js
CHANGED
@@ -1,91 +1,91 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module highlight/highlightcommand
|
7
|
-
*/
|
8
|
-
import { Command } from 'ckeditor5/src/core';
|
9
|
-
/**
|
10
|
-
* The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
|
11
|
-
* to apply the text highlighting.
|
12
|
-
*
|
13
|
-
* ```ts
|
14
|
-
* editor.execute( 'highlight', { value: 'greenMarker' } );
|
15
|
-
* ```
|
16
|
-
*
|
17
|
-
* **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed
|
18
|
-
* inside a text with the highlight attribute, the command will remove the attribute from the entire range
|
19
|
-
* of that text.
|
20
|
-
*/
|
21
|
-
export default class HighlightCommand extends Command {
|
22
|
-
/**
|
23
|
-
* @inheritDoc
|
24
|
-
*/
|
25
|
-
refresh() {
|
26
|
-
const model = this.editor.model;
|
27
|
-
const doc = model.document;
|
28
|
-
this.value = doc.selection.getAttribute('highlight');
|
29
|
-
this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'highlight');
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* Executes the command.
|
33
|
-
*
|
34
|
-
* @param options Options for the executed command.
|
35
|
-
* @param options.value The value to apply.
|
36
|
-
*
|
37
|
-
* @fires execute
|
38
|
-
*/
|
39
|
-
execute(options = {}) {
|
40
|
-
const model = this.editor.model;
|
41
|
-
const document = model.document;
|
42
|
-
const selection = document.selection;
|
43
|
-
const highlighter = options.value;
|
44
|
-
model.change(writer => {
|
45
|
-
if (selection.isCollapsed) {
|
46
|
-
const position = selection.getFirstPosition();
|
47
|
-
// When selection is inside text with `highlight` attribute.
|
48
|
-
if (selection.hasAttribute('highlight')) {
|
49
|
-
// Find the full highlighted range.
|
50
|
-
const isSameHighlight = (value) => {
|
51
|
-
return value.item.hasAttribute('highlight') && value.item.getAttribute('highlight') === this.value;
|
52
|
-
};
|
53
|
-
const highlightStart = position.getLastMatchingPosition(isSameHighlight, { direction: 'backward' });
|
54
|
-
const highlightEnd = position.getLastMatchingPosition(isSameHighlight);
|
55
|
-
const highlightRange = writer.createRange(highlightStart, highlightEnd);
|
56
|
-
// Then depending on current value...
|
57
|
-
if (!highlighter || this.value === highlighter) {
|
58
|
-
// ...remove attribute when passing highlighter different then current or executing "eraser".
|
59
|
-
// If we're at the end of the highlighted range, we don't want to remove highlight of the range.
|
60
|
-
if (!position.isEqual(highlightEnd)) {
|
61
|
-
writer.removeAttribute('highlight', highlightRange);
|
62
|
-
}
|
63
|
-
writer.removeSelectionAttribute('highlight');
|
64
|
-
}
|
65
|
-
else {
|
66
|
-
// ...update `highlight` value.
|
67
|
-
// If we're at the end of the highlighted range, we don't want to change the highlight of the range.
|
68
|
-
if (!position.isEqual(highlightEnd)) {
|
69
|
-
writer.setAttribute('highlight', highlighter, highlightRange);
|
70
|
-
}
|
71
|
-
writer.setSelectionAttribute('highlight', highlighter);
|
72
|
-
}
|
73
|
-
}
|
74
|
-
else if (highlighter) {
|
75
|
-
writer.setSelectionAttribute('highlight', highlighter);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
const ranges = model.schema.getValidRanges(selection.getRanges(), 'highlight');
|
80
|
-
for (const range of ranges) {
|
81
|
-
if (highlighter) {
|
82
|
-
writer.setAttribute('highlight', highlighter, range);
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
writer.removeAttribute('highlight', range);
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
});
|
90
|
-
}
|
91
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module highlight/highlightcommand
|
7
|
+
*/
|
8
|
+
import { Command } from 'ckeditor5/src/core';
|
9
|
+
/**
|
10
|
+
* The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
|
11
|
+
* to apply the text highlighting.
|
12
|
+
*
|
13
|
+
* ```ts
|
14
|
+
* editor.execute( 'highlight', { value: 'greenMarker' } );
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed
|
18
|
+
* inside a text with the highlight attribute, the command will remove the attribute from the entire range
|
19
|
+
* of that text.
|
20
|
+
*/
|
21
|
+
export default class HighlightCommand extends Command {
|
22
|
+
/**
|
23
|
+
* @inheritDoc
|
24
|
+
*/
|
25
|
+
refresh() {
|
26
|
+
const model = this.editor.model;
|
27
|
+
const doc = model.document;
|
28
|
+
this.value = doc.selection.getAttribute('highlight');
|
29
|
+
this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'highlight');
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Executes the command.
|
33
|
+
*
|
34
|
+
* @param options Options for the executed command.
|
35
|
+
* @param options.value The value to apply.
|
36
|
+
*
|
37
|
+
* @fires execute
|
38
|
+
*/
|
39
|
+
execute(options = {}) {
|
40
|
+
const model = this.editor.model;
|
41
|
+
const document = model.document;
|
42
|
+
const selection = document.selection;
|
43
|
+
const highlighter = options.value;
|
44
|
+
model.change(writer => {
|
45
|
+
if (selection.isCollapsed) {
|
46
|
+
const position = selection.getFirstPosition();
|
47
|
+
// When selection is inside text with `highlight` attribute.
|
48
|
+
if (selection.hasAttribute('highlight')) {
|
49
|
+
// Find the full highlighted range.
|
50
|
+
const isSameHighlight = (value) => {
|
51
|
+
return value.item.hasAttribute('highlight') && value.item.getAttribute('highlight') === this.value;
|
52
|
+
};
|
53
|
+
const highlightStart = position.getLastMatchingPosition(isSameHighlight, { direction: 'backward' });
|
54
|
+
const highlightEnd = position.getLastMatchingPosition(isSameHighlight);
|
55
|
+
const highlightRange = writer.createRange(highlightStart, highlightEnd);
|
56
|
+
// Then depending on current value...
|
57
|
+
if (!highlighter || this.value === highlighter) {
|
58
|
+
// ...remove attribute when passing highlighter different then current or executing "eraser".
|
59
|
+
// If we're at the end of the highlighted range, we don't want to remove highlight of the range.
|
60
|
+
if (!position.isEqual(highlightEnd)) {
|
61
|
+
writer.removeAttribute('highlight', highlightRange);
|
62
|
+
}
|
63
|
+
writer.removeSelectionAttribute('highlight');
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
// ...update `highlight` value.
|
67
|
+
// If we're at the end of the highlighted range, we don't want to change the highlight of the range.
|
68
|
+
if (!position.isEqual(highlightEnd)) {
|
69
|
+
writer.setAttribute('highlight', highlighter, highlightRange);
|
70
|
+
}
|
71
|
+
writer.setSelectionAttribute('highlight', highlighter);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
else if (highlighter) {
|
75
|
+
writer.setSelectionAttribute('highlight', highlighter);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
const ranges = model.schema.getValidRanges(selection.getRanges(), 'highlight');
|
80
|
+
for (const range of ranges) {
|
81
|
+
if (highlighter) {
|
82
|
+
writer.setAttribute('highlight', highlighter, range);
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
writer.removeAttribute('highlight', range);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
});
|
90
|
+
}
|
91
|
+
}
|