项目作者: postedin

项目描述 :
CKEditor 5 component for Ember JS.
高级语言: JavaScript
项目地址: git://github.com/postedin/ember-ckeditor.git
创建时间: 2019-11-20T17:33:22Z
项目社区:https://github.com/postedin/ember-ckeditor

开源协议:MIT License

下载


CKEditor 5 component for Ember.js

@postedin/ember-ckeditor

Unofficial CKEditor 5 rich text editor component for Ember.js.

Why we made it

Postedin is a content creation platform. A good rich text editor is at the core of our product. Our platform uses Ember.js so we naturally need a good integration with CKEditor 5 which we consider to be the best editor for the browser by a long shot.

What is next

For 1.0.0

  • write a proper readme with proper documentation
  • write a proper contributing guide
  • some basic tests

Wishlist

  • hopefully get changes we want into CKEditor instead of running custom builds or extending things
  • full extensive testing
  • autocomplete plugin (similar to gmail suggestions when writing an email)
  • sources plugin (add a source that we can list at the bottom of the document)

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Installation

  1. ember install @postedin/ember-ckeditor

Usage

TODO: proper detailed usage

You need to have a build to use with this component. We use a combined build, so we can use multiple different custom versions (https://github.com/postedin/ckeditor5-build-combined). You can use any build like the official classic (@ckeditor/ckeditor5-build-classic"">https://www.npmjs.com/package/@ckeditor/ckeditor5-build-classic).

You will need to import the build and use it in the component.

For example, make an Editor component. We added a basic option and it will update the value.

  1. // components/editor.js
  2. import Component from '@glimmer/component';
  3. import { action } from '@ember/object';
  4. import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  5. export default class EditorComponent extends Component {
  6. classicEditor = ClassicEditor;
  7. value = '';
  8. options = {
  9. link: {
  10. addTargetToExternalLinks: true,
  11. },
  12. };
  13. @action
  14. handleInput(value) {
  15. this.value = value;
  16. if (this.args.onChanged) {
  17. this.args.onChanged(value); // for consuming this component and getting the updated value
  18. }
  19. }
  20. }
  1. <!-- components/editor.hbs -->
  2. <CKEditor
  3. @editor="{{this.classicEditor}}"
  4. @value="{{this.value}}"
  5. @options="{{this.options}}"
  6. @onInput="{{this.handleInput}}"
  7. ></CKEditor>

TODO: explain getting languages working

Contributing

TODO: more details

See the Contributing guide for details.

License

This project is licensed under the MIT License.