@ckeditor/ckeditor5-font 41.3.0-alpha.4 → 41.3.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.
Files changed (152) hide show
  1. package/build/font.js +1 -1
  2. package/build/translations/es-co.js +1 -0
  3. package/lang/translations/es-co.po +58 -0
  4. package/package.json +2 -3
  5. package/src/fontfamily/fontfamilyui.js +29 -2
  6. package/src/fontsize/fontsizeui.js +29 -2
  7. package/src/ui/colorui.js +51 -1
  8. package/dist/content-index.css +0 -16
  9. package/dist/editor-index.css +0 -4
  10. package/dist/index.css +0 -27
  11. package/dist/index.css.map +0 -1
  12. package/dist/translations/ar.d.ts +0 -8
  13. package/dist/translations/ar.js +0 -5
  14. package/dist/translations/az.d.ts +0 -8
  15. package/dist/translations/az.js +0 -5
  16. package/dist/translations/bg.d.ts +0 -8
  17. package/dist/translations/bg.js +0 -5
  18. package/dist/translations/bn.d.ts +0 -8
  19. package/dist/translations/bn.js +0 -5
  20. package/dist/translations/bs.d.ts +0 -8
  21. package/dist/translations/bs.js +0 -5
  22. package/dist/translations/ca.d.ts +0 -8
  23. package/dist/translations/ca.js +0 -5
  24. package/dist/translations/cs.d.ts +0 -8
  25. package/dist/translations/cs.js +0 -5
  26. package/dist/translations/da.d.ts +0 -8
  27. package/dist/translations/da.js +0 -5
  28. package/dist/translations/de-ch.d.ts +0 -8
  29. package/dist/translations/de-ch.js +0 -5
  30. package/dist/translations/de.d.ts +0 -8
  31. package/dist/translations/de.js +0 -5
  32. package/dist/translations/el.d.ts +0 -8
  33. package/dist/translations/el.js +0 -5
  34. package/dist/translations/en-au.d.ts +0 -8
  35. package/dist/translations/en-au.js +0 -5
  36. package/dist/translations/en-gb.d.ts +0 -8
  37. package/dist/translations/en-gb.js +0 -5
  38. package/dist/translations/en.d.ts +0 -8
  39. package/dist/translations/en.js +0 -5
  40. package/dist/translations/es.d.ts +0 -8
  41. package/dist/translations/es.js +0 -5
  42. package/dist/translations/et.d.ts +0 -8
  43. package/dist/translations/et.js +0 -5
  44. package/dist/translations/fa.d.ts +0 -8
  45. package/dist/translations/fa.js +0 -5
  46. package/dist/translations/fi.d.ts +0 -8
  47. package/dist/translations/fi.js +0 -5
  48. package/dist/translations/fr.d.ts +0 -8
  49. package/dist/translations/fr.js +0 -5
  50. package/dist/translations/gl.d.ts +0 -8
  51. package/dist/translations/gl.js +0 -5
  52. package/dist/translations/he.d.ts +0 -8
  53. package/dist/translations/he.js +0 -5
  54. package/dist/translations/hi.d.ts +0 -8
  55. package/dist/translations/hi.js +0 -5
  56. package/dist/translations/hr.d.ts +0 -8
  57. package/dist/translations/hr.js +0 -5
  58. package/dist/translations/hu.d.ts +0 -8
  59. package/dist/translations/hu.js +0 -5
  60. package/dist/translations/id.d.ts +0 -8
  61. package/dist/translations/id.js +0 -5
  62. package/dist/translations/it.d.ts +0 -8
  63. package/dist/translations/it.js +0 -5
  64. package/dist/translations/ja.d.ts +0 -8
  65. package/dist/translations/ja.js +0 -5
  66. package/dist/translations/jv.d.ts +0 -8
  67. package/dist/translations/jv.js +0 -5
  68. package/dist/translations/ko.d.ts +0 -8
  69. package/dist/translations/ko.js +0 -5
  70. package/dist/translations/ku.d.ts +0 -8
  71. package/dist/translations/ku.js +0 -5
  72. package/dist/translations/lt.d.ts +0 -8
  73. package/dist/translations/lt.js +0 -5
  74. package/dist/translations/lv.d.ts +0 -8
  75. package/dist/translations/lv.js +0 -5
  76. package/dist/translations/ms.d.ts +0 -8
  77. package/dist/translations/ms.js +0 -5
  78. package/dist/translations/nb.d.ts +0 -8
  79. package/dist/translations/nb.js +0 -5
  80. package/dist/translations/ne.d.ts +0 -8
  81. package/dist/translations/ne.js +0 -5
  82. package/dist/translations/nl.d.ts +0 -8
  83. package/dist/translations/nl.js +0 -5
  84. package/dist/translations/no.d.ts +0 -8
  85. package/dist/translations/no.js +0 -5
  86. package/dist/translations/pl.d.ts +0 -8
  87. package/dist/translations/pl.js +0 -5
  88. package/dist/translations/pt-br.d.ts +0 -8
  89. package/dist/translations/pt-br.js +0 -5
  90. package/dist/translations/pt.d.ts +0 -8
  91. package/dist/translations/pt.js +0 -5
  92. package/dist/translations/ro.d.ts +0 -8
  93. package/dist/translations/ro.js +0 -5
  94. package/dist/translations/ru.d.ts +0 -8
  95. package/dist/translations/ru.js +0 -5
  96. package/dist/translations/sk.d.ts +0 -8
  97. package/dist/translations/sk.js +0 -5
  98. package/dist/translations/sl.d.ts +0 -8
  99. package/dist/translations/sl.js +0 -5
  100. package/dist/translations/sq.d.ts +0 -8
  101. package/dist/translations/sq.js +0 -5
  102. package/dist/translations/sr-latn.d.ts +0 -8
  103. package/dist/translations/sr-latn.js +0 -5
  104. package/dist/translations/sr.d.ts +0 -8
  105. package/dist/translations/sr.js +0 -5
  106. package/dist/translations/sv.d.ts +0 -8
  107. package/dist/translations/sv.js +0 -5
  108. package/dist/translations/th.d.ts +0 -8
  109. package/dist/translations/th.js +0 -5
  110. package/dist/translations/tk.d.ts +0 -8
  111. package/dist/translations/tk.js +0 -5
  112. package/dist/translations/tr.d.ts +0 -8
  113. package/dist/translations/tr.js +0 -5
  114. package/dist/translations/ug.d.ts +0 -8
  115. package/dist/translations/ug.js +0 -5
  116. package/dist/translations/uk.d.ts +0 -8
  117. package/dist/translations/uk.js +0 -5
  118. package/dist/translations/ur.d.ts +0 -8
  119. package/dist/translations/ur.js +0 -5
  120. package/dist/translations/uz.d.ts +0 -8
  121. package/dist/translations/uz.js +0 -5
  122. package/dist/translations/vi.d.ts +0 -8
  123. package/dist/translations/vi.js +0 -5
  124. package/dist/translations/zh-cn.d.ts +0 -8
  125. package/dist/translations/zh-cn.js +0 -5
  126. package/dist/translations/zh.d.ts +0 -8
  127. package/dist/translations/zh.js +0 -5
  128. package/dist/types/augmentation.d.ts +0 -62
  129. package/dist/types/font.d.ts +0 -37
  130. package/dist/types/fontbackgroundcolor/fontbackgroundcolorcommand.d.ts +0 -30
  131. package/dist/types/fontbackgroundcolor/fontbackgroundcolorediting.d.ts +0 -30
  132. package/dist/types/fontbackgroundcolor/fontbackgroundcolorui.d.ts +0 -26
  133. package/dist/types/fontbackgroundcolor.d.ts +0 -34
  134. package/dist/types/fontcolor/fontcolorcommand.d.ts +0 -29
  135. package/dist/types/fontcolor/fontcolorediting.d.ts +0 -30
  136. package/dist/types/fontcolor/fontcolorui.d.ts +0 -26
  137. package/dist/types/fontcolor.d.ts +0 -33
  138. package/dist/types/fontcommand.d.ts +0 -52
  139. package/dist/types/fontconfig.d.ts +0 -377
  140. package/dist/types/fontfamily/fontfamilycommand.d.ts +0 -29
  141. package/dist/types/fontfamily/fontfamilyediting.d.ts +0 -43
  142. package/dist/types/fontfamily/fontfamilyui.d.ts +0 -34
  143. package/dist/types/fontfamily/utils.d.ts +0 -19
  144. package/dist/types/fontfamily.d.ts +0 -33
  145. package/dist/types/fontsize/fontsizecommand.d.ts +0 -29
  146. package/dist/types/fontsize/fontsizeediting.d.ts +0 -48
  147. package/dist/types/fontsize/fontsizeui.d.ts +0 -35
  148. package/dist/types/fontsize/utils.d.ts +0 -16
  149. package/dist/types/fontsize.d.ts +0 -41
  150. package/dist/types/index.d.ts +0 -31
  151. package/dist/types/ui/colorui.d.ts +0 -67
  152. package/dist/types/utils.d.ts +0 -84
