8
0

alignment.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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. * It loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
  15. * {@link module:alignment/alignmentui~AlignmentUI} plugins.
  16. *
  17. * Read more about the feature on the {@glink api/alignment text alignment package} page.
  18. *
  19. * @extends module:core/plugin~Plugin
  20. */
  21. export default class Alignment extends Plugin {
  22. /**
  23. * @inheritDoc
  24. */
  25. static get requires() {
  26. return [ AlignmentEditing, AlignmentUI ];
  27. }
  28. /**
  29. * @inheritDoc
  30. */
  31. static get pluginName() {
  32. return 'Alignment';
  33. }
  34. }
  35. /**
  36. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  37. *
  38. * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  39. *
  40. * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
  41. */
  42. /**
  43. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  44. *
  45. * ClassicEditor
  46. * .create( editorElement, {
  47. * alignment: {
  48. * options: [ 'left', 'right' ]
  49. * }
  50. * } )
  51. * .then( ... )
  52. * .catch( ... );
  53. *
  54. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  55. *
  56. * @interface AlignmentConfig
  57. */
  58. /**
  59. * Available alignment options.
  60. *
  61. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
  62. *
  63. * **Note:** It is recommended to always use `'left'` as it is the default value which the user should
  64. * normally be able to choose.
  65. *
  66. * ClassicEditor
  67. * .create( editorElement, {
  68. * alignment: {
  69. * options: [ 'left', 'right' ]
  70. * }
  71. * } )
  72. * .then( ... )
  73. * .catch( ... );
  74. *
  75. * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  76. *
  77. * @member {Array.<String>} module:alignment/alignment~AlignmentConfig#options
  78. */