@ckeditor/ckeditor5-remove-format 0.0.0-internal-20241017.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 (305) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +17 -0
  3. package/README.md +26 -0
  4. package/build/remove-format.js +5 -0
  5. package/build/translations/af.js +1 -0
  6. package/build/translations/ar.js +1 -0
  7. package/build/translations/az.js +1 -0
  8. package/build/translations/bg.js +1 -0
  9. package/build/translations/bn.js +1 -0
  10. package/build/translations/ca.js +1 -0
  11. package/build/translations/cs.js +1 -0
  12. package/build/translations/da.js +1 -0
  13. package/build/translations/de-ch.js +1 -0
  14. package/build/translations/de.js +1 -0
  15. package/build/translations/el.js +1 -0
  16. package/build/translations/en-au.js +1 -0
  17. package/build/translations/en-gb.js +1 -0
  18. package/build/translations/es.js +1 -0
  19. package/build/translations/et.js +1 -0
  20. package/build/translations/fa.js +1 -0
  21. package/build/translations/fi.js +1 -0
  22. package/build/translations/fr.js +1 -0
  23. package/build/translations/gl.js +1 -0
  24. package/build/translations/he.js +1 -0
  25. package/build/translations/hi.js +1 -0
  26. package/build/translations/hr.js +1 -0
  27. package/build/translations/hu.js +1 -0
  28. package/build/translations/id.js +1 -0
  29. package/build/translations/it.js +1 -0
  30. package/build/translations/ja.js +1 -0
  31. package/build/translations/ko.js +1 -0
  32. package/build/translations/ku.js +1 -0
  33. package/build/translations/lt.js +1 -0
  34. package/build/translations/lv.js +1 -0
  35. package/build/translations/ms.js +1 -0
  36. package/build/translations/ne.js +1 -0
  37. package/build/translations/nl.js +1 -0
  38. package/build/translations/no.js +1 -0
  39. package/build/translations/pl.js +1 -0
  40. package/build/translations/pt-br.js +1 -0
  41. package/build/translations/pt.js +1 -0
  42. package/build/translations/ro.js +1 -0
  43. package/build/translations/ru.js +1 -0
  44. package/build/translations/sk.js +1 -0
  45. package/build/translations/sq.js +1 -0
  46. package/build/translations/sr-latn.js +1 -0
  47. package/build/translations/sr.js +1 -0
  48. package/build/translations/sv.js +1 -0
  49. package/build/translations/th.js +1 -0
  50. package/build/translations/tk.js +1 -0
  51. package/build/translations/tr.js +1 -0
  52. package/build/translations/ug.js +1 -0
  53. package/build/translations/uk.js +1 -0
  54. package/build/translations/ur.js +1 -0
  55. package/build/translations/uz.js +1 -0
  56. package/build/translations/vi.js +1 -0
  57. package/build/translations/zh-cn.js +1 -0
  58. package/build/translations/zh.js +1 -0
  59. package/ckeditor5-metadata.json +18 -0
  60. package/dist/augmentation.d.ts +19 -0
  61. package/dist/index-content.css +4 -0
  62. package/dist/index-editor.css +4 -0
  63. package/dist/index.css +4 -0
  64. package/dist/index.d.ts +16 -0
  65. package/dist/index.js +196 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/removeformat.d.ts +36 -0
  68. package/dist/removeformatcommand.d.ts +46 -0
  69. package/dist/removeformatediting.d.ts +31 -0
  70. package/dist/removeformatui.d.ts +34 -0
  71. package/dist/translations/af.d.ts +8 -0
  72. package/dist/translations/af.js +5 -0
  73. package/dist/translations/af.umd.js +11 -0
  74. package/dist/translations/ar.d.ts +8 -0
  75. package/dist/translations/ar.js +5 -0
  76. package/dist/translations/ar.umd.js +11 -0
  77. package/dist/translations/az.d.ts +8 -0
  78. package/dist/translations/az.js +5 -0
  79. package/dist/translations/az.umd.js +11 -0
  80. package/dist/translations/bg.d.ts +8 -0
  81. package/dist/translations/bg.js +5 -0
  82. package/dist/translations/bg.umd.js +11 -0
  83. package/dist/translations/bn.d.ts +8 -0
  84. package/dist/translations/bn.js +5 -0
  85. package/dist/translations/bn.umd.js +11 -0
  86. package/dist/translations/ca.d.ts +8 -0
  87. package/dist/translations/ca.js +5 -0
  88. package/dist/translations/ca.umd.js +11 -0
  89. package/dist/translations/cs.d.ts +8 -0
  90. package/dist/translations/cs.js +5 -0
  91. package/dist/translations/cs.umd.js +11 -0
  92. package/dist/translations/da.d.ts +8 -0
  93. package/dist/translations/da.js +5 -0
  94. package/dist/translations/da.umd.js +11 -0
  95. package/dist/translations/de-ch.d.ts +8 -0
  96. package/dist/translations/de-ch.js +5 -0
  97. package/dist/translations/de-ch.umd.js +11 -0
  98. package/dist/translations/de.d.ts +8 -0
  99. package/dist/translations/de.js +5 -0
  100. package/dist/translations/de.umd.js +11 -0
  101. package/dist/translations/el.d.ts +8 -0
  102. package/dist/translations/el.js +5 -0
  103. package/dist/translations/el.umd.js +11 -0
  104. package/dist/translations/en-au.d.ts +8 -0
  105. package/dist/translations/en-au.js +5 -0
  106. package/dist/translations/en-au.umd.js +11 -0
  107. package/dist/translations/en-gb.d.ts +8 -0
  108. package/dist/translations/en-gb.js +5 -0
  109. package/dist/translations/en-gb.umd.js +11 -0
  110. package/dist/translations/en.d.ts +8 -0
  111. package/dist/translations/en.js +5 -0
  112. package/dist/translations/en.umd.js +11 -0
  113. package/dist/translations/es.d.ts +8 -0
  114. package/dist/translations/es.js +5 -0
  115. package/dist/translations/es.umd.js +11 -0
  116. package/dist/translations/et.d.ts +8 -0
  117. package/dist/translations/et.js +5 -0
  118. package/dist/translations/et.umd.js +11 -0
  119. package/dist/translations/fa.d.ts +8 -0
  120. package/dist/translations/fa.js +5 -0
  121. package/dist/translations/fa.umd.js +11 -0
  122. package/dist/translations/fi.d.ts +8 -0
  123. package/dist/translations/fi.js +5 -0
  124. package/dist/translations/fi.umd.js +11 -0
  125. package/dist/translations/fr.d.ts +8 -0
  126. package/dist/translations/fr.js +5 -0
  127. package/dist/translations/fr.umd.js +11 -0
  128. package/dist/translations/gl.d.ts +8 -0
  129. package/dist/translations/gl.js +5 -0
  130. package/dist/translations/gl.umd.js +11 -0
  131. package/dist/translations/he.d.ts +8 -0
  132. package/dist/translations/he.js +5 -0
  133. package/dist/translations/he.umd.js +11 -0
  134. package/dist/translations/hi.d.ts +8 -0
  135. package/dist/translations/hi.js +5 -0
  136. package/dist/translations/hi.umd.js +11 -0
  137. package/dist/translations/hr.d.ts +8 -0
  138. package/dist/translations/hr.js +5 -0
  139. package/dist/translations/hr.umd.js +11 -0
  140. package/dist/translations/hu.d.ts +8 -0
  141. package/dist/translations/hu.js +5 -0
  142. package/dist/translations/hu.umd.js +11 -0
  143. package/dist/translations/id.d.ts +8 -0
  144. package/dist/translations/id.js +5 -0
  145. package/dist/translations/id.umd.js +11 -0
  146. package/dist/translations/it.d.ts +8 -0
  147. package/dist/translations/it.js +5 -0
  148. package/dist/translations/it.umd.js +11 -0
  149. package/dist/translations/ja.d.ts +8 -0
  150. package/dist/translations/ja.js +5 -0
  151. package/dist/translations/ja.umd.js +11 -0
  152. package/dist/translations/ko.d.ts +8 -0
  153. package/dist/translations/ko.js +5 -0
  154. package/dist/translations/ko.umd.js +11 -0
  155. package/dist/translations/ku.d.ts +8 -0
  156. package/dist/translations/ku.js +5 -0
  157. package/dist/translations/ku.umd.js +11 -0
  158. package/dist/translations/lt.d.ts +8 -0
  159. package/dist/translations/lt.js +5 -0
  160. package/dist/translations/lt.umd.js +11 -0
  161. package/dist/translations/lv.d.ts +8 -0
  162. package/dist/translations/lv.js +5 -0
  163. package/dist/translations/lv.umd.js +11 -0
  164. package/dist/translations/ms.d.ts +8 -0
  165. package/dist/translations/ms.js +5 -0
  166. package/dist/translations/ms.umd.js +11 -0
  167. package/dist/translations/ne.d.ts +8 -0
  168. package/dist/translations/ne.js +5 -0
  169. package/dist/translations/ne.umd.js +11 -0
  170. package/dist/translations/nl.d.ts +8 -0
  171. package/dist/translations/nl.js +5 -0
  172. package/dist/translations/nl.umd.js +11 -0
  173. package/dist/translations/no.d.ts +8 -0
  174. package/dist/translations/no.js +5 -0
  175. package/dist/translations/no.umd.js +11 -0
  176. package/dist/translations/pl.d.ts +8 -0
  177. package/dist/translations/pl.js +5 -0
  178. package/dist/translations/pl.umd.js +11 -0
  179. package/dist/translations/pt-br.d.ts +8 -0
  180. package/dist/translations/pt-br.js +5 -0
  181. package/dist/translations/pt-br.umd.js +11 -0
  182. package/dist/translations/pt.d.ts +8 -0
  183. package/dist/translations/pt.js +5 -0
  184. package/dist/translations/pt.umd.js +11 -0
  185. package/dist/translations/ro.d.ts +8 -0
  186. package/dist/translations/ro.js +5 -0
  187. package/dist/translations/ro.umd.js +11 -0
  188. package/dist/translations/ru.d.ts +8 -0
  189. package/dist/translations/ru.js +5 -0
  190. package/dist/translations/ru.umd.js +11 -0
  191. package/dist/translations/sk.d.ts +8 -0
  192. package/dist/translations/sk.js +5 -0
  193. package/dist/translations/sk.umd.js +11 -0
  194. package/dist/translations/sq.d.ts +8 -0
  195. package/dist/translations/sq.js +5 -0
  196. package/dist/translations/sq.umd.js +11 -0
  197. package/dist/translations/sr-latn.d.ts +8 -0
  198. package/dist/translations/sr-latn.js +5 -0
  199. package/dist/translations/sr-latn.umd.js +11 -0
  200. package/dist/translations/sr.d.ts +8 -0
  201. package/dist/translations/sr.js +5 -0
  202. package/dist/translations/sr.umd.js +11 -0
  203. package/dist/translations/sv.d.ts +8 -0
  204. package/dist/translations/sv.js +5 -0
  205. package/dist/translations/sv.umd.js +11 -0
  206. package/dist/translations/th.d.ts +8 -0
  207. package/dist/translations/th.js +5 -0
  208. package/dist/translations/th.umd.js +11 -0
  209. package/dist/translations/tk.d.ts +8 -0
  210. package/dist/translations/tk.js +5 -0
  211. package/dist/translations/tk.umd.js +11 -0
  212. package/dist/translations/tr.d.ts +8 -0
  213. package/dist/translations/tr.js +5 -0
  214. package/dist/translations/tr.umd.js +11 -0
  215. package/dist/translations/ug.d.ts +8 -0
  216. package/dist/translations/ug.js +5 -0
  217. package/dist/translations/ug.umd.js +11 -0
  218. package/dist/translations/uk.d.ts +8 -0
  219. package/dist/translations/uk.js +5 -0
  220. package/dist/translations/uk.umd.js +11 -0
  221. package/dist/translations/ur.d.ts +8 -0
  222. package/dist/translations/ur.js +5 -0
  223. package/dist/translations/ur.umd.js +11 -0
  224. package/dist/translations/uz.d.ts +8 -0
  225. package/dist/translations/uz.js +5 -0
  226. package/dist/translations/uz.umd.js +11 -0
  227. package/dist/translations/vi.d.ts +8 -0
  228. package/dist/translations/vi.js +5 -0
  229. package/dist/translations/vi.umd.js +11 -0
  230. package/dist/translations/zh-cn.d.ts +8 -0
  231. package/dist/translations/zh-cn.js +5 -0
  232. package/dist/translations/zh-cn.umd.js +11 -0
  233. package/dist/translations/zh.d.ts +8 -0
  234. package/dist/translations/zh.js +5 -0
  235. package/dist/translations/zh.umd.js +11 -0
  236. package/lang/contexts.json +3 -0
  237. package/lang/translations/af.po +22 -0
  238. package/lang/translations/ar.po +22 -0
  239. package/lang/translations/az.po +22 -0
  240. package/lang/translations/bg.po +22 -0
  241. package/lang/translations/bn.po +22 -0
  242. package/lang/translations/ca.po +22 -0
  243. package/lang/translations/cs.po +22 -0
  244. package/lang/translations/da.po +22 -0
  245. package/lang/translations/de-ch.po +22 -0
  246. package/lang/translations/de.po +22 -0
  247. package/lang/translations/el.po +22 -0
  248. package/lang/translations/en-au.po +22 -0
  249. package/lang/translations/en-gb.po +22 -0
  250. package/lang/translations/en.po +22 -0
  251. package/lang/translations/es.po +22 -0
  252. package/lang/translations/et.po +22 -0
  253. package/lang/translations/fa.po +22 -0
  254. package/lang/translations/fi.po +22 -0
  255. package/lang/translations/fr.po +22 -0
  256. package/lang/translations/gl.po +22 -0
  257. package/lang/translations/he.po +22 -0
  258. package/lang/translations/hi.po +22 -0
  259. package/lang/translations/hr.po +22 -0
  260. package/lang/translations/hu.po +22 -0
  261. package/lang/translations/id.po +22 -0
  262. package/lang/translations/it.po +22 -0
  263. package/lang/translations/ja.po +22 -0
  264. package/lang/translations/ko.po +22 -0
  265. package/lang/translations/ku.po +22 -0
  266. package/lang/translations/lt.po +22 -0
  267. package/lang/translations/lv.po +22 -0
  268. package/lang/translations/ms.po +22 -0
  269. package/lang/translations/ne.po +22 -0
  270. package/lang/translations/nl.po +22 -0
  271. package/lang/translations/no.po +22 -0
  272. package/lang/translations/pl.po +22 -0
  273. package/lang/translations/pt-br.po +22 -0
  274. package/lang/translations/pt.po +22 -0
  275. package/lang/translations/ro.po +22 -0
  276. package/lang/translations/ru.po +22 -0
  277. package/lang/translations/sk.po +22 -0
  278. package/lang/translations/sq.po +22 -0
  279. package/lang/translations/sr-latn.po +22 -0
  280. package/lang/translations/sr.po +22 -0
  281. package/lang/translations/sv.po +22 -0
  282. package/lang/translations/th.po +22 -0
  283. package/lang/translations/tk.po +22 -0
  284. package/lang/translations/tr.po +22 -0
  285. package/lang/translations/ug.po +22 -0
  286. package/lang/translations/uk.po +22 -0
  287. package/lang/translations/ur.po +22 -0
  288. package/lang/translations/uz.po +22 -0
  289. package/lang/translations/vi.po +22 -0
  290. package/lang/translations/zh-cn.po +22 -0
  291. package/lang/translations/zh.po +22 -0
  292. package/package.json +41 -0
  293. package/src/augmentation.d.ts +15 -0
  294. package/src/augmentation.js +5 -0
  295. package/src/index.d.ts +12 -0
  296. package/src/index.js +11 -0
  297. package/src/removeformat.d.ts +32 -0
  298. package/src/removeformat.js +38 -0
  299. package/src/removeformatcommand.d.ts +42 -0
  300. package/src/removeformatcommand.js +94 -0
  301. package/src/removeformatediting.d.ts +27 -0
  302. package/src/removeformatediting.js +35 -0
  303. package/src/removeformatui.d.ts +30 -0
  304. package/src/removeformatui.js +64 -0
  305. package/theme/icons/remove-format.svg +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ Changelog
