ckeditor / ckeditor5-vue

Official CKEditor 5 Vue.js component.
https://ckeditor.com/ckeditor-5
Other
361 stars 77 forks source link

Cloud integration #301

Closed Mati365 closed 2 months ago

Mati365 commented 4 months ago

Suggested merge commit message (convention)

Add CDN implementation

Additional information

Integrations common https://github.com/ckeditor/ckeditor5-integrations-common Related React integration: https://github.com/ckeditor/ckeditor5-react/pull/510 Related Angular integration: https://github.com/ckeditor/ckeditor5-angular/pull/431

Added demo: http://localhost:5173/demos/editor-cdn/index.html

🔧 General format of the useCKEditorCloud hook call

import type * as CKEditor5 from 'https://cdn.ckeditor.com/typings/ckeditor5.d.ts';

const cloud = useCKEditorCloud( {
  version: '43.0.0'
} );

watchEffect( () => {
  if ( !cloud.data.value ) {
    return;
  }

  const { ClassicEditor, Paragraph, ... } = cloud.data.value.CKEditor;
  // ....
} );
...

A more advanced example that allows to specify whether external stylesheets or scripts should be loaded:

const cloud = useCKEditorCloud({
  version: '43.0.0',
  plugins: {
    YourPlugin: {
      scripts: ["https://example.com/your-plugin.js"],
      stylesheets: ["https://example.com/your-plugin.css"],
      getExportedEntries: () => window.YourPlugin,
    },
  },
});
...

🔧 Experimental Vue 3.x suspense support

<script setup lang="ts">
  // ..
  const { CKEditor } = await loadCKEditorCloud( {
      version: '43.0.0'
  } );

  const { Paragraph  } = CKEditor;
  // ..
</script>
coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 15237ac9-f21b-45ef-938e-42e00f2e905a

Details


Totals Coverage Status
Change from base Build c719f577-6274-45ce-86f9-5343d6d08673: 0.0%
Covered Lines: 79
Relevant Lines: 79

💛 - Coveralls