@ckeditor/ckeditor5-basic-styles 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 (181) hide show
  1. package/build/basic-styles.js +2 -2
  2. package/build/translations/es-co.js +1 -1
  3. package/lang/translations/es-co.po +1 -1
  4. package/package.json +2 -3
  5. package/src/bold/boldui.js +21 -18
  6. package/src/code/codeui.js +20 -16
  7. package/src/italic/italicui.js +21 -18
  8. package/src/strikethrough/strikethroughui.js +21 -17
  9. package/src/subscript/subscriptui.js +20 -16
  10. package/src/superscript/superscriptui.js +20 -16
  11. package/src/underline/underlineui.js +21 -18
  12. package/src/utils.d.ts +20 -0
  13. package/src/utils.js +26 -0
  14. package/dist/content-index.css +0 -9
  15. package/dist/editor-index.css +0 -7
  16. package/dist/index.css +0 -20
  17. package/dist/index.css.map +0 -1
  18. package/dist/translations/af.d.ts +0 -8
  19. package/dist/translations/af.js +0 -5
  20. package/dist/translations/ar.d.ts +0 -8
  21. package/dist/translations/ar.js +0 -5
  22. package/dist/translations/ast.d.ts +0 -8
  23. package/dist/translations/ast.js +0 -5
  24. package/dist/translations/az.d.ts +0 -8
  25. package/dist/translations/az.js +0 -5
  26. package/dist/translations/bg.d.ts +0 -8
  27. package/dist/translations/bg.js +0 -5
  28. package/dist/translations/bn.d.ts +0 -8
  29. package/dist/translations/bn.js +0 -5
  30. package/dist/translations/bs.d.ts +0 -8
  31. package/dist/translations/bs.js +0 -5
  32. package/dist/translations/ca.d.ts +0 -8
  33. package/dist/translations/ca.js +0 -5
  34. package/dist/translations/cs.d.ts +0 -8
  35. package/dist/translations/cs.js +0 -5
  36. package/dist/translations/da.d.ts +0 -8
  37. package/dist/translations/da.js +0 -5
  38. package/dist/translations/de-ch.d.ts +0 -8
  39. package/dist/translations/de-ch.js +0 -5
  40. package/dist/translations/de.d.ts +0 -8
  41. package/dist/translations/de.js +0 -5
  42. package/dist/translations/el.d.ts +0 -8
  43. package/dist/translations/el.js +0 -5
  44. package/dist/translations/en-au.d.ts +0 -8
  45. package/dist/translations/en-au.js +0 -5
  46. package/dist/translations/en-gb.d.ts +0 -8
  47. package/dist/translations/en-gb.js +0 -5
  48. package/dist/translations/en.d.ts +0 -8
  49. package/dist/translations/en.js +0 -5
  50. package/dist/translations/eo.d.ts +0 -8
  51. package/dist/translations/eo.js +0 -5
  52. package/dist/translations/es-co.d.ts +0 -8
  53. package/dist/translations/es-co.js +0 -5
  54. package/dist/translations/es.d.ts +0 -8
  55. package/dist/translations/es.js +0 -5
  56. package/dist/translations/et.d.ts +0 -8
  57. package/dist/translations/et.js +0 -5
  58. package/dist/translations/eu.d.ts +0 -8
  59. package/dist/translations/eu.js +0 -5
  60. package/dist/translations/fa.d.ts +0 -8
  61. package/dist/translations/fa.js +0 -5
  62. package/dist/translations/fi.d.ts +0 -8
  63. package/dist/translations/fi.js +0 -5
  64. package/dist/translations/fr.d.ts +0 -8
  65. package/dist/translations/fr.js +0 -5
  66. package/dist/translations/gl.d.ts +0 -8
  67. package/dist/translations/gl.js +0 -5
  68. package/dist/translations/gu.d.ts +0 -8
  69. package/dist/translations/gu.js +0 -5
  70. package/dist/translations/he.d.ts +0 -8
  71. package/dist/translations/he.js +0 -5
  72. package/dist/translations/hi.d.ts +0 -8
  73. package/dist/translations/hi.js +0 -5
  74. package/dist/translations/hr.d.ts +0 -8
  75. package/dist/translations/hr.js +0 -5
  76. package/dist/translations/hu.d.ts +0 -8
  77. package/dist/translations/hu.js +0 -5
  78. package/dist/translations/hy.d.ts +0 -8
  79. package/dist/translations/hy.js +0 -5
  80. package/dist/translations/id.d.ts +0 -8
  81. package/dist/translations/id.js +0 -5
  82. package/dist/translations/it.d.ts +0 -8
  83. package/dist/translations/it.js +0 -5
  84. package/dist/translations/ja.d.ts +0 -8
  85. package/dist/translations/ja.js +0 -5
  86. package/dist/translations/jv.d.ts +0 -8
  87. package/dist/translations/jv.js +0 -5
  88. package/dist/translations/km.d.ts +0 -8
  89. package/dist/translations/km.js +0 -5
  90. package/dist/translations/kn.d.ts +0 -8
  91. package/dist/translations/kn.js +0 -5
  92. package/dist/translations/ko.d.ts +0 -8
  93. package/dist/translations/ko.js +0 -5
  94. package/dist/translations/ku.d.ts +0 -8
  95. package/dist/translations/ku.js +0 -5
  96. package/dist/translations/lt.d.ts +0 -8
  97. package/dist/translations/lt.js +0 -5
  98. package/dist/translations/lv.d.ts +0 -8
  99. package/dist/translations/lv.js +0 -5
  100. package/dist/translations/ms.d.ts +0 -8
  101. package/dist/translations/ms.js +0 -5
  102. package/dist/translations/nb.d.ts +0 -8
  103. package/dist/translations/nb.js +0 -5
  104. package/dist/translations/ne.d.ts +0 -8
  105. package/dist/translations/ne.js +0 -5
  106. package/dist/translations/nl.d.ts +0 -8
  107. package/dist/translations/nl.js +0 -5
  108. package/dist/translations/no.d.ts +0 -8
  109. package/dist/translations/no.js +0 -5
  110. package/dist/translations/oc.d.ts +0 -8
  111. package/dist/translations/oc.js +0 -5
  112. package/dist/translations/pl.d.ts +0 -8
  113. package/dist/translations/pl.js +0 -5
  114. package/dist/translations/pt-br.d.ts +0 -8
  115. package/dist/translations/pt-br.js +0 -5
  116. package/dist/translations/pt.d.ts +0 -8
  117. package/dist/translations/pt.js +0 -5
  118. package/dist/translations/ro.d.ts +0 -8
  119. package/dist/translations/ro.js +0 -5
  120. package/dist/translations/ru.d.ts +0 -8
  121. package/dist/translations/ru.js +0 -5
  122. package/dist/translations/si.d.ts +0 -8
  123. package/dist/translations/si.js +0 -5
  124. package/dist/translations/sk.d.ts +0 -8
  125. package/dist/translations/sk.js +0 -5
  126. package/dist/translations/sl.d.ts +0 -8
  127. package/dist/translations/sl.js +0 -5
  128. package/dist/translations/sq.d.ts +0 -8
  129. package/dist/translations/sq.js +0 -5
  130. package/dist/translations/sr-latn.d.ts +0 -8
  131. package/dist/translations/sr-latn.js +0 -5
  132. package/dist/translations/sr.d.ts +0 -8
  133. package/dist/translations/sr.js +0 -5
  134. package/dist/translations/sv.d.ts +0 -8
  135. package/dist/translations/sv.js +0 -5
  136. package/dist/translations/th.d.ts +0 -8
  137. package/dist/translations/th.js +0 -5
  138. package/dist/translations/tk.d.ts +0 -8
  139. package/dist/translations/tk.js +0 -5
  140. package/dist/translations/tr.d.ts +0 -8
  141. package/dist/translations/tr.js +0 -5
  142. package/dist/translations/tt.d.ts +0 -8
  143. package/dist/translations/tt.js +0 -5
  144. package/dist/translations/ug.d.ts +0 -8
  145. package/dist/translations/ug.js +0 -5
  146. package/dist/translations/uk.d.ts +0 -8
  147. package/dist/translations/uk.js +0 -5
  148. package/dist/translations/ur.d.ts +0 -8
  149. package/dist/translations/ur.js +0 -5
  150. package/dist/translations/uz.d.ts +0 -8
  151. package/dist/translations/uz.js +0 -5
  152. package/dist/translations/vi.d.ts +0 -8
  153. package/dist/translations/vi.js +0 -5
  154. package/dist/translations/zh-cn.d.ts +0 -8
  155. package/dist/translations/zh-cn.js +0 -5
  156. package/dist/translations/zh.d.ts +0 -8
  157. package/dist/translations/zh.js +0 -5
  158. package/dist/types/attributecommand.d.ts +0 -78
  159. package/dist/types/augmentation.d.ts +0 -44
  160. package/dist/types/bold/boldediting.d.ts +0 -28
  161. package/dist/types/bold/boldui.d.ts +0 -25
  162. package/dist/types/bold.d.ts +0 -33
  163. package/dist/types/code/codeediting.d.ts +0 -33
  164. package/dist/types/code/codeui.d.ts +0 -26
  165. package/dist/types/code.d.ts +0 -34
  166. package/dist/types/index.d.ts +0 -34
  167. package/dist/types/italic/italicediting.d.ts +0 -28
  168. package/dist/types/italic/italicui.d.ts +0 -25
  169. package/dist/types/italic.d.ts +0 -33
  170. package/dist/types/strikethrough/strikethroughediting.d.ts +0 -29
  171. package/dist/types/strikethrough/strikethroughui.d.ts +0 -25
  172. package/dist/types/strikethrough.d.ts +0 -33
  173. package/dist/types/subscript/subscriptediting.d.ts +0 -28
  174. package/dist/types/subscript/subscriptui.d.ts +0 -25
  175. package/dist/types/subscript.d.ts +0 -30
  176. package/dist/types/superscript/superscriptediting.d.ts +0 -28
  177. package/dist/types/superscript/superscriptui.d.ts +0 -25
  178. package/dist/types/superscript.d.ts +0 -30
  179. package/dist/types/underline/underlineediting.d.ts +0 -28
  180. package/dist/types/underline/underlineui.d.ts +0 -25
  181. package/dist/types/underline.d.ts +0 -33
