@ckeditor/ckeditor5-heading 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 (363) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +17 -0
  3. package/README.md +26 -0
  4. package/build/heading.js +5 -0
  5. package/build/translations/ar.js +1 -0
  6. package/build/translations/az.js +1 -0
  7. package/build/translations/bg.js +1 -0
  8. package/build/translations/bn.js +1 -0
  9. package/build/translations/bs.js +1 -0
  10. package/build/translations/ca.js +1 -0
  11. package/build/translations/cs.js +1 -0
  12. package/build/translations/da.js +1 -0
  13. package/build/translations/de-ch.js +1 -0
  14. package/build/translations/de.js +1 -0
  15. package/build/translations/el.js +1 -0
  16. package/build/translations/en-au.js +1 -0
  17. package/build/translations/en-gb.js +1 -0
  18. package/build/translations/eo.js +1 -0
  19. package/build/translations/es.js +1 -0
  20. package/build/translations/et.js +1 -0
  21. package/build/translations/eu.js +1 -0
  22. package/build/translations/fa.js +1 -0
  23. package/build/translations/fi.js +1 -0
  24. package/build/translations/fr.js +1 -0
  25. package/build/translations/gl.js +1 -0
  26. package/build/translations/he.js +1 -0
  27. package/build/translations/hi.js +1 -0
  28. package/build/translations/hr.js +1 -0
  29. package/build/translations/hu.js +1 -0
  30. package/build/translations/hy.js +1 -0
  31. package/build/translations/id.js +1 -0
  32. package/build/translations/it.js +1 -0
  33. package/build/translations/ja.js +1 -0
  34. package/build/translations/jv.js +1 -0
  35. package/build/translations/km.js +1 -0
  36. package/build/translations/kn.js +1 -0
  37. package/build/translations/ko.js +1 -0
  38. package/build/translations/ku.js +1 -0
  39. package/build/translations/lt.js +1 -0
  40. package/build/translations/lv.js +1 -0
  41. package/build/translations/ms.js +1 -0
  42. package/build/translations/nb.js +1 -0
  43. package/build/translations/ne.js +1 -0
  44. package/build/translations/nl.js +1 -0
  45. package/build/translations/no.js +1 -0
  46. package/build/translations/pl.js +1 -0
  47. package/build/translations/pt-br.js +1 -0
  48. package/build/translations/pt.js +1 -0
  49. package/build/translations/ro.js +1 -0
  50. package/build/translations/ru.js +1 -0
  51. package/build/translations/sk.js +1 -0
  52. package/build/translations/sl.js +1 -0
  53. package/build/translations/sq.js +1 -0
  54. package/build/translations/sr-latn.js +1 -0
  55. package/build/translations/sr.js +1 -0
  56. package/build/translations/sv.js +1 -0
  57. package/build/translations/th.js +1 -0
  58. package/build/translations/ti.js +1 -0
  59. package/build/translations/tk.js +1 -0
  60. package/build/translations/tr.js +1 -0
  61. package/build/translations/ug.js +1 -0
  62. package/build/translations/uk.js +1 -0
  63. package/build/translations/ur.js +1 -0
  64. package/build/translations/uz.js +1 -0
  65. package/build/translations/vi.js +1 -0
  66. package/build/translations/zh-cn.js +1 -0
  67. package/build/translations/zh.js +1 -0
  68. package/ckeditor5-metadata.json +46 -0
  69. package/dist/augmentation.d.ts +34 -0
  70. package/dist/heading.d.ts +40 -0
  71. package/dist/headingbuttonsui.d.ts +55 -0
  72. package/dist/headingcommand.d.ts +52 -0
  73. package/dist/headingconfig.d.ts +123 -0
  74. package/dist/headingediting.d.ts +50 -0
  75. package/dist/headingui.d.ts +30 -0
  76. package/dist/index-content.css +4 -0
  77. package/dist/index-editor.css +19 -0
  78. package/dist/index.css +26 -0
  79. package/dist/index.css.map +1 -0
  80. package/dist/index.d.ts +20 -0
  81. package/dist/index.js +937 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/title.d.ts +123 -0
  84. package/dist/translations/ar.d.ts +8 -0
  85. package/dist/translations/ar.js +5 -0
  86. package/dist/translations/ar.umd.js +11 -0
  87. package/dist/translations/az.d.ts +8 -0
  88. package/dist/translations/az.js +5 -0
  89. package/dist/translations/az.umd.js +11 -0
  90. package/dist/translations/bg.d.ts +8 -0
  91. package/dist/translations/bg.js +5 -0
  92. package/dist/translations/bg.umd.js +11 -0
  93. package/dist/translations/bn.d.ts +8 -0
  94. package/dist/translations/bn.js +5 -0
  95. package/dist/translations/bn.umd.js +11 -0
  96. package/dist/translations/bs.d.ts +8 -0
  97. package/dist/translations/bs.js +5 -0
  98. package/dist/translations/bs.umd.js +11 -0
  99. package/dist/translations/ca.d.ts +8 -0
  100. package/dist/translations/ca.js +5 -0
  101. package/dist/translations/ca.umd.js +11 -0
  102. package/dist/translations/cs.d.ts +8 -0
  103. package/dist/translations/cs.js +5 -0
  104. package/dist/translations/cs.umd.js +11 -0
  105. package/dist/translations/da.d.ts +8 -0
  106. package/dist/translations/da.js +5 -0
  107. package/dist/translations/da.umd.js +11 -0
  108. package/dist/translations/de-ch.d.ts +8 -0
  109. package/dist/translations/de-ch.js +5 -0
  110. package/dist/translations/de-ch.umd.js +11 -0
  111. package/dist/translations/de.d.ts +8 -0
  112. package/dist/translations/de.js +5 -0
  113. package/dist/translations/de.umd.js +11 -0
  114. package/dist/translations/el.d.ts +8 -0
  115. package/dist/translations/el.js +5 -0
  116. package/dist/translations/el.umd.js +11 -0
  117. package/dist/translations/en-au.d.ts +8 -0
  118. package/dist/translations/en-au.js +5 -0
  119. package/dist/translations/en-au.umd.js +11 -0
  120. package/dist/translations/en-gb.d.ts +8 -0
  121. package/dist/translations/en-gb.js +5 -0
  122. package/dist/translations/en-gb.umd.js +11 -0
  123. package/dist/translations/en.d.ts +8 -0
  124. package/dist/translations/en.js +5 -0
  125. package/dist/translations/en.umd.js +11 -0
  126. package/dist/translations/eo.d.ts +8 -0
  127. package/dist/translations/eo.js +5 -0
  128. package/dist/translations/eo.umd.js +11 -0
  129. package/dist/translations/es.d.ts +8 -0
  130. package/dist/translations/es.js +5 -0
  131. package/dist/translations/es.umd.js +11 -0
  132. package/dist/translations/et.d.ts +8 -0
  133. package/dist/translations/et.js +5 -0
  134. package/dist/translations/et.umd.js +11 -0
  135. package/dist/translations/eu.d.ts +8 -0
  136. package/dist/translations/eu.js +5 -0
  137. package/dist/translations/eu.umd.js +11 -0
  138. package/dist/translations/fa.d.ts +8 -0
  139. package/dist/translations/fa.js +5 -0
  140. package/dist/translations/fa.umd.js +11 -0
  141. package/dist/translations/fi.d.ts +8 -0
  142. package/dist/translations/fi.js +5 -0
  143. package/dist/translations/fi.umd.js +11 -0
  144. package/dist/translations/fr.d.ts +8 -0
  145. package/dist/translations/fr.js +5 -0
  146. package/dist/translations/fr.umd.js +11 -0
  147. package/dist/translations/gl.d.ts +8 -0
  148. package/dist/translations/gl.js +5 -0
  149. package/dist/translations/gl.umd.js +11 -0
  150. package/dist/translations/he.d.ts +8 -0
  151. package/dist/translations/he.js +5 -0
  152. package/dist/translations/he.umd.js +11 -0
  153. package/dist/translations/hi.d.ts +8 -0
  154. package/dist/translations/hi.js +5 -0
  155. package/dist/translations/hi.umd.js +11 -0
  156. package/dist/translations/hr.d.ts +8 -0
  157. package/dist/translations/hr.js +5 -0
  158. package/dist/translations/hr.umd.js +11 -0
  159. package/dist/translations/hu.d.ts +8 -0
  160. package/dist/translations/hu.js +5 -0
  161. package/dist/translations/hu.umd.js +11 -0
  162. package/dist/translations/hy.d.ts +8 -0
  163. package/dist/translations/hy.js +5 -0
  164. package/dist/translations/hy.umd.js +11 -0
  165. package/dist/translations/id.d.ts +8 -0
  166. package/dist/translations/id.js +5 -0
  167. package/dist/translations/id.umd.js +11 -0
  168. package/dist/translations/it.d.ts +8 -0
  169. package/dist/translations/it.js +5 -0
  170. package/dist/translations/it.umd.js +11 -0
  171. package/dist/translations/ja.d.ts +8 -0
  172. package/dist/translations/ja.js +5 -0
  173. package/dist/translations/ja.umd.js +11 -0
  174. package/dist/translations/jv.d.ts +8 -0
  175. package/dist/translations/jv.js +5 -0
  176. package/dist/translations/jv.umd.js +11 -0
  177. package/dist/translations/km.d.ts +8 -0
  178. package/dist/translations/km.js +5 -0
  179. package/dist/translations/km.umd.js +11 -0
  180. package/dist/translations/kn.d.ts +8 -0
  181. package/dist/translations/kn.js +5 -0
  182. package/dist/translations/kn.umd.js +11 -0
  183. package/dist/translations/ko.d.ts +8 -0
  184. package/dist/translations/ko.js +5 -0
  185. package/dist/translations/ko.umd.js +11 -0
  186. package/dist/translations/ku.d.ts +8 -0
  187. package/dist/translations/ku.js +5 -0
  188. package/dist/translations/ku.umd.js +11 -0
  189. package/dist/translations/lt.d.ts +8 -0
  190. package/dist/translations/lt.js +5 -0
  191. package/dist/translations/lt.umd.js +11 -0
  192. package/dist/translations/lv.d.ts +8 -0
  193. package/dist/translations/lv.js +5 -0
  194. package/dist/translations/lv.umd.js +11 -0
  195. package/dist/translations/ms.d.ts +8 -0
  196. package/dist/translations/ms.js +5 -0
  197. package/dist/translations/ms.umd.js +11 -0
  198. package/dist/translations/nb.d.ts +8 -0
  199. package/dist/translations/nb.js +5 -0
  200. package/dist/translations/nb.umd.js +11 -0
  201. package/dist/translations/ne.d.ts +8 -0
  202. package/dist/translations/ne.js +5 -0
  203. package/dist/translations/ne.umd.js +11 -0
  204. package/dist/translations/nl.d.ts +8 -0
  205. package/dist/translations/nl.js +5 -0
  206. package/dist/translations/nl.umd.js +11 -0
  207. package/dist/translations/no.d.ts +8 -0
  208. package/dist/translations/no.js +5 -0
  209. package/dist/translations/no.umd.js +11 -0
  210. package/dist/translations/pl.d.ts +8 -0
  211. package/dist/translations/pl.js +5 -0
  212. package/dist/translations/pl.umd.js +11 -0
  213. package/dist/translations/pt-br.d.ts +8 -0
  214. package/dist/translations/pt-br.js +5 -0
  215. package/dist/translations/pt-br.umd.js +11 -0
  216. package/dist/translations/pt.d.ts +8 -0
  217. package/dist/translations/pt.js +5 -0
  218. package/dist/translations/pt.umd.js +11 -0
  219. package/dist/translations/ro.d.ts +8 -0
  220. package/dist/translations/ro.js +5 -0
  221. package/dist/translations/ro.umd.js +11 -0
  222. package/dist/translations/ru.d.ts +8 -0
  223. package/dist/translations/ru.js +5 -0
  224. package/dist/translations/ru.umd.js +11 -0
  225. package/dist/translations/sk.d.ts +8 -0
  226. package/dist/translations/sk.js +5 -0
  227. package/dist/translations/sk.umd.js +11 -0
  228. package/dist/translations/sl.d.ts +8 -0
  229. package/dist/translations/sl.js +5 -0
  230. package/dist/translations/sl.umd.js +11 -0
  231. package/dist/translations/sq.d.ts +8 -0
  232. package/dist/translations/sq.js +5 -0
  233. package/dist/translations/sq.umd.js +11 -0
  234. package/dist/translations/sr-latn.d.ts +8 -0
  235. package/dist/translations/sr-latn.js +5 -0
  236. package/dist/translations/sr-latn.umd.js +11 -0
  237. package/dist/translations/sr.d.ts +8 -0
  238. package/dist/translations/sr.js +5 -0
  239. package/dist/translations/sr.umd.js +11 -0
  240. package/dist/translations/sv.d.ts +8 -0
  241. package/dist/translations/sv.js +5 -0
  242. package/dist/translations/sv.umd.js +11 -0
  243. package/dist/translations/th.d.ts +8 -0
  244. package/dist/translations/th.js +5 -0
  245. package/dist/translations/th.umd.js +11 -0
  246. package/dist/translations/ti.d.ts +8 -0
  247. package/dist/translations/ti.js +5 -0
  248. package/dist/translations/ti.umd.js +11 -0
  249. package/dist/translations/tk.d.ts +8 -0
  250. package/dist/translations/tk.js +5 -0
  251. package/dist/translations/tk.umd.js +11 -0
  252. package/dist/translations/tr.d.ts +8 -0
  253. package/dist/translations/tr.js +5 -0
  254. package/dist/translations/tr.umd.js +11 -0
  255. package/dist/translations/ug.d.ts +8 -0
  256. package/dist/translations/ug.js +5 -0
  257. package/dist/translations/ug.umd.js +11 -0
  258. package/dist/translations/uk.d.ts +8 -0
  259. package/dist/translations/uk.js +5 -0
  260. package/dist/translations/uk.umd.js +11 -0
  261. package/dist/translations/ur.d.ts +8 -0
  262. package/dist/translations/ur.js +5 -0
  263. package/dist/translations/ur.umd.js +11 -0
  264. package/dist/translations/uz.d.ts +8 -0
  265. package/dist/translations/uz.js +5 -0
  266. package/dist/translations/uz.umd.js +11 -0
  267. package/dist/translations/vi.d.ts +8 -0
  268. package/dist/translations/vi.js +5 -0
  269. package/dist/translations/vi.umd.js +11 -0
  270. package/dist/translations/zh-cn.d.ts +8 -0
  271. package/dist/translations/zh-cn.js +5 -0
  272. package/dist/translations/zh-cn.umd.js +11 -0
  273. package/dist/translations/zh.d.ts +8 -0
  274. package/dist/translations/zh.js +5 -0
  275. package/dist/translations/zh.umd.js +11 -0
  276. package/dist/utils.d.ts +22 -0
  277. package/lang/contexts.json +13 -0
  278. package/lang/translations/ar.po +62 -0
  279. package/lang/translations/az.po +62 -0
  280. package/lang/translations/bg.po +62 -0
  281. package/lang/translations/bn.po +62 -0
  282. package/lang/translations/bs.po +62 -0
  283. package/lang/translations/ca.po +62 -0
  284. package/lang/translations/cs.po +62 -0
  285. package/lang/translations/da.po +62 -0
  286. package/lang/translations/de-ch.po +62 -0
  287. package/lang/translations/de.po +62 -0
  288. package/lang/translations/el.po +62 -0
  289. package/lang/translations/en-au.po +62 -0
  290. package/lang/translations/en-gb.po +62 -0
  291. package/lang/translations/en.po +62 -0
  292. package/lang/translations/eo.po +62 -0
  293. package/lang/translations/es.po +62 -0
  294. package/lang/translations/et.po +62 -0
  295. package/lang/translations/eu.po +62 -0
  296. package/lang/translations/fa.po +62 -0
  297. package/lang/translations/fi.po +62 -0
  298. package/lang/translations/fr.po +62 -0
  299. package/lang/translations/gl.po +62 -0
  300. package/lang/translations/he.po +62 -0
  301. package/lang/translations/hi.po +62 -0
  302. package/lang/translations/hr.po +62 -0
  303. package/lang/translations/hu.po +62 -0
  304. package/lang/translations/hy.po +62 -0
  305. package/lang/translations/id.po +62 -0
  306. package/lang/translations/it.po +62 -0
  307. package/lang/translations/ja.po +62 -0
  308. package/lang/translations/jv.po +62 -0
  309. package/lang/translations/km.po +62 -0
  310. package/lang/translations/kn.po +62 -0
  311. package/lang/translations/ko.po +62 -0
  312. package/lang/translations/ku.po +62 -0
  313. package/lang/translations/lt.po +62 -0
  314. package/lang/translations/lv.po +62 -0
  315. package/lang/translations/ms.po +62 -0
  316. package/lang/translations/nb.po +62 -0
  317. package/lang/translations/ne.po +62 -0
  318. package/lang/translations/nl.po +62 -0
  319. package/lang/translations/no.po +62 -0
  320. package/lang/translations/pl.po +62 -0
  321. package/lang/translations/pt-br.po +62 -0
  322. package/lang/translations/pt.po +62 -0
  323. package/lang/translations/ro.po +62 -0
  324. package/lang/translations/ru.po +62 -0
  325. package/lang/translations/sk.po +62 -0
  326. package/lang/translations/sl.po +62 -0
  327. package/lang/translations/sq.po +62 -0
  328. package/lang/translations/sr-latn.po +62 -0
  329. package/lang/translations/sr.po +62 -0
  330. package/lang/translations/sv.po +62 -0
  331. package/lang/translations/th.po +62 -0
  332. package/lang/translations/ti.po +62 -0
  333. package/lang/translations/tk.po +62 -0
  334. package/lang/translations/tr.po +62 -0
  335. package/lang/translations/ug.po +62 -0
  336. package/lang/translations/uk.po +62 -0
  337. package/lang/translations/ur.po +62 -0
  338. package/lang/translations/uz.po +62 -0
  339. package/lang/translations/vi.po +62 -0
  340. package/lang/translations/zh-cn.po +62 -0
  341. package/lang/translations/zh.po +62 -0
  342. package/package.json +43 -0
  343. package/src/augmentation.d.ts +30 -0
  344. package/src/augmentation.js +5 -0
  345. package/src/heading.d.ts +36 -0
  346. package/src/heading.js +42 -0
  347. package/src/headingbuttonsui.d.ts +51 -0
  348. package/src/headingbuttonsui.js +83 -0
  349. package/src/headingcommand.d.ts +48 -0
  350. package/src/headingcommand.js +65 -0
  351. package/src/headingconfig.d.ts +119 -0
  352. package/src/headingconfig.js +5 -0
  353. package/src/headingediting.d.ts +46 -0
  354. package/src/headingediting.js +107 -0
  355. package/src/headingui.d.ts +26 -0
  356. package/src/headingui.js +171 -0
  357. package/src/index.d.ts +16 -0
  358. package/src/index.js +13 -0
  359. package/src/title.d.ts +119 -0
  360. package/src/title.js +466 -0
  361. package/src/utils.d.ts +18 -0
  362. package/src/utils.js +31 -0
  363. package/theme/heading.css +20 -0
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module heading/headingcommand
11
+ */
12
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
13
+ /**
14
+ * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
15
+ */
16
+ export default class HeadingCommand extends Command {
17
+ /**
18
+ * If the selection starts in a heading (which {@link #modelElements is supported by this command})
19
+ * the value is set to the name of that heading model element.
20
+ * It is set to `false` otherwise.
21
+ *
22
+ * @observable
23
+ * @readonly
24
+ */
25
+ value: false | string;
26
+ /**
27
+ * Set of defined model's elements names that this command support.
28
+ * See {@link module:heading/headingconfig~HeadingOption}.
29
+ */
30
+ readonly modelElements: Array<string>;
31
+ /**
32
+ * Creates an instance of the command.
33
+ *
34
+ * @param editor Editor instance.
35
+ * @param modelElements Names of the element which this command can apply in the model.
36
+ */
37
+ constructor(editor: Editor, modelElements: Array<string>);
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ refresh(): void;
42
+ /**
43
+ * Executes the command. Applies the heading to the selected blocks or, if the first selected
44
+ * block is a heading already, turns selected headings (of this level only) to paragraphs.
45
+ *
46
+ * @param options.value Name of the element which this command will apply in the model.
47
+ * @fires execute
48
+ */
49
+ execute(options: {
50
+ value: string;
51
+ }): void;
52
+ }
@@ -0,0 +1,123 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module heading/headingconfig
11
+ */
12
+ import type { ArrayOrItem } from 'ckeditor5/src/utils.js';
13
+ import type { MatcherPattern, ViewElementDefinition } from 'ckeditor5/src/engine.js';
14
+ /**
15
+ * The configuration of the heading feature.
16
+ * The option is used by the {@link module:heading/headingediting~HeadingEditing} feature.
17
+ *
18
+ * ```ts
19
+ * ClassicEditor
20
+ * .create( {
21
+ * heading: ... // Heading feature config.
22
+ * } )
23
+ * .then( ... )
24
+ * .catch( ... );
25
+ * ```
26
+ *
27
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
28
+ */
29
+ export interface HeadingConfig {
30
+ /**
31
+ * The available heading options.
32
+ *
33
+ * The default value is:
34
+ * ```ts
35
+ * const headingConfig = {
36
+ * options: [
37
+ * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
38
+ * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
39
+ * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
40
+ * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
41
+ * ]
42
+ * };
43
+ * ```
44
+ *
45
+ * It defines 3 levels of headings. In the editor model they will use `heading1`, `heading2`, and `heading3` elements.
46
+ * Their respective view elements (so the elements output by the editor) will be: `h2`, `h3`, and `h4`. This means that
47
+ * if you choose "Heading 1" in the headings dropdown the editor will turn the current block to `<heading1>` in the model
48
+ * which will result in rendering (and outputting to data) the `<h2>` element.
49
+ *
50
+ * The `title` and `class` properties will be used by the `headings` dropdown to render available options.
51
+ * Usually, the first option in the headings dropdown is the "Paragraph" option, hence it's also defined on the list.
52
+ * However, you don't need to define its view representation because it's handled by
53
+ * the {@link module:paragraph/paragraph~Paragraph} feature (which is required by
54
+ * the {@link module:heading/headingediting~HeadingEditing} feature).
55
+ *
56
+ * You can **read more** about configuring heading levels and **see more examples** in
57
+ * the {@glink features/headings Headings} guide.
58
+ *
59
+ * Note: In the model you should always start from `heading1`, regardless of how the headings are represented in the view.
60
+ * That's assumption is used by features like {@link module:autoformat/autoformat~Autoformat} to know which element
61
+ * they should use when applying the first level heading.
62
+ *
63
+ * The defined headings are also available as values passed to the `'heading'` command under their model names.
64
+ * For example, the below code will apply `<heading1>` to the current selection:
65
+ *
66
+ * ```ts
67
+ * editor.execute( 'heading', { value: 'heading1' } );
68
+ * ```
69
+ */
70
+ options?: Array<HeadingOption>;
71
+ }
72
+ /**
73
+ * Heading option descriptor.
74
+ */
75
+ export type HeadingOption = HeadingElementOption | HeadingParagraphOption;
76
+ export interface HeadingElementOption {
77
+ /**
78
+ * Name of the model element to convert.
79
+ */
80
+ model: 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | `heading${string}` & Record<never, never>;
81
+ /**
82
+ * Definition of a view element to convert from/to.
83
+ */
84
+ view: ViewElementDefinition;
85
+ /**
86
+ * The user-readable title of the option.
87
+ */
88
+ title: string;
89
+ /**
90
+ * The class which will be added to the dropdown item representing this option.
91
+ */
92
+ class: string;
93
+ /**
94
+ * Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using the default configuration.
95
+ */
96
+ icon?: string;
97
+ /**
98
+ * An array with all matched elements that the view-to-model conversion should also accept.
99
+ */
100
+ upcastAlso?: ArrayOrItem<ViewElementDefinition | MatcherPattern>;
101
+ }
102
+ export interface HeadingParagraphOption {
103
+ /**
104
+ * Name of the model element to convert.
105
+ */
106
+ model: 'paragraph';
107
+ /**
108
+ * The user-readable title of the option.
109
+ */
110
+ title: string;
111
+ /**
112
+ * The class which will be added to the dropdown item representing this option.
113
+ * */
114
+ class: string;
115
+ /**
116
+ * Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using the default configuration.
117
+ */
118
+ icon?: string;
119
+ /**
120
+ * An array with all matched elements that the view-to-model conversion should also accept.
121
+ */
122
+ upcastAlso?: ArrayOrItem<ViewElementDefinition | MatcherPattern>;
123
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module heading/headingediting
11
+ */
12
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
+ import { Paragraph } from 'ckeditor5/src/paragraph.js';
14
+ /**
15
+ * The headings engine feature. It handles switching between block formats &ndash; headings and paragraph.
16
+ * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.
17
+ * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.
18
+ */
19
+ export default class HeadingEditing extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get pluginName(): "HeadingEditing";
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get isOfficialPlugin(): true;
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ constructor(editor: Editor);
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get requires(): readonly [typeof Paragraph];
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ init(): void;
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ afterInit(): void;
44
+ /**
45
+ * Adds default conversion for `h1` -> `heading1` with a low priority.
46
+ *
47
+ * @param editor Editor instance on which to add the `h1` conversion.
48
+ */
49
+ private _addDefaultH1Conversion;
50
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module heading/headingui
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import '../theme/heading.css';
14
+ /**
15
+ * The headings UI feature. It introduces the `headings` dropdown.
16
+ */
17
+ export default class HeadingUI extends Plugin {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName(): "HeadingUI";
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get isOfficialPlugin(): true;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ init(): void;
30
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ .ck.ck-heading_heading1 .ck-button__label{
6
+ font-size:20px;
7
+ }
8
+
9
+ .ck.ck-heading_heading2 .ck-button__label{
10
+ font-size:17px;
11
+ }
12
+
13
+ .ck.ck-heading_heading3 .ck-button__label{
14
+ font-size:14px;
15
+ }
16
+
17
+ .ck[class*="ck-heading_heading"]{
18
+ font-weight:bold;
19
+ }
package/dist/index.css ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /*
6
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+
10
+ .ck.ck-heading_heading1 .ck-button__label {
11
+ font-size: 20px;
12
+ }
13
+
14
+ .ck.ck-heading_heading2 .ck-button__label {
15
+ font-size: 17px;
16
+ }
17
+
18
+ .ck.ck-heading_heading3 .ck-button__label {
19
+ font-size: 14px;
20
+ }
21
+
22
+ .ck[class*="ck-heading_heading"] {
23
+ font-weight: bold;
24
+ }
25
+
26
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../theme/heading.css","index.css"],"names":[],"mappings":";;;;AAAA,CAAA;ACCA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ;AAC3E,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC5E,CAAC,CDAC;;AAEF,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe;AAChB;;AAEA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe;AAChB;;AAEA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,aAAA,CAAA;ACCA,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,IAAe;AAChB;;AAEA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAA,CAAA,eAAA,CAAA,CAAA,CAAA;ACCA,CDAC,IAAA,CAAA,MAAA,CAAA,CAAA,IAAiB;AAClB;;ACEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 .ck-button__label {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 .ck-button__label {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 .ck-button__label {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n","/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 .ck-button__label {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 .ck-button__label {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 .ck-button__label {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module heading
11
+ */
12
+ export { default as Heading } from './heading.js';
13
+ export type { HeadingOption, HeadingElementOption } from './headingconfig.js';
14
+ export { default as HeadingEditing } from './headingediting.js';
15
+ export { default as HeadingUI } from './headingui.js';
16
+ export { default as HeadingButtonsUI } from './headingbuttonsui.js';
17
+ export { default as Title, type TitleConfig } from './title.js';
18
+ export type { HeadingConfig } from './headingconfig.js';
19
+ export type { default as HeadingCommand } from './headingcommand.js';
20
+ import './augmentation.js';