Socket
Socket
Sign inDemoInstall

ckeditor5-iframe

Package Overview
Dependencies
15
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ckeditor5-iframe

iframe feature for CKEditor 5.


Version published
Maintainers
1
Created

Changelog

Source

27.1.0-next.9

  • Support for showPreview: true
  • README: Compress images, document showPreviews, highlight usefulness of rebuilds in the developer loop
  • Dev watcher: Default fonts, larger width, iframe-friendly examples

Readme

Source

CKEditor 5 iframe feature · GitHub license npm version

ckeditor5-iframe is based on CKEditor 5's HTML embed Plugin (NPM)

Renders links to <iframe src="...">

ckeditor5-iframe in a classic build.

Table of contents

Installation

via npm:

npm install ckeditor5-iframe --save-dev

via yarn:

yarn install ckeditor5-iframe --dev

Configuration

In your editor build / configuration:

import IframeEmbed from "ckeditor5-iframe/src/iframeembed";

ClassicEditor.create(document.querySelector("#editor"), {
  plugins: [Essentials, Paragraph, Bold, Italic, IframeEmbed],
  toolbar: ["bold", "italic", "iframeEmbed"],
});

Show previews

Preview option

Passing true to iframeEmbed.showPreviews will enable previewing.

import IframeEmbed from "ckeditor5-iframe/src/iframeembed";

ClassicEditor.create(document.querySelector("#editor"), {
  plugins: [Essentials, Paragraph, Bold, Italic, IframeEmbed],
  toolbar: ["bold", "italic", "iframeEmbed"],
  iframeEmbed: {
    showPreviews: true,
  },
});

The minimum dimensions are tweakable via CSS variables --ck-iframe-embed-content-min-height and --ck-iframe-embed-content-min-width.

Input format

<figure class="iframe-embed">
  <iframe src="https://www.google.com">
</figure>

Development

To boot up a development loop, clone the repo, install the packages via yarn, yarn start and go to http://localhost:8080

Dev environment

From here, you can customize demo/'s app.js and index.html as well as files inside src/ (the plugin code itself) and files will be automatically rebuilt. You still may need to refresh.

The window.editor can access the ClassicEditor object, e.g. editor.getData() can retrieve the output HTML.

Credits

Icon: https://iconify.design/icon-sets/mdi/iframe.html, Open Font License

Keywords

FAQs

Last updated on 02 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc