@ckeditor/ckeditor5-alignment 0.0.0-internal-20241206.0 → 0.0.0-internal-20251211.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 (319) hide show
  1. package/LICENSE.md +4 -4
  2. package/README.md +1 -1
  3. package/build/alignment.js +2 -2
  4. package/build/translations/be.js +1 -0
  5. package/ckeditor5-metadata.json +1 -1
  6. package/dist/index-content.css +2 -2
  7. package/dist/index-editor.css +2 -2
  8. package/dist/index.css +2 -2
  9. package/dist/index.js +103 -97
  10. package/dist/index.js.map +1 -1
  11. package/dist/translations/af.d.ts +2 -2
  12. package/dist/translations/af.js +2 -2
  13. package/dist/translations/af.umd.js +2 -2
  14. package/dist/translations/ar.d.ts +2 -2
  15. package/dist/translations/ar.js +2 -2
  16. package/dist/translations/ar.umd.js +2 -2
  17. package/dist/translations/ast.d.ts +2 -2
  18. package/dist/translations/ast.js +2 -2
  19. package/dist/translations/ast.umd.js +2 -2
  20. package/dist/translations/az.d.ts +2 -2
  21. package/dist/translations/az.js +2 -2
  22. package/dist/translations/az.umd.js +2 -2
  23. package/dist/translations/be.d.ts +8 -0
  24. package/dist/translations/be.js +5 -0
  25. package/dist/translations/be.umd.js +11 -0
  26. package/dist/translations/bg.d.ts +2 -2
  27. package/dist/translations/bg.js +2 -2
  28. package/dist/translations/bg.umd.js +2 -2
  29. package/dist/translations/bn.d.ts +2 -2
  30. package/dist/translations/bn.js +2 -2
  31. package/dist/translations/bn.umd.js +2 -2
  32. package/dist/translations/bs.d.ts +2 -2
  33. package/dist/translations/bs.js +2 -2
  34. package/dist/translations/bs.umd.js +2 -2
  35. package/dist/translations/ca.d.ts +2 -2
  36. package/dist/translations/ca.js +2 -2
  37. package/dist/translations/ca.umd.js +2 -2
  38. package/dist/translations/cs.d.ts +2 -2
  39. package/dist/translations/cs.js +2 -2
  40. package/dist/translations/cs.umd.js +2 -2
  41. package/dist/translations/da.d.ts +2 -2
  42. package/dist/translations/da.js +2 -2
  43. package/dist/translations/da.umd.js +2 -2
  44. package/dist/translations/de-ch.d.ts +2 -2
  45. package/dist/translations/de-ch.js +2 -2
  46. package/dist/translations/de-ch.umd.js +2 -2
  47. package/dist/translations/de.d.ts +2 -2
  48. package/dist/translations/de.js +2 -2
  49. package/dist/translations/de.umd.js +2 -2
  50. package/dist/translations/el.d.ts +2 -2
  51. package/dist/translations/el.js +2 -2
  52. package/dist/translations/el.umd.js +2 -2
  53. package/dist/translations/en-au.d.ts +2 -2
  54. package/dist/translations/en-au.js +2 -2
  55. package/dist/translations/en-au.umd.js +2 -2
  56. package/dist/translations/en-gb.d.ts +2 -2
  57. package/dist/translations/en-gb.js +2 -2
  58. package/dist/translations/en-gb.umd.js +2 -2
  59. package/dist/translations/en.d.ts +2 -2
  60. package/dist/translations/en.js +2 -2
  61. package/dist/translations/en.umd.js +2 -2
  62. package/dist/translations/eo.d.ts +2 -2
  63. package/dist/translations/eo.js +2 -2
  64. package/dist/translations/eo.umd.js +2 -2
  65. package/dist/translations/es-co.d.ts +2 -2
  66. package/dist/translations/es-co.js +2 -2
  67. package/dist/translations/es-co.umd.js +2 -2
  68. package/dist/translations/es.d.ts +2 -2
  69. package/dist/translations/es.js +2 -2
  70. package/dist/translations/es.umd.js +2 -2
  71. package/dist/translations/et.d.ts +2 -2
  72. package/dist/translations/et.js +2 -2
  73. package/dist/translations/et.umd.js +2 -2
  74. package/dist/translations/eu.d.ts +2 -2
  75. package/dist/translations/eu.js +2 -2
  76. package/dist/translations/eu.umd.js +2 -2
  77. package/dist/translations/fa.d.ts +2 -2
  78. package/dist/translations/fa.js +2 -2
  79. package/dist/translations/fa.umd.js +2 -2
  80. package/dist/translations/fi.d.ts +2 -2
  81. package/dist/translations/fi.js +2 -2
  82. package/dist/translations/fi.umd.js +2 -2
  83. package/dist/translations/fr.d.ts +2 -2
  84. package/dist/translations/fr.js +2 -2
  85. package/dist/translations/fr.umd.js +2 -2
  86. package/dist/translations/gl.d.ts +2 -2
  87. package/dist/translations/gl.js +2 -2
  88. package/dist/translations/gl.umd.js +2 -2
  89. package/dist/translations/gu.d.ts +2 -2
  90. package/dist/translations/gu.js +2 -2
  91. package/dist/translations/gu.umd.js +2 -2
  92. package/dist/translations/he.d.ts +2 -2
  93. package/dist/translations/he.js +2 -2
  94. package/dist/translations/he.umd.js +2 -2
  95. package/dist/translations/hi.d.ts +2 -2
  96. package/dist/translations/hi.js +2 -2
  97. package/dist/translations/hi.umd.js +2 -2
  98. package/dist/translations/hr.d.ts +2 -2
  99. package/dist/translations/hr.js +2 -2
  100. package/dist/translations/hr.umd.js +2 -2
  101. package/dist/translations/hu.d.ts +2 -2
  102. package/dist/translations/hu.js +2 -2
  103. package/dist/translations/hu.umd.js +2 -2
  104. package/dist/translations/hy.d.ts +2 -2
  105. package/dist/translations/hy.js +2 -2
  106. package/dist/translations/hy.umd.js +2 -2
  107. package/dist/translations/id.d.ts +2 -2
  108. package/dist/translations/id.js +2 -2
  109. package/dist/translations/id.umd.js +2 -2
  110. package/dist/translations/it.d.ts +2 -2
  111. package/dist/translations/it.js +2 -2
  112. package/dist/translations/it.umd.js +2 -2
  113. package/dist/translations/ja.d.ts +2 -2
  114. package/dist/translations/ja.js +2 -2
  115. package/dist/translations/ja.umd.js +2 -2
  116. package/dist/translations/jv.d.ts +2 -2
  117. package/dist/translations/jv.js +2 -2
  118. package/dist/translations/jv.umd.js +2 -2
  119. package/dist/translations/kk.d.ts +2 -2
  120. package/dist/translations/kk.js +2 -2
  121. package/dist/translations/kk.umd.js +2 -2
  122. package/dist/translations/km.d.ts +2 -2
  123. package/dist/translations/km.js +2 -2
  124. package/dist/translations/km.umd.js +2 -2
  125. package/dist/translations/kn.d.ts +2 -2
  126. package/dist/translations/kn.js +2 -2
  127. package/dist/translations/kn.umd.js +2 -2
  128. package/dist/translations/ko.d.ts +2 -2
  129. package/dist/translations/ko.js +2 -2
  130. package/dist/translations/ko.umd.js +2 -2
  131. package/dist/translations/ku.d.ts +2 -2
  132. package/dist/translations/ku.js +2 -2
  133. package/dist/translations/ku.umd.js +2 -2
  134. package/dist/translations/lt.d.ts +2 -2
  135. package/dist/translations/lt.js +2 -2
  136. package/dist/translations/lt.umd.js +2 -2
  137. package/dist/translations/lv.d.ts +2 -2
  138. package/dist/translations/lv.js +2 -2
  139. package/dist/translations/lv.umd.js +2 -2
  140. package/dist/translations/ms.d.ts +2 -2
  141. package/dist/translations/ms.js +2 -2
  142. package/dist/translations/ms.umd.js +2 -2
  143. package/dist/translations/nb.d.ts +2 -2
  144. package/dist/translations/nb.js +2 -2
  145. package/dist/translations/nb.umd.js +2 -2
  146. package/dist/translations/ne.d.ts +2 -2
  147. package/dist/translations/ne.js +2 -2
  148. package/dist/translations/ne.umd.js +2 -2
  149. package/dist/translations/nl.d.ts +2 -2
  150. package/dist/translations/nl.js +2 -2
  151. package/dist/translations/nl.umd.js +2 -2
  152. package/dist/translations/no.d.ts +2 -2
  153. package/dist/translations/no.js +2 -2
  154. package/dist/translations/no.umd.js +2 -2
  155. package/dist/translations/oc.d.ts +2 -2
  156. package/dist/translations/oc.js +2 -2
  157. package/dist/translations/oc.umd.js +2 -2
  158. package/dist/translations/pl.d.ts +2 -2
  159. package/dist/translations/pl.js +2 -2
  160. package/dist/translations/pl.umd.js +2 -2
  161. package/dist/translations/pt-br.d.ts +2 -2
  162. package/dist/translations/pt-br.js +2 -2
  163. package/dist/translations/pt-br.umd.js +2 -2
  164. package/dist/translations/pt.d.ts +2 -2
  165. package/dist/translations/pt.js +2 -2
  166. package/dist/translations/pt.umd.js +2 -2
  167. package/dist/translations/ro.d.ts +2 -2
  168. package/dist/translations/ro.js +2 -2
  169. package/dist/translations/ro.umd.js +2 -2
  170. package/dist/translations/ru.d.ts +2 -2
  171. package/dist/translations/ru.js +2 -2
  172. package/dist/translations/ru.umd.js +2 -2
  173. package/dist/translations/si.d.ts +2 -2
  174. package/dist/translations/si.js +2 -2
  175. package/dist/translations/si.umd.js +2 -2
  176. package/dist/translations/sk.d.ts +2 -2
  177. package/dist/translations/sk.js +2 -2
  178. package/dist/translations/sk.umd.js +2 -2
  179. package/dist/translations/sl.d.ts +2 -2
  180. package/dist/translations/sl.js +2 -2
  181. package/dist/translations/sl.umd.js +2 -2
  182. package/dist/translations/sq.d.ts +2 -2
  183. package/dist/translations/sq.js +2 -2
  184. package/dist/translations/sq.umd.js +2 -2
  185. package/dist/translations/sr-latn.d.ts +2 -2
  186. package/dist/translations/sr-latn.js +2 -2
  187. package/dist/translations/sr-latn.umd.js +2 -2
  188. package/dist/translations/sr.d.ts +2 -2
  189. package/dist/translations/sr.js +2 -2
  190. package/dist/translations/sr.umd.js +2 -2
  191. package/dist/translations/sv.d.ts +2 -2
  192. package/dist/translations/sv.js +2 -2
  193. package/dist/translations/sv.umd.js +2 -2
  194. package/dist/translations/th.d.ts +2 -2
  195. package/dist/translations/th.js +2 -2
  196. package/dist/translations/th.umd.js +2 -2
  197. package/dist/translations/ti.d.ts +2 -2
  198. package/dist/translations/ti.js +2 -2
  199. package/dist/translations/ti.umd.js +2 -2
  200. package/dist/translations/tk.d.ts +2 -2
  201. package/dist/translations/tk.js +2 -2
  202. package/dist/translations/tk.umd.js +2 -2
  203. package/dist/translations/tr.d.ts +2 -2
  204. package/dist/translations/tr.js +2 -2
  205. package/dist/translations/tr.umd.js +2 -2
  206. package/dist/translations/tt.d.ts +2 -2
  207. package/dist/translations/tt.js +2 -2
  208. package/dist/translations/tt.umd.js +2 -2
  209. package/dist/translations/ug.d.ts +2 -2
  210. package/dist/translations/ug.js +2 -2
  211. package/dist/translations/ug.umd.js +2 -2
  212. package/dist/translations/uk.d.ts +2 -2
  213. package/dist/translations/uk.js +2 -2
  214. package/dist/translations/uk.umd.js +2 -2
  215. package/dist/translations/ur.d.ts +2 -2
  216. package/dist/translations/ur.js +2 -2
  217. package/dist/translations/ur.umd.js +2 -2
  218. package/dist/translations/uz.d.ts +2 -2
  219. package/dist/translations/uz.js +2 -2
  220. package/dist/translations/uz.umd.js +2 -2
  221. package/dist/translations/vi.d.ts +2 -2
  222. package/dist/translations/vi.js +2 -2
  223. package/dist/translations/vi.umd.js +2 -2
  224. package/dist/translations/zh-cn.d.ts +2 -2
  225. package/dist/translations/zh-cn.js +2 -2
  226. package/dist/translations/zh-cn.umd.js +2 -2
  227. package/dist/translations/zh.d.ts +2 -2
  228. package/dist/translations/zh.js +2 -2
  229. package/dist/translations/zh.umd.js +2 -2
  230. package/lang/translations/af.po +1 -1
  231. package/lang/translations/ar.po +1 -1
  232. package/lang/translations/ast.po +1 -1
  233. package/lang/translations/az.po +1 -1
  234. package/lang/translations/be.po +36 -0
  235. package/lang/translations/bg.po +1 -1
  236. package/lang/translations/bn.po +1 -1
  237. package/lang/translations/bs.po +1 -1
  238. package/lang/translations/ca.po +1 -1
  239. package/lang/translations/cs.po +1 -1
  240. package/lang/translations/da.po +1 -1
  241. package/lang/translations/de-ch.po +1 -1
  242. package/lang/translations/de.po +1 -1
  243. package/lang/translations/el.po +1 -1
  244. package/lang/translations/en-au.po +1 -1
  245. package/lang/translations/en-gb.po +1 -1
  246. package/lang/translations/en.po +1 -1
  247. package/lang/translations/eo.po +1 -1
  248. package/lang/translations/es-co.po +1 -1
  249. package/lang/translations/es.po +1 -1
  250. package/lang/translations/et.po +1 -1
  251. package/lang/translations/eu.po +1 -1
  252. package/lang/translations/fa.po +1 -1
  253. package/lang/translations/fi.po +1 -1
  254. package/lang/translations/fr.po +1 -1
  255. package/lang/translations/gl.po +1 -1
  256. package/lang/translations/gu.po +1 -1
  257. package/lang/translations/he.po +1 -1
  258. package/lang/translations/hi.po +1 -1
  259. package/lang/translations/hr.po +1 -1
  260. package/lang/translations/hu.po +1 -1
  261. package/lang/translations/hy.po +1 -1
  262. package/lang/translations/id.po +1 -1
  263. package/lang/translations/it.po +1 -1
  264. package/lang/translations/ja.po +1 -1
  265. package/lang/translations/jv.po +1 -1
  266. package/lang/translations/kk.po +1 -1
  267. package/lang/translations/km.po +1 -1
  268. package/lang/translations/kn.po +1 -1
  269. package/lang/translations/ko.po +1 -1
  270. package/lang/translations/ku.po +1 -1
  271. package/lang/translations/lt.po +1 -1
  272. package/lang/translations/lv.po +1 -1
  273. package/lang/translations/ms.po +1 -1
  274. package/lang/translations/nb.po +1 -1
  275. package/lang/translations/ne.po +1 -1
  276. package/lang/translations/nl.po +1 -1
  277. package/lang/translations/no.po +1 -1
  278. package/lang/translations/oc.po +1 -1
  279. package/lang/translations/pl.po +1 -1
  280. package/lang/translations/pt-br.po +1 -1
  281. package/lang/translations/pt.po +1 -1
  282. package/lang/translations/ro.po +1 -1
  283. package/lang/translations/ru.po +1 -1
  284. package/lang/translations/si.po +1 -1
  285. package/lang/translations/sk.po +1 -1
  286. package/lang/translations/sl.po +1 -1
  287. package/lang/translations/sq.po +1 -1
  288. package/lang/translations/sr-latn.po +1 -1
  289. package/lang/translations/sr.po +1 -1
  290. package/lang/translations/sv.po +1 -1
  291. package/lang/translations/th.po +1 -1
  292. package/lang/translations/ti.po +1 -1
  293. package/lang/translations/tk.po +1 -1
  294. package/lang/translations/tr.po +1 -1
  295. package/lang/translations/tt.po +1 -1
  296. package/lang/translations/ug.po +1 -1
  297. package/lang/translations/uk.po +1 -1
  298. package/lang/translations/ur.po +1 -1
  299. package/lang/translations/uz.po +1 -1
  300. package/lang/translations/vi.po +1 -1
  301. package/lang/translations/zh-cn.po +1 -1
  302. package/lang/translations/zh.po +1 -1
  303. package/package.json +13 -9
  304. package/src/alignment.d.ts +4 -4
  305. package/src/alignment.js +4 -4
  306. package/src/alignmentcommand.d.ts +5 -5
  307. package/src/alignmentcommand.js +2 -2
  308. package/src/alignmentconfig.d.ts +4 -4
  309. package/src/alignmentconfig.js +1 -1
  310. package/src/alignmentediting.d.ts +2 -2
  311. package/src/alignmentediting.js +3 -3
  312. package/src/alignmentui.d.ts +5 -5
  313. package/src/alignmentui.js +9 -8
  314. package/src/augmentation.d.ts +1 -1
  315. package/src/augmentation.js +1 -1
  316. package/src/index.d.ts +7 -6
  317. package/src/index.js +6 -4
  318. package/src/utils.d.ts +8 -3
  319. package/src/utils.js +12 -7
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 Text alignment feature** (https://github.com/ckeditor/ckeditor5)<br>
5
- Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 2003–2025, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under a dual-license model, this software is available under:
8
8
 
@@ -11,10 +11,10 @@ Licensed under a dual-license model, this software is available under:
11
11
 
12
12
  For more information, see: [https://ckeditor.com/legal/ckeditor-licensing-options](https://ckeditor.com/legal/ckeditor-licensing-options).
13
13
 
14
- Sources of Intellectual Property Included in CKEditor
15
- -----------------------------------------------------
14
+ Sources of Intellectual Property Included in CKEditor&nbsp;5
15
+ ------------------------------------------------------------
16
16
 
17
- Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
17
+ Where not otherwise indicated, all CKEditor&nbsp;5 content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor&nbsp;5 will incorporate work done by developers outside of CKSource with their express permission.
18
18
 
19
19
  Trademarks
20
20
  ----------
package/README.md CHANGED
@@ -2,7 +2,7 @@ CKEditor&nbsp;5 text alignment feature
2
2
  ========================================
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-alignment.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-alignment)
5
- [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
5
+ [![codecov](https://codecov.io/gh/ckeditor/ckeditor5/branch/master/graph/badge.svg)](https://codecov.io/gh/ckeditor/ckeditor5)
6
6
  [![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5?branch=master)
7
7
 
8
8
  This package implements text alignment support for CKEditor&nbsp;5.
@@ -1,5 +1,5 @@
1
1
  !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Align center":"Align center","Align left":"Align left","Align right":"Align right",Justify:"Justify","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
2
2
  /*!
3
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>f,AlignmentEditing:()=>u,AlignmentUI:()=>m});var e=n(782),t=n(584);const o=["left","right","center","justify"];function a(e){return o.includes(e)}function r(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function s(e){const n=e.map((e=>{let t;return t="string"==typeof e?{name:e}:e,t})).filter((e=>{const n=o.includes(e.name);return n||(0,t.logWarning)("alignment-config-name-not-recognized",{option:e}),n})),i=n.filter((e=>Boolean(e.className))).length;if(i&&i<n.length)throw new t.CKEditorError("alignment-config-classnames-are-missing",{configuredOptions:e});return n.forEach(((n,i,o)=>{const a=o.slice(i+1);if(a.some((e=>e.name==n.name)))throw new t.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:e});if(n.className){if(a.some((e=>e.className==n.className)))throw new t.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:e})}})),n}const l="alignment";class c extends e.Command{refresh(){const e=this.editor.locale,n=(0,t.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(n)&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,o=i.document,a=e.value;i.change((e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter((e=>this._canBeAligned(e))),i=t[0].getAttribute("alignment");r(a,n)||i===a||!a?function(e,t){for(const n of e)t.removeAttribute(l,n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute(l,n,i)}(t,e,a)}))}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,l)}}class u extends e.Plugin{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:o.map((e=>({name:e})))})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=s(e.config.get("alignment.options")).filter((e=>a(e.name)&&!r(e.name,t))),o=i.some((e=>!!e.className));n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?e.conversion.attributeToAttribute(function(e){const t={};for(const n of e)t[n.name]={key:"class",value:n.className};const n={model:{key:"alignment",values:e.map((e=>e.name))},view:t};return n}(i)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={};for(const{name:n}of e)t[n]={key:"style",value:{"text-align":n}};const n={model:{key:"alignment",values:e.map((e=>e.name))},view:t};return n}(i));const l=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return t}(i);for(const t of l)e.conversion.for("upcast").attributeToAttribute(t);const u=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return t}(i);for(const t of u)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new c(e))}}var g=n(311);const d=(()=>new Map([["left",e.icons.alignLeft],["right",e.icons.alignRight],["center",e.icons.alignCenter],["justify",e.icons.alignJustify]]))();class m extends e.Plugin{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=s(this.editor.config.get("alignment.options"));e.map((e=>e.name)).filter(a).forEach((e=>this._addButton(e))),this._addToolbarDropdown(e),this._addMenuBarMenu(e)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,(t=>this._createButton(t,e)))}_createButton(e,t,n={}){const i=this.editor,o=i.commands.get("alignment"),a=new g.ButtonView(e);return a.set({label:this.localizedOptionTitles[t],icon:d.get(t),tooltip:!0,isToggleable:!0,...n}),a.bind("isEnabled").to(o),a.bind("isOn").to(o,"value",(e=>e===t)),this.listenTo(a,"execute",(()=>{i.execute("alignment",{value:t}),i.editing.view.focus()})),a}_addToolbarDropdown(e){const t=this.editor;t.ui.componentFactory.add("alignment",(n=>{const i=(0,g.createDropdown)(n),o="rtl"===n.uiLanguageDirection?"w":"e",a=n.t;(0,g.addToolbarToDropdown)(i,(()=>e.map((e=>this._createButton(n,e.name,{tooltipPosition:o})))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:a("Text alignment toolbar")}),i.buttonView.set({label:a("Text alignment"),tooltip:!0}),i.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r="rtl"===n.contentLanguageDirection?d.get("right"):d.get("left"),s=t.commands.get("alignment");return i.buttonView.bind("icon").to(s,"value",(e=>d.get(e)||r)),i.bind("isEnabled").to(s,"isEnabled"),this.listenTo(i,"execute",(()=>{t.editing.view.focus()})),i}))}_addMenuBarMenu(e){const t=this.editor;t.ui.componentFactory.add("menuBar:alignment",(n=>{const i=t.commands.get("alignment"),o=n.t,a=new g.MenuBarMenuView(n),r=new g.MenuBarMenuListView(n);a.bind("isEnabled").to(i),r.set({ariaLabel:o("Text alignment"),role:"menu"}),a.buttonView.set({label:o("Text alignment")});for(const o of e){const e=new g.MenuBarMenuListItemView(n,a),s=new g.MenuBarMenuListItemButtonView(n);s.delegate("execute").to(a),s.set({label:this.localizedOptionTitles[o.name],icon:d.get(o.name),role:"menuitemcheckbox",isToggleable:!0}),s.on("execute",(()=>{t.execute("alignment",{value:o.name}),t.editing.view.focus()})),s.bind("isOn").to(i,"value",(e=>e===o.name)),s.bind("isEnabled").to(i,"isEnabled"),e.children.add(s),r.items.add(e)}return a.panelView.children.add(r),a}))}}class f extends e.Plugin{static get requires(){return[u,m]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).alignment=i})();
5
+ */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},355:(e,t,n)=>{e.exports=n(237)("./src/icons.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{Alignment:()=>p,AlignmentCommand:()=>c,AlignmentEditing:()=>u,AlignmentUI:()=>f,_ALIGNMENT_SUPPORTED_OPTIONS:()=>o,_isAlignmentSupported:()=>a,_isDefaultAlignment:()=>r,_normalizeAlignmentOptions:()=>l});var e=n(782),t=n(584);const o=["left","right","center","justify"];function a(e){return o.includes(e)}function r(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function l(e){const n=e.map(e=>{let t;return t="string"==typeof e?{name:e}:e,t}).filter(e=>{const n=o.includes(e.name);return n||(0,t.logWarning)("alignment-config-name-not-recognized",{option:e}),n}),i=n.filter(e=>Boolean(e.className)).length;if(i&&i<n.length)throw new t.CKEditorError("alignment-config-classnames-are-missing",{configuredOptions:e});return n.forEach((n,i,o)=>{const a=o.slice(i+1);if(a.some(e=>e.name==n.name))throw new t.CKEditorError("alignment-config-name-already-defined",{option:n,configuredOptions:e});if(n.className){if(a.some(e=>e.className==n.className))throw new t.CKEditorError("alignment-config-classname-already-defined",{option:n,configuredOptions:e})}}),n}const s="alignment";class c extends e.Command{refresh(){const e=this.editor.locale,n=(0,t.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(n)&&this._canBeAligned(n),this.isEnabled&&n.hasAttribute("alignment")?this.value=n.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,o=i.document,a=e.value;i.change(e=>{const t=Array.from(o.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e)),i=t[0].getAttribute("alignment");r(a,n)||i===a||!a?function(e,t){for(const n of e)t.removeAttribute(s,n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute(s,n,i)}(t,e,a)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,s)}}class u extends e.Plugin{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:o.map(e=>({name:e}))})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=l(e.config.get("alignment.options")).filter(e=>a(e.name)&&!r(e.name,t)),o=i.some(e=>!!e.className);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?e.conversion.attributeToAttribute(function(e){const t={};for(const n of e)t[n.name]={key:"class",value:n.className};const n={model:{key:"alignment",values:e.map(e=>e.name)},view:t};return n}(i)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={};for(const{name:n}of e)t[n]={key:"style",value:{"text-align":n}};const n={model:{key:"alignment",values:e.map(e=>e.name)},view:t};return n}(i));const s=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return t}(i);for(const t of s)e.conversion.for("upcast").attributeToAttribute(t);const u=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return t}(i);for(const t of u)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new c(e))}}var g=n(311),d=n(355);const m=(()=>new Map([["left",d.IconAlignLeft],["right",d.IconAlignRight],["center",d.IconAlignCenter],["justify",d.IconAlignJustify]]))();class f extends e.Plugin{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=l(this.editor.config.get("alignment.options"));e.map(e=>e.name).filter(a).forEach(e=>this._addButton(e)),this._addToolbarDropdown(e),this._addMenuBarMenu(e)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,t=>this._createButton(t,e))}_createButton(e,t,n={}){const i=this.editor,o=i.commands.get("alignment"),a=new g.ButtonView(e);return a.set({label:this.localizedOptionTitles[t],icon:m.get(t),tooltip:!0,isToggleable:!0,...n}),a.bind("isEnabled").to(o),a.bind("isOn").to(o,"value",e=>e===t),this.listenTo(a,"execute",()=>{i.execute("alignment",{value:t}),i.editing.view.focus()}),a}_addToolbarDropdown(e){const t=this.editor;t.ui.componentFactory.add("alignment",n=>{const i=(0,g.createDropdown)(n),o="rtl"===n.uiLanguageDirection?"w":"e",a=n.t;(0,g.addToolbarToDropdown)(i,()=>e.map(e=>this._createButton(n,e.name,{tooltipPosition:o})),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:a("Text alignment toolbar")}),i.buttonView.set({label:a("Text alignment"),tooltip:!0}),i.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r="rtl"===n.contentLanguageDirection?m.get("right"):m.get("left"),l=t.commands.get("alignment");return i.buttonView.bind("icon").to(l,"value",e=>m.get(e)||r),i.bind("isEnabled").to(l,"isEnabled"),this.listenTo(i,"execute",()=>{t.editing.view.focus()}),i})}_addMenuBarMenu(e){const t=this.editor;t.ui.componentFactory.add("menuBar:alignment",n=>{const i=t.commands.get("alignment"),o=n.t,a=new g.MenuBarMenuView(n),r=new g.MenuBarMenuListView(n);a.bind("isEnabled").to(i),r.set({ariaLabel:o("Text alignment"),role:"menu"}),a.buttonView.set({label:o("Text alignment")});for(const o of e){const e=new g.MenuBarMenuListItemView(n,a),l=new g.MenuBarMenuListItemButtonView(n);l.delegate("execute").to(a),l.set({label:this.localizedOptionTitles[o.name],icon:m.get(o.name),role:"menuitemcheckbox",isToggleable:!0}),l.on("execute",()=>{t.execute("alignment",{value:o.name}),t.editing.view.focus()}),l.bind("isOn").to(i,"value",e=>e===o.name),l.bind("isEnabled").to(i,"isEnabled"),e.children.add(l),r.items.add(e)}return a.panelView.children.add(r),a})}}class p extends e.Plugin{static get requires(){return[u,f]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).alignment=i})();
@@ -0,0 +1 @@
1
+ !function(n){const i=n.be=n.be||{};i.dictionary=Object.assign(i.dictionary||{},{"Align center":"Выраўнаваць па цэнтры","Align left":"Выраўнаваць па левым краі","Align right":"Выраўнаваць па правым краі",Justify:"Выраўнаваць па шырыні","Text alignment":"Выраўнаваць тэкст","Text alignment toolbar":"Выраўноўванне"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "type": "SplitButton",
12
12
  "name": "alignment",
13
- "iconPath": "@ckeditor/ckeditor5-core/theme/icons/align-left.svg"
13
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/align-left.svg"
14
14
  }
15
15
  ],
16
16
  "htmlOutput": [
@@ -1,4 +1,4 @@
1
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
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
@@ -1,4 +1,4 @@
1
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
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
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
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
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
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';
5
+ import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
6
  import { logWarning, CKEditorError, first } from '@ckeditor/ckeditor5-utils/dist/index.js';
7
7
  import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, MenuBarMenuListView, MenuBarMenuListItemView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
8
+ import { IconAlignLeft, IconAlignRight, IconAlignCenter, IconAlignJustify } from '@ckeditor/ckeditor5-icons/dist/index.js';
8
9
 
9
10
  /**
10
11
  * @module alignment/utils
@@ -15,6 +16,8 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
15
16
  * * `'right'`,
16
17
  * * `'center'`,
17
18
  * * `'justify'`
19
+ *
20
+ * @internal
18
21
  */ const supportedOptions = [
19
22
  'left',
20
23
  'right',
@@ -24,6 +27,7 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
24
27
  /**
25
28
  * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
26
29
  *
30
+ * @internal
27
31
  * @param option The option value to check.
28
32
  */ function isSupported(option) {
29
33
  return supportedOptions.includes(option);
@@ -32,6 +36,7 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
32
36
  * Checks whether alignment is the default one considering the direction
33
37
  * of the editor content.
34
38
  *
39
+ * @internal
35
40
  * @param alignment The name of the alignment to check.
36
41
  * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
37
42
  */ function isDefault(alignment, locale) {
@@ -45,6 +50,7 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
45
50
  /**
46
51
  * Brings the configuration to the common form, an array of objects.
47
52
  *
53
+ * @internal
48
54
  * @param configuredOptions Alignment plugin configuration.
49
55
  * @returns Normalized object holding the configuration.
50
56
  */ function normalizeAlignmentOptions(configuredOptions) {
@@ -63,12 +69,12 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
63
69
  const isNameValid = supportedOptions.includes(option.name);
64
70
  if (!isNameValid) {
65
71
  /**
66
- * The `name` in one of the `alignment.options` is not recognized.
67
- * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.
68
- *
69
- * @error alignment-config-name-not-recognized
70
- * @param option Options with unknown value of the `name` property.
71
- */ logWarning('alignment-config-name-not-recognized', {
72
+ * The `name` in one of the `alignment.options` is not recognized.
73
+ * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.
74
+ *
75
+ * @error alignment-config-name-not-recognized
76
+ * @param {object} option Options with unknown value of the `name` property.
77
+ */ logWarning('alignment-config-name-not-recognized', {
72
78
  option
73
79
  });
74
80
  }
@@ -78,11 +84,11 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
78
84
  // We either use classes for all styling options or for none.
79
85
  if (classNameCount && classNameCount < normalizedOptions.length) {
80
86
  /**
81
- * The `className` property has to be defined for all options once at least one option declares `className`.
82
- *
83
- * @error alignment-config-classnames-are-missing
84
- * @param configuredOptions Contents of `alignment.options`.
85
- */ throw new CKEditorError('alignment-config-classnames-are-missing', {
87
+ * The `className` property has to be defined for all options once at least one option declares `className`.
88
+ *
89
+ * @error alignment-config-classnames-are-missing
90
+ * @param {object} configuredOptions Contents of `alignment.options`.
91
+ */ throw new CKEditorError('alignment-config-classnames-are-missing', {
86
92
  configuredOptions
87
93
  });
88
94
  }
@@ -92,13 +98,13 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
92
98
  const nameAlreadyExists = succeedingOptions.some((item)=>item.name == option.name);
93
99
  if (nameAlreadyExists) {
94
100
  /**
95
- * The same `name` in one of the `alignment.options` was already declared.
96
- * Each `name` representing one alignment option can be set exactly once.
97
- *
98
- * @error alignment-config-name-already-defined
99
- * @param option First option that declares given `name`.
100
- * @param configuredOptions Contents of `alignment.options`.
101
- */ throw new CKEditorError('alignment-config-name-already-defined', {
101
+ * The same `name` in one of the `alignment.options` was already declared.
102
+ * Each `name` representing one alignment option can be set exactly once.
103
+ *
104
+ * @error alignment-config-name-already-defined
105
+ * @param {object} option First option that declares given `name`.
106
+ * @param {object} configuredOptions Contents of `alignment.options`.
107
+ */ throw new CKEditorError('alignment-config-name-already-defined', {
102
108
  option,
103
109
  configuredOptions
104
110
  });
@@ -108,13 +114,13 @@ import { ButtonView, createDropdown, addToolbarToDropdown, MenuBarMenuView, Menu
108
114
  const classNameAlreadyExists = succeedingOptions.some((item)=>item.className == option.className);
109
115
  if (classNameAlreadyExists) {
110
116
  /**
111
- * The same `className` in one of the `alignment.options` was already declared.
112
- *
113
- * @error alignment-config-classname-already-defined
114
- * @param option First option that declares given `className`.
115
- * @param configuredOptions
116
- * Contents of `alignment.options`.
117
- */ throw new CKEditorError('alignment-config-classname-already-defined', {
117
+ * The same `className` in one of the `alignment.options` was already declared.
118
+ *
119
+ * @error alignment-config-classname-already-defined
120
+ * @param {object} option First option that declares given `className`.
121
+ * @param {object} configuredOptions
122
+ * Contents of `alignment.options`.
123
+ */ throw new CKEditorError('alignment-config-classname-already-defined', {
118
124
  option,
119
125
  configuredOptions
120
126
  });
@@ -129,8 +135,8 @@ const ALIGNMENT = 'alignment';
129
135
  * The alignment command plugin.
130
136
  */ class AlignmentCommand extends Command {
131
137
  /**
132
- * @inheritDoc
133
- */ refresh() {
138
+ * @inheritDoc
139
+ */ refresh() {
134
140
  const editor = this.editor;
135
141
  const locale = editor.locale;
136
142
  const firstBlock = first(this.editor.model.document.selection.getSelectedBlocks());
@@ -143,14 +149,14 @@ const ALIGNMENT = 'alignment';
143
149
  }
144
150
  }
145
151
  /**
146
- * Executes the command. Applies the alignment `value` to the selected blocks.
147
- * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
148
- * the command will remove the attribute from the selected blocks.
149
- *
150
- * @param options Options for the executed command.
151
- * @param options.value The value to apply.
152
- * @fires execute
153
- */ execute(options = {}) {
152
+ * Executes the command. Applies the alignment `value` to the selected blocks.
153
+ * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
154
+ * the command will remove the attribute from the selected blocks.
155
+ *
156
+ * @param options Options for the executed command.
157
+ * @param options.value The value to apply.
158
+ * @fires execute
159
+ */ execute(options = {}) {
154
160
  const editor = this.editor;
155
161
  const locale = editor.locale;
156
162
  const model = editor.model;
@@ -173,10 +179,10 @@ const ALIGNMENT = 'alignment';
173
179
  });
174
180
  }
175
181
  /**
176
- * Checks whether a block can have alignment set.
177
- *
178
- * @param block The block to be checked.
179
- */ _canBeAligned(block) {
182
+ * Checks whether a block can have alignment set.
183
+ *
184
+ * @param block The block to be checked.
185
+ */ _canBeAligned(block) {
180
186
  return this.editor.model.schema.checkAttribute(block, ALIGNMENT);
181
187
  }
182
188
  }
@@ -200,18 +206,18 @@ const ALIGNMENT = 'alignment';
200
206
  * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
201
207
  */ class AlignmentEditing extends Plugin {
202
208
  /**
203
- * @inheritDoc
204
- */ static get pluginName() {
209
+ * @inheritDoc
210
+ */ static get pluginName() {
205
211
  return 'AlignmentEditing';
206
212
  }
207
213
  /**
208
- * @inheritDoc
209
- */ static get isOfficialPlugin() {
214
+ * @inheritDoc
215
+ */ static get isOfficialPlugin() {
210
216
  return true;
211
217
  }
212
218
  /**
213
- * @inheritDoc
214
- */ constructor(editor){
219
+ * @inheritDoc
220
+ */ constructor(editor){
215
221
  super(editor);
216
222
  editor.config.define('alignment', {
217
223
  options: supportedOptions.map((option)=>({
@@ -220,8 +226,8 @@ const ALIGNMENT = 'alignment';
220
226
  });
221
227
  }
222
228
  /**
223
- * @inheritDoc
224
- */ init() {
229
+ * @inheritDoc
230
+ */ init() {
225
231
  const editor = this.editor;
226
232
  const locale = editor.locale;
227
233
  const schema = editor.model.schema;
@@ -338,19 +344,19 @@ const ALIGNMENT = 'alignment';
338
344
  const iconsMap = /* #__PURE__ */ (()=>new Map([
339
345
  [
340
346
  'left',
341
- icons.alignLeft
347
+ IconAlignLeft
342
348
  ],
343
349
  [
344
350
  'right',
345
- icons.alignRight
351
+ IconAlignRight
346
352
  ],
347
353
  [
348
354
  'center',
349
- icons.alignCenter
355
+ IconAlignCenter
350
356
  ],
351
357
  [
352
358
  'justify',
353
- icons.alignJustify
359
+ IconAlignJustify
354
360
  ]
355
361
  ]))();
356
362
  /**
@@ -360,18 +366,18 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
360
366
  * and the `'alignment'` dropdown.
361
367
  */ class AlignmentUI extends Plugin {
362
368
  /**
363
- * Returns the localized option titles provided by the plugin.
364
- *
365
- * The following localized titles corresponding with
366
- * {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:
367
- *
368
- * * `'left'`,
369
- * * `'right'`,
370
- * * `'center'`,
371
- * * `'justify'`.
372
- *
373
- * @readonly
374
- */ get localizedOptionTitles() {
369
+ * Returns the localized option titles provided by the plugin.
370
+ *
371
+ * The following localized titles corresponding with
372
+ * {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:
373
+ *
374
+ * * `'left'`,
375
+ * * `'right'`,
376
+ * * `'center'`,
377
+ * * `'justify'`.
378
+ *
379
+ * @readonly
380
+ */ get localizedOptionTitles() {
375
381
  const t = this.editor.t;
376
382
  return {
377
383
  'left': t('Align left'),
@@ -381,18 +387,18 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
381
387
  };
382
388
  }
383
389
  /**
384
- * @inheritDoc
385
- */ static get pluginName() {
390
+ * @inheritDoc
391
+ */ static get pluginName() {
386
392
  return 'AlignmentUI';
387
393
  }
388
394
  /**
389
- * @inheritDoc
390
- */ static get isOfficialPlugin() {
395
+ * @inheritDoc
396
+ */ static get isOfficialPlugin() {
391
397
  return true;
392
398
  }
393
399
  /**
394
- * @inheritDoc
395
- */ init() {
400
+ * @inheritDoc
401
+ */ init() {
396
402
  const editor = this.editor;
397
403
  const options = normalizeAlignmentOptions(editor.config.get('alignment.options'));
398
404
  options.map((option)=>option.name).filter(isSupported).forEach((option)=>this._addButton(option));
@@ -400,20 +406,20 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
400
406
  this._addMenuBarMenu(options);
401
407
  }
402
408
  /**
403
- * Helper method for initializing the button and linking it with an appropriate command.
404
- *
405
- * @param option The name of the alignment option for which the button is added.
406
- */ _addButton(option) {
409
+ * Helper method for initializing the button and linking it with an appropriate command.
410
+ *
411
+ * @param option The name of the alignment option for which the button is added.
412
+ */ _addButton(option) {
407
413
  const editor = this.editor;
408
414
  editor.ui.componentFactory.add(`alignment:${option}`, (locale)=>this._createButton(locale, option));
409
415
  }
410
416
  /**
411
- * Helper method for creating the button view element.
412
- *
413
- * @param locale Editor locale.
414
- * @param option The name of the alignment option for which the button is added.
415
- * @param buttonAttrs Optional parameters passed to button view instance.
416
- */ _createButton(locale, option, buttonAttrs = {}) {
417
+ * Helper method for creating the button view element.
418
+ *
419
+ * @param locale Editor locale.
420
+ * @param option The name of the alignment option for which the button is added.
421
+ * @param buttonAttrs Optional parameters passed to button view instance.
422
+ */ _createButton(locale, option, buttonAttrs = {}) {
417
423
  const editor = this.editor;
418
424
  const command = editor.commands.get('alignment');
419
425
  const buttonView = new ButtonView(locale);
@@ -437,10 +443,10 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
437
443
  return buttonView;
438
444
  }
439
445
  /**
440
- * Helper method for initializing the toolnar dropdown and linking it with an appropriate command.
441
- *
442
- * @param option The name of the alignment option for which the button is added.
443
- */ _addToolbarDropdown(options) {
446
+ * Helper method for initializing the toolnar dropdown and linking it with an appropriate command.
447
+ *
448
+ * @param options The name of the alignment option for which the button is added.
449
+ */ _addToolbarDropdown(options) {
444
450
  const editor = this.editor;
445
451
  const factory = editor.ui.componentFactory;
446
452
  factory.add('alignment', (locale)=>{
@@ -481,10 +487,10 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
481
487
  });
482
488
  }
483
489
  /**
484
- * Creates a menu for all alignment options to use either in menu bar.
485
- *
486
- * @param options Normalized alignment options from config.
487
- */ _addMenuBarMenu(options) {
490
+ * Creates a menu for all alignment options to use either in menu bar.
491
+ *
492
+ * @param options Normalized alignment options from config.
493
+ */ _addMenuBarMenu(options) {
488
494
  const editor = this.editor;
489
495
  editor.ui.componentFactory.add('menuBar:alignment', (locale)=>{
490
496
  const command = editor.commands.get('alignment');
@@ -536,24 +542,24 @@ const iconsMap = /* #__PURE__ */ (()=>new Map([
536
542
  * {@link module:alignment/alignmentui~AlignmentUI} plugins.
537
543
  */ class Alignment extends Plugin {
538
544
  /**
539
- * @inheritDoc
540
- */ static get requires() {
545
+ * @inheritDoc
546
+ */ static get requires() {
541
547
  return [
542
548
  AlignmentEditing,
543
549
  AlignmentUI
544
550
  ];
545
551
  }
546
552
  /**
547
- * @inheritDoc
548
- */ static get pluginName() {
553
+ * @inheritDoc
554
+ */ static get pluginName() {
549
555
  return 'Alignment';
550
556
  }
551
557
  /**
552
- * @inheritDoc
553
- */ static get isOfficialPlugin() {
558
+ * @inheritDoc
559
+ */ static get isOfficialPlugin() {
554
560
  return true;
555
561
  }
556
562
  }
557
563
 
558
- export { Alignment, AlignmentEditing, AlignmentUI };
564
+ export { Alignment, AlignmentCommand, AlignmentEditing, AlignmentUI, supportedOptions as _ALIGNMENT_SUPPORTED_OPTIONS, isSupported as _isAlignmentSupported, isDefault as _isDefaultAlignment, normalizeAlignmentOptions as _normalizeAlignmentOptions };
559
565
  //# sourceMappingURL=index.js.map