@ckeditor/ckeditor5-basic-styles 30.0.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 (158) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +20 -0
  3. package/build/basic-styles.js +5 -0
  4. package/build/translations/af.js +1 -0
  5. package/build/translations/ar.js +1 -0
  6. package/build/translations/ast.js +1 -0
  7. package/build/translations/az.js +1 -0
  8. package/build/translations/bg.js +1 -0
  9. package/build/translations/ca.js +1 -0
  10. package/build/translations/cs.js +1 -0
  11. package/build/translations/da.js +1 -0
  12. package/build/translations/de-ch.js +1 -0
  13. package/build/translations/de.js +1 -0
  14. package/build/translations/el.js +1 -0
  15. package/build/translations/en-au.js +1 -0
  16. package/build/translations/en-gb.js +1 -0
  17. package/build/translations/eo.js +1 -0
  18. package/build/translations/es.js +1 -0
  19. package/build/translations/et.js +1 -0
  20. package/build/translations/eu.js +1 -0
  21. package/build/translations/fa.js +1 -0
  22. package/build/translations/fi.js +1 -0
  23. package/build/translations/fr.js +1 -0
  24. package/build/translations/gl.js +1 -0
  25. package/build/translations/gu.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/id.js +1 -0
  31. package/build/translations/it.js +1 -0
  32. package/build/translations/ja.js +1 -0
  33. package/build/translations/km.js +1 -0
  34. package/build/translations/kn.js +1 -0
  35. package/build/translations/ko.js +1 -0
  36. package/build/translations/ku.js +1 -0
  37. package/build/translations/lt.js +1 -0
  38. package/build/translations/lv.js +1 -0
  39. package/build/translations/nb.js +1 -0
  40. package/build/translations/ne.js +1 -0
  41. package/build/translations/nl.js +1 -0
  42. package/build/translations/no.js +1 -0
  43. package/build/translations/oc.js +1 -0
  44. package/build/translations/pl.js +1 -0
  45. package/build/translations/pt-br.js +1 -0
  46. package/build/translations/pt.js +1 -0
  47. package/build/translations/ro.js +1 -0
  48. package/build/translations/ru.js +1 -0
  49. package/build/translations/si.js +1 -0
  50. package/build/translations/sk.js +1 -0
  51. package/build/translations/sl.js +1 -0
  52. package/build/translations/sq.js +1 -0
  53. package/build/translations/sr-latn.js +1 -0
  54. package/build/translations/sr.js +1 -0
  55. package/build/translations/sv.js +1 -0
  56. package/build/translations/tk.js +1 -0
  57. package/build/translations/tr.js +1 -0
  58. package/build/translations/tt.js +1 -0
  59. package/build/translations/ug.js +1 -0
  60. package/build/translations/uk.js +1 -0
  61. package/build/translations/vi.js +1 -0
  62. package/build/translations/zh-cn.js +1 -0
  63. package/build/translations/zh.js +1 -0
  64. package/ckeditor5-metadata.json +137 -0
  65. package/lang/contexts.json +9 -0
  66. package/lang/translations/af.po +45 -0
  67. package/lang/translations/ar.po +45 -0
  68. package/lang/translations/ast.po +45 -0
  69. package/lang/translations/az.po +45 -0
  70. package/lang/translations/bg.po +45 -0
  71. package/lang/translations/ca.po +45 -0
  72. package/lang/translations/cs.po +45 -0
  73. package/lang/translations/da.po +45 -0
  74. package/lang/translations/de-ch.po +45 -0
  75. package/lang/translations/de.po +45 -0
  76. package/lang/translations/el.po +45 -0
  77. package/lang/translations/en-au.po +45 -0
  78. package/lang/translations/en-gb.po +45 -0
  79. package/lang/translations/en.po +45 -0
  80. package/lang/translations/eo.po +45 -0
  81. package/lang/translations/es.po +45 -0
  82. package/lang/translations/et.po +45 -0
  83. package/lang/translations/eu.po +45 -0
  84. package/lang/translations/fa.po +45 -0
  85. package/lang/translations/fi.po +45 -0
  86. package/lang/translations/fr.po +45 -0
  87. package/lang/translations/gl.po +45 -0
  88. package/lang/translations/gu.po +45 -0
  89. package/lang/translations/he.po +45 -0
  90. package/lang/translations/hi.po +45 -0
  91. package/lang/translations/hr.po +45 -0
  92. package/lang/translations/hu.po +45 -0
  93. package/lang/translations/id.po +45 -0
  94. package/lang/translations/it.po +45 -0
  95. package/lang/translations/ja.po +45 -0
  96. package/lang/translations/km.po +45 -0
  97. package/lang/translations/kn.po +45 -0
  98. package/lang/translations/ko.po +45 -0
  99. package/lang/translations/ku.po +45 -0
  100. package/lang/translations/lt.po +45 -0
  101. package/lang/translations/lv.po +45 -0
  102. package/lang/translations/nb.po +45 -0
  103. package/lang/translations/ne.po +45 -0
  104. package/lang/translations/nl.po +45 -0
  105. package/lang/translations/no.po +45 -0
  106. package/lang/translations/oc.po +45 -0
  107. package/lang/translations/pl.po +45 -0
  108. package/lang/translations/pt-br.po +45 -0
  109. package/lang/translations/pt.po +45 -0
  110. package/lang/translations/ro.po +45 -0
  111. package/lang/translations/ru.po +45 -0
  112. package/lang/translations/si.po +45 -0
  113. package/lang/translations/sk.po +45 -0
  114. package/lang/translations/sl.po +45 -0
  115. package/lang/translations/sq.po +45 -0
  116. package/lang/translations/sr-latn.po +45 -0
  117. package/lang/translations/sr.po +45 -0
  118. package/lang/translations/sv.po +45 -0
  119. package/lang/translations/tk.po +45 -0
  120. package/lang/translations/tr.po +45 -0
  121. package/lang/translations/tt.po +45 -0
  122. package/lang/translations/ug.po +45 -0
  123. package/lang/translations/uk.po +45 -0
  124. package/lang/translations/vi.po +45 -0
  125. package/lang/translations/zh-cn.po +45 -0
  126. package/lang/translations/zh.po +45 -0
  127. package/package.json +53 -0
  128. package/src/attributecommand.js +138 -0
  129. package/src/bold/boldediting.js +73 -0
  130. package/src/bold/boldui.js +61 -0
  131. package/src/bold.js +39 -0
  132. package/src/code/codeediting.js +73 -0
  133. package/src/code/codeui.js +62 -0
  134. package/src/code.js +41 -0
  135. package/src/index.js +30 -0
  136. package/src/italic/italicediting.js +63 -0
  137. package/src/italic/italicui.js +61 -0
  138. package/src/italic.js +39 -0
  139. package/src/strikethrough/strikethroughediting.js +65 -0
  140. package/src/strikethrough/strikethroughui.js +61 -0
  141. package/src/strikethrough.js +39 -0
  142. package/src/subscript/subscriptediting.js +60 -0
  143. package/src/subscript/subscriptui.js +60 -0
  144. package/src/subscript.js +36 -0
  145. package/src/superscript/superscriptediting.js +60 -0
  146. package/src/superscript/superscriptui.js +60 -0
  147. package/src/superscript.js +36 -0
  148. package/src/underline/underlineediting.js +60 -0
  149. package/src/underline/underlineui.js +61 -0
  150. package/src/underline.js +39 -0
  151. package/theme/code.css +14 -0
  152. package/theme/icons/bold.svg +1 -0
  153. package/theme/icons/code.svg +1 -0
  154. package/theme/icons/italic.svg +1 -0
  155. package/theme/icons/strikethrough.svg +1 -0
  156. package/theme/icons/subscript.svg +1 -0
  157. package/theme/icons/superscript.svg +1 -0
  158. package/theme/icons/underline.svg +1 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module basic-styles/underline/underlineediting
