@ckeditor/ckeditor5-heading 35.4.0 → 36.0.1

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.
package/src/utils.js CHANGED
@@ -1,12 +1,7 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
- /**
7
- * @module heading/utils
8
- */
9
-
10
5
  /**
11
6
  * Returns heading options as defined in `config.heading.options` but processed to consider
12
7
  * the editor localization, i.e. to display {@link module:heading/heading~HeadingOption}
@@ -14,29 +9,23 @@
14
9
  *
15
10
  * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
16
11
  * when the user configuration is defined because the editor does not exist yet.
17
- *
18
- * @param {module:core/editor/editor~Editor} editor
19
- * @returns {Array.<module:heading/heading~HeadingOption>}.
20
12
  */
21
- export function getLocalizedOptions( editor ) {
22
- const t = editor.t;
23
- const localizedTitles = {
24
- Paragraph: t( 'Paragraph' ),
25
- 'Heading 1': t( 'Heading 1' ),
26
- 'Heading 2': t( 'Heading 2' ),
27
- 'Heading 3': t( 'Heading 3' ),
28
- 'Heading 4': t( 'Heading 4' ),
29
- 'Heading 5': t( 'Heading 5' ),
30
- 'Heading 6': t( 'Heading 6' )
31
- };
32
-
33
- return editor.config.get( 'heading.options' ).map( option => {
34
- const title = localizedTitles[ option.title ];
35
-
36
- if ( title && title != option.title ) {
37
- option.title = title;
38
- }
39
-
40
- return option;
41
- } );
13
+ export function getLocalizedOptions(editor) {
14
+ const t = editor.t;
15
+ const localizedTitles = {
16
+ 'Paragraph': t('Paragraph'),
17
+ 'Heading 1': t('Heading 1'),
18
+ 'Heading 2': t('Heading 2'),
19
+ 'Heading 3': t('Heading 3'),
20
+ 'Heading 4': t('Heading 4'),
21
+ 'Heading 5': t('Heading 5'),
22
+ 'Heading 6': t('Heading 6')
23
+ };
24
+ return editor.config.get('heading.options').map(option => {
25
+ const title = localizedTitles[option.title];
26
+ if (title && title != option.title) {
27
+ option.title = title;
28
+ }
29
+ return option;
30
+ });
42
31
  }
package/theme/heading.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5