From 5fa89f3ea3ecc6ab459c2360362a2fd6f07fae26 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 3 Feb 2021 10:48:58 +0100 Subject: [PATCH] docs: add images example --- docs/src/demos/Examples/Images/index.spec.js | 7 ++ docs/src/demos/Examples/Images/index.vue | 79 ++++++++++++++++++++ docs/src/demos/Nodes/Image/index.vue | 8 +- docs/src/docPages/examples/images.md | 3 + docs/src/links.yaml | 3 + 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 docs/src/demos/Examples/Images/index.spec.js create mode 100644 docs/src/demos/Examples/Images/index.vue create mode 100644 docs/src/docPages/examples/images.md diff --git a/docs/src/demos/Examples/Images/index.spec.js b/docs/src/demos/Examples/Images/index.spec.js new file mode 100644 index 000000000..40cfc04b2 --- /dev/null +++ b/docs/src/demos/Examples/Images/index.spec.js @@ -0,0 +1,7 @@ +context('/demos/Examples/Images', () => { + before(() => { + cy.visit('/demos/Examples/Images') + }) + + // TODO: Write tests +}) diff --git a/docs/src/demos/Examples/Images/index.vue b/docs/src/demos/Examples/Images/index.vue new file mode 100644 index 000000000..6a949add4 --- /dev/null +++ b/docs/src/demos/Examples/Images/index.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/docs/src/demos/Nodes/Image/index.vue b/docs/src/demos/Nodes/Image/index.vue index 8c59b3bb8..6a458dfc7 100644 --- a/docs/src/demos/Nodes/Image/index.vue +++ b/docs/src/demos/Nodes/Image/index.vue @@ -31,7 +31,9 @@ export default { addImage() { const url = window.prompt('URL') - this.editor.chain().focus().setImage({ src: url }).run() + if (url) { + this.editor.chain().focus().setImage({ src: url }).run() + } }, }, @@ -68,6 +70,10 @@ export default { img { max-width: 100%; height: auto; + + &.ProseMirror-selectednode { + outline: 3px solid #68CEF8; + } } } diff --git a/docs/src/docPages/examples/images.md b/docs/src/docPages/examples/images.md new file mode 100644 index 000000000..28b757393 --- /dev/null +++ b/docs/src/docPages/examples/images.md @@ -0,0 +1,3 @@ +# Images + + diff --git a/docs/src/links.yaml b/docs/src/links.yaml index a4bf733c4..fa075b7d7 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -43,6 +43,9 @@ - title: Tables link: /examples/tables type: draft + - title: Images + link: /examples/images + type: draft - title: Guide items: