1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-07 06:25:21 +02:00

add embed tool

This commit is contained in:
Peter Savchenko 2021-12-01 19:52:25 +03:00
parent 39cbfd8652
commit 12552f75f4
No known key found for this signature in database
GPG key ID: E68306B1AB0F727C
8 changed files with 44 additions and 9 deletions

View file

@ -21,7 +21,6 @@
},
"dependencies": {
"@editorjs/embed": "^2.5.0",
"@editorjs/nested-list": "^1.0.2",
"bcrypt": "^5.0.1",
"commander": "^2.19.0",
"cookie-parser": "~1.4.3",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -6,13 +6,14 @@ import EditorJS from '@editorjs/editorjs';
import Header from '@editorjs/header';
import Image from '@editorjs/image';
import CodeTool from '@editorjs/code';
import List from '@editorjs/nested-list';
import List from '@editorjs/list';
import Delimiter from '@editorjs/delimiter';
import Table from '@editorjs/table';
import Warning from '@editorjs/warning';
import Checklist from '@editorjs/checklist';
import LinkTool from '@editorjs/link';
import RawTool from '@editorjs/raw';
import Embed from '@editorjs/embed';
/**
* Inline Tools for the Editor
@ -110,6 +111,8 @@ export default class Editor {
},
raw: RawTool,
embed: Embed,
},
data: {
blocks: [

View file

@ -484,3 +484,17 @@
}
}
}
.block-embed {
margin: 0;
&__iframe {
width: 100%;
height: 450px;
border: 0;
@media (--mobile) {
height: 200px;
}
}
}

View file

@ -0,0 +1,12 @@
<figure class="block-embed">
<iframe
class="block-embed__iframe"
src="{{ embed }}"
frameborder="0"
></iframe>
{% if caption %}
<footer class="block-iframe__caption">
{{ caption }}
</footer>
{% endif %}
</figure>

View file

@ -35,7 +35,7 @@
{% for block in page.body.blocks %}
{# Skip first header, because it is already showed as a Title #}
{% if not (loop.first and block.type == 'header') %}
{% if block.type in ['paragraph', 'header', 'image', 'code', 'list', 'delimiter', 'table', 'warning', 'checklist', 'linkTool', 'raw'] %}
{% if block.type in ['paragraph', 'header', 'image', 'code', 'list', 'delimiter', 'table', 'warning', 'checklist', 'linkTool', 'raw', 'embed'] %}
{% include './blocks/' ~ block.type ~ '.twig' with block.data %}
{% endif %}
{% endif %}

View file

@ -764,10 +764,6 @@
version "1.2.2"
resolved "https://registry.yarnpkg.com/@editorjs/marker/-/marker-1.2.2.tgz#d9261a257436bf70179c0fa1e766ab85c823c96b"
"@editorjs/nested-list@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@editorjs/nested-list/-/nested-list-1.0.2.tgz#4eaacfddb0802d0cd612bdd3269d6daa58bf7fab"
"@editorjs/raw@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@editorjs/raw/-/raw-2.3.0.tgz#d0c3daa1144e38b4d92bc5eca2faebba337bfae7"