From 6700eda658a85649444bfc62ac20e91a0a29aa06 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sat, 11 Jun 2022 19:48:25 +0300 Subject: [PATCH] css fix --- editors/demo/src/OEN/OEN.js | 2 +- .../src/components/OEN/OENToolGroup.js | 9 ++++++++- .../src/OENContainersService/OENContainersTool.js | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/editors/demo/src/OEN/OEN.js b/editors/demo/src/OEN/OEN.js index 29b6c46c7..1d0b4bbd7 100644 --- a/editors/demo/src/OEN/OEN.js +++ b/editors/demo/src/OEN/OEN.js @@ -26,7 +26,7 @@ const user = { username: 'admin', }; -const val = `<section class="section"><div class="introduction" data-type="content_structure_element"><p>Intro</p></div> +const val = `<h3>33333</h3><section class="section"><div class="introduction" data-type="content_structure_element"><p>Intro</p></div> <div class="outline" data-type="content_structure_element"><p>outline</p></div></section> <section class="section"><div class="introduction" data-type="content_structure_element"><p>Intro</p></div> <div class="outline" data-type="content_structure_element"><p>outline</p></div></section>`; diff --git a/wax-prosemirror-components/src/components/OEN/OENToolGroup.js b/wax-prosemirror-components/src/components/OEN/OENToolGroup.js index 7c24cd056..d463f4a8f 100644 --- a/wax-prosemirror-components/src/components/OEN/OENToolGroup.js +++ b/wax-prosemirror-components/src/components/OEN/OENToolGroup.js @@ -3,7 +3,7 @@ import styled, { css } from 'styled-components'; import { WaxContext } from 'wax-prosemirror-core'; import { wrapIn } from 'prosemirror-commands'; import { v4 as uuidv4 } from 'uuid'; -import { liftTarget, findWrapping } from 'prosemirror-transform'; +import { liftTarget } from 'prosemirror-transform'; import MenuButton from '../../ui/buttons/MenuButton'; const activeStyles = css` @@ -18,6 +18,7 @@ const GroupName = styled.div` const OENToolWrapper = styled.div` display: flex; + margin-bottom: 4px; `; const Box = styled.div` @@ -32,6 +33,12 @@ const Box = styled.div` `; const StyledButton = styled(MenuButton)` + border-radius: 4px; + left: -33px; + margin-left: 4px; + padding-left: 25px; + position: relative; + ${props => props.active && activeStyles} `; diff --git a/wax-prosemirror-services/src/OENContainersService/OENContainersTool.js b/wax-prosemirror-services/src/OENContainersService/OENContainersTool.js index 395dd09ea..8d2a2d321 100644 --- a/wax-prosemirror-services/src/OENContainersService/OENContainersTool.js +++ b/wax-prosemirror-services/src/OENContainersService/OENContainersTool.js @@ -27,7 +27,7 @@ export default class OENContainersTool extends Tools { get active() { return (state, OENToolsConfig) => { const { from, to } = state.selection; - const a = {}; + const tools = {}; state.doc.nodesBetween(from, to, (node, pos) => { if ( node.type.name === 'oen_container' || @@ -36,13 +36,13 @@ export default class OENContainersTool extends Tools { OENToolsConfig.forEach(groupTool => { groupTool.items.forEach(tool => { if (tool.className === node.attrs.class) { - a[tool.className] = true; + tools[tool.className] = true; } }); }); } }); - return a; + return tools; }; } } -- GitLab