From 893e754ea7ba2636ab47e5aced59d777e6a0420a Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sat, 13 Mar 2021 19:58:25 +0200 Subject: [PATCH] caption styles --- editors/editoria/src/layout/EditorElements.js | 35 ++++++++++++++++--- .../comments/CommentBubbleComponent.js | 3 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/editors/editoria/src/layout/EditorElements.js b/editors/editoria/src/layout/EditorElements.js index 54ebf1ecb..bcc75c130 100644 --- a/editors/editoria/src/layout/EditorElements.js +++ b/editors/editoria/src/layout/EditorElements.js @@ -30,7 +30,8 @@ export default css` h4 span::selection, code span::selection, custom-tag-block::selection, - custom-tag-inline::selection { + custom-tag-inline::selection, + figcaption span::selection, { background-color: transparent; } @@ -100,9 +101,35 @@ export default css` margin-right: 0; } - img { - cursor: default; - width: 100%; + figure { + display: flex; + flex-direction: column; + // align-items: center; + // justify-content: center; + // margin: 0px; + + img { + cursor: default; + height: auto; + max-width: 100%; + width: auto; + } + + figcaption { + background: #e2ebff; + padding: 10px; + min-height: 50px; + max-width: 100%; + width: auto; + overflow-y: auto; + + &:focus { + outline: none; + } + &: before { + font-weight: bold; + } + } } sup, diff --git a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js index 9e9f9818b..4dce8b2db 100644 --- a/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js +++ b/wax-prosemirror-components/src/components/comments/CommentBubbleComponent.js @@ -41,7 +41,8 @@ const CommentBubbleComponent = ({ (node, from) => { if ( node.type.name === 'math_display' || - node.type.name === 'math_inline' + node.type.name === 'math_inline' || + node.type.name === 'image' ) { allowed = false; } -- GitLab