@@ -1,5 +1,5 @@
1
- !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{Bold:"Bold","Bold text":"Bold text",Code:"Code",Italic:"Italic","Italic text":"Italic text","Move out of an inline code style":"Move out of an inline code style",Strikethrough:"Strikethrough","Strikethrough text":"Strikethrough text",Subscript:"Subscript",Superscript:"Superscript",Underline:"Underline","Underline text":"Underline text"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
1
+ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{Bold:"Bold","Bold text":"Bold text",Code:"Code",Italic:"Italic","Italic text":"Italic text","Move out of an inline code style":"Move out of an inline code style",Strikethrough:"Strikethrough","Strikethrough text":"Strikethrough text",Subscript:"Subscript",Superscript:"Superscript",Underline:"Underline","Underline text":"Underline text"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
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={598:(e,t,i)=>{"use strict";i.d(t,{A:()=>o});var n=i(935),s=i.n(n)()((function(e){return e[1]}));s.push([e.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}",""]);const o=s},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=e(t);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(n)for(var o=0;o<this.length;o++){var r=this[o][0];null!=r&&(s[r]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);n&&s[c[0]]||(i&&(c[2]?c[2]="".concat(i," and ").concat(c[2]):c[2]=i),t.push(c))}},t}},591:(e,t,i)=>{"use strict";var n,s=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),r=[];function a(e){for(var t=-1,i=0;i<r.length;i++)if(r[i].identifier===e){t=i;break}return t}function c(e,t){for(var i={},n=[],s=0;s<e.length;s++){var o=e[s],c=t.base?o[0]+t.base:o[0],l=i[c]||0,d="".concat(c," ").concat(l);i[c]=l+1;var u=a(d),g={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(r[u].references++,r[u].updater(g)):r.push({identifier:d,updater:b(g,t),references:1}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var s=i.nc;s&&(n.nonce=s)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var r=o(e.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function g(e,t,i,n){var s=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,s);else{var o=document.createTextNode(s),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o)}}function m(e,t,i){var n=i.css,s=i.media,o=i.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var h=null,p=0;function b(e,t){var i,n,s;if(t.singleton){var o=p++;i=h||(h=l(t)),n=g.bind(null,i,o,!1),s=g.bind(null,i,o,!0)}else i=l(t),n=m.bind(null,i,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(i)};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 s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var i=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<i.length;n++){var s=a(i[n]);r[s].references--}for(var o=c(e,t),l=0;l<i.length;l++){var d=a(i[l]);0===r[d].references&&(r[d].updater(),r.splice(d,1))}i=o}}}},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},834:(e,t,i)=>{e.exports=i(237)("./src/typing.js")},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={id:n,exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{Bold:()=>l,BoldEditing:()=>o,BoldUI:()=>c,Code:()=>w,CodeEditing:()=>g,CodeUI:()=>f,Italic:()=>T,ItalicEditing:()=>x,ItalicUI:()=>S,Strikethrough:()=>N,StrikethroughEditing:()=>I,StrikethroughUI:()=>C,Subscript:()=>L,SubscriptEditing:()=>B,SubscriptUI:()=>O,Superscript:()=>V,SuperscriptEditing:()=>M,SuperscriptUI:()=>K,Underline:()=>H,UnderlineEditing:()=>z,UnderlineUI:()=>q});var e=i(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=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,n=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of s)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const s="bold";class o extends e.Plugin{static get pluginName(){return"BoldEditing"}init(){const e=this.editor,i=this.editor.t;e.model.schema.extend("$text",{allowAttributes:s}),e.model.schema.setAttributeProperties(s,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:s,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(s,new t(e,s)),e.keystrokes.set("CTRL+B",s),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Bold text"),keystroke:"CTRL+B"}]})}}var r=i(311);const a="bold";class c extends e.Plugin{static get pluginName(){return"BoldUI"}init(){const t=this.editor,i=t.t;t.ui.componentFactory.add(a,(n=>{const s=t.commands.get(a),o=new r.ButtonView(n);return o.set({label:i("Bold"),icon:e.icons.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),this.listenTo(o,"execute",(()=>{t.execute(a),t.editing.view.focus()})),o}))}}class l extends e.Plugin{static get requires(){return[o,c]}static get pluginName(){return"Bold"}}var d=i(834);const u="code";class g extends e.Plugin{static get pluginName(){return"CodeEditing"}static get requires(){return[d.TwoStepCaretMovement]}init(){const e=this.editor,i=this.editor.t;e.model.schema.extend("$text",{allowAttributes:u}),e.model.schema.setAttributeProperties(u,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:u,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),e.commands.add(u,new t(e,u)),e.plugins.get(d.TwoStepCaretMovement).registerAttribute(u),(0,d.inlineHighlight)(e,u,"code","ck-code_selected"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}var m=i(591),h=i.n(m),p=i(598),b={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};h()(p.A,b);p.A.locals;const v="code";class f extends e.Plugin{static get pluginName(){return"CodeUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(v,(i=>{const n=e.commands.get(v),s=new r.ButtonView(i);return s.set({label:t("Code"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(v),e.editing.view.focus()})),s}))}}class w extends e.Plugin{static get requires(){return[g,f]}static get pluginName(){return"Code"}}const y="italic";class x extends e.Plugin{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor,i=this.editor.t;e.model.schema.extend("$text",{allowAttributes:y}),e.model.schema.setAttributeProperties(y,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:y,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(y,new t(e,y)),e.keystrokes.set("CTRL+I",y),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Italic text"),keystroke:"CTRL+I"}]})}}const k="italic";class S extends e.Plugin{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(k,(i=>{const n=e.commands.get(k),s=new r.ButtonView(i);return s.set({label:t("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(k),e.editing.view.focus()})),s}))}}class T extends e.Plugin{static get requires(){return[x,S]}static get pluginName(){return"Italic"}}const E="strikethrough";class I extends e.Plugin{static get pluginName(){return"StrikethroughEditing"}init(){const e=this.editor,i=this.editor.t;e.model.schema.extend("$text",{allowAttributes:E}),e.model.schema.setAttributeProperties(E,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:E,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(E,new t(e,E)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const A="strikethrough";class C extends e.Plugin{static get pluginName(){return"StrikethroughUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(A,(i=>{const n=e.commands.get(A),s=new r.ButtonView(i);return s.set({label:t("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(A),e.editing.view.focus()})),s}))}}class N extends e.Plugin{static get requires(){return[I,C]}static get pluginName(){return"Strikethrough"}}const P="subscript";class B extends e.Plugin{static get pluginName(){return"SubscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:P}),e.model.schema.setAttributeProperties(P,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:P,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),e.commands.add(P,new t(e,P))}}const U="subscript";class O extends e.Plugin{static get pluginName(){return"SubscriptUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(U,(i=>{const n=e.commands.get(U),s=new r.ButtonView(i);return s.set({label:t("Subscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z"/></svg>',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(U),e.editing.view.focus()})),s}))}}class L extends e.Plugin{static get requires(){return[B,O]}static get pluginName(){return"Subscript"}}const F="superscript";class M extends e.Plugin{static get pluginName(){return"SuperscriptEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:F}),e.model.schema.setAttributeProperties(F,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:F,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),e.commands.add(F,new t(e,F))}}const R="superscript";class K extends e.Plugin{static get pluginName(){return"SuperscriptUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(R,(i=>{const n=e.commands.get(R),s=new r.ButtonView(i);return s.set({label:t("Superscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z"/></svg>',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(R),e.editing.view.focus()})),s}))}}class V extends e.Plugin{static get requires(){return[M,K]}static get pluginName(){return"Superscript"}}const j="underline";class z extends e.Plugin{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor,i=this.editor.t;e.model.schema.extend("$text",{allowAttributes:j}),e.model.schema.setAttributeProperties(j,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:j,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(j,new t(e,j)),e.keystrokes.set("CTRL+U","underline"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Underline text"),keystroke:"CTRL+U"}]})}}const _="underline";class q extends e.Plugin{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(_,(i=>{const n=e.commands.get(_),s=new r.ButtonView(i);return s.set({label:t("Underline"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(_),e.editing.view.focus()})),s}))}}class H extends e.Plugin{static get requires(){return[z,q]}static get pluginName(){return"Underline"}}})(),(window.CKEditor5=window.CKEditor5||{}).basicStyles=n})();
5
+ */(()=>{var t={598:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(935),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}",""]);const r=o},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);n&&o[c[0]]||(i&&(c[2]?c[2]="".concat(i," and ").concat(c[2]):c[2]=i),e.push(c))}},e}},591:(t,e,i)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i<s.length;i++)if(s[i].identifier===t){e=i;break}return e}function c(t,e){for(var i={},n=[],o=0;o<t.length;o++){var r=t[o],c=e.base?r[0]+e.base:r[0],l=i[c]||0,u="".concat(c," ").concat(l);i[c]=l+1;var d=a(u),m={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(s[d].references++,s[d].updater(m)):s.push({identifier:u,updater:b(m,e),references:1}),n.push(u)}return n}function l(t){var e=document.createElement("style"),n=t.attributes||{};if(void 0===n.nonce){var o=i.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(t){e.setAttribute(t,n[t])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function m(t,e,i,n){var o=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(t.styleSheet)t.styleSheet.cssText=d(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function g(t,e,i){var n=i.css,o=i.media,r=i.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var p=null,h=0;function b(t,e){var i,n,o;if(e.singleton){var r=h++;i=p||(p=l(e)),n=m.bind(null,i,r,!1),o=m.bind(null,i,r,!0)}else i=l(e),n=g.bind(null,i,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var i=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var n=0;n<i.length;n++){var o=a(i[n]);s[o].references--}for(var r=c(t,e),l=0;l<i.length;l++){var u=a(i[l]);0===s[u].references&&(s[u].updater(),s.splice(u,1))}i=r}}}},782:(t,e,i)=>{t.exports=i(237)("./src/core.js")},834:(t,e,i)=>{t.exports=i(237)("./src/typing.js")},311:(t,e,i)=>{t.exports=i(237)("./src/ui.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{Bold:()=>u,BoldEditing:()=>r,BoldUI:()=>l,Code:()=>w,CodeEditing:()=>g,CodeUI:()=>f,Italic:()=>B,ItalicEditing:()=>k,ItalicUI:()=>I,Strikethrough:()=>E,StrikethroughEditing:()=>T,StrikethroughUI:()=>C,Subscript:()=>F,SubscriptEditing:()=>L,SubscriptUI:()=>U,Superscript:()=>j,SuperscriptEditing:()=>V,SuperscriptUI:()=>K,Underline:()=>$,UnderlineEditing:()=>_,UnderlineUI:()=>H});var t=i(782);class e extends t.Command{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change((t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}}))}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const o="bold";class r extends t.Plugin{static get pluginName(){return"BoldEditing"}init(){const t=this.editor,i=this.editor.t;t.model.schema.extend("$text",{allowAttributes:o}),t.model.schema.setAttributeProperties(o,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:o,view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e&&("bold"==e||Number(e)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(o,new e(t,o)),t.keystrokes.set("CTRL+B",o),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Bold text"),keystroke:"CTRL+B"}]})}}var s=i(311);function a({editor:t,commandName:e,plugin:i,icon:n,label:o,keystroke:r}){return s=>{const a=t.commands.get(e),c=new s(t.locale);return c.set({label:o,icon:n,keystroke:r,isToggleable:!0}),c.bind("isEnabled").to(a,"isEnabled"),i.listenTo(c,"execute",(()=>{t.execute(e),t.editing.view.focus()})),c}}const c="bold";class l extends t.Plugin{static get pluginName(){return"BoldUI"}init(){const e=this.editor,i=e.locale.t,n=e.commands.get(c),o=a({editor:e,commandName:c,plugin:this,icon:t.icons.bold,label:i("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(c,(()=>{const t=o(s.ButtonView);return t.set({tooltip:!0}),t.bind("isOn").to(n,"value"),t})),e.ui.componentFactory.add("menuBar:"+c,(()=>o(s.MenuBarMenuListItemButtonView)))}}class u extends t.Plugin{static get requires(){return[r,l]}static get pluginName(){return"Bold"}}var d=i(834);const m="code";class g extends t.Plugin{static get pluginName(){return"CodeEditing"}static get requires(){return[d.TwoStepCaretMovement]}init(){const t=this.editor,i=this.editor.t;t.model.schema.extend("$text",{allowAttributes:m}),t.model.schema.setAttributeProperties(m,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:m,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(m,new e(t,m)),t.plugins.get(d.TwoStepCaretMovement).registerAttribute(m),(0,d.inlineHighlight)(t,m,"code","ck-code_selected"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}var p=i(591),h=i.n(p),b=i(598),v={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};h()(b.A,v);b.A.locals;const y="code";class f extends t.Plugin{static get pluginName(){return"CodeUI"}init(){const t=this.editor,e=t.locale.t,i=a({editor:t,commandName:y,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>',label:e("Code")});t.ui.componentFactory.add(y,(()=>{const e=i(s.ButtonView),n=t.commands.get(y);return e.set({tooltip:!0}),e.bind("isOn").to(n,"value"),e})),t.ui.componentFactory.add("menuBar:"+y,(()=>i(s.MenuBarMenuListItemButtonView)))}}class w extends t.Plugin{static get requires(){return[g,f]}static get pluginName(){return"Code"}}const x="italic";class k extends t.Plugin{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor,i=this.editor.t;t.model.schema.extend("$text",{allowAttributes:x}),t.model.schema.setAttributeProperties(x,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:x,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(x,new e(t,x)),t.keystrokes.set("CTRL+I",x),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Italic text"),keystroke:"CTRL+I"}]})}}const S="italic";class I extends t.Plugin{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.commands.get(S),i=t.locale.t,n=a({editor:t,commandName:S,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",label:i("Italic")});t.ui.componentFactory.add(S,(()=>{const t=n(s.ButtonView);return t.set({tooltip:!0}),t.bind("isOn").to(e,"value"),t})),t.ui.componentFactory.add("menuBar:"+S,(()=>n(s.MenuBarMenuListItemButtonView)))}}class B extends t.Plugin{static get requires(){return[k,I]}static get pluginName(){return"Italic"}}const A="strikethrough";class T extends t.Plugin{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor,i=this.editor.t;t.model.schema.extend("$text",{allowAttributes:A}),t.model.schema.setAttributeProperties(A,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:A,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add(A,new e(t,A)),t.keystrokes.set("CTRL+SHIFT+X","strikethrough"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const N="strikethrough";class C extends t.Plugin{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.locale.t,i=a({editor:t,commandName:N,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",label:e("Strikethrough")});t.ui.componentFactory.add(N,(()=>{const e=i(s.ButtonView),n=t.commands.get(N);return e.set({tooltip:!0}),e.bind("isOn").to(n,"value"),e})),t.ui.componentFactory.add("menuBar:"+N,(()=>i(s.MenuBarMenuListItemButtonView)))}}class E extends t.Plugin{static get requires(){return[T,C]}static get pluginName(){return"Strikethrough"}}const M="subscript";class L extends t.Plugin{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:M}),t.model.schema.setAttributeProperties(M,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:M,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add(M,new e(t,M))}}const P="subscript";class U extends t.Plugin{static get pluginName(){return"SubscriptUI"}init(){const t=this.editor,e=t.locale.t,i=a({editor:t,commandName:P,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z"/></svg>',label:e("Subscript")});t.ui.componentFactory.add(P,(()=>{const e=i(s.ButtonView),n=t.commands.get(P);return e.set({tooltip:!0}),e.bind("isOn").to(n,"value"),e})),t.ui.componentFactory.add("menuBar:"+P,(()=>i(s.MenuBarMenuListItemButtonView)))}}class F extends t.Plugin{static get requires(){return[L,U]}static get pluginName(){return"Subscript"}}const O="superscript";class V extends t.Plugin{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:O}),t.model.schema.setAttributeProperties(O,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:O,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add(O,new e(t,O))}}const R="superscript";class K extends t.Plugin{static get pluginName(){return"SuperscriptUI"}init(){const t=this.editor,e=t.locale.t,i=a({editor:t,commandName:R,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z"/></svg>',label:e("Superscript")});t.ui.componentFactory.add(R,(()=>{const e=i(s.ButtonView),n=t.commands.get(R);return e.set({tooltip:!0}),e.bind("isOn").to(n,"value"),e})),t.ui.componentFactory.add("menuBar:"+R,(()=>i(s.MenuBarMenuListItemButtonView)))}}class j extends t.Plugin{static get requires(){return[V,K]}static get pluginName(){return"Superscript"}}const z="underline";class _ extends t.Plugin{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor,i=this.editor.t;t.model.schema.extend("$text",{allowAttributes:z}),t.model.schema.setAttributeProperties(z,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:z,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(z,new e(t,z)),t.keystrokes.set("CTRL+U","underline"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Underline text"),keystroke:"CTRL+U"}]})}}const q="underline";class H extends t.Plugin{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.commands.get(q),i=t.locale.t,n=a({editor:t,commandName:q,plugin:this,icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',label:i("Underline"),keystroke:"CTRL+U"});t.ui.componentFactory.add(q,(()=>{const t=n(s.ButtonView);return t.set({tooltip:!0}),t.bind("isOn").to(e,"value"),t})),t.ui.componentFactory.add("menuBar:"+q,(()=>n(s.MenuBarMenuListItemButtonView)))}}class $ extends t.Plugin{static get requires(){return[_,H]}static get pluginName(){return"Underline"}}})(),(window.CKEditor5=window.CKEditor5||{}).basicStyles=n})();
@@ -1 +1 @@
1
- !function(t){const e=t["es-co"]=t["es-co"]||{};e.dictionary=Object.assign(e.dictionary||{},{Bold:"Negrita","Bold text":"",Code:"Código",Italic:"Cursiva","Italic text":"","Move out of an inline code style":"",Strikethrough:"Tachado","Strikethrough text":"",Subscript:"Subíndice",Superscript:"Superíndice",Underline:"Subrayado","Underline text":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
1
+ !function(e){const t=e["es-co"]=e["es-co"]||{};t.dictionary=Object.assign(t.dictionary||{},{Bold:"Negrita","Bold text":"",Code:"Código",Italic:"Cursiva","Italic text":"Texto en cursiva","Move out of an inline code style":"",Strikethrough:"Tachado","Strikethrough text":"",Subscript:"Subíndice",Superscript:"Superíndice",Underline:"Subrayado","Underline text":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -47,7 +47,7 @@ msgstr "Superíndice"
47
47
 
48
48
  msgctxt "Keystroke description for assistive technologies: keystroke for making text italic."
49
49
  msgid "Italic text"
50
- msgstr ""
50
+ msgstr "Texto en cursiva"
51
51
 
52
52
  msgctxt "Keystroke description for assistive technologies: keystroke for moving selection out of an inline code style."
53
53
  msgid "Move out of an inline code style"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-basic-styles",
3
- "version": "41.3.0-alpha.4",
3
+ "version": "41.3.0",
4
4
  "description": "Basic styles 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-basic-styles"
26
26
  },
27
27
  "files": [
28
- "dist",
29
28
  "lang",
30
29
  "src/**/*.js",
31
30
  "src/**/*.d.ts",
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/bold/boldui
7
7
  */
8
8
  import { Plugin, icons } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  const BOLD = 'bold';
11
12
  /**
12
13
  * The bold UI feature. It introduces the Bold button.
@@ -23,25 +24,27 @@ export default class BoldUI extends Plugin {
23
24
  */
24
25
  init() {
25
26
  const editor = this.editor;
26
- const t = editor.t;
27
+ const t = editor.locale.t;
28
+ const command = editor.commands.get(BOLD);
29
+ const createButton = getButtonCreator({
30
+ editor,
31
+ commandName: BOLD,
32
+ plugin: this,
33
+ icon: icons.bold,
34
+ label: t('Bold'),
35
+ keystroke: 'CTRL+B'
36
+ });
27
37
  // Add bold button to feature components.
28
- editor.ui.componentFactory.add(BOLD, locale => {
29
- const command = editor.commands.get(BOLD);
30
- const view = new ButtonView(locale);
31
- view.set({
32
- label: t('Bold'),
33
- icon: icons.bold,
34
- keystroke: 'CTRL+B',
35
- tooltip: true,
36
- isToggleable: true
37
- });
38
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
39
- // Execute command.
40
- this.listenTo(view, 'execute', () => {
41
- editor.execute(BOLD);
42
- editor.editing.view.focus();
38
+ editor.ui.componentFactory.add(BOLD, () => {
39
+ const buttonView = createButton(ButtonView);
40
+ buttonView.set({
41
+ tooltip: true
43
42
  });
44
- return view;
43
+ buttonView.bind('isOn').to(command, 'value');
44
+ return buttonView;
45
+ });
46
+ editor.ui.componentFactory.add('menuBar:' + BOLD, () => {
47
+ return createButton(MenuBarMenuListItemButtonView);
45
48
  });
46
49
  }
47
50
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/code/codeui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import codeIcon from '../../theme/icons/code.svg';
11
12
  import '../../theme/code.css';
12
13
  const CODE = 'code';
@@ -25,24 +26,27 @@ export default class CodeUI extends Plugin {
25
26
  */
26
27
  init() {
27
28
  const editor = this.editor;
28
- const t = editor.t;
29
+ const t = editor.locale.t;
30
+ const createButton = getButtonCreator({
31
+ editor,
32
+ commandName: CODE,
33
+ plugin: this,
34
+ icon: codeIcon,
35
+ label: t('Code')
36
+ });
29
37
  // Add code button to feature components.
30
- editor.ui.componentFactory.add(CODE, locale => {
38
+ editor.ui.componentFactory.add(CODE, () => {
39
+ const buttonView = createButton(ButtonView);
31
40
  const command = editor.commands.get(CODE);
32
- const view = new ButtonView(locale);
33
- view.set({
34
- label: t('Code'),
35
- icon: codeIcon,
36
- tooltip: true,
37
- isToggleable: true
38
- });
39
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
40
- // Execute command.
41
- this.listenTo(view, 'execute', () => {
42
- editor.execute(CODE);
43
- editor.editing.view.focus();
41
+ buttonView.set({
42
+ tooltip: true
44
43
  });
45
- return view;
44
+ // Bind button model to command.
45
+ buttonView.bind('isOn').to(command, 'value');
46
+ return buttonView;
47
+ });
48
+ editor.ui.componentFactory.add('menuBar:' + CODE, () => {
49
+ return createButton(MenuBarMenuListItemButtonView);
46
50
  });
47
51
  }
48
52
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/italic/italicui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { MenuBarMenuListItemButtonView, ButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import italicIcon from '../../theme/icons/italic.svg';
11
12
  const ITALIC = 'italic';
12
13
  /**
@@ -24,25 +25,27 @@ export default class ItalicUI extends Plugin {
24
25
  */
25
26
  init() {
26
27
  const editor = this.editor;
27
- const t = editor.t;
28
+ const command = editor.commands.get(ITALIC);
29
+ const t = editor.locale.t;
30
+ const createButton = getButtonCreator({
31
+ editor,
32
+ commandName: ITALIC,
33
+ plugin: this,
34
+ icon: italicIcon,
35
+ keystroke: 'CTRL+I',
36
+ label: t('Italic')
37
+ });
28
38
  // Add bold button to feature components.
29
- editor.ui.componentFactory.add(ITALIC, locale => {
30
- const command = editor.commands.get(ITALIC);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Italic'),
34
- icon: italicIcon,
35
- keystroke: 'CTRL+I',
36
- tooltip: true,
37
- isToggleable: true
38
- });
39
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
40
- // Execute command.
41
- this.listenTo(view, 'execute', () => {
42
- editor.execute(ITALIC);
43
- editor.editing.view.focus();
39
+ editor.ui.componentFactory.add(ITALIC, () => {
40
+ const buttonView = createButton(ButtonView);
41
+ buttonView.set({
42
+ tooltip: true
44
43
  });
45
- return view;
44
+ buttonView.bind('isOn').to(command, 'value');
45
+ return buttonView;
46
+ });
47
+ editor.ui.componentFactory.add('menuBar:' + ITALIC, () => {
48
+ return createButton(MenuBarMenuListItemButtonView);
46
49
  });
47
50
  }
48
51
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/strikethrough/strikethroughui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import strikethroughIcon from '../../theme/icons/strikethrough.svg';
11
12
  const STRIKETHROUGH = 'strikethrough';
12
13
  /**
@@ -24,25 +25,28 @@ export default class StrikethroughUI extends Plugin {
24
25
  */
25
26
  init() {
26
27
  const editor = this.editor;
27
- const t = editor.t;
28
+ const t = editor.locale.t;
29
+ const createButton = getButtonCreator({
30
+ editor,
31
+ commandName: STRIKETHROUGH,
32
+ plugin: this,
33
+ icon: strikethroughIcon,
34
+ keystroke: 'CTRL+SHIFT+X',
35
+ label: t('Strikethrough')
36
+ });
28
37
  // Add strikethrough button to feature components.
29
- editor.ui.componentFactory.add(STRIKETHROUGH, locale => {
38
+ editor.ui.componentFactory.add(STRIKETHROUGH, () => {
39
+ const buttonView = createButton(ButtonView);
30
40
  const command = editor.commands.get(STRIKETHROUGH);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Strikethrough'),
34
- icon: strikethroughIcon,
35
- keystroke: 'CTRL+SHIFT+X',
36
- tooltip: true,
37
- isToggleable: true
38
- });
39
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
40
- // Execute command.
41
- this.listenTo(view, 'execute', () => {
42
- editor.execute(STRIKETHROUGH);
43
- editor.editing.view.focus();
41
+ buttonView.set({
42
+ tooltip: true
44
43
  });
45
- return view;
44
+ // Bind button model to command.
45
+ buttonView.bind('isOn').to(command, 'value');
46
+ return buttonView;
47
+ });
48
+ editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, () => {
49
+ return createButton(MenuBarMenuListItemButtonView);
46
50
  });
47
51
  }
48
52
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/subscript/subscriptui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import subscriptIcon from '../../theme/icons/subscript.svg';
11
12
  const SUBSCRIPT = 'subscript';
12
13
  /**
@@ -24,24 +25,27 @@ export default class SubscriptUI extends Plugin {
24
25
  */
25
26
  init() {
26
27
  const editor = this.editor;
27
- const t = editor.t;
28
+ const t = editor.locale.t;
29
+ const createButton = getButtonCreator({
30
+ editor,
31
+ commandName: SUBSCRIPT,
32
+ plugin: this,
33
+ icon: subscriptIcon,
34
+ label: t('Subscript')
35
+ });
28
36
  // Add subscript button to feature components.
29
- editor.ui.componentFactory.add(SUBSCRIPT, locale => {
37
+ editor.ui.componentFactory.add(SUBSCRIPT, () => {
38
+ const buttonView = createButton(ButtonView);
30
39
  const command = editor.commands.get(SUBSCRIPT);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Subscript'),
34
- icon: subscriptIcon,
35
- tooltip: true,
36
- isToggleable: true
37
- });
38
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
39
- // Execute command.
40
- this.listenTo(view, 'execute', () => {
41
- editor.execute(SUBSCRIPT);
42
- editor.editing.view.focus();
40
+ buttonView.set({
41
+ tooltip: true
43
42
  });
44
- return view;
43
+ // Bind button model to command.
44
+ buttonView.bind('isOn').to(command, 'value');
45
+ return buttonView;
46
+ });
47
+ editor.ui.componentFactory.add('menuBar:' + SUBSCRIPT, () => {
48
+ return createButton(MenuBarMenuListItemButtonView);
45
49
  });
46
50
  }
47
51
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/superscript/superscriptui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import superscriptIcon from '../../theme/icons/superscript.svg';
11
12
  const SUPERSCRIPT = 'superscript';
12
13
  /**
@@ -24,24 +25,27 @@ export default class SuperscriptUI extends Plugin {
24
25
  */
25
26
  init() {
26
27
  const editor = this.editor;
27
- const t = editor.t;
28
+ const t = editor.locale.t;
29
+ const createButton = getButtonCreator({
30
+ editor,
31
+ commandName: SUPERSCRIPT,
32
+ plugin: this,
33
+ icon: superscriptIcon,
34
+ label: t('Superscript')
35
+ });
28
36
  // Add superscript button to feature components.
29
- editor.ui.componentFactory.add(SUPERSCRIPT, locale => {
37
+ editor.ui.componentFactory.add(SUPERSCRIPT, () => {
38
+ const buttonView = createButton(ButtonView);
30
39
  const command = editor.commands.get(SUPERSCRIPT);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Superscript'),
34
- icon: superscriptIcon,
35
- tooltip: true,
36
- isToggleable: true
37
- });
38
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
39
- // Execute command.
40
- this.listenTo(view, 'execute', () => {
41
- editor.execute(SUPERSCRIPT);
42
- editor.editing.view.focus();
40
+ buttonView.set({
41
+ tooltip: true
43
42
  });
44
- return view;
43
+ // Bind button model to command.
44
+ buttonView.bind('isOn').to(command, 'value');
45
+ return buttonView;
46
+ });
47
+ editor.ui.componentFactory.add('menuBar:' + SUPERSCRIPT, () => {
48
+ return createButton(MenuBarMenuListItemButtonView);
45
49
  });
46
50
  }
47
51
  }
@@ -6,7 +6,8 @@
6
6
  * @module basic-styles/underline/underlineui
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { ButtonView } from 'ckeditor5/src/ui.js';
9
+ import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ import { getButtonCreator } from '../utils.js';
10
11
  import underlineIcon from '../../theme/icons/underline.svg';
11
12
  const UNDERLINE = 'underline';
12
13
  /**
@@ -24,25 +25,27 @@ export default class UnderlineUI extends Plugin {
24
25
  */
25
26
  init() {
26
27
  const editor = this.editor;
27
- const t = editor.t;
28
+ const command = editor.commands.get(UNDERLINE);
29
+ const t = editor.locale.t;
30
+ const createButton = getButtonCreator({
31
+ editor,
32
+ commandName: UNDERLINE,
33
+ plugin: this,
34
+ icon: underlineIcon,
35
+ label: t('Underline'),
36
+ keystroke: 'CTRL+U'
37
+ });
28
38
  // Add bold button to feature components.
29
- editor.ui.componentFactory.add(UNDERLINE, locale => {
30
- const command = editor.commands.get(UNDERLINE);
31
- const view = new ButtonView(locale);
32
- view.set({
33
- label: t('Underline'),
34
- icon: underlineIcon,
35
- keystroke: 'CTRL+U',
36
- tooltip: true,
37
- isToggleable: true
38
- });
39
- view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
40
- // Execute command.
41
- this.listenTo(view, 'execute', () => {
42
- editor.execute(UNDERLINE);
43
- editor.editing.view.focus();
39
+ editor.ui.componentFactory.add(UNDERLINE, () => {
40
+ const buttonView = createButton(ButtonView);
41
+ buttonView.set({
42
+ tooltip: true
44
43
  });
45
- return view;
44
+ buttonView.bind('isOn').to(command, 'value');
45
+ return buttonView;
46
+ });
47
+ editor.ui.componentFactory.add('menuBar:' + UNDERLINE, () => {
48
+ return createButton(MenuBarMenuListItemButtonView);
46
49
  });
47
50
  }
48
51
  }
package/src/utils.d.ts ADDED
@@ -0,0 +1,20 @@
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
+ * @module basic-styles/utils
7
+ */
8
+ import type { Editor, Plugin } from 'ckeditor5/src/core.js';
9
+ import type { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
10
+ /**
11
+ * Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
12
+ */
13
+ export declare function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }: {
14
+ editor: Editor;
15
+ commandName: string;
16
+ icon: string;
17
+ label: string;
18
+ plugin: Plugin;
19
+ keystroke?: string;
20
+ }): <T extends typeof ButtonView | typeof MenuBarMenuListItemButtonView>(ButtonClass: T) => InstanceType<T>;
package/src/utils.js ADDED
@@ -0,0 +1,26 @@
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
+ * Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
7
+ */
8
+ export function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {
9
+ return (ButtonClass) => {
10
+ const command = editor.commands.get(commandName);
11
+ const view = new ButtonClass(editor.locale);
12
+ view.set({
13
+ label,
14
+ icon,
15
+ keystroke,
16
+ isToggleable: true
17
+ });
18
+ view.bind('isEnabled').to(command, 'isEnabled');
19
+ // Execute the command.
20
+ plugin.listenTo(view, 'execute', () => {
21
+ editor.execute(commandName);
22
+ editor.editing.view.focus();
23
+ });
24
+ return view;
25
+ };
26
+ }
@@ -1,9 +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 code {
6
- background-color: hsla(0, 0%, 78%, 0.3);
7
- padding: .15em;
8
- border-radius: 2px;
9
- }
@@ -1,7 +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.ck-editor__editable .ck-code_selected {
6
- background-color: hsla(0, 0%, 78%, 0.5);
7
- }
package/dist/index.css DELETED
@@ -1,20 +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
- .ck-content code {
11
- background-color: hsla(0, 0%, 78%, 0.3);
12
- padding: .15em;
13
- border-radius: 2px;
14
- }
15
-
16
- .ck.ck-editor__editable .ck-code_selected {
17
- background-color: hsla(0, 0%, 78%, 0.5);
18
- }
19
-
20
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../theme/code.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,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA;ACCA,CDAC,UAAA,CAAA,KAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC,CAAA;ACCxC,CDAC,OAAA,CAAA,CAAA,CAAA,IAAc,CAAA;ACCf,CDAC,MAAA,CAAA,MAAA,CAAA,CAAA,GAAkB,CAAA;AACnB,CAAA;ACCA;ADCA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA,CAAA;ACCA,CDAC,UAAA,CAAA,KAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC,CAAA;AACxC,CAAA;ACCA;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.ck-content code {\n\tbackground-color: hsla(0, 0%, 78%, 0.3);\n\tpadding: .15em;\n\tborder-radius: 2px;\n}\n\n.ck.ck-editor__editable .ck-code_selected {\n\tbackground-color: hsla(0, 0%, 78%, 0.5);\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.ck-content code {\n\tbackground-color: hsla(0, 0%, 78%, 0.3);\n\tpadding: .15em;\n\tborder-radius: 2px;\n}\n\n.ck.ck-editor__editable .ck-code_selected {\n\tbackground-color: hsla(0, 0%, 78%, 0.5);\n}\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 {"af":{"dictionary":{"Bold":"Vet","Italic":"Kursief","Underline":"Onderstreep","Code":"Bronkode","Strikethrough":"Deurstreep","Subscript":"Onderskrif","Superscript":"Boskrif","Italic text":"","Move out of an inline code style":"","Bold text":"","Underline text":"","Strikethrough text":""},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;