@ckeditor/ckeditor5-basic-styles 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 (449) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +17 -0
  3. package/README.md +26 -0
  4. package/build/basic-styles.js +5 -0
  5. package/build/translations/af.js +1 -0
  6. package/build/translations/ar.js +1 -0
  7. package/build/translations/ast.js +1 -0
  8. package/build/translations/az.js +1 -0
  9. package/build/translations/bg.js +1 -0
  10. package/build/translations/bn.js +1 -0
  11. package/build/translations/bs.js +1 -0
  12. package/build/translations/ca.js +1 -0
  13. package/build/translations/cs.js +1 -0
  14. package/build/translations/da.js +1 -0
  15. package/build/translations/de-ch.js +1 -0
  16. package/build/translations/de.js +1 -0
  17. package/build/translations/el.js +1 -0
  18. package/build/translations/en-au.js +1 -0
  19. package/build/translations/en-gb.js +1 -0
  20. package/build/translations/eo.js +1 -0
  21. package/build/translations/es-co.js +1 -0
  22. package/build/translations/es.js +1 -0
  23. package/build/translations/et.js +1 -0
  24. package/build/translations/eu.js +1 -0
  25. package/build/translations/fa.js +1 -0
  26. package/build/translations/fi.js +1 -0
  27. package/build/translations/fr.js +1 -0
  28. package/build/translations/gl.js +1 -0
  29. package/build/translations/gu.js +1 -0
  30. package/build/translations/he.js +1 -0
  31. package/build/translations/hi.js +1 -0
  32. package/build/translations/hr.js +1 -0
  33. package/build/translations/hu.js +1 -0
  34. package/build/translations/hy.js +1 -0
  35. package/build/translations/id.js +1 -0
  36. package/build/translations/it.js +1 -0
  37. package/build/translations/ja.js +1 -0
  38. package/build/translations/jv.js +1 -0
  39. package/build/translations/km.js +1 -0
  40. package/build/translations/kn.js +1 -0
  41. package/build/translations/ko.js +1 -0
  42. package/build/translations/ku.js +1 -0
  43. package/build/translations/lt.js +1 -0
  44. package/build/translations/lv.js +1 -0
  45. package/build/translations/ms.js +1 -0
  46. package/build/translations/nb.js +1 -0
  47. package/build/translations/ne.js +1 -0
  48. package/build/translations/nl.js +1 -0
  49. package/build/translations/no.js +1 -0
  50. package/build/translations/oc.js +1 -0
  51. package/build/translations/pl.js +1 -0
  52. package/build/translations/pt-br.js +1 -0
  53. package/build/translations/pt.js +1 -0
  54. package/build/translations/ro.js +1 -0
  55. package/build/translations/ru.js +1 -0
  56. package/build/translations/si.js +1 -0
  57. package/build/translations/sk.js +1 -0
  58. package/build/translations/sl.js +1 -0
  59. package/build/translations/sq.js +1 -0
  60. package/build/translations/sr-latn.js +1 -0
  61. package/build/translations/sr.js +1 -0
  62. package/build/translations/sv.js +1 -0
  63. package/build/translations/th.js +1 -0
  64. package/build/translations/ti.js +1 -0
  65. package/build/translations/tk.js +1 -0
  66. package/build/translations/tr.js +1 -0
  67. package/build/translations/tt.js +1 -0
  68. package/build/translations/ug.js +1 -0
  69. package/build/translations/uk.js +1 -0
  70. package/build/translations/ur.js +1 -0
  71. package/build/translations/uz.js +1 -0
  72. package/build/translations/vi.js +1 -0
  73. package/build/translations/zh-cn.js +1 -0
  74. package/build/translations/zh.js +1 -0
  75. package/ckeditor5-metadata.json +137 -0
  76. package/dist/attributecommand.d.ts +78 -0
  77. package/dist/augmentation.d.ts +44 -0
  78. package/dist/bold/boldediting.d.ts +32 -0
  79. package/dist/bold/boldui.d.ts +29 -0
  80. package/dist/bold.d.ts +37 -0
  81. package/dist/code/codeediting.d.ts +37 -0
  82. package/dist/code/codeui.d.ts +30 -0
  83. package/dist/code.d.ts +38 -0
  84. package/dist/index-content.css +9 -0
  85. package/dist/index-editor.css +7 -0
  86. package/dist/index.css +20 -0
  87. package/dist/index.css.map +1 -0
  88. package/dist/index.d.ts +34 -0
  89. package/dist/index.js +981 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/italic/italicediting.d.ts +32 -0
  92. package/dist/italic/italicui.d.ts +29 -0
  93. package/dist/italic.d.ts +37 -0
  94. package/dist/strikethrough/strikethroughediting.d.ts +33 -0
  95. package/dist/strikethrough/strikethroughui.d.ts +29 -0
  96. package/dist/strikethrough.d.ts +37 -0
  97. package/dist/subscript/subscriptediting.d.ts +32 -0
  98. package/dist/subscript/subscriptui.d.ts +29 -0
  99. package/dist/subscript.d.ts +34 -0
  100. package/dist/superscript/superscriptediting.d.ts +32 -0
  101. package/dist/superscript/superscriptui.d.ts +29 -0
  102. package/dist/superscript.d.ts +34 -0
  103. package/dist/translations/af.d.ts +8 -0
  104. package/dist/translations/af.js +5 -0
  105. package/dist/translations/af.umd.js +11 -0
  106. package/dist/translations/ar.d.ts +8 -0
  107. package/dist/translations/ar.js +5 -0
  108. package/dist/translations/ar.umd.js +11 -0
  109. package/dist/translations/ast.d.ts +8 -0
  110. package/dist/translations/ast.js +5 -0
  111. package/dist/translations/ast.umd.js +11 -0
  112. package/dist/translations/az.d.ts +8 -0
  113. package/dist/translations/az.js +5 -0
  114. package/dist/translations/az.umd.js +11 -0
  115. package/dist/translations/bg.d.ts +8 -0
  116. package/dist/translations/bg.js +5 -0
  117. package/dist/translations/bg.umd.js +11 -0
  118. package/dist/translations/bn.d.ts +8 -0
  119. package/dist/translations/bn.js +5 -0
  120. package/dist/translations/bn.umd.js +11 -0
  121. package/dist/translations/bs.d.ts +8 -0
  122. package/dist/translations/bs.js +5 -0
  123. package/dist/translations/bs.umd.js +11 -0
  124. package/dist/translations/ca.d.ts +8 -0
  125. package/dist/translations/ca.js +5 -0
  126. package/dist/translations/ca.umd.js +11 -0
  127. package/dist/translations/cs.d.ts +8 -0
  128. package/dist/translations/cs.js +5 -0
  129. package/dist/translations/cs.umd.js +11 -0
  130. package/dist/translations/da.d.ts +8 -0
  131. package/dist/translations/da.js +5 -0
  132. package/dist/translations/da.umd.js +11 -0
  133. package/dist/translations/de-ch.d.ts +8 -0
  134. package/dist/translations/de-ch.js +5 -0
  135. package/dist/translations/de-ch.umd.js +11 -0
  136. package/dist/translations/de.d.ts +8 -0
  137. package/dist/translations/de.js +5 -0
  138. package/dist/translations/de.umd.js +11 -0
  139. package/dist/translations/el.d.ts +8 -0
  140. package/dist/translations/el.js +5 -0
  141. package/dist/translations/el.umd.js +11 -0
  142. package/dist/translations/en-au.d.ts +8 -0
  143. package/dist/translations/en-au.js +5 -0
  144. package/dist/translations/en-au.umd.js +11 -0
  145. package/dist/translations/en-gb.d.ts +8 -0
  146. package/dist/translations/en-gb.js +5 -0
  147. package/dist/translations/en-gb.umd.js +11 -0
  148. package/dist/translations/en.d.ts +8 -0
  149. package/dist/translations/en.js +5 -0
  150. package/dist/translations/en.umd.js +11 -0
  151. package/dist/translations/eo.d.ts +8 -0
  152. package/dist/translations/eo.js +5 -0
  153. package/dist/translations/eo.umd.js +11 -0
  154. package/dist/translations/es-co.d.ts +8 -0
  155. package/dist/translations/es-co.js +5 -0
  156. package/dist/translations/es-co.umd.js +11 -0
  157. package/dist/translations/es.d.ts +8 -0
  158. package/dist/translations/es.js +5 -0
  159. package/dist/translations/es.umd.js +11 -0
  160. package/dist/translations/et.d.ts +8 -0
  161. package/dist/translations/et.js +5 -0
  162. package/dist/translations/et.umd.js +11 -0
  163. package/dist/translations/eu.d.ts +8 -0
  164. package/dist/translations/eu.js +5 -0
  165. package/dist/translations/eu.umd.js +11 -0
  166. package/dist/translations/fa.d.ts +8 -0
  167. package/dist/translations/fa.js +5 -0
  168. package/dist/translations/fa.umd.js +11 -0
  169. package/dist/translations/fi.d.ts +8 -0
  170. package/dist/translations/fi.js +5 -0
  171. package/dist/translations/fi.umd.js +11 -0
  172. package/dist/translations/fr.d.ts +8 -0
  173. package/dist/translations/fr.js +5 -0
  174. package/dist/translations/fr.umd.js +11 -0
  175. package/dist/translations/gl.d.ts +8 -0
  176. package/dist/translations/gl.js +5 -0
  177. package/dist/translations/gl.umd.js +11 -0
  178. package/dist/translations/gu.d.ts +8 -0
  179. package/dist/translations/gu.js +5 -0
  180. package/dist/translations/gu.umd.js +11 -0
  181. package/dist/translations/he.d.ts +8 -0
  182. package/dist/translations/he.js +5 -0
  183. package/dist/translations/he.umd.js +11 -0
  184. package/dist/translations/hi.d.ts +8 -0
  185. package/dist/translations/hi.js +5 -0
  186. package/dist/translations/hi.umd.js +11 -0
  187. package/dist/translations/hr.d.ts +8 -0
  188. package/dist/translations/hr.js +5 -0
  189. package/dist/translations/hr.umd.js +11 -0
  190. package/dist/translations/hu.d.ts +8 -0
  191. package/dist/translations/hu.js +5 -0
  192. package/dist/translations/hu.umd.js +11 -0
  193. package/dist/translations/hy.d.ts +8 -0
  194. package/dist/translations/hy.js +5 -0
  195. package/dist/translations/hy.umd.js +11 -0
  196. package/dist/translations/id.d.ts +8 -0
  197. package/dist/translations/id.js +5 -0
  198. package/dist/translations/id.umd.js +11 -0
  199. package/dist/translations/it.d.ts +8 -0
  200. package/dist/translations/it.js +5 -0
  201. package/dist/translations/it.umd.js +11 -0
  202. package/dist/translations/ja.d.ts +8 -0
  203. package/dist/translations/ja.js +5 -0
  204. package/dist/translations/ja.umd.js +11 -0
  205. package/dist/translations/jv.d.ts +8 -0
  206. package/dist/translations/jv.js +5 -0
  207. package/dist/translations/jv.umd.js +11 -0
  208. package/dist/translations/km.d.ts +8 -0
  209. package/dist/translations/km.js +5 -0
  210. package/dist/translations/km.umd.js +11 -0
  211. package/dist/translations/kn.d.ts +8 -0
  212. package/dist/translations/kn.js +5 -0
  213. package/dist/translations/kn.umd.js +11 -0
  214. package/dist/translations/ko.d.ts +8 -0
  215. package/dist/translations/ko.js +5 -0
  216. package/dist/translations/ko.umd.js +11 -0
  217. package/dist/translations/ku.d.ts +8 -0
  218. package/dist/translations/ku.js +5 -0
  219. package/dist/translations/ku.umd.js +11 -0
  220. package/dist/translations/lt.d.ts +8 -0
  221. package/dist/translations/lt.js +5 -0
  222. package/dist/translations/lt.umd.js +11 -0
  223. package/dist/translations/lv.d.ts +8 -0
  224. package/dist/translations/lv.js +5 -0
  225. package/dist/translations/lv.umd.js +11 -0
  226. package/dist/translations/ms.d.ts +8 -0
  227. package/dist/translations/ms.js +5 -0
  228. package/dist/translations/ms.umd.js +11 -0
  229. package/dist/translations/nb.d.ts +8 -0
  230. package/dist/translations/nb.js +5 -0
  231. package/dist/translations/nb.umd.js +11 -0
  232. package/dist/translations/ne.d.ts +8 -0
  233. package/dist/translations/ne.js +5 -0
  234. package/dist/translations/ne.umd.js +11 -0
  235. package/dist/translations/nl.d.ts +8 -0
  236. package/dist/translations/nl.js +5 -0
  237. package/dist/translations/nl.umd.js +11 -0
  238. package/dist/translations/no.d.ts +8 -0
  239. package/dist/translations/no.js +5 -0
  240. package/dist/translations/no.umd.js +11 -0
  241. package/dist/translations/oc.d.ts +8 -0
  242. package/dist/translations/oc.js +5 -0
  243. package/dist/translations/oc.umd.js +11 -0
  244. package/dist/translations/pl.d.ts +8 -0
  245. package/dist/translations/pl.js +5 -0
  246. package/dist/translations/pl.umd.js +11 -0
  247. package/dist/translations/pt-br.d.ts +8 -0
  248. package/dist/translations/pt-br.js +5 -0
  249. package/dist/translations/pt-br.umd.js +11 -0
  250. package/dist/translations/pt.d.ts +8 -0
  251. package/dist/translations/pt.js +5 -0
  252. package/dist/translations/pt.umd.js +11 -0
  253. package/dist/translations/ro.d.ts +8 -0
  254. package/dist/translations/ro.js +5 -0
  255. package/dist/translations/ro.umd.js +11 -0
  256. package/dist/translations/ru.d.ts +8 -0
  257. package/dist/translations/ru.js +5 -0
  258. package/dist/translations/ru.umd.js +11 -0
  259. package/dist/translations/si.d.ts +8 -0
  260. package/dist/translations/si.js +5 -0
  261. package/dist/translations/si.umd.js +11 -0
  262. package/dist/translations/sk.d.ts +8 -0
  263. package/dist/translations/sk.js +5 -0
  264. package/dist/translations/sk.umd.js +11 -0
  265. package/dist/translations/sl.d.ts +8 -0
  266. package/dist/translations/sl.js +5 -0
  267. package/dist/translations/sl.umd.js +11 -0
  268. package/dist/translations/sq.d.ts +8 -0
  269. package/dist/translations/sq.js +5 -0
  270. package/dist/translations/sq.umd.js +11 -0
  271. package/dist/translations/sr-latn.d.ts +8 -0
  272. package/dist/translations/sr-latn.js +5 -0
  273. package/dist/translations/sr-latn.umd.js +11 -0
  274. package/dist/translations/sr.d.ts +8 -0
  275. package/dist/translations/sr.js +5 -0
  276. package/dist/translations/sr.umd.js +11 -0
  277. package/dist/translations/sv.d.ts +8 -0
  278. package/dist/translations/sv.js +5 -0
  279. package/dist/translations/sv.umd.js +11 -0
  280. package/dist/translations/th.d.ts +8 -0
  281. package/dist/translations/th.js +5 -0
  282. package/dist/translations/th.umd.js +11 -0
  283. package/dist/translations/ti.d.ts +8 -0
  284. package/dist/translations/ti.js +5 -0
  285. package/dist/translations/ti.umd.js +11 -0
  286. package/dist/translations/tk.d.ts +8 -0
  287. package/dist/translations/tk.js +5 -0
  288. package/dist/translations/tk.umd.js +11 -0
  289. package/dist/translations/tr.d.ts +8 -0
  290. package/dist/translations/tr.js +5 -0
  291. package/dist/translations/tr.umd.js +11 -0
  292. package/dist/translations/tt.d.ts +8 -0
  293. package/dist/translations/tt.js +5 -0
  294. package/dist/translations/tt.umd.js +11 -0
  295. package/dist/translations/ug.d.ts +8 -0
  296. package/dist/translations/ug.js +5 -0
  297. package/dist/translations/ug.umd.js +11 -0
  298. package/dist/translations/uk.d.ts +8 -0
  299. package/dist/translations/uk.js +5 -0
  300. package/dist/translations/uk.umd.js +11 -0
  301. package/dist/translations/ur.d.ts +8 -0
  302. package/dist/translations/ur.js +5 -0
  303. package/dist/translations/ur.umd.js +11 -0
  304. package/dist/translations/uz.d.ts +8 -0
  305. package/dist/translations/uz.js +5 -0
  306. package/dist/translations/uz.umd.js +11 -0
  307. package/dist/translations/vi.d.ts +8 -0
  308. package/dist/translations/vi.js +5 -0
  309. package/dist/translations/vi.umd.js +11 -0
  310. package/dist/translations/zh-cn.d.ts +8 -0
  311. package/dist/translations/zh-cn.js +5 -0
  312. package/dist/translations/zh-cn.umd.js +11 -0
  313. package/dist/translations/zh.d.ts +8 -0
  314. package/dist/translations/zh.js +5 -0
  315. package/dist/translations/zh.umd.js +11 -0
  316. package/dist/underline/underlineediting.d.ts +32 -0
  317. package/dist/underline/underlineui.d.ts +29 -0
  318. package/dist/underline.d.ts +37 -0
  319. package/dist/utils.d.ts +24 -0
  320. package/lang/contexts.json +14 -0
  321. package/lang/translations/af.po +66 -0
  322. package/lang/translations/ar.po +66 -0
  323. package/lang/translations/ast.po +66 -0
  324. package/lang/translations/az.po +66 -0
  325. package/lang/translations/bg.po +66 -0
  326. package/lang/translations/bn.po +66 -0
  327. package/lang/translations/bs.po +66 -0
  328. package/lang/translations/ca.po +66 -0
  329. package/lang/translations/cs.po +66 -0
  330. package/lang/translations/da.po +66 -0
  331. package/lang/translations/de-ch.po +66 -0
  332. package/lang/translations/de.po +66 -0
  333. package/lang/translations/el.po +66 -0
  334. package/lang/translations/en-au.po +66 -0
  335. package/lang/translations/en-gb.po +66 -0
  336. package/lang/translations/en.po +66 -0
  337. package/lang/translations/eo.po +66 -0
  338. package/lang/translations/es-co.po +66 -0
  339. package/lang/translations/es.po +66 -0
  340. package/lang/translations/et.po +66 -0
  341. package/lang/translations/eu.po +66 -0
  342. package/lang/translations/fa.po +66 -0
  343. package/lang/translations/fi.po +66 -0
  344. package/lang/translations/fr.po +66 -0
  345. package/lang/translations/gl.po +66 -0
  346. package/lang/translations/gu.po +66 -0
  347. package/lang/translations/he.po +66 -0
  348. package/lang/translations/hi.po +66 -0
  349. package/lang/translations/hr.po +66 -0
  350. package/lang/translations/hu.po +66 -0
  351. package/lang/translations/hy.po +66 -0
  352. package/lang/translations/id.po +66 -0
  353. package/lang/translations/it.po +66 -0
  354. package/lang/translations/ja.po +66 -0
  355. package/lang/translations/jv.po +66 -0
  356. package/lang/translations/km.po +66 -0
  357. package/lang/translations/kn.po +66 -0
  358. package/lang/translations/ko.po +66 -0
  359. package/lang/translations/ku.po +66 -0
  360. package/lang/translations/lt.po +66 -0
  361. package/lang/translations/lv.po +66 -0
  362. package/lang/translations/ms.po +66 -0
  363. package/lang/translations/nb.po +66 -0
  364. package/lang/translations/ne.po +66 -0
  365. package/lang/translations/nl.po +66 -0
  366. package/lang/translations/no.po +66 -0
  367. package/lang/translations/oc.po +66 -0
  368. package/lang/translations/pl.po +66 -0
  369. package/lang/translations/pt-br.po +66 -0
  370. package/lang/translations/pt.po +66 -0
  371. package/lang/translations/ro.po +66 -0
  372. package/lang/translations/ru.po +66 -0
  373. package/lang/translations/si.po +66 -0
  374. package/lang/translations/sk.po +66 -0
  375. package/lang/translations/sl.po +66 -0
  376. package/lang/translations/sq.po +66 -0
  377. package/lang/translations/sr-latn.po +66 -0
  378. package/lang/translations/sr.po +66 -0
  379. package/lang/translations/sv.po +66 -0
  380. package/lang/translations/th.po +66 -0
  381. package/lang/translations/ti.po +66 -0
  382. package/lang/translations/tk.po +66 -0
  383. package/lang/translations/tr.po +66 -0
  384. package/lang/translations/tt.po +66 -0
  385. package/lang/translations/ug.po +66 -0
  386. package/lang/translations/uk.po +66 -0
  387. package/lang/translations/ur.po +66 -0
  388. package/lang/translations/uz.po +66 -0
  389. package/lang/translations/vi.po +66 -0
  390. package/lang/translations/zh-cn.po +66 -0
  391. package/lang/translations/zh.po +66 -0
  392. package/package.json +41 -0
  393. package/src/attributecommand.d.ts +74 -0
  394. package/src/attributecommand.js +105 -0
  395. package/src/augmentation.d.ts +40 -0
  396. package/src/augmentation.js +5 -0
  397. package/src/bold/boldediting.d.ts +28 -0
  398. package/src/bold/boldediting.js +78 -0
  399. package/src/bold/boldui.d.ts +25 -0
  400. package/src/bold/boldui.js +46 -0
  401. package/src/bold.d.ts +33 -0
  402. package/src/bold.js +39 -0
  403. package/src/code/codeediting.d.ts +33 -0
  404. package/src/code/codeediting.js +78 -0
  405. package/src/code/codeui.d.ts +26 -0
  406. package/src/code/codeui.js +47 -0
  407. package/src/code.d.ts +34 -0
  408. package/src/code.js +40 -0
  409. package/src/index.d.ts +30 -0
  410. package/src/index.js +30 -0
  411. package/src/italic/italicediting.d.ts +28 -0
  412. package/src/italic/italicediting.js +68 -0
  413. package/src/italic/italicui.d.ts +25 -0
  414. package/src/italic/italicui.js +47 -0
  415. package/src/italic.d.ts +33 -0
  416. package/src/italic.js +39 -0
  417. package/src/strikethrough/strikethroughediting.d.ts +29 -0
  418. package/src/strikethrough/strikethroughediting.js +70 -0
  419. package/src/strikethrough/strikethroughui.d.ts +25 -0
  420. package/src/strikethrough/strikethroughui.js +47 -0
  421. package/src/strikethrough.d.ts +33 -0
  422. package/src/strikethrough.js +39 -0
  423. package/src/subscript/subscriptediting.d.ts +28 -0
  424. package/src/subscript/subscriptediting.js +56 -0
  425. package/src/subscript/subscriptui.d.ts +25 -0
  426. package/src/subscript/subscriptui.js +46 -0
  427. package/src/subscript.d.ts +30 -0
  428. package/src/subscript.js +36 -0
  429. package/src/superscript/superscriptediting.d.ts +28 -0
  430. package/src/superscript/superscriptediting.js +56 -0
  431. package/src/superscript/superscriptui.d.ts +25 -0
  432. package/src/superscript/superscriptui.js +46 -0
  433. package/src/superscript.d.ts +30 -0
  434. package/src/superscript.js +36 -0
  435. package/src/underline/underlineediting.d.ts +28 -0
  436. package/src/underline/underlineediting.js +65 -0
  437. package/src/underline/underlineui.d.ts +25 -0
  438. package/src/underline/underlineui.js +47 -0
  439. package/src/underline.d.ts +33 -0
  440. package/src/underline.js +39 -0
  441. package/src/utils.d.ts +20 -0
  442. package/src/utils.js +38 -0
  443. package/theme/code.css +14 -0
  444. package/theme/icons/code.svg +1 -0
  445. package/theme/icons/italic.svg +1 -0
  446. package/theme/icons/strikethrough.svg +1 -0
  447. package/theme/icons/subscript.svg +1 -0
  448. package/theme/icons/superscript.svg +1 -0
  449. package/theme/icons/underline.svg +1 -0