8
+ */
9
+
10
+ import { Plugin } from 'ckeditor5/src/core';
11
+ import AttributeCommand from '../attributecommand';
12
+
13
+ const UNDERLINE = 'underline';
14
+
15
+ /**
16
+ * The underline editing feature.
17
+ *
18
+ * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
19
+ * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
20
+ *
21
+ * @extends module:core/plugin~Plugin
22
+ */
23
+ export default class UnderlineEditing extends Plugin {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName() {
28
+ return 'UnderlineEditing';
29
+ }
30
+
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ init() {
35
+ const editor = this.editor;
36
+
37
+ // Allow strikethrough attribute on text nodes.
38
+ editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
39
+ editor.model.schema.setAttributeProperties( UNDERLINE, {
40
+ isFormatting: true,
41
+ copyOnEnter: true
42
+ } );
43
+
44
+ editor.conversion.attributeToElement( {
45
+ model: UNDERLINE,
46
+ view: 'u',
47
+ upcastAlso: {
48
+ styles: {
49
+ 'text-decoration': 'underline'
50
+ }
51
+ }
52
+ } );
53
+
54
+ // Create underline command.
55
+ editor.commands.add( UNDERLINE, new AttributeCommand( editor, UNDERLINE ) );
56
+
57
+ // Set the Ctrl+U keystroke.
58
+ editor.keystrokes.set( 'CTRL+U', 'underline' );
59
+ }
60
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module basic-styles/underline/underlineui
8
+ */
9
+
10
+ import { Plugin } from 'ckeditor5/src/core';
11
+ import { ButtonView } from 'ckeditor5/src/ui';
12
+
13
+ import underlineIcon from '../../theme/icons/underline.svg';
14
+
15
+ const UNDERLINE = 'underline';
16
+
17
+ /**
18
+ * The underline UI feature. It introduces the Underline button.
19
+ *
20
+ * @extends module:core/plugin~Plugin
21
+ */
22
+ export default class UnderlineUI extends Plugin {
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName() {
27
+ return 'UnderlineUI';
28
+ }
29
+
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ init() {
34
+ const editor = this.editor;
35
+ const t = editor.t;
36
+
37
+ // Add bold button to feature components.
38
+ editor.ui.componentFactory.add( UNDERLINE, locale => {
39
+ const command = editor.commands.get( UNDERLINE );
40
+ const view = new ButtonView( locale );
41
+
42
+ view.set( {
43
+ label: t( 'Underline' ),
44
+ icon: underlineIcon,
45
+ keystroke: 'CTRL+U',
46
+ tooltip: true,
47
+ isToggleable: true
48
+ } );
49
+
50
+ view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
51
+
52
+ // Execute command.
53
+ this.listenTo( view, 'execute', () => {
54
+ editor.execute( UNDERLINE );
55
+ editor.editing.view.focus();
56
+ } );
57
+
58
+ return view;
59
+ } );
60
+ }
61
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module basic-styles/underline
8
+ */
9
+
10
+ import { Plugin } from 'ckeditor5/src/core';
11
+ import UnderlineEditing from './underline/underlineediting';
12
+ import UnderlineUI from './underline/underlineui';
13
+
14
+ /**
15
+ * The underline feature.
16
+ *
17
+ * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
18
+ * and the {@glink api/basic-styles package page}.
19
+ *
20
+ * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
21
+ * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
22
+ *
23
+ * @extends module:core/plugin~Plugin
24
+ */
25
+ export default class Underline extends Plugin {
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get requires() {
30
+ return [ UnderlineEditing, UnderlineUI ];
31
+ }
32
+
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ static get pluginName() {
37
+ return 'Underline';
38
+ }
39
+ }
package/theme/code.css ADDED
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ .ck-content code {
7
+ background-color: hsla(0, 0%, 78%, 0.3);
8
+ padding: .15em;
9
+ border-radius: 2px;
10
+ }
11
+
12
+ .ck.ck-editor__editable .ck-code_selected {
13
+ background-color: hsla(0, 0%, 78%, 0.5);
14
+ }
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>
@@ -0,0 +1 @@
1
+ <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>
@@ -0,0 +1 @@
1
+ <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>
@@ -0,0 +1 @@
1
+ <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>
@@ -0,0 +1 @@
1
+ <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>
@@ -0,0 +1 @@
1
+ <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>
@@ -0,0 +1 @@
1
+ <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>