2
+ =========
3
+
4
+ All changes in the package are documented in https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
package/LICENSE.md ADDED
@@ -0,0 +1,17 @@
1
+ Software License Agreement
2
+ ==========================
3
+
4
+ **CKEditor&nbsp;5 remove format feature** – https://github.com/ckeditor/ckeditor5-remove-format <br>
5
+ Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
+
7
+ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
+
9
+ Sources of Intellectual Property Included in CKEditor
10
+ -----------------------------------------------------
11
+
12
+ 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.
13
+
14
+ Trademarks
15
+ ----------
16
+
17
+ **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ CKEditor&nbsp;5 remove format feature
2
+ ===========================
3
+
4
+ [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-remove-format.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-remove-format)
5
+ [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
+ [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
7
+
8
+ This package implements remove format support for CKEditor&nbsp;5.
9
+
10
+ ## Demo
11
+
12
+ Check out the demo in the [remove formatting feature guide](https://ckeditor.com/docs/ckeditor5/latest/features/remove-format.html#demo).
13
+
14
+ ## Documentation
15
+
16
+ See the [`@ckeditor/ckeditor5-remove-format` package](https://ckeditor.com/docs/ckeditor5/latest/api/remove-format.html) page in [CKEditor&nbsp;5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install ckeditor5
22
+ ```
23
+
24
+ ## License
25
+
26
+ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
@@ -0,0 +1,5 @@
1
+ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Remove Format":"Remove Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
2
+ /*!
3
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4
+ * For licensing, see LICENSE.md.
5
+ */(()=>{var t={782:(t,e,o)=>{t.exports=o(237)("./src/core.js")},311:(t,e,o)=>{t.exports=o(237)("./src/ui.js")},584:(t,e,o)=>{t.exports=o(237)("./src/utils.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,o),s.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{RemoveFormat:()=>l,RemoveFormatEditing:()=>c,RemoveFormatUI:()=>s});var t=o(782),e=o(311);const r="removeFormat";class s extends t.Plugin{static get pluginName(){return"RemoveFormatUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add(r,(()=>{const t=this._createButton(e.ButtonView);return t.set({tooltip:!0}),t})),t.ui.componentFactory.add(`menuBar:${r}`,(()=>this._createButton(e.MenuBarMenuListItemButtonView)))}_createButton(t){const e=this.editor,o=e.locale,i=e.commands.get(r),s=new t(e.locale),n=o.t;return s.set({label:n("Remove Format"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z"/></svg>'}),s.bind("isEnabled").to(i,"isEnabled"),this.listenTo(s,"execute",(()=>{e.execute(r),e.editing.view.focus()})),s}}var n=o(584);class a extends t.Command{refresh(){const t=this.editor.model;this.isEnabled=!!(0,n.first)(this._getFormattingItems(t.document.selection,t.schema))}execute(){const t=this.editor.model,e=t.schema;t.change((o=>{for(const i of this._getFormattingItems(t.document.selection,e))if(i.is("selection"))for(const t of this._getFormattingAttributes(i,e))o.removeSelectionAttribute(t);else{const t=o.createRangeOn(i);for(const r of this._getFormattingAttributes(i,e))o.removeAttribute(r,t)}}))}*_getFormattingItems(t,e){const o=t=>!!(0,n.first)(this._getFormattingAttributes(t,e));for(const i of t.getRanges())for(const t of i.getItems())!e.isBlock(t)&&o(t)&&(yield t);for(const e of t.getSelectedBlocks())o(e)&&(yield e);o(t)&&(yield t)}*_getFormattingAttributes(t,e){for(const[o]of t.getAttributes()){const t=e.getAttributeProperties(o);t&&t.isFormatting&&(yield o)}}}class c extends t.Plugin{static get pluginName(){return"RemoveFormatEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.commands.add("removeFormat",new a(t))}}class l extends t.Plugin{static get requires(){return[c,s]}static get pluginName(){return"RemoveFormat"}static get isOfficialPlugin(){return!0}}})(),(window.CKEditor5=window.CKEditor5||{}).removeFormat=i})();
@@ -0,0 +1 @@
1
+ !function(i){const n=i.af=i.af||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Verwyder formatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ar=i.ar||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"إزالة التنسيق"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.az=o.az||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Formatı Ləğv Et"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.bg=i.bg||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Премахни форматиране"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.bn=n.bn||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"ফরম্যাট মুছে ফেলুন"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const a=o.ca=o.ca||{};a.dictionary=Object.assign(a.dictionary||{},{"Remove Format":"Esborrar el format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.cs=n.cs||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Odstranit formátování"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.da=n.da||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Fjern format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const e=n["de-ch"]=n["de-ch"]||{};e.dictionary=Object.assign(e.dictionary||{},{"Remove Format":"Formatierung entfernen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const e=n.de=n.de||{};e.dictionary=Object.assign(e.dictionary||{},{"Remove Format":"Formatierung entfernen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.el=i.el||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Απομάκρυνση μορφοποίησης"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n["en-au"]=n["en-au"]||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Remove Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n["en-gb"]=n["en-gb"]||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Remove Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.es=o.es||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Quitar Formato"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.et=i.et||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Eemalda vorming"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.fa=i.fa||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"حذف کردن قالب"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.fi=i.fi||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Poista muotoilu"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.fr=n.fr||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Enlever le format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.gl=o.gl||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Retirar o formato"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.he=i.he||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"הסרת עיצוב"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.hi=i.hi||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Remove Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.hr=o.hr||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Ukloni format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.hu=o.hu||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Formázás eltávolítása"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.id=i.id||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Hapus Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.it=i.it||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Rimuovi formato"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ja=i.ja||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"フォーマットの削除"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.ko=o.ko||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"서식 지우기"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ku=i.ku||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"لابردنی شێواز"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const t=i.lt=i.lt||{};t.dictionary=Object.assign(t.dictionary||{},{"Remove Format":"Naikinti formatavimą"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.lv=o.lv||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Noņemt formatējumu"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.ms=n.ms||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Buang Format"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.ne=n.ne||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"ढाँचा हटाउनुहोस्"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.nl=n.nl||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Verwijder opmaak"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.no=n.no||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Fjern formatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.pl=o.pl||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Usuń formatowanie"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const t=o["pt-br"]=o["pt-br"]||{};t.dictionary=Object.assign(t.dictionary||{},{"Remove Format":"Remover Formatação"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const t=o.pt=o.pt||{};t.dictionary=Object.assign(t.dictionary||{},{"Remove Format":"Remover formatação"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.ro=o.ro||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Șterge formatare"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ru=i.ru||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Убрать форматирование"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.sk=i.sk||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Vyčistiť formátovanie"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.sq=i.sq||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Largo formatimin"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n["sr-latn"]=n["sr-latn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"Ukloni formatiranje"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.sr=i.sr||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Уклони форматирање"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.sv=i.sv||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Radera formatering"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.th=i.th||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"ลบรูปแบบ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const t=o.tk=o.tk||{};t.dictionary=Object.assign(t.dictionary||{},{"Remove Format":"Formaty aýyryň"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.tr=i.tr||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Biçimlendirmeyi Kaldır"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ug=i.ug||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"پىچىمنى چىقىرىۋەت"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.uk=i.uk||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Видалити форматування"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ur=i.ur||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"فارمیٹ ہٹائیں"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.uz=i.uz||{};o.dictionary=Object.assign(o.dictionary||{},{"Remove Format":"Formatlashni olib tashlash"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.vi=i.vi||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"Xóa định dang"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n["zh-cn"]=n["zh-cn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Remove Format":"移除格式"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.zh=i.zh||{};n.dictionary=Object.assign(n.dictionary||{},{"Remove Format":"移除格式"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1,18 @@
1
+ {
2
+ "plugins": [
3
+ {
4
+ "name": "Remove format",
5
+ "className": "RemoveFormat",
6
+ "description": "Allows you to quickly remove any text formatting applied using inline HTML elements and CSS styles like basic text styles (bold, italic, etc.), font family, size, and color and similar.",
7
+ "docs": "features/remove-format.html",
8
+ "path": "src/removeformat.js",
9
+ "uiComponents": [
10
+ {
11
+ "type": "Button",
12
+ "name": "removeFormat",
13
+ "iconPath": "theme/icons/remove-format.svg"
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,19 @@
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
+ * @license 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
+ import type { RemoveFormat, RemoveFormatEditing, RemoveFormatUI, RemoveFormatCommand } from './index.js';
10
+ declare module '@ckeditor/ckeditor5-core' {
11
+ interface PluginsMap {
12
+ [RemoveFormat.pluginName]: RemoveFormat;
13
+ [RemoveFormatUI.pluginName]: RemoveFormatUI;
14
+ [RemoveFormatEditing.pluginName]: RemoveFormatEditing;
15
+ }
16
+ interface CommandsMap {
17
+ removeFormat: RemoveFormatCommand;
18
+ }
19
+ }
@@ -0,0 +1,4 @@
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
+ */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
package/dist/index.css ADDED
@@ -0,0 +1,4 @@
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
+ */
@@ -0,0 +1,16 @@
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
+ * @license 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
+ * @module remove-format
11
+ */
12
+ export { default as RemoveFormat } from './removeformat.js';
13
+ export { default as RemoveFormatEditing } from './removeformatediting.js';
14
+ export { default as RemoveFormatUI } from './removeformatui.js';
15
+ export type { default as RemoveFormatCommand } from './removeformatcommand.js';
16
+ import './augmentation.js';
package/dist/index.js ADDED
@@ -0,0 +1,196 @@
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
+ import { Plugin, Command } from '@ckeditor/ckeditor5-core/dist/index.js';
6
+ import { ButtonView, MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
7
+ import { first } from '@ckeditor/ckeditor5-utils/dist/index.js';
8
+
9
+ var removeFormatIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\"/></svg>";
10
+
11
+ const REMOVE_FORMAT = 'removeFormat';
12
+ /**
13
+ * The remove format UI plugin. It registers the `'removeFormat'` button which can be
14
+ * used in the toolbar.
15
+ */ class RemoveFormatUI extends Plugin {
16
+ /**
17
+ * @inheritDoc
18
+ */ static get pluginName() {
19
+ return 'RemoveFormatUI';
20
+ }
21
+ /**
22
+ * @inheritDoc
23
+ */ static get isOfficialPlugin() {
24
+ return true;
25
+ }
26
+ /**
27
+ * @inheritDoc
28
+ */ init() {
29
+ const editor = this.editor;
30
+ editor.ui.componentFactory.add(REMOVE_FORMAT, ()=>{
31
+ const view = this._createButton(ButtonView);
32
+ view.set({
33
+ tooltip: true
34
+ });
35
+ return view;
36
+ });
37
+ editor.ui.componentFactory.add(`menuBar:${REMOVE_FORMAT}`, ()=>this._createButton(MenuBarMenuListItemButtonView));
38
+ }
39
+ /**
40
+ * Creates a button for remove format command to use either in toolbar or in menu bar.
41
+ */ _createButton(ButtonClass) {
42
+ const editor = this.editor;
43
+ const locale = editor.locale;
44
+ const command = editor.commands.get(REMOVE_FORMAT);
45
+ const view = new ButtonClass(editor.locale);
46
+ const t = locale.t;
47
+ view.set({
48
+ label: t('Remove Format'),
49
+ icon: removeFormatIcon
50
+ });
51
+ view.bind('isEnabled').to(command, 'isEnabled');
52
+ // Execute the command.
53
+ this.listenTo(view, 'execute', ()=>{
54
+ editor.execute(REMOVE_FORMAT);
55
+ editor.editing.view.focus();
56
+ });
57
+ return view;
58
+ }
59
+ }
60
+
61
+ /**
62
+ * The remove format command.
63
+ *
64
+ * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
65
+ * to clear the formatting in the selection.
66
+ *
67
+ * ```ts
68
+ * editor.execute( 'removeFormat' );
69
+ * ```
70
+ */ class RemoveFormatCommand extends Command {
71
+ /**
72
+ * @inheritDoc
73
+ */ refresh() {
74
+ const model = this.editor.model;
75
+ this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));
76
+ }
77
+ /**
78
+ * @inheritDoc
79
+ */ execute() {
80
+ const model = this.editor.model;
81
+ const schema = model.schema;
82
+ model.change((writer)=>{
83
+ for (const item of this._getFormattingItems(model.document.selection, schema)){
84
+ if (item.is('selection')) {
85
+ for (const attributeName of this._getFormattingAttributes(item, schema)){
86
+ writer.removeSelectionAttribute(attributeName);
87
+ }
88
+ } else {
89
+ // Workaround for items with multiple removable attributes. See
90
+ // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
91
+ const itemRange = writer.createRangeOn(item);
92
+ for (const attributeName of this._getFormattingAttributes(item, schema)){
93
+ writer.removeAttribute(attributeName, itemRange);
94
+ }
95
+ }
96
+ }
97
+ });
98
+ }
99
+ /**
100
+ * Returns an iterable of items in a selection (including the selection itself) that have formatting model
101
+ * attributes to be removed by the feature.
102
+ *
103
+ * @param schema The schema describing the item.
104
+ */ *_getFormattingItems(selection, schema) {
105
+ const itemHasRemovableFormatting = (item)=>{
106
+ return !!first(this._getFormattingAttributes(item, schema));
107
+ };
108
+ // Check formatting on selected items that are not blocks.
109
+ for (const curRange of selection.getRanges()){
110
+ for (const item of curRange.getItems()){
111
+ if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {
112
+ yield item;
113
+ }
114
+ }
115
+ }
116
+ // Check formatting from selected blocks.
117
+ for (const block of selection.getSelectedBlocks()){
118
+ if (itemHasRemovableFormatting(block)) {
119
+ yield block;
120
+ }
121
+ }
122
+ // Finally the selection might be formatted as well, so make sure to check it.
123
+ if (itemHasRemovableFormatting(selection)) {
124
+ yield selection;
125
+ }
126
+ }
127
+ /**
128
+ * Returns an iterable of formatting attributes of a given model item.
129
+ *
130
+ * **Note:** Formatting items have the `isFormatting` property set to `true`.
131
+ *
132
+ * @param schema The schema describing the item.
133
+ * @returns The names of formatting attributes found in a given item.
134
+ */ *_getFormattingAttributes(item, schema) {
135
+ for (const [attributeName] of item.getAttributes()){
136
+ const attributeProperties = schema.getAttributeProperties(attributeName);
137
+ if (attributeProperties && attributeProperties.isFormatting) {
138
+ yield attributeName;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ /**
145
+ * The remove format editing plugin.
146
+ *
147
+ * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
148
+ */ class RemoveFormatEditing extends Plugin {
149
+ /**
150
+ * @inheritDoc
151
+ */ static get pluginName() {
152
+ return 'RemoveFormatEditing';
153
+ }
154
+ /**
155
+ * @inheritDoc
156
+ */ static get isOfficialPlugin() {
157
+ return true;
158
+ }
159
+ /**
160
+ * @inheritDoc
161
+ */ init() {
162
+ const editor = this.editor;
163
+ editor.commands.add('removeFormat', new RemoveFormatCommand(editor));
164
+ }
165
+ }
166
+
167
+ /**
168
+ * The remove format plugin.
169
+ *
170
+ * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
171
+ * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
172
+ *
173
+ * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
174
+ */ class RemoveFormat extends Plugin {
175
+ /**
176
+ * @inheritDoc
177
+ */ static get requires() {
178
+ return [
179
+ RemoveFormatEditing,
180
+ RemoveFormatUI
181
+ ];
182
+ }
183
+ /**
184
+ * @inheritDoc
185
+ */ static get pluginName() {
186
+ return 'RemoveFormat';
187
+ }
188
+ /**
189
+ * @inheritDoc
190
+ */ static get isOfficialPlugin() {
191
+ return true;
192
+ }
193
+ }
194
+
195
+ export { RemoveFormat, RemoveFormatEditing, RemoveFormatUI };
196
+ //# sourceMappingURL=index.js.map