package/build/font.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={485:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var n=o(935),r=o.n(n)()((function(e){return e[1]}));r.push([e.id,".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}",""]);const i=r},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,n){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(n)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(r[l]=!0)}for(var s=0;s<e.length;s++){var a=[].concat(e[s]);n&&r[a[0]]||(o&&(a[2]?a[2]="".concat(o," and ").concat(a[2]):a[2]=o),t.push(a))}},t}},591:(e,t,o)=>{"use strict";var n,r=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),l=[];function s(e){for(var t=-1,o=0;o<l.length;o++)if(l[o].identifier===e){t=o;break}return t}function a(e,t){for(var o={},n=[],r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],c=o[a]||0,u="".concat(a," ").concat(c);o[a]=c+1;var d=s(u),m={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(l[d].references++,l[d].updater(m)):l.push({identifier:u,updater:h(m,t),references:1}),n.push(u)}return n}function c(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var r=o.nc;r&&(n.nonce=r)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var l=i(e.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,o,n){var r=o?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,r);else{var i=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(i,l[t]):e.appendChild(i)}}function p(e,t,o){var n=o.css,r=o.media,i=o.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var g=null,f=0;function h(e,t){var o,n,r;if(t.singleton){var i=f++;o=g||(g=c(t)),n=m.bind(null,o,i,!1),r=m.bind(null,o,i,!0)}else o=c(t),n=p.bind(null,o,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(o)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var o=a(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<o.length;n++){var r=s(o[n]);l[r].references--}for(var i=a(e,t),c=0;c<o.length;c++){var u=s(o[c]);0===l[u].references&&(l[u].updater(),l.splice(u,1))}o=i}}}},782:(e,t,o)=>{e.exports=o(237)("./src/core.js")},783:(e,t,o)=>{e.exports=o(237)("./src/engine.js")},311:(e,t,o)=>{e.exports=o(237)("./src/ui.js")},584:(e,t,o)=>{e.exports=o(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var n={};(()=>{"use strict";o.r(n),o.d(n,{Font:()=>K,FontBackgroundColor:()=>I,FontBackgroundColorEditing:()=>H,FontBackgroundColorUI:()=>M,FontColor:()=>_,FontColorEditing:()=>O,FontColorUI:()=>D,FontFamily:()=>w,FontFamilyEditing:()=>h,FontFamilyUI:()=>b,FontSize:()=>P,FontSizeEditing:()=>L,FontSizeUI:()=>B});var e=o(782);class t extends e.Command{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,o=t.document.selection,n=e.value,r=e.batch,i=e=>{if(o.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,n):e.removeSelectionAttribute(this.attributeKey);else{const r=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of r)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}};r?t.enqueueChange(r,(e=>{i(e)})):t.change((e=>{i(e)}))}}var r=o(311);const i="fontSize",l="fontFamily",s="fontColor",a="fontBackgroundColor";function c(e,t){const o={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)o.model.values.push(e.model),o.view[e.model]=e.view,e.upcastAlso&&(o.upcastAlso[e.model]=e.upcastAlso);return o}function u(e){return t=>t.getStyle(e).replace(/\s/g,"")}function d(e){return(t,{writer:o})=>o.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class m extends t{constructor(e){super(e,l)}}function p(e){return e.map(g).filter((e=>void 0!==e))}function g(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),o=t[0],n=t.map(f).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}(e):void 0}function f(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class h extends e.Plugin{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define(l,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:l}),e.model.schema.setAttributeProperties(l,{isFormatting:!0,copyOnEnter:!0});const t=p(e.config.get("fontFamily.options")).filter((e=>e.model)),o=c(l,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(o),e.commands.add(l,new m(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:l,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:l,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:l,value:e=>e.getAttribute("face")}})}}var v=o(584);class b extends e.Plugin{static get pluginName(){return"FontFamilyUI"}init(){const e=this.editor,t=e.t,o=this._getLocalizedOptions(),n=e.commands.get(l),i=t("Font Family");e.ui.componentFactory.add(l,(t=>{const s=(0,r.createDropdown)(t);return(0,r.addListToDropdown)(s,(()=>function(e,t){const o=new v.Collection;for(const n of e){const e={type:"button",model:new r.ViewModel({commandName:l,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===n.model||!(!e||!n.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase())),n.view&&"string"!=typeof n.view&&n.view.styles&&e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(e)}return o}(o,n)),{role:"menu",ariaLabel:i}),s.buttonView.set({label:i,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>',tooltip:!0}),s.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),s.bind("isEnabled").to(n),this.listenTo(s,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),s}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return p(e.config.get(l).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class w extends e.Plugin{static get requires(){return[h,b]}static get pluginName(){return"FontFamily"}}var y=o(783);class x extends t{constructor(e){super(e,i)}}function C(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return S(e);var t;const o=function(e){return"string"==typeof e?F[e]:F[e.model]}(e);if(o)return S(o);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new v.CKEditorError("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},S(e)}(e)}(e))).filter((e=>void 0!==e))}const F={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function S(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const A=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class L extends e.Plugin{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define(i,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:i}),e.model.schema.setAttributeProperties(i,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),o=C(this.editor.config.get("fontSize.options")).filter((e=>e.model)),n=c(i,o);t?(this._prepareAnyValueConverters(n),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(i,new x(e))}_prepareAnyValueConverters(e){const t=this.editor,o=e.model.values.filter((e=>!(0,y.isLength)(String(e))&&!(0,y.isPercentage)(String(e))));if(o.length)throw new v.CKEditorError("font-size-invalid-use-of-named-presets",null,{presets:o});t.conversion.for("downcast").attributeToElement({model:i,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:i,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:i,value:e=>{const t=e.getAttribute("size"),o="-"===t[0]||"+"===t[0];let n=parseInt(t,10);o&&(n=3+n);const r=A.length-1,i=Math.min(Math.max(n,0),r);return A[i]}}})}}var z=o(591),T=o.n(z),k=o(485),N={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};T()(k.A,N);k.A.locals;class B extends e.Plugin{static get pluginName(){return"FontSizeUI"}init(){const e=this.editor,t=e.t,o=this._getLocalizedOptions(),n=e.commands.get(i),l=t("Font Size");e.ui.componentFactory.add(i,(t=>{const s=(0,r.createDropdown)(t);return(0,r.addListToDropdown)(s,(()=>function(e,t){const o=new v.Collection;for(const n of e){const e={type:"button",model:new r.ViewModel({commandName:i,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&"string"!=typeof n.view&&(n.view.styles&&e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&e.model.set("class",`${e.model.class} ${n.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===n.model)),o.add(e)}return o}(o,n)),{role:"menu",ariaLabel:l}),s.buttonView.set({label:l,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>',tooltip:!0}),s.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),s.bind("isEnabled").to(n),this.listenTo(s,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),s}))}_getLocalizedOptions(){const e=this.editor,t=e.t,o={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return C(e.config.get(i).options).map((e=>{const t=o[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class P extends e.Plugin{static get requires(){return[L,B]}static get pluginName(){return"FontSize"}normalizeSizeOptions(e){return C(e)}}class E extends t{constructor(e){super(e,s)}}class O extends e.Plugin{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(s,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:s,value:u("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:s,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:s,view:d("color")}),e.commands.add(s,new E(e)),e.model.schema.extend("$text",{allowAttributes:s}),e.model.schema.setAttributeProperties(s,{isFormatting:!0,copyOnEnter:!0})}}class V extends e.Plugin{constructor(e,{commandName:t,componentName:o,icon:n,dropdownLabel:r}){super(e),this.commandName=t,this.componentName=o,this.icon=n,this.dropdownLabel=r,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,o=t.t,n=e.commands.get(this.commandName),i=e.config.get(this.componentName),l=(0,r.normalizeColorOptions)(i.colors),s=(0,r.getLocalizedColorOptions)(t,l),a=i.documentColors,c=!1!==i.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const l=(0,r.createDropdown)(t);let u=!1;const d=function({dropdownView:e,colors:t,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:l,documentColorsCount:s,colorPickerViewConfig:a}){const c=e.locale,u=new r.ColorSelectorView(c,{colors:t,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:l,documentColorsCount:s,colorPickerViewConfig:a});return e.colorSelectorView=u,e.panelView.children.add(u),u}({dropdownView:l,colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:o("Remove color"),colorPickerLabel:o("Color picker"),documentColorsLabel:0!==a?o("Document colors"):"",documentColorsCount:void 0===a?this.columns:a,colorPickerViewConfig:!!c&&(i.colorPicker||{})});return d.bind("selectedColor").to(n,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(n),d.on("execute",((t,o)=>{l.isOpen&&e.execute(this.commandName,{value:o.value,batch:this._undoStepBatch}),"colorPicker"!==o.source&&e.editing.view.focus(),"colorPickerSaveButton"===o.source&&(l.isOpen=!1)})),d.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),d.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),l.on("change:isOpen",((t,o,n)=>{u||(u=!0,l.colorSelectorView.appendUI()),n&&(0!==a&&d.updateDocumentColors(e.model,this.componentName),d.updateSelectedColors(),d.showColorGridsFragment())})),(0,r.focusChildOnDropdownOpen)(l,(()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),l}))}}class D extends V{constructor(e){const t=e.locale.t;super(e,{commandName:s,componentName:s,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class _ extends e.Plugin{static get requires(){return[O,D]}static get pluginName(){return"FontColor"}}class j extends t{constructor(e){super(e,a)}}class H extends e.Plugin{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(a,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(y.addBackgroundRules),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:a,value:u("background-color")}}),e.conversion.for("downcast").attributeToElement({model:a,view:d("background-color")}),e.commands.add(a,new j(e)),e.model.schema.extend("$text",{allowAttributes:a}),e.model.schema.setAttributeProperties(a,{isFormatting:!0,copyOnEnter:!0})}}class M extends V{constructor(e){const t=e.locale.t;super(e,{commandName:a,componentName:a,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class I extends e.Plugin{static get requires(){return[H,M]}static get pluginName(){return"FontBackgroundColor"}}class K extends e.Plugin{static get requires(){return[w,P,_,I]}static get pluginName(){return"Font"}}})(),(window.CKEditor5=window.CKEditor5||{}).font=n})();
5
+ */(()=>{var e={485:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var n=o(935),r=o.n(n)()((function(e){return e[1]}));r.push([e.id,".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}",""]);const i=r},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,n){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(n)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(r[l]=!0)}for(var s=0;s<e.length;s++){var a=[].concat(e[s]);n&&r[a[0]]||(o&&(a[2]?a[2]="".concat(o," and ").concat(a[2]):a[2]=o),t.push(a))}},t}},591:(e,t,o)=>{"use strict";var n,r=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),l=[];function s(e){for(var t=-1,o=0;o<l.length;o++)if(l[o].identifier===e){t=o;break}return t}function a(e,t){for(var o={},n=[],r=0;r<e.length;r++){var i=e[r],a=t.base?i[0]+t.base:i[0],c=o[a]||0,u="".concat(a," ").concat(c);o[a]=c+1;var d=s(u),m={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(l[d].references++,l[d].updater(m)):l.push({identifier:u,updater:h(m,t),references:1}),n.push(u)}return n}function c(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var r=o.nc;r&&(n.nonce=r)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var l=i(e.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,o,n){var r=o?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,r);else{var i=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(i,l[t]):e.appendChild(i)}}function p(e,t,o){var n=o.css,r=o.media,i=o.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var g=null,f=0;function h(e,t){var o,n,r;if(t.singleton){var i=f++;o=g||(g=c(t)),n=m.bind(null,o,i,!1),r=m.bind(null,o,i,!0)}else o=c(t),n=p.bind(null,o,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(o)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var o=a(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<o.length;n++){var r=s(o[n]);l[r].references--}for(var i=a(e,t),c=0;c<o.length;c++){var u=s(o[c]);0===l[u].references&&(l[u].updater(),l.splice(u,1))}o=i}}}},782:(e,t,o)=>{e.exports=o(237)("./src/core.js")},783:(e,t,o)=>{e.exports=o(237)("./src/engine.js")},311:(e,t,o)=>{e.exports=o(237)("./src/ui.js")},584:(e,t,o)=>{e.exports=o(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var n={};(()=>{"use strict";o.r(n),o.d(n,{Font:()=>R,FontBackgroundColor:()=>K,FontBackgroundColorEditing:()=>H,FontBackgroundColorUI:()=>$,FontColor:()=>I,FontColorEditing:()=>M,FontColorUI:()=>j,FontFamily:()=>y,FontFamilyEditing:()=>h,FontFamilyUI:()=>w,FontSize:()=>E,FontSizeEditing:()=>k,FontSizeUI:()=>P});var e=o(782);class t extends e.Command{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,o=t.document.selection,n=e.value,r=e.batch,i=e=>{if(o.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,n):e.removeSelectionAttribute(this.attributeKey);else{const r=t.schema.getValidRanges(o.getRanges(),this.attributeKey);for(const t of r)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}};r?t.enqueueChange(r,(e=>{i(e)})):t.change((e=>{i(e)}))}}var r=o(311);const i="fontSize",l="fontFamily",s="fontColor",a="fontBackgroundColor";function c(e,t){const o={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)o.model.values.push(e.model),o.view[e.model]=e.view,e.upcastAlso&&(o.upcastAlso[e.model]=e.upcastAlso);return o}function u(e){return t=>t.getStyle(e).replace(/\s/g,"")}function d(e){return(t,{writer:o})=>o.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class m extends t{constructor(e){super(e,l)}}function p(e){return e.map(g).filter((e=>void 0!==e))}function g(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),o=t[0],n=t.map(f).join(", ");return{title:o,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}(e):void 0}function f(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class h extends e.Plugin{static get pluginName(){return"FontFamilyEditing"}constructor(e){super(e),e.config.define(l,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:l}),e.model.schema.setAttributeProperties(l,{isFormatting:!0,copyOnEnter:!0});const t=p(e.config.get("fontFamily.options")).filter((e=>e.model)),o=c(l,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(o),e.commands.add(l,new m(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:l,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:l,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:l,value:e=>e.getAttribute("face")}})}}var b=o(584);const v='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>';class w extends e.Plugin{static get pluginName(){return"FontFamilyUI"}init(){const e=this.editor,t=e.t,o=this._getLocalizedOptions(),n=e.commands.get(l),i=t("Font Family"),s=function(e,t){const o=new b.Collection;for(const n of e){const e={type:"button",model:new r.ViewModel({commandName:l,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===n.model||!(!e||!n.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase())),n.view&&"string"!=typeof n.view&&n.view.styles&&e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),o.add(e)}return o}(o,n);e.ui.componentFactory.add(l,(t=>{const o=(0,r.createDropdown)(t);return(0,r.addListToDropdown)(o,s,{role:"menu",ariaLabel:i}),o.buttonView.set({label:i,icon:v,tooltip:!0}),o.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),o.bind("isEnabled").to(n),this.listenTo(o,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),o})),e.ui.componentFactory.add(`menuBar:${l}`,(t=>{const o=new r.MenuBarMenuView(t);o.buttonView.set({label:i,icon:v}),o.bind("isEnabled").to(n);const l=new r.MenuBarMenuListView(t);for(const n of s){const i=new r.MenuBarMenuListItemView(t,o),s=new r.MenuBarMenuListItemButtonView(t);s.bind(...Object.keys(n.model)).to(n.model),s.bind("ariaChecked").to(s,"isOn"),s.delegate("execute").to(o),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),i.children.add(s),l.items.add(i)}return o.panelView.children.add(l),o}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return p(e.config.get(l).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class y extends e.Plugin{static get requires(){return[h,w]}static get pluginName(){return"FontFamily"}}var C=o(783);class x extends t{constructor(e){super(e,i)}}function F(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return L(e);var t;const o=function(e){return"string"==typeof e?S[e]:S[e.model]}(e);if(o)return L(o);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new b.CKEditorError("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},L(e)}(e)}(e))).filter((e=>void 0!==e))}const S={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function L(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const B=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class k extends e.Plugin{static get pluginName(){return"FontSizeEditing"}constructor(e){super(e),e.config.define(i,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:i}),e.model.schema.setAttributeProperties(i,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),o=F(this.editor.config.get("fontSize.options")).filter((e=>e.model)),n=c(i,o);t?(this._prepareAnyValueConverters(n),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(i,new x(e))}_prepareAnyValueConverters(e){const t=this.editor,o=e.model.values.filter((e=>!(0,C.isLength)(String(e))&&!(0,C.isPercentage)(String(e))));if(o.length)throw new b.CKEditorError("font-size-invalid-use-of-named-presets",null,{presets:o});t.conversion.for("downcast").attributeToElement({model:i,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:i,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:i,value:e=>{const t=e.getAttribute("size"),o="-"===t[0]||"+"===t[0];let n=parseInt(t,10);o&&(n=3+n);const r=B.length-1,i=Math.min(Math.max(n,0),r);return B[i]}}})}}var A=o(591),z=o.n(A),N=o(485),T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};z()(N.A,T);N.A.locals;const V='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>';class P extends e.Plugin{static get pluginName(){return"FontSizeUI"}init(){const e=this.editor,t=e.t,o=this._getLocalizedOptions(),n=e.commands.get(i),l=t("Font Size"),s=function(e,t){const o=new b.Collection;for(const n of e){const e={type:"button",model:new r.ViewModel({commandName:i,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&"string"!=typeof n.view&&(n.view.styles&&e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&e.model.set("class",`${e.model.class} ${n.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===n.model)),o.add(e)}return o}(o,n);e.ui.componentFactory.add(i,(t=>{const o=(0,r.createDropdown)(t);return(0,r.addListToDropdown)(o,s,{role:"menu",ariaLabel:l}),o.buttonView.set({label:l,icon:V,tooltip:!0}),o.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),o.bind("isEnabled").to(n),this.listenTo(o,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),o})),e.ui.componentFactory.add(`menuBar:${i}`,(t=>{const o=new r.MenuBarMenuView(t);o.buttonView.set({label:l,icon:V}),o.bind("isEnabled").to(n);const i=new r.MenuBarMenuListView(t);for(const n of s){const l=new r.MenuBarMenuListItemView(t,o),s=new r.MenuBarMenuListItemButtonView(t);s.bind(...Object.keys(n.model)).to(n.model),s.bind("ariaChecked").to(s,"isOn"),s.delegate("execute").to(o),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),l.children.add(s),i.items.add(l)}return o.panelView.children.add(i),o}))}_getLocalizedOptions(){const e=this.editor,t=e.t,o={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return F(e.config.get(i).options).map((e=>{const t=o[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class E extends e.Plugin{static get requires(){return[k,P]}static get pluginName(){return"FontSize"}normalizeSizeOptions(e){return F(e)}}class O extends t{constructor(e){super(e,s)}}class M extends e.Plugin{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(s,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:s,value:u("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:s,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:s,view:d("color")}),e.commands.add(s,new O(e)),e.model.schema.extend("$text",{allowAttributes:s}),e.model.schema.setAttributeProperties(s,{isFormatting:!0,copyOnEnter:!0})}}class D extends e.Plugin{constructor(e,{commandName:t,componentName:o,icon:n,dropdownLabel:r}){super(e),this.commandName=t,this.componentName=o,this.icon=n,this.dropdownLabel=r,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,o=t.t,n=e.commands.get(this.commandName),i=e.config.get(this.componentName),l=(0,r.normalizeColorOptions)(i.colors),s=(0,r.getLocalizedColorOptions)(t,l),a=i.documentColors,c=!1!==i.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const l=(0,r.createDropdown)(t);let u=!1;const d=function({dropdownView:e,colors:t,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:l,documentColorsCount:s,colorPickerViewConfig:a}){const c=e.locale,u=new r.ColorSelectorView(c,{colors:t,columns:o,removeButtonLabel:n,colorPickerLabel:i,documentColorsLabel:l,documentColorsCount:s,colorPickerViewConfig:a});return e.colorSelectorView=u,e.panelView.children.add(u),u}({dropdownView:l,colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:o("Remove color"),colorPickerLabel:o("Color picker"),documentColorsLabel:0!==a?o("Document colors"):"",documentColorsCount:void 0===a?this.columns:a,colorPickerViewConfig:!!c&&(i.colorPicker||{})});return d.bind("selectedColor").to(n,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(n),d.on("execute",((t,o)=>{l.isOpen&&e.execute(this.commandName,{value:o.value,batch:this._undoStepBatch}),"colorPicker"!==o.source&&e.editing.view.focus(),"colorPickerSaveButton"===o.source&&(l.isOpen=!1)})),d.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),d.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),l.on("change:isOpen",((t,o,n)=>{u||(u=!0,l.colorSelectorView.appendUI()),n&&(0!==a&&d.updateDocumentColors(e.model,this.componentName),d.updateSelectedColors(),d.showColorGridsFragment())})),(0,r.focusChildOnDropdownOpen)(l,(()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),l})),e.ui.componentFactory.add(`menuBar:${this.componentName}`,(t=>{const i=new r.MenuBarMenuView(t);i.buttonView.set({label:this.dropdownLabel,icon:this.icon}),i.bind("isEnabled").to(n);let l=!1;const c=new r.ColorSelectorView(t,{colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:o("Remove color"),colorPickerLabel:o("Color picker"),documentColorsLabel:0!==a?o("Document colors"):"",documentColorsCount:void 0===a?this.columns:a,colorPickerViewConfig:!1});return c.bind("selectedColor").to(n,"value"),c.delegate("execute").to(i),c.on("execute",((t,o)=>{e.execute(this.commandName,{value:o.value,batch:this._undoStepBatch}),e.editing.view.focus()})),i.on("change:isOpen",((t,o,n)=>{l||(l=!0,c.appendUI()),n&&(0!==a&&c.updateDocumentColors(e.model,this.componentName),c.updateSelectedColors(),c.showColorGridsFragment())})),i.panelView.children.add(c),i}))}}class j extends D{constructor(e){const t=e.locale.t;super(e,{commandName:s,componentName:s,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class I extends e.Plugin{static get requires(){return[M,j]}static get pluginName(){return"FontColor"}}class _ extends t{constructor(e){super(e,a)}}class H extends e.Plugin{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(a,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(C.addBackgroundRules),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:a,value:u("background-color")}}),e.conversion.for("downcast").attributeToElement({model:a,view:d("background-color")}),e.commands.add(a,new _(e)),e.model.schema.extend("$text",{allowAttributes:a}),e.model.schema.setAttributeProperties(a,{isFormatting:!0,copyOnEnter:!0})}}class $ extends D{constructor(e){const t=e.locale.t;super(e,{commandName:a,componentName:a,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class K extends e.Plugin{static get requires(){return[H,$]}static get pluginName(){return"FontBackgroundColor"}}class R extends e.Plugin{static get requires(){return[y,E,I,K]}static get pluginName(){return"Font"}}})(),(window.CKEditor5=window.CKEditor5||{}).font=n})();
@@ -0,0 +1 @@
1
+ !function(o){const e=o["es-co"]=o["es-co"]||{};e.dictionary=Object.assign(e.dictionary||{},{Big:"Grande",Default:"Por defecto","Document colors":"Colores del documento","Font Background Color":"Color de fondo de fuente","Font Color":"Color de fuente","Font Family":"Familia de fuente","Font Size":"Tamaño de fuente",Huge:"Enorme",Small:"Pequeña",Tiny:"Diminuta"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1,58 @@
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Spanish (Colombia) (https://app.transifex.com/ckeditor/teams/11143/es_CO/)\n"
16
+ "Language: es_CO\n"
17
+ "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+
20
+ msgctxt "Tooltip for the font size dropdown."
21
+ msgid "Font Size"
22
+ msgstr "Tamaño de fuente"
23
+
24
+ msgctxt "Dropdown option label for the 'tiny' font size preset."
25
+ msgid "Tiny"
26
+ msgstr "Diminuta"
27
+
28
+ msgctxt "Dropdown option label for the 'small' font size preset."
29
+ msgid "Small"
30
+ msgstr "Pequeña"
31
+
32
+ msgctxt "Dropdown option label for the 'big' font size preset."
33
+ msgid "Big"
34
+ msgstr "Grande"
35
+
36
+ msgctxt "Dropdown option label for the 'huge' font size preset."
37
+ msgid "Huge"
38
+ msgstr "Enorme"
39
+
40
+ msgctxt "Tooltip for the font family dropdown."
41
+ msgid "Font Family"
42
+ msgstr "Familia de fuente"
43
+
44
+ msgctxt "Dropdown option label for the default font family."
45
+ msgid "Default"
46
+ msgstr "Por defecto"
47
+
48
+ msgctxt "Label of a button that allows selecting a font color."
49
+ msgid "Font Color"
50
+ msgstr "Color de fuente"
51
+
52
+ msgctxt "Label of a button that allows selecting a font background color."
53
+ msgid "Font Background Color"
54
+ msgstr "Color de fondo de fuente"
55
+
56
+ msgctxt "Title of a color picker section containing the colors currently used in the document."
57
+ msgid "Document colors"
58
+ msgstr "Colores del documento"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-font",
3
- "version": "41.3.0-alpha.4",
3
+ "version": "41.3.0",
4
4
  "description": "Font feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,7 +13,7 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "ckeditor5": "41.3.0-alpha.4"
16
+ "ckeditor5": "41.3.0"
17
17
  },
18
18
  "author": "CKSource (http://cksource.com/)",
19
19
  "license": "GPL-2.0-or-later",
@@ -25,7 +25,6 @@
25
25
  "directory": "packages/ckeditor5-font"
26
26
  },
27
27
  "files": [
28
- "dist",
29
28
  "lang",
30
29
  "src/**/*.js",
31
30
  "src/**/*.d.ts",
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { Collection } from 'ckeditor5/src/utils.js';
10
- import { ViewModel, createDropdown, addListToDropdown } from 'ckeditor5/src/ui.js';
10
+ import { ViewModel, createDropdown, addListToDropdown, MenuBarMenuView, MenuBarMenuListView, MenuBarMenuListItemView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
11
11
  import { normalizeOptions } from './utils.js';
12
12
  import { FONT_FAMILY } from '../utils.js';
13
13
  import fontFamilyIcon from '../../theme/icons/font-family.svg';
@@ -30,10 +30,11 @@ export default class FontFamilyUI extends Plugin {
30
30
  const options = this._getLocalizedOptions();
31
31
  const command = editor.commands.get(FONT_FAMILY);
32
32
  const accessibleLabel = t('Font Family');
33
+ const listOptions = _prepareListOptions(options, command);
33
34
  // Register UI component.
34
35
  editor.ui.componentFactory.add(FONT_FAMILY, locale => {
35
36
  const dropdownView = createDropdown(locale);
36
- addListToDropdown(dropdownView, () => _prepareListOptions(options, command), {
37
+ addListToDropdown(dropdownView, listOptions, {
37
38
  role: 'menu',
38
39
  ariaLabel: accessibleLabel
39
40
  });
@@ -55,6 +56,32 @@ export default class FontFamilyUI extends Plugin {
55
56
  });
56
57
  return dropdownView;
57
58
  });
59
+ editor.ui.componentFactory.add(`menuBar:${FONT_FAMILY}`, locale => {
60
+ const menuView = new MenuBarMenuView(locale);
61
+ menuView.buttonView.set({
62
+ label: accessibleLabel,
63
+ icon: fontFamilyIcon
64
+ });
65
+ menuView.bind('isEnabled').to(command);
66
+ const listView = new MenuBarMenuListView(locale);
67
+ for (const definition of listOptions) {
68
+ const listItemView = new MenuBarMenuListItemView(locale, menuView);
69
+ const buttonView = new MenuBarMenuListItemButtonView(locale);
70
+ buttonView.bind(...Object.keys(definition.model)).to(definition.model);
71
+ buttonView.bind('ariaChecked').to(buttonView, 'isOn');
72
+ buttonView.delegate('execute').to(menuView);
73
+ buttonView.on('execute', () => {
74
+ editor.execute(definition.model.commandName, {
75
+ value: definition.model.commandParam
76
+ });
77
+ editor.editing.view.focus();
78
+ });
79
+ listItemView.children.add(buttonView);
80
+ listView.items.add(listItemView);
81
+ }
82
+ menuView.panelView.children.add(listView);
83
+ return menuView;
84
+ });
58
85
  }
59
86
  /**
60
87
  * Returns options as defined in `config.fontFamily.options` but processed to account for
@@ -6,7 +6,7 @@
6
6
  * @module font/fontsize/fontsizeui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ViewModel, createDropdown, addListToDropdown } from 'ckeditor5/src/ui.js';
9
+ import { ViewModel, createDropdown, addListToDropdown, MenuBarMenuView, MenuBarMenuListView, MenuBarMenuListItemView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
10
  import { Collection } from 'ckeditor5/src/utils.js';
11
11
  import { normalizeOptions } from './utils.js';
12
12
  import { FONT_SIZE } from '../utils.js';
@@ -31,10 +31,11 @@ export default class FontSizeUI extends Plugin {
31
31
  const options = this._getLocalizedOptions();
32
32
  const command = editor.commands.get(FONT_SIZE);
33
33
  const accessibleLabel = t('Font Size');
34
+ const listOptions = _prepareListOptions(options, command);
34
35
  // Register UI component.
35
36
  editor.ui.componentFactory.add(FONT_SIZE, locale => {
36
37
  const dropdownView = createDropdown(locale);
37
- addListToDropdown(dropdownView, () => _prepareListOptions(options, command), {
38
+ addListToDropdown(dropdownView, listOptions, {
38
39
  role: 'menu',
39
40
  ariaLabel: accessibleLabel
40
41
  });
@@ -59,6 +60,32 @@ export default class FontSizeUI extends Plugin {
59
60
  });
60
61
  return dropdownView;
61
62
  });
63
+ editor.ui.componentFactory.add(`menuBar:${FONT_SIZE}`, locale => {
64
+ const menuView = new MenuBarMenuView(locale);
65
+ menuView.buttonView.set({
66
+ label: accessibleLabel,
67
+ icon: fontSizeIcon
68
+ });
69
+ menuView.bind('isEnabled').to(command);
70
+ const listView = new MenuBarMenuListView(locale);
71
+ for (const definition of listOptions) {
72
+ const listItemView = new MenuBarMenuListItemView(locale, menuView);
73
+ const buttonView = new MenuBarMenuListItemButtonView(locale);
74
+ buttonView.bind(...Object.keys(definition.model)).to(definition.model);
75
+ buttonView.bind('ariaChecked').to(buttonView, 'isOn');
76
+ buttonView.delegate('execute').to(menuView);
77
+ buttonView.on('execute', () => {
78
+ editor.execute(definition.model.commandName, {
79
+ value: definition.model.commandParam
80
+ });
81
+ editor.editing.view.focus();
82
+ });
83
+ listItemView.children.add(buttonView);
84
+ listView.items.add(listItemView);
85
+ }
86
+ menuView.panelView.children.add(listView);
87
+ return menuView;
88
+ });
62
89
  }
63
90
  /**
64
91
  * Returns options as defined in `config.fontSize.options` but processed to account for
package/src/ui/colorui.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * @module font/ui/colorui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { createDropdown, normalizeColorOptions, getLocalizedColorOptions, focusChildOnDropdownOpen } from 'ckeditor5/src/ui.js';
9
+ import { createDropdown, normalizeColorOptions, getLocalizedColorOptions, focusChildOnDropdownOpen, MenuBarMenuView, ColorSelectorView } from 'ckeditor5/src/ui.js';
10
10
  import { addColorSelectorToDropdown } from '../utils.js';
11
11
  /**
12
12
  * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
@@ -125,5 +125,55 @@ export default class ColorUI extends Plugin {
125
125
  focusChildOnDropdownOpen(dropdownView, () => dropdownView.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((item) => item.isOn));
126
126
  return dropdownView;
127
127
  });
128
+ // Register menu bar button..
129
+ editor.ui.componentFactory.add(`menuBar:${this.componentName}`, locale => {
130
+ const menuView = new MenuBarMenuView(locale);
131
+ menuView.buttonView.set({
132
+ label: this.dropdownLabel,
133
+ icon: this.icon
134
+ });
135
+ menuView.bind('isEnabled').to(command);
136
+ // Font color sub-menu rendering is deferred once it gets open to improve performance (#6192).
137
+ let contentRendered = false;
138
+ const colorSelectorView = new ColorSelectorView(locale, {
139
+ colors: localizedColors.map(option => ({
140
+ label: option.label,
141
+ color: option.model,
142
+ options: {
143
+ hasBorder: option.hasBorder
144
+ }
145
+ })),
146
+ columns: this.columns,
147
+ removeButtonLabel: t('Remove color'),
148
+ colorPickerLabel: t('Color picker'),
149
+ documentColorsLabel: documentColorsCount !== 0 ? t('Document colors') : '',
150
+ documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount,
151
+ colorPickerViewConfig: false
152
+ });
153
+ colorSelectorView.bind('selectedColor').to(command, 'value');
154
+ colorSelectorView.delegate('execute').to(menuView);
155
+ colorSelectorView.on('execute', (evt, data) => {
156
+ editor.execute(this.commandName, {
157
+ value: data.value,
158
+ batch: this._undoStepBatch
159
+ });
160
+ editor.editing.view.focus();
161
+ });
162
+ menuView.on('change:isOpen', (evt, name, isVisible) => {
163
+ if (!contentRendered) {
164
+ contentRendered = true;
165
+ colorSelectorView.appendUI();
166
+ }
167
+ if (isVisible) {
168
+ if (documentColorsCount !== 0) {
169
+ colorSelectorView.updateDocumentColors(editor.model, this.componentName);
170
+ }
171
+ colorSelectorView.updateSelectedColors();
172
+ colorSelectorView.showColorGridsFragment();
173
+ }
174
+ });
175
+ menuView.panelView.children.add(colorSelectorView);
176
+ return menuView;
177
+ });
128
178
  }
129
179
  }
@@ -1,16 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- .ck-content .text-tiny {
6
- font-size: .7em;
7
- }
8
- .ck-content .text-small {
9
- font-size: .85em;
10
- }
11
- .ck-content .text-big {
12
- font-size: 1.4em;
13
- }
14
- .ck-content .text-huge {
15
- font-size: 1.8em;
16
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
package/dist/index.css DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
-
10
- /* The values should be synchronized with the "FONT_SIZE_PRESET_UNITS" object in the "/src/fontsize/utils.js" file. */
11
-
12
- /* Styles should be prefixed with the `.ck-content` class.
13
- See https://github.com/ckeditor/ckeditor5/issues/6636 */
14
- .ck-content .text-tiny {
15
- font-size: .7em;
16
- }
17
- .ck-content .text-small {
18
- font-size: .85em;
19
- }
20
- .ck-content .text-big {
21
- font-size: 1.4em;
22
- }
23
- .ck-content .text-huge {
24
- font-size: 1.8em;
25
- }
26
-
27
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../theme/fontsize.css","index.css"],"names":[],"mappings":";;;;AAAA,CAAA,CAAA;ACCA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5E,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO;AACnF,CAAC,CDAC,CAAA;ACCF;ADCA,CAAA,CAAA,CAAA,GAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,CAAA,YAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,sBAAA,CAAA,CAAA,MAAA,CAAA,EAAA,CAAA,GAAA,CAAA,CAAA,CAAA,GAAA,CAAA,QAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAqH,CAAA;ACCrH;ADCA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,CAAA,QAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,KAAA,CAAA;ACCA,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CDAC,CAAA;AAEtD,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;ACAD,CAAC,CDCC,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,GAAe,CAAA;ACAjB,CDCC,CAAA;AAEA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;ACDD,CAAC,CDEC,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,IAAgB,CAAA;ACDlB,CDEC,CAAA;AAEA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA;ACFD,CAAC,CDGC,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,GAAgB,CAAA;ACFlB,CDGC,CAAA;AAEA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;ACHD,CAAC,CDIC,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,GAAgB,CAAA;ACHlB,CDIC,CAAA;ACHD;AACA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2024, 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/* The values should be synchronized with the \"FONT_SIZE_PRESET_UNITS\" object in the \"/src/fontsize/utils.js\" file. */\n\n/* Styles should be prefixed with the `.ck-content` class.\nSee https://github.com/ckeditor/ckeditor5/issues/6636 */\n.ck-content {\n\t& .text-tiny {\n\t\tfont-size: .7em;\n\t}\n\n\t& .text-small {\n\t\tfont-size: .85em;\n\t}\n\n\t& .text-big {\n\t\tfont-size: 1.4em;\n\t}\n\n\t& .text-huge {\n\t\tfont-size: 1.8em;\n\t}\n}\n","/*\n * Copyright (c) 2003-2024, 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/* The values should be synchronized with the \"FONT_SIZE_PRESET_UNITS\" object in the \"/src/fontsize/utils.js\" file. */\n\n/* Styles should be prefixed with the `.ck-content` class.\nSee https://github.com/ckeditor/ckeditor5/issues/6636 */\n.ck-content .text-tiny {\n\t\tfont-size: .7em;\n\t}\n.ck-content .text-small {\n\t\tfont-size: .85em;\n\t}\n.ck-content .text-big {\n\t\tfont-size: 1.4em;\n\t}\n.ck-content .text-huge {\n\t\tfont-size: 1.8em;\n\t}\n\n/*# sourceMappingURL=index.css.map */"]}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"ar":{"dictionary":{"Font Size":"حجم الخط","Tiny":"ضئيل","Small":"صغير","Big":"كبير","Huge":"ضخم","Font Family":"نوع الخط","Default":"افتراضي","Font Color":"لون الخط","Font Background Color":"لون خلفية الخط","Document colors":"ألوان المستند"},getPluralForm(n){return n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"az":{"dictionary":{"Font Size":"Şrift ölçüsü","Tiny":"Miniatür","Small":"Kiçik","Big":"Böyük","Huge":"Nəhəng","Font Family":"Şrift ailəsi","Default":"Default","Font Color":"Şrift Rəngi","Font Background Color":"Şrift Fonunun Rəngi","Document colors":"Rənglər"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"bg":{"dictionary":{"Font Size":"Размер на шрифта","Tiny":"Много малък","Small":"Малък","Big":"Едър","Huge":"Много едър","Font Family":"Семейство шрифтове","Default":"По подразбиране","Font Color":"Цвят на шрифта","Font Background Color":"Цвят на шрифтовия фон","Document colors":"Цвят на документа"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"bn":{"dictionary":{"Font Size":"অক্ষরের আকার","Tiny":"ক্ষুদ্র","Small":"ছোট","Big":"বড়","Huge":"অনেক বড়","Font Family":"ফন্ট পরিবার","Default":"ডিফল্ট","Font Color":"ফন্টের রং","Font Background Color":"ফন্ট ব্যাকগ্রাউন্ডের রং","Document colors":"নথির রং"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"bs":{"dictionary":{"Font Size":"Veličina fonta","Tiny":"","Small":"","Big":"","Huge":"","Font Family":"Font","Default":"Zadani","Font Color":"Boja","Font Background Color":"Boja pozadine","Document colors":""},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"ca":{"dictionary":{"Font Size":"Mida de la font","Tiny":"Molt petita","Small":"Peita","Big":"Gran","Huge":"Molt gran","Font Family":"Font","Default":"Predeterminada","Font Color":"Color del tipus de lletra","Font Background Color":"Color de fons del tipus de lletra","Document colors":"Colors del document"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"cs":{"dictionary":{"Font Size":"Velikost písma","Tiny":"Drobné","Small":"Malé","Big":"Velké","Huge":"Obrovské","Font Family":"Typ písma","Default":"Výchozí","Font Color":"Barva písma","Font Background Color":"Barva pozadí písma","Document colors":"Barvy dokumentu"},getPluralForm(n){return (n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"da":{"dictionary":{"Font Size":"Skriftstørrelse","Tiny":"Lillebitte","Small":"Lille","Big":"Stor","Huge":"Kæmpe","Font Family":"Skriftfamilie","Default":"Standard","Font Color":"Skriftfarve","Font Background Color":"Skrift baggrundsfarve","Document colors":"Dokumentfarve"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"de-ch":{"dictionary":{"Font Size":"Schriftgrösse","Tiny":"Winzig","Small":"Klein","Big":"Gross","Huge":"Riesig","Font Family":"Schriftfamilie","Default":"Standard","Font Color":"Schriftfarbe","Font Background Color":"Hintergrundfarbe der Schrift","Document colors":"Farben des Dokuments"},getPluralForm(n){return (n != 1);}}}
@@ -1,8 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- import type { Translations } from 'ckeditor5';
7
- declare const translations: Translations;
8
- export default translations;
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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 default {"de":{"dictionary":{"Font Size":"Schriftgröße","Tiny":"Sehr klein","Small":"Klein","Big":"Groß","Huge":"Sehr groß","Font Family":"Schriftart","Default":"Standard","Font Color":"Schriftfarbe","Font Background Color":"Hintergrundfarbe","Document colors":"Dokumentfarben"},getPluralForm(n){return (n != 1);}}}