alignment.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /**
  6. * @module alignment/alignment
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import AlignmentEditing from './alignmentediting';
  10. import AlignmentUI from './alignmentui';
  11. /**
  12. * The text alignment plugin.
  13. *
  14. * For a detailed overview, check the {@glink features/text-alignment Text alignment feature documentation}
  15. * and the {@glink api/alignment package page}.
  16. *
  17. * This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
  18. * {@link module:alignment/alignmentui~AlignmentUI} plugins.
  19. *
  20. * @extends module:core/plugin~Plugin
  21. */
  22. export default class Alignment extends Plugin {
  23. /**
  24. * @inheritDoc
  25. */
  26. static get requires() {
  27. return [ AlignmentEditing, AlignmentUI ];
  28. }
  29. /**
  30. * @inheritDoc
  31. */
  32. static get pluginName() {
  33. return 'Alignment';
  34. }
  35. }
  36. /**
  37. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  38. *
  39. * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  40. *
  41. * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
  42. */
  43. /**
  44. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  45. *
  46. * ClassicEditor
  47. * .create( editorElement, {
  48. * alignment: {
  49. * options: [ 'left', 'right' ]
  50. * }
  51. * } )
  52. * .then( ... )
  53. * .catch( ... );
  54. *
  55. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  56. *
  57. * @interface AlignmentConfig
  58. */
  59. /**
  60. * Available alignment options.
  61. *
  62. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
  63. *
  64. * **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
  65. * normally be able to choose depending on the
  66. * {@glink features/ui-language#setting-the-language-of-the-content language of the editor content}.
  67. *
  68. * ClassicEditor
  69. * .create( editorElement, {
  70. * alignment: {
  71. * options: [ 'left', 'right' ]
  72. * }
  73. * } )
  74. * .then( ... )
  75. * .catch( ... );
  76. *
  77. * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  78. *
  79. * @member {Array.<String>} module:alignment/alignment~AlignmentConfig#options
  80. */