package/dist/index.js ADDED
@@ -0,0 +1,981 @@
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 { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';
6
+ import { MenuBarMenuListItemButtonView, ButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
7
+ import { TwoStepCaretMovement, inlineHighlight } from '@ckeditor/ckeditor5-typing/dist/index.js';
8
+
9
+ /**
10
+ * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
11
+ * that toggles a single attribute on a text or an element.
12
+ *
13
+ * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}
14
+ * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
15
+ *
16
+ * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
17
+ * for the current selection and to which nodes the attribute can be applied.
18
+ */ class AttributeCommand extends Command {
19
+ /**
20
+ * The attribute that will be set by the command.
21
+ */ attributeKey;
22
+ /**
23
+ * @param attributeKey Attribute that will be set by the command.
24
+ */ constructor(editor, attributeKey){
25
+ super(editor);
26
+ this.attributeKey = attributeKey;
27
+ }
28
+ /**
29
+ * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
30
+ */ refresh() {
31
+ const model = this.editor.model;
32
+ const doc = model.document;
33
+ this.value = this._getValueFromFirstAllowedNode();
34
+ this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);
35
+ }
36
+ /**
37
+ * Executes the command – applies the attribute to the selection or removes it from the selection.
38
+ *
39
+ * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
40
+ *
41
+ * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
42
+ *
43
+ * * If the selection is on a range, the command applies the attribute to all nodes in that range
44
+ * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
45
+ * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
46
+ * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
47
+ * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
48
+ * that the selection inherits all attributes from a node if it is in an empty node).
49
+ *
50
+ * @fires execute
51
+ * @param options Command options.
52
+ * @param options.forceValue If set, it will force the command behavior. If `true`,
53
+ * the command will apply the attribute, otherwise the command will remove the attribute.
54
+ * If not set, the command will look for its current value to decide what it should do.
55
+ */ execute(options = {}) {
56
+ const model = this.editor.model;
57
+ const doc = model.document;
58
+ const selection = doc.selection;
59
+ const value = options.forceValue === undefined ? !this.value : options.forceValue;
60
+ model.change((writer)=>{
61
+ if (selection.isCollapsed) {
62
+ if (value) {
63
+ writer.setSelectionAttribute(this.attributeKey, true);
64
+ } else {
65
+ writer.removeSelectionAttribute(this.attributeKey);
66
+ }
67
+ } else {
68
+ const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);
69
+ for (const range of ranges){
70
+ if (value) {
71
+ writer.setAttribute(this.attributeKey, value, range);
72
+ } else {
73
+ writer.removeAttribute(this.attributeKey, range);
74
+ }
75
+ }
76
+ }
77
+ });
78
+ }
79
+ /**
80
+ * Checks the attribute value of the first node in the selection that allows the attribute.
81
+ * For the collapsed selection returns the selection attribute.
82
+ *
83
+ * @returns The attribute value.
84
+ */ _getValueFromFirstAllowedNode() {
85
+ const model = this.editor.model;
86
+ const schema = model.schema;
87
+ const selection = model.document.selection;
88
+ if (selection.isCollapsed) {
89
+ return selection.hasAttribute(this.attributeKey);
90
+ }
91
+ for (const range of selection.getRanges()){
92
+ for (const item of range.getItems()){
93
+ if (schema.checkAttribute(item, this.attributeKey)) {
94
+ return item.hasAttribute(this.attributeKey);
95
+ }
96
+ }
97
+ }
98
+ return false;
99
+ }
100
+ }
101
+
102
+ const BOLD$1 = 'bold';
103
+ /**
104
+ * The bold editing feature.
105
+ *
106
+ * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
107
+ * as a `<strong>` element.
108
+ */ class BoldEditing extends Plugin {
109
+ /**
110
+ * @inheritDoc
111
+ */ static get pluginName() {
112
+ return 'BoldEditing';
113
+ }
114
+ /**
115
+ * @inheritDoc
116
+ */ static get isOfficialPlugin() {
117
+ return true;
118
+ }
119
+ /**
120
+ * @inheritDoc
121
+ */ init() {
122
+ const editor = this.editor;
123
+ const t = this.editor.t;
124
+ // Allow bold attribute on text nodes.
125
+ editor.model.schema.extend('$text', {
126
+ allowAttributes: BOLD$1
127
+ });
128
+ editor.model.schema.setAttributeProperties(BOLD$1, {
129
+ isFormatting: true,
130
+ copyOnEnter: true
131
+ });
132
+ // Build converter from model to view for data and editing pipelines.
133
+ editor.conversion.attributeToElement({
134
+ model: BOLD$1,
135
+ view: 'strong',
136
+ upcastAlso: [
137
+ 'b',
138
+ (viewElement)=>{
139
+ const fontWeight = viewElement.getStyle('font-weight');
140
+ if (!fontWeight) {
141
+ return null;
142
+ }
143
+ // Value of the `font-weight` attribute can be defined as a string or a number.
144
+ if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
145
+ return {
146
+ name: true,
147
+ styles: [
148
+ 'font-weight'
149
+ ]
150
+ };
151
+ }
152
+ return null;
153
+ }
154
+ ]
155
+ });
156
+ // Create bold command.
157
+ editor.commands.add(BOLD$1, new AttributeCommand(editor, BOLD$1));
158
+ // Set the Ctrl+B keystroke.
159
+ editor.keystrokes.set('CTRL+B', BOLD$1);
160
+ // Add the information about the keystroke to the accessibility database.
161
+ editor.accessibility.addKeystrokeInfos({
162
+ keystrokes: [
163
+ {
164
+ label: t('Bold text'),
165
+ keystroke: 'CTRL+B'
166
+ }
167
+ ]
168
+ });
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
174
+ */ function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {
175
+ return (ButtonClass)=>{
176
+ const command = editor.commands.get(commandName);
177
+ const view = new ButtonClass(editor.locale);
178
+ view.set({
179
+ label,
180
+ icon,
181
+ keystroke,
182
+ isToggleable: true
183
+ });
184
+ view.bind('isEnabled').to(command, 'isEnabled');
185
+ view.bind('isOn').to(command, 'value');
186
+ if (view instanceof MenuBarMenuListItemButtonView) {
187
+ view.set({
188
+ role: 'menuitemcheckbox'
189
+ });
190
+ } else {
191
+ view.set({
192
+ tooltip: true
193
+ });
194
+ }
195
+ // Execute the command.
196
+ plugin.listenTo(view, 'execute', ()=>{
197
+ editor.execute(commandName);
198
+ editor.editing.view.focus();
199
+ });
200
+ return view;
201
+ };
202
+ }
203
+
204
+ const BOLD = 'bold';
205
+ /**
206
+ * The bold UI feature. It introduces the Bold button.
207
+ */ class BoldUI extends Plugin {
208
+ /**
209
+ * @inheritDoc
210
+ */ static get pluginName() {
211
+ return 'BoldUI';
212
+ }
213
+ /**
214
+ * @inheritDoc
215
+ */ static get isOfficialPlugin() {
216
+ return true;
217
+ }
218
+ /**
219
+ * @inheritDoc
220
+ */ init() {
221
+ const editor = this.editor;
222
+ const t = editor.locale.t;
223
+ const createButton = getButtonCreator({
224
+ editor,
225
+ commandName: BOLD,
226
+ plugin: this,
227
+ icon: icons.bold,
228
+ label: t('Bold'),
229
+ keystroke: 'CTRL+B'
230
+ });
231
+ // Add bold button to feature components.
232
+ editor.ui.componentFactory.add(BOLD, ()=>createButton(ButtonView));
233
+ editor.ui.componentFactory.add('menuBar:' + BOLD, ()=>createButton(MenuBarMenuListItemButtonView));
234
+ }
235
+ }
236
+
237
+ /**
238
+ * The bold feature.
239
+ *
240
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
241
+ * and the {@glink api/basic-styles package page}.
242
+ *
243
+ * This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
244
+ * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
245
+ */ class Bold extends Plugin {
246
+ /**
247
+ * @inheritDoc
248
+ */ static get requires() {
249
+ return [
250
+ BoldEditing,
251
+ BoldUI
252
+ ];
253
+ }
254
+ /**
255
+ * @inheritDoc
256
+ */ static get pluginName() {
257
+ return 'Bold';
258
+ }
259
+ /**
260
+ * @inheritDoc
261
+ */ static get isOfficialPlugin() {
262
+ return true;
263
+ }
264
+ }
265
+
266
+ const CODE$1 = 'code';
267
+ const HIGHLIGHT_CLASS = 'ck-code_selected';
268
+ /**
269
+ * The code editing feature.
270
+ *
271
+ * It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
272
+ * as a `<code>` element.
273
+ */ class CodeEditing extends Plugin {
274
+ /**
275
+ * @inheritDoc
276
+ */ static get pluginName() {
277
+ return 'CodeEditing';
278
+ }
279
+ /**
280
+ * @inheritDoc
281
+ */ static get isOfficialPlugin() {
282
+ return true;
283
+ }
284
+ /**
285
+ * @inheritDoc
286
+ */ static get requires() {
287
+ return [
288
+ TwoStepCaretMovement
289
+ ];
290
+ }
291
+ /**
292
+ * @inheritDoc
293
+ */ init() {
294
+ const editor = this.editor;
295
+ const t = this.editor.t;
296
+ // Allow code attribute on text nodes.
297
+ editor.model.schema.extend('$text', {
298
+ allowAttributes: CODE$1
299
+ });
300
+ editor.model.schema.setAttributeProperties(CODE$1, {
301
+ isFormatting: true,
302
+ copyOnEnter: false
303
+ });
304
+ editor.conversion.attributeToElement({
305
+ model: CODE$1,
306
+ view: 'code',
307
+ upcastAlso: {
308
+ styles: {
309
+ 'word-wrap': 'break-word'
310
+ }
311
+ }
312
+ });
313
+ // Create code command.
314
+ editor.commands.add(CODE$1, new AttributeCommand(editor, CODE$1));
315
+ // Enable two-step caret movement for `code` attribute.
316
+ editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE$1);
317
+ // Setup highlight over selected element.
318
+ inlineHighlight(editor, CODE$1, 'code', HIGHLIGHT_CLASS);
319
+ // Add the information about the keystroke to the accessibility database.
320
+ editor.accessibility.addKeystrokeInfos({
321
+ keystrokes: [
322
+ {
323
+ label: t('Move out of an inline code style'),
324
+ keystroke: [
325
+ [
326
+ 'arrowleft',
327
+ 'arrowleft'
328
+ ],
329
+ [
330
+ 'arrowright',
331
+ 'arrowright'
332
+ ]
333
+ ]
334
+ }
335
+ ]
336
+ });
337
+ }
338
+ }
339
+
340
+ var codeIcon = "<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>";
341
+
342
+ const CODE = 'code';
343
+ /**
344
+ * The code UI feature. It introduces the Code button.
345
+ */ class CodeUI extends Plugin {
346
+ /**
347
+ * @inheritDoc
348
+ */ static get pluginName() {
349
+ return 'CodeUI';
350
+ }
351
+ /**
352
+ * @inheritDoc
353
+ */ static get isOfficialPlugin() {
354
+ return true;
355
+ }
356
+ /**
357
+ * @inheritDoc
358
+ */ init() {
359
+ const editor = this.editor;
360
+ const t = editor.locale.t;
361
+ const createButton = getButtonCreator({
362
+ editor,
363
+ commandName: CODE,
364
+ plugin: this,
365
+ icon: codeIcon,
366
+ label: t('Code')
367
+ });
368
+ // Add code button to feature components.
369
+ editor.ui.componentFactory.add(CODE, ()=>createButton(ButtonView));
370
+ editor.ui.componentFactory.add('menuBar:' + CODE, ()=>createButton(MenuBarMenuListItemButtonView));
371
+ }
372
+ }
373
+
374
+ /**
375
+ * The code feature.
376
+ *
377
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
378
+ * and the {@glink api/basic-styles package page}.
379
+ *
380
+ * This is a "glue" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}
381
+ * and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.
382
+ */ class Code extends Plugin {
383
+ /**
384
+ * @inheritDoc
385
+ */ static get requires() {
386
+ return [
387
+ CodeEditing,
388
+ CodeUI
389
+ ];
390
+ }
391
+ /**
392
+ * @inheritDoc
393
+ */ static get pluginName() {
394
+ return 'Code';
395
+ }
396
+ /**
397
+ * @inheritDoc
398
+ */ static get isOfficialPlugin() {
399
+ return true;
400
+ }
401
+ }
402
+
403
+ const ITALIC$1 = 'italic';
404
+ /**
405
+ * The italic editing feature.
406
+ *
407
+ * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
408
+ * which renders to the view as an `<i>` element.
409
+ */ class ItalicEditing extends Plugin {
410
+ /**
411
+ * @inheritDoc
412
+ */ static get pluginName() {
413
+ return 'ItalicEditing';
414
+ }
415
+ /**
416
+ * @inheritDoc
417
+ */ static get isOfficialPlugin() {
418
+ return true;
419
+ }
420
+ /**
421
+ * @inheritDoc
422
+ */ init() {
423
+ const editor = this.editor;
424
+ const t = this.editor.t;
425
+ // Allow italic attribute on text nodes.
426
+ editor.model.schema.extend('$text', {
427
+ allowAttributes: ITALIC$1
428
+ });
429
+ editor.model.schema.setAttributeProperties(ITALIC$1, {
430
+ isFormatting: true,
431
+ copyOnEnter: true
432
+ });
433
+ editor.conversion.attributeToElement({
434
+ model: ITALIC$1,
435
+ view: 'i',
436
+ upcastAlso: [
437
+ 'em',
438
+ {
439
+ styles: {
440
+ 'font-style': 'italic'
441
+ }
442
+ }
443
+ ]
444
+ });
445
+ // Create italic command.
446
+ editor.commands.add(ITALIC$1, new AttributeCommand(editor, ITALIC$1));
447
+ // Set the Ctrl+I keystroke.
448
+ editor.keystrokes.set('CTRL+I', ITALIC$1);
449
+ // Add the information about the keystroke to the accessibility database.
450
+ editor.accessibility.addKeystrokeInfos({
451
+ keystrokes: [
452
+ {
453
+ label: t('Italic text'),
454
+ keystroke: 'CTRL+I'
455
+ }
456
+ ]
457
+ });
458
+ }
459
+ }
460
+
461
+ var italicIcon = "<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>";
462
+
463
+ const ITALIC = 'italic';
464
+ /**
465
+ * The italic UI feature. It introduces the Italic button.
466
+ */ class ItalicUI extends Plugin {
467
+ /**
468
+ * @inheritDoc
469
+ */ static get pluginName() {
470
+ return 'ItalicUI';
471
+ }
472
+ /**
473
+ * @inheritDoc
474
+ */ static get isOfficialPlugin() {
475
+ return true;
476
+ }
477
+ /**
478
+ * @inheritDoc
479
+ */ init() {
480
+ const editor = this.editor;
481
+ const t = editor.locale.t;
482
+ const createButton = getButtonCreator({
483
+ editor,
484
+ commandName: ITALIC,
485
+ plugin: this,
486
+ icon: italicIcon,
487
+ keystroke: 'CTRL+I',
488
+ label: t('Italic')
489
+ });
490
+ // Add bold button to feature components.
491
+ editor.ui.componentFactory.add(ITALIC, ()=>createButton(ButtonView));
492
+ editor.ui.componentFactory.add('menuBar:' + ITALIC, ()=>createButton(MenuBarMenuListItemButtonView));
493
+ }
494
+ }
495
+
496
+ /**
497
+ * The italic feature.
498
+ *
499
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
500
+ * and the {@glink api/basic-styles package page}.
501
+ *
502
+ * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
503
+ * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
504
+ */ class Italic extends Plugin {
505
+ /**
506
+ * @inheritDoc
507
+ */ static get requires() {
508
+ return [
509
+ ItalicEditing,
510
+ ItalicUI
511
+ ];
512
+ }
513
+ /**
514
+ * @inheritDoc
515
+ */ static get pluginName() {
516
+ return 'Italic';
517
+ }
518
+ /**
519
+ * @inheritDoc
520
+ */ static get isOfficialPlugin() {
521
+ return true;
522
+ }
523
+ }
524
+
525
+ const STRIKETHROUGH$1 = 'strikethrough';
526
+ /**
527
+ * The strikethrough editing feature.
528
+ *
529
+ * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
530
+ * `strikethroughsthrough` attribute in the model which renders to the view
531
+ * as a `<s>` element.
532
+ */ class StrikethroughEditing extends Plugin {
533
+ /**
534
+ * @inheritDoc
535
+ */ static get pluginName() {
536
+ return 'StrikethroughEditing';
537
+ }
538
+ /**
539
+ * @inheritDoc
540
+ */ static get isOfficialPlugin() {
541
+ return true;
542
+ }
543
+ /**
544
+ * @inheritDoc
545
+ */ init() {
546
+ const editor = this.editor;
547
+ const t = this.editor.t;
548
+ // Allow strikethrough attribute on text nodes.
549
+ editor.model.schema.extend('$text', {
550
+ allowAttributes: STRIKETHROUGH$1
551
+ });
552
+ editor.model.schema.setAttributeProperties(STRIKETHROUGH$1, {
553
+ isFormatting: true,
554
+ copyOnEnter: true
555
+ });
556
+ editor.conversion.attributeToElement({
557
+ model: STRIKETHROUGH$1,
558
+ view: 's',
559
+ upcastAlso: [
560
+ 'del',
561
+ 'strike',
562
+ {
563
+ styles: {
564
+ 'text-decoration': 'line-through'
565
+ }
566
+ }
567
+ ]
568
+ });
569
+ // Create strikethrough command.
570
+ editor.commands.add(STRIKETHROUGH$1, new AttributeCommand(editor, STRIKETHROUGH$1));
571
+ // Set the Ctrl+Shift+X keystroke.
572
+ editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');
573
+ // Add the information about the keystroke to the accessibility database.
574
+ editor.accessibility.addKeystrokeInfos({
575
+ keystrokes: [
576
+ {
577
+ label: t('Strikethrough text'),
578
+ keystroke: 'CTRL+SHIFT+X'
579
+ }
580
+ ]
581
+ });
582
+ }
583
+ }
584
+
585
+ var strikethroughIcon = "<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>";
586
+
587
+ const STRIKETHROUGH = 'strikethrough';
588
+ /**
589
+ * The strikethrough UI feature. It introduces the Strikethrough button.
590
+ */ class StrikethroughUI extends Plugin {
591
+ /**
592
+ * @inheritDoc
593
+ */ static get pluginName() {
594
+ return 'StrikethroughUI';
595
+ }
596
+ /**
597
+ * @inheritDoc
598
+ */ static get isOfficialPlugin() {
599
+ return true;
600
+ }
601
+ /**
602
+ * @inheritDoc
603
+ */ init() {
604
+ const editor = this.editor;
605
+ const t = editor.locale.t;
606
+ const createButton = getButtonCreator({
607
+ editor,
608
+ commandName: STRIKETHROUGH,
609
+ plugin: this,
610
+ icon: strikethroughIcon,
611
+ keystroke: 'CTRL+SHIFT+X',
612
+ label: t('Strikethrough')
613
+ });
614
+ // Add strikethrough button to feature components.
615
+ editor.ui.componentFactory.add(STRIKETHROUGH, ()=>createButton(ButtonView));
616
+ editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, ()=>createButton(MenuBarMenuListItemButtonView));
617
+ }
618
+ }
619
+
620
+ /**
621
+ * The strikethrough feature.
622
+ *
623
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
624
+ * and the {@glink api/basic-styles package page}.
625
+ *
626
+ * This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
627
+ * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
628
+ */ class Strikethrough extends Plugin {
629
+ /**
630
+ * @inheritDoc
631
+ */ static get requires() {
632
+ return [
633
+ StrikethroughEditing,
634
+ StrikethroughUI
635
+ ];
636
+ }
637
+ /**
638
+ * @inheritDoc
639
+ */ static get pluginName() {
640
+ return 'Strikethrough';
641
+ }
642
+ /**
643
+ * @inheritDoc
644
+ */ static get isOfficialPlugin() {
645
+ return true;
646
+ }
647
+ }
648
+
649
+ const SUBSCRIPT$1 = 'subscript';
650
+ /**
651
+ * The subscript editing feature.
652
+ *
653
+ * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
654
+ * as a `<sub>` element.
655
+ */ class SubscriptEditing extends Plugin {
656
+ /**
657
+ * @inheritDoc
658
+ */ static get pluginName() {
659
+ return 'SubscriptEditing';
660
+ }
661
+ /**
662
+ * @inheritDoc
663
+ */ static get isOfficialPlugin() {
664
+ return true;
665
+ }
666
+ /**
667
+ * @inheritDoc
668
+ */ init() {
669
+ const editor = this.editor;
670
+ // Allow sub attribute on text nodes.
671
+ editor.model.schema.extend('$text', {
672
+ allowAttributes: SUBSCRIPT$1
673
+ });
674
+ editor.model.schema.setAttributeProperties(SUBSCRIPT$1, {
675
+ isFormatting: true,
676
+ copyOnEnter: true
677
+ });
678
+ // Build converter from model to view for data and editing pipelines.
679
+ editor.conversion.attributeToElement({
680
+ model: SUBSCRIPT$1,
681
+ view: 'sub',
682
+ upcastAlso: [
683
+ {
684
+ styles: {
685
+ 'vertical-align': 'sub'
686
+ }
687
+ }
688
+ ]
689
+ });
690
+ // Create sub command.
691
+ editor.commands.add(SUBSCRIPT$1, new AttributeCommand(editor, SUBSCRIPT$1));
692
+ }
693
+ }
694
+
695
+ var subscriptIcon = "<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>";
696
+
697
+ const SUBSCRIPT = 'subscript';
698
+ /**
699
+ * The subscript UI feature. It introduces the Subscript button.
700
+ */ class SubscriptUI extends Plugin {
701
+ /**
702
+ * @inheritDoc
703
+ */ static get pluginName() {
704
+ return 'SubscriptUI';
705
+ }
706
+ /**
707
+ * @inheritDoc
708
+ */ static get isOfficialPlugin() {
709
+ return true;
710
+ }
711
+ /**
712
+ * @inheritDoc
713
+ */ init() {
714
+ const editor = this.editor;
715
+ const t = editor.locale.t;
716
+ const createButton = getButtonCreator({
717
+ editor,
718
+ commandName: SUBSCRIPT,
719
+ plugin: this,
720
+ icon: subscriptIcon,
721
+ label: t('Subscript')
722
+ });
723
+ // Add subscript button to feature components.
724
+ editor.ui.componentFactory.add(SUBSCRIPT, ()=>createButton(ButtonView));
725
+ editor.ui.componentFactory.add('menuBar:' + SUBSCRIPT, ()=>createButton(MenuBarMenuListItemButtonView));
726
+ }
727
+ }
728
+
729
+ /**
730
+ * The subscript feature.
731
+ *
732
+ * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
733
+ * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
734
+ */ class Subscript extends Plugin {
735
+ /**
736
+ * @inheritDoc
737
+ */ static get requires() {
738
+ return [
739
+ SubscriptEditing,
740
+ SubscriptUI
741
+ ];
742
+ }
743
+ /**
744
+ * @inheritDoc
745
+ */ static get pluginName() {
746
+ return 'Subscript';
747
+ }
748
+ /**
749
+ * @inheritDoc
750
+ */ static get isOfficialPlugin() {
751
+ return true;
752
+ }
753
+ }
754
+
755
+ const SUPERSCRIPT$1 = 'superscript';
756
+ /**
757
+ * The superscript editing feature.
758
+ *
759
+ * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
760
+ * as a `<super>` element.
761
+ */ class SuperscriptEditing extends Plugin {
762
+ /**
763
+ * @inheritDoc
764
+ */ static get pluginName() {
765
+ return 'SuperscriptEditing';
766
+ }
767
+ /**
768
+ * @inheritDoc
769
+ */ static get isOfficialPlugin() {
770
+ return true;
771
+ }
772
+ /**
773
+ * @inheritDoc
774
+ */ init() {
775
+ const editor = this.editor;
776
+ // Allow super attribute on text nodes.
777
+ editor.model.schema.extend('$text', {
778
+ allowAttributes: SUPERSCRIPT$1
779
+ });
780
+ editor.model.schema.setAttributeProperties(SUPERSCRIPT$1, {
781
+ isFormatting: true,
782
+ copyOnEnter: true
783
+ });
784
+ // Build converter from model to view for data and editing pipelines.
785
+ editor.conversion.attributeToElement({
786
+ model: SUPERSCRIPT$1,
787
+ view: 'sup',
788
+ upcastAlso: [
789
+ {
790
+ styles: {
791
+ 'vertical-align': 'super'
792
+ }
793
+ }
794
+ ]
795
+ });
796
+ // Create super command.
797
+ editor.commands.add(SUPERSCRIPT$1, new AttributeCommand(editor, SUPERSCRIPT$1));
798
+ }
799
+ }
800
+
801
+ var superscriptIcon = "<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>";
802
+
803
+ const SUPERSCRIPT = 'superscript';
804
+ /**
805
+ * The superscript UI feature. It introduces the Superscript button.
806
+ */ class SuperscriptUI extends Plugin {
807
+ /**
808
+ * @inheritDoc
809
+ */ static get pluginName() {
810
+ return 'SuperscriptUI';
811
+ }
812
+ /**
813
+ * @inheritDoc
814
+ */ static get isOfficialPlugin() {
815
+ return true;
816
+ }
817
+ /**
818
+ * @inheritDoc
819
+ */ init() {
820
+ const editor = this.editor;
821
+ const t = editor.locale.t;
822
+ const createButton = getButtonCreator({
823
+ editor,
824
+ commandName: SUPERSCRIPT,
825
+ plugin: this,
826
+ icon: superscriptIcon,
827
+ label: t('Superscript')
828
+ });
829
+ // Add superscript button to feature components.
830
+ editor.ui.componentFactory.add(SUPERSCRIPT, ()=>createButton(ButtonView));
831
+ editor.ui.componentFactory.add('menuBar:' + SUPERSCRIPT, ()=>createButton(MenuBarMenuListItemButtonView));
832
+ }
833
+ }
834
+
835
+ /**
836
+ * The superscript feature.
837
+ *
838
+ * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
839
+ * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
840
+ */ class Superscript extends Plugin {
841
+ /**
842
+ * @inheritDoc
843
+ */ static get requires() {
844
+ return [
845
+ SuperscriptEditing,
846
+ SuperscriptUI
847
+ ];
848
+ }
849
+ /**
850
+ * @inheritDoc
851
+ */ static get pluginName() {
852
+ return 'Superscript';
853
+ }
854
+ /**
855
+ * @inheritDoc
856
+ */ static get isOfficialPlugin() {
857
+ return true;
858
+ }
859
+ }
860
+
861
+ const UNDERLINE$1 = 'underline';
862
+ /**
863
+ * The underline editing feature.
864
+ *
865
+ * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
866
+ * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
867
+ */ class UnderlineEditing extends Plugin {
868
+ /**
869
+ * @inheritDoc
870
+ */ static get pluginName() {
871
+ return 'UnderlineEditing';
872
+ }
873
+ /**
874
+ * @inheritDoc
875
+ */ static get isOfficialPlugin() {
876
+ return true;
877
+ }
878
+ /**
879
+ * @inheritDoc
880
+ */ init() {
881
+ const editor = this.editor;
882
+ const t = this.editor.t;
883
+ // Allow strikethrough attribute on text nodes.
884
+ editor.model.schema.extend('$text', {
885
+ allowAttributes: UNDERLINE$1
886
+ });
887
+ editor.model.schema.setAttributeProperties(UNDERLINE$1, {
888
+ isFormatting: true,
889
+ copyOnEnter: true
890
+ });
891
+ editor.conversion.attributeToElement({
892
+ model: UNDERLINE$1,
893
+ view: 'u',
894
+ upcastAlso: {
895
+ styles: {
896
+ 'text-decoration': 'underline'
897
+ }
898
+ }
899
+ });
900
+ // Create underline command.
901
+ editor.commands.add(UNDERLINE$1, new AttributeCommand(editor, UNDERLINE$1));
902
+ // Set the Ctrl+U keystroke.
903
+ editor.keystrokes.set('CTRL+U', 'underline');
904
+ // Add the information about the keystroke to the accessibility database.
905
+ editor.accessibility.addKeystrokeInfos({
906
+ keystrokes: [
907
+ {
908
+ label: t('Underline text'),
909
+ keystroke: 'CTRL+U'
910
+ }
911
+ ]
912
+ });
913
+ }
914
+ }
915
+
916
+ var underlineIcon = "<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>";
917
+
918
+ const UNDERLINE = 'underline';
919
+ /**
920
+ * The underline UI feature. It introduces the Underline button.
921
+ */ class UnderlineUI extends Plugin {
922
+ /**
923
+ * @inheritDoc
924
+ */ static get pluginName() {
925
+ return 'UnderlineUI';
926
+ }
927
+ /**
928
+ * @inheritDoc
929
+ */ static get isOfficialPlugin() {
930
+ return true;
931
+ }
932
+ /**
933
+ * @inheritDoc
934
+ */ init() {
935
+ const editor = this.editor;
936
+ const t = editor.locale.t;
937
+ const createButton = getButtonCreator({
938
+ editor,
939
+ commandName: UNDERLINE,
940
+ plugin: this,
941
+ icon: underlineIcon,
942
+ label: t('Underline'),
943
+ keystroke: 'CTRL+U'
944
+ });
945
+ // Add bold button to feature components.
946
+ editor.ui.componentFactory.add(UNDERLINE, ()=>createButton(ButtonView));
947
+ editor.ui.componentFactory.add('menuBar:' + UNDERLINE, ()=>createButton(MenuBarMenuListItemButtonView));
948
+ }
949
+ }
950
+
951
+ /**
952
+ * The underline feature.
953
+ *
954
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
955
+ * and the {@glink api/basic-styles package page}.
956
+ *
957
+ * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
958
+ * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
959
+ */ class Underline extends Plugin {
960
+ /**
961
+ * @inheritDoc
962
+ */ static get requires() {
963
+ return [
964
+ UnderlineEditing,
965
+ UnderlineUI
966
+ ];
967
+ }
968
+ /**
969
+ * @inheritDoc
970
+ */ static get pluginName() {
971
+ return 'Underline';
972
+ }
973
+ /**
974
+ * @inheritDoc
975
+ */ static get isOfficialPlugin() {
976
+ return true;
977
+ }
978
+ }
979
+
980
+ export { AttributeCommand, Bold, BoldEditing, BoldUI, Code, CodeEditing, CodeUI, Italic, ItalicEditing, ItalicUI, Strikethrough, StrikethroughEditing, StrikethroughUI, Subscript, SubscriptEditing, SubscriptUI, Superscript, SuperscriptEditing, SuperscriptUI, Underline, UnderlineEditing, UnderlineUI };
981
+ //# sourceMappingURL=index.js.map