Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud integration #301

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Cloud integration #301

merged 1 commit into from
Sep 5, 2024

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Jul 26, 2024

Suggested merge commit message (convention)

Add CDN implementation

Additional information

Integrations common https://github.com/ckeditor/ckeditor5-integrations-common
Related React integration: ckeditor/ckeditor5-react#510
Related Angular integration: ckeditor/ckeditor5-angular#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>

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
demos/editor/App.vue Outdated Show resolved Hide resolved
demos/editor-cdn-suspense/App.vue Show resolved Hide resolved
demos/editor-cdn-suspense/App.vue Show resolved Hide resolved
demos/editor/demo.ts Outdated Show resolved Hide resolved
src/composables/useAsync.ts Outdated Show resolved Hide resolved
src/composables/useAsync.ts Outdated Show resolved Hide resolved
src/composables/useAsync.ts Show resolved Hide resolved
@Mati365 Mati365 force-pushed the ck/cloud-poc branch 2 times, most recently from d0cfec0 to 3875bd2 Compare August 20, 2024 08:29
@coveralls
Copy link

coveralls commented Aug 20, 2024

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

Details

  • 22 of 22 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

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

💛 - Coveralls

@Mati365 Mati365 changed the title Cloud integration PoC Cloud integration Aug 20, 2024
@Mati365 Mati365 force-pushed the ck/cloud-poc branch 2 times, most recently from 8c5c770 to 13b1e58 Compare September 5, 2024 05:07
@Mati365 Mati365 merged commit d17eb7f into master Sep 5, 2024
5 checks passed
@Mati365 Mati365 deleted the ck/cloud-poc branch September 5, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants