@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
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Uzbek (https://app.transifex.com/ckeditor/teams/11143/uz/)\n"
16
+ "Language: uz\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+
20
+ msgctxt "Toolbar button tooltip for the Bold feature."
21
+ msgid "Bold"
22
+ msgstr "Qalin"
23
+
24
+ msgctxt "Toolbar button tooltip for the Italic feature."
25
+ msgid "Italic"
26
+ msgstr "Kursiv"
27
+
28
+ msgctxt "Toolbar button tooltip for the Underline feature."
29
+ msgid "Underline"
30
+ msgstr "Tagi chizilgan"
31
+
32
+ msgctxt "Toolbar button tooltip for the Code feature."
33
+ msgid "Code"
34
+ msgstr "Manba kodi"
35
+
36
+ msgctxt "Toolbar button tooltip for the Strikethrough feature."
37
+ msgid "Strikethrough"
38
+ msgstr "Chizilgan"
39
+
40
+ msgctxt "Toolbar button tooltip for the Subscript feature."
41
+ msgid "Subscript"
42
+ msgstr "Pastki yozuv"
43
+
44
+ msgctxt "Toolbar button tooltip for the Superscript feature."
45
+ msgid "Superscript"
46
+ msgstr "Yuqori yozuv"
47
+
48
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text italic."
49
+ msgid "Italic text"
50
+ msgstr ""
51
+
52
+ msgctxt "Keystroke description for assistive technologies: keystroke for moving selection out of an inline code style."
53
+ msgid "Move out of an inline code style"
54
+ msgstr ""
55
+
56
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text bold."
57
+ msgid "Bold text"
58
+ msgstr ""
59
+
60
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text underlined."
61
+ msgid "Underline text"
62
+ msgstr ""
63
+
64
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text strikethrough."
65
+ msgid "Strikethrough text"
66
+ msgstr ""
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Vietnamese (https://app.transifex.com/ckeditor/teams/11143/vi/)\n"
16
+ "Language: vi\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+
20
+ msgctxt "Toolbar button tooltip for the Bold feature."
21
+ msgid "Bold"
22
+ msgstr "Đậm"
23
+
24
+ msgctxt "Toolbar button tooltip for the Italic feature."
25
+ msgid "Italic"
26
+ msgstr "Nghiêng"
27
+
28
+ msgctxt "Toolbar button tooltip for the Underline feature."
29
+ msgid "Underline"
30
+ msgstr "Gạch dưới"
31
+
32
+ msgctxt "Toolbar button tooltip for the Code feature."
33
+ msgid "Code"
34
+ msgstr "Code"
35
+
36
+ msgctxt "Toolbar button tooltip for the Strikethrough feature."
37
+ msgid "Strikethrough"
38
+ msgstr "Gạch ngang"
39
+
40
+ msgctxt "Toolbar button tooltip for the Subscript feature."
41
+ msgid "Subscript"
42
+ msgstr "Chữ nhỏ dưới"
43
+
44
+ msgctxt "Toolbar button tooltip for the Superscript feature."
45
+ msgid "Superscript"
46
+ msgstr "Chữ nhỏ trên"
47
+
48
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text italic."
49
+ msgid "Italic text"
50
+ msgstr "In nghiêng chữ"
51
+
52
+ msgctxt "Keystroke description for assistive technologies: keystroke for moving selection out of an inline code style."
53
+ msgid "Move out of an inline code style"
54
+ msgstr "Thoát khỏi kiểu mã nội dòng"
55
+
56
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text bold."
57
+ msgid "Bold text"
58
+ msgstr "In đậm chữ"
59
+
60
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text underlined."
61
+ msgid "Underline text"
62
+ msgstr "Gạch chân chữ"
63
+
64
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text strikethrough."
65
+ msgid "Strikethrough text"
66
+ msgstr "Gạch ngang chữ"
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Chinese (China) (https://app.transifex.com/ckeditor/teams/11143/zh_CN/)\n"
16
+ "Language: zh_CN\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+
20
+ msgctxt "Toolbar button tooltip for the Bold feature."
21
+ msgid "Bold"
22
+ msgstr "加粗"
23
+
24
+ msgctxt "Toolbar button tooltip for the Italic feature."
25
+ msgid "Italic"
26
+ msgstr "倾斜"
27
+
28
+ msgctxt "Toolbar button tooltip for the Underline feature."
29
+ msgid "Underline"
30
+ msgstr "下划线"
31
+
32
+ msgctxt "Toolbar button tooltip for the Code feature."
33
+ msgid "Code"
34
+ msgstr "代码"
35
+
36
+ msgctxt "Toolbar button tooltip for the Strikethrough feature."
37
+ msgid "Strikethrough"
38
+ msgstr "删除线"
39
+
40
+ msgctxt "Toolbar button tooltip for the Subscript feature."
41
+ msgid "Subscript"
42
+ msgstr "下标"
43
+
44
+ msgctxt "Toolbar button tooltip for the Superscript feature."
45
+ msgid "Superscript"
46
+ msgstr "上标"
47
+
48
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text italic."
49
+ msgid "Italic text"
50
+ msgstr "斜体文本"
51
+
52
+ msgctxt "Keystroke description for assistive technologies: keystroke for moving selection out of an inline code style."
53
+ msgid "Move out of an inline code style"
54
+ msgstr "摆脱内联代码风格"
55
+
56
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text bold."
57
+ msgid "Bold text"
58
+ msgstr "加粗字体"
59
+
60
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text underlined."
61
+ msgid "Underline text"
62
+ msgstr "给文本添加下划线"
63
+
64
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text strikethrough."
65
+ msgid "Strikethrough text"
66
+ msgstr "给文本添加删除线"
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Chinese (Taiwan) (https://app.transifex.com/ckeditor/teams/11143/zh_TW/)\n"
16
+ "Language: zh_TW\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
19
+
20
+ msgctxt "Toolbar button tooltip for the Bold feature."
21
+ msgid "Bold"
22
+ msgstr "粗體"
23
+
24
+ msgctxt "Toolbar button tooltip for the Italic feature."
25
+ msgid "Italic"
26
+ msgstr "斜體"
27
+
28
+ msgctxt "Toolbar button tooltip for the Underline feature."
29
+ msgid "Underline"
30
+ msgstr "底線"
31
+
32
+ msgctxt "Toolbar button tooltip for the Code feature."
33
+ msgid "Code"
34
+ msgstr "代碼"
35
+
36
+ msgctxt "Toolbar button tooltip for the Strikethrough feature."
37
+ msgid "Strikethrough"
38
+ msgstr "刪除線"
39
+
40
+ msgctxt "Toolbar button tooltip for the Subscript feature."
41
+ msgid "Subscript"
42
+ msgstr "下標"
43
+
44
+ msgctxt "Toolbar button tooltip for the Superscript feature."
45
+ msgid "Superscript"
46
+ msgstr "上標"
47
+
48
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text italic."
49
+ msgid "Italic text"
50
+ msgstr "斜體文字"
51
+
52
+ msgctxt "Keystroke description for assistive technologies: keystroke for moving selection out of an inline code style."
53
+ msgid "Move out of an inline code style"
54
+ msgstr "移出行內程式碼樣式"
55
+
56
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text bold."
57
+ msgid "Bold text"
58
+ msgstr "粗體文字"
59
+
60
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text underlined."
61
+ msgid "Underline text"
62
+ msgstr "底線文字"
63
+
64
+ msgctxt "Keystroke description for assistive technologies: keystroke for making text strikethrough."
65
+ msgid "Strikethrough text"
66
+ msgstr "刪除線文字"
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@ckeditor/ckeditor5-basic-styles",
3
+ "version": "0.0.0-internal-20241017.0",
4
+ "description": "Basic styles feature for CKEditor 5.",
5
+ "keywords": [
6
+ "ckeditor",
7
+ "ckeditor5",
8
+ "ckeditor 5",
9
+ "ckeditor5-feature",
10
+ "ckeditor5-plugin",
11
+ "ckeditor5-dll"
12
+ ],
13
+ "type": "module",
14
+ "main": "src/index.js",
15
+ "dependencies": {
16
+ "@ckeditor/ckeditor5-core": "0.0.0-internal-20241017.0",
17
+ "@ckeditor/ckeditor5-typing": "0.0.0-internal-20241017.0",
18
+ "@ckeditor/ckeditor5-ui": "0.0.0-internal-20241017.0",
19
+ "ckeditor5": "0.0.0-internal-20241017.0"
20
+ },
21
+ "author": "CKSource (http://cksource.com/)",
22
+ "license": "GPL-2.0-or-later",
23
+ "homepage": "https://ckeditor.com/ckeditor-5",
24
+ "bugs": "https://github.com/ckeditor/ckeditor5/issues",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/ckeditor/ckeditor5.git",
28
+ "directory": "packages/ckeditor5-basic-styles"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "lang",
33
+ "src/**/*.js",
34
+ "src/**/*.d.ts",
35
+ "theme",
36
+ "build",
37
+ "ckeditor5-metadata.json",
38
+ "CHANGELOG.md"
39
+ ],
40
+ "types": "src/index.d.ts"
41
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module basic-styles/attributecommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
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
+ */
19
+ export default class AttributeCommand extends Command {
20
+ /**
21
+ * Flag indicating whether the command is active. The command is active when the
22
+ * {@link module:engine/model/selection~Selection#hasAttribute selection has the attribute} which means that:
23
+ *
24
+ * * If the selection is not empty – That the attribute is set on the first node in the selection that allows this attribute.
25
+ * * If the selection is empty – That the selection has the attribute itself (which means that newly typed
26
+ * text will have this attribute, too).
27
+ *
28
+ * @observable
29
+ * @readonly
30
+ */
31
+ value: boolean;
32
+ /**
33
+ * The attribute that will be set by the command.
34
+ */
35
+ readonly attributeKey: string;
36
+ /**
37
+ * @param attributeKey Attribute that will be set by the command.
38
+ */
39
+ constructor(editor: Editor, attributeKey: string);
40
+ /**
41
+ * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
42
+ */
43
+ refresh(): void;
44
+ /**
45
+ * Executes the command – applies the attribute to the selection or removes it from the selection.
46
+ *
47
+ * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
48
+ *
49
+ * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
50
+ *
51
+ * * If the selection is on a range, the command applies the attribute to all nodes in that range
52
+ * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
53
+ * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
54
+ * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
55
+ * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
56
+ * that the selection inherits all attributes from a node if it is in an empty node).
57
+ *
58
+ * @fires execute
59
+ * @param options Command options.
60
+ * @param options.forceValue If set, it will force the command behavior. If `true`,
61
+ * the command will apply the attribute, otherwise the command will remove the attribute.
62
+ * If not set, the command will look for its current value to decide what it should do.
63
+ */
64
+ execute(options?: {
65
+ forceValue?: boolean;
66
+ }): void;
67
+ /**
68
+ * Checks the attribute value of the first node in the selection that allows the attribute.
69
+ * For the collapsed selection returns the selection attribute.
70
+ *
71
+ * @returns The attribute value.
72
+ */
73
+ private _getValueFromFirstAllowedNode;
74
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module basic-styles/attributecommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
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
+ */
19
+ export default class AttributeCommand extends Command {
20
+ /**
21
+ * @param attributeKey Attribute that will be set by the command.
22
+ */
23
+ constructor(editor, attributeKey) {
24
+ super(editor);
25
+ this.attributeKey = attributeKey;
26
+ }
27
+ /**
28
+ * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
29
+ */
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
+ */
56
+ execute(options = {}) {
57
+ const model = this.editor.model;
58
+ const doc = model.document;
59
+ const selection = doc.selection;
60
+ const value = (options.forceValue === undefined) ? !this.value : options.forceValue;
61
+ model.change(writer => {
62
+ if (selection.isCollapsed) {
63
+ if (value) {
64
+ writer.setSelectionAttribute(this.attributeKey, true);
65
+ }
66
+ else {
67
+ writer.removeSelectionAttribute(this.attributeKey);
68
+ }
69
+ }
70
+ else {
71
+ const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);
72
+ for (const range of ranges) {
73
+ if (value) {
74
+ writer.setAttribute(this.attributeKey, value, range);
75
+ }
76
+ else {
77
+ writer.removeAttribute(this.attributeKey, range);
78
+ }
79
+ }
80
+ }
81
+ });
82
+ }
83
+ /**
84
+ * Checks the attribute value of the first node in the selection that allows the attribute.
85
+ * For the collapsed selection returns the selection attribute.
86
+ *
87
+ * @returns The attribute value.
88
+ */
89
+ _getValueFromFirstAllowedNode() {
90
+ const model = this.editor.model;
91
+ const schema = model.schema;
92
+ const selection = model.document.selection;
93
+ if (selection.isCollapsed) {
94
+ return selection.hasAttribute(this.attributeKey);
95
+ }
96
+ for (const range of selection.getRanges()) {
97
+ for (const item of range.getItems()) {
98
+ if (schema.checkAttribute(item, this.attributeKey)) {
99
+ return item.hasAttribute(this.attributeKey);
100
+ }
101
+ }
102
+ }
103
+ return false;
104
+ }
105
+ }
@@ -0,0 +1,40 @@
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 type { Superscript, Subscript, Bold, Code, AttributeCommand, BoldUI, CodeEditing, CodeUI, Italic, ItalicEditing, ItalicUI, Strikethrough, StrikethroughEditing, StrikethroughUI, SubscriptEditing, SubscriptUI, SuperscriptEditing, SuperscriptUI, Underline, UnderlineEditing, UnderlineUI } from './index.js';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [Superscript.pluginName]: Superscript;
9
+ [Subscript.pluginName]: Subscript;
10
+ [Bold.pluginName]: Bold;
11
+ [Code.pluginName]: Code;
12
+ [Code.pluginName]: Code;
13
+ [Code.pluginName]: Code;
14
+ [BoldUI.pluginName]: BoldUI;
15
+ [CodeEditing.pluginName]: CodeEditing;
16
+ [CodeUI.pluginName]: CodeUI;
17
+ [Italic.pluginName]: Italic;
18
+ [ItalicEditing.pluginName]: ItalicEditing;
19
+ [ItalicUI.pluginName]: ItalicUI;
20
+ [Strikethrough.pluginName]: Strikethrough;
21
+ [StrikethroughEditing.pluginName]: StrikethroughEditing;
22
+ [StrikethroughUI.pluginName]: StrikethroughUI;
23
+ [SubscriptEditing.pluginName]: SubscriptEditing;
24
+ [SubscriptUI.pluginName]: SubscriptUI;
25
+ [SuperscriptEditing.pluginName]: SuperscriptEditing;
26
+ [SuperscriptUI.pluginName]: SuperscriptUI;
27
+ [Underline.pluginName]: Underline;
28
+ [UnderlineEditing.pluginName]: UnderlineEditing;
29
+ [UnderlineUI.pluginName]: UnderlineUI;
30
+ }
31
+ interface CommandsMap {
32
+ bold: AttributeCommand;
33
+ code: AttributeCommand;
34
+ italic: AttributeCommand;
35
+ strikethrough: AttributeCommand;
36
+ subscript: AttributeCommand;
37
+ superscript: AttributeCommand;
38
+ underline: AttributeCommand;
39
+ }
40
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module basic-styles/bold/boldediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The bold editing feature.
11
+ *
12
+ * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
13
+ * as a `<strong>` element.
14
+ */
15
+ export default class BoldEditing extends Plugin {
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName(): "BoldEditing";
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get isOfficialPlugin(): true;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ init(): void;
28
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module basic-styles/bold/boldediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import AttributeCommand from '../attributecommand.js';
10
+ const BOLD = 'bold';
11
+ /**
12
+ * The bold editing feature.
13
+ *
14
+ * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
15
+ * as a `<strong>` element.
16
+ */
17
+ export default class BoldEditing extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName() {
22
+ return 'BoldEditing';
23
+ }
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get isOfficialPlugin() {
28
+ return true;
29
+ }
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ init() {
34
+ const editor = this.editor;
35
+ const t = this.editor.t;
36
+ // Allow bold attribute on text nodes.
37
+ editor.model.schema.extend('$text', { allowAttributes: BOLD });
38
+ editor.model.schema.setAttributeProperties(BOLD, {
39
+ isFormatting: true,
40
+ copyOnEnter: true
41
+ });
42
+ // Build converter from model to view for data and editing pipelines.
43
+ editor.conversion.attributeToElement({
44
+ model: BOLD,
45
+ view: 'strong',
46
+ upcastAlso: [
47
+ 'b',
48
+ viewElement => {
49
+ const fontWeight = viewElement.getStyle('font-weight');
50
+ if (!fontWeight) {
51
+ return null;
52
+ }
53
+ // Value of the `font-weight` attribute can be defined as a string or a number.
54
+ if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
55
+ return {
56
+ name: true,
57
+ styles: ['font-weight']
58
+ };
59
+ }
60
+ return null;
61
+ }
62
+ ]
63
+ });
64
+ // Create bold command.
65
+ editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));
66
+ // Set the Ctrl+B keystroke.
67
+ editor.keystrokes.set('CTRL+B', BOLD);
68
+ // Add the information about the keystroke to the accessibility database.
69
+ editor.accessibility.addKeystrokeInfos({
70
+ keystrokes: [
71
+ {
72
+ label: t('Bold text'),
73
+ keystroke: 'CTRL+B'
74
+ }
75
+ ]
76
+ });
77
+ }
78
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module basic-styles/bold/boldui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The bold UI feature. It introduces the Bold button.
11
+ */
12
+ export default class BoldUI extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "BoldUI";
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get isOfficialPlugin(): true;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ init(): void;
25
+ }