classiccreatorbundle.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. /**
  7. * Bundle configuration for {@link ckeditor5.creator-classic.ClassiCcreator}.
  8. *
  9. * At this moment we don't know a list of every dependency needed in the bundle. It is because
  10. * editor features load automatically during initialization process. To work around this problem
  11. * we have created a custom entry file where we defined some of imports with features
  12. * needed to initialize editor.
  13. */
  14. import CKEDITOR from '../../../build/esnext/ckeditor.js';
  15. import ClassicCreator from '../../../build/esnext/ckeditor5/creator-classic/classiccreator.js';
  16. /**
  17. * Wrapper for {@link CKEDITOR.create} which passes default setting
  18. * for {@link ckeditor5.creator-classic.ClassiCcreator}. This settings could be extended.
  19. * API of this function is exactly the same as {@link CKEDITOR.create}.
  20. */
  21. export default function createEditor( element, config ) {
  22. return CKEDITOR.create( element, Object.assign( {
  23. creator: ClassicCreator,
  24. toolbar: [ 'bold', 'italic' ]
  25. }, config ) );
  26. }