From ee66aaecf1f8d9bb995fbcf954bd4d53fee5a9ea Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Fri, 12 Jan 2024 15:39:17 +0200 Subject: [PATCH] revert styles and add content to node --- .../MultipleDropDownService/components/ContainerEditor.js | 2 +- .../MultipleDropDownService/components/DropDownComponent.js | 5 +++-- .../components/MultipleDropDownComponent.js | 5 +---- .../schema/multipleDropDownOptionNode.js | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/wax-questions-service/src/MultipleDropDownService/components/ContainerEditor.js b/wax-questions-service/src/MultipleDropDownService/components/ContainerEditor.js index 8fddffb74..27ce9ce42 100644 --- a/wax-questions-service/src/MultipleDropDownService/components/ContainerEditor.js +++ b/wax-questions-service/src/MultipleDropDownService/components/ContainerEditor.js @@ -15,7 +15,7 @@ import { WaxContext, ComponentPlugin } from 'wax-prosemirror-core'; import FakeCursorPlugin from '../plugins/FakeCursorPlugin'; const EditorWrapper = styled.div` - // position: relative; + position: relative; height: 100%; > .ProseMirror { diff --git a/wax-questions-service/src/MultipleDropDownService/components/DropDownComponent.js b/wax-questions-service/src/MultipleDropDownService/components/DropDownComponent.js index 5435583a4..f52cc6b88 100644 --- a/wax-questions-service/src/MultipleDropDownService/components/DropDownComponent.js +++ b/wax-questions-service/src/MultipleDropDownService/components/DropDownComponent.js @@ -119,13 +119,14 @@ export default ({ setPosition, position }) => { const { from } = selection; const WaxSurface = activeView.dom.getBoundingClientRect(); const start = activeView.coordsAtPos(from); + console.log(start, WaxSurface.top); const left = start.left - WaxSurface.left - 75; const top = start.top - WaxSurface.top + 25; setPosition({ ...position, left, top }); }, [position.left]); useEffect(() => { - // if (addOptionRef.current) addOptionRef.current.focus(); + if (addOptionRef.current) addOptionRef.current.focus(); if (!activeView.state.selection.node) return; const { tr } = activeView.state; @@ -163,7 +164,7 @@ export default ({ setPosition, position }) => { const obj = { label: addOptionRef.current.value, value: uuidv4() }; setOptions(prevOptions => [...prevOptions, obj]); setOptionText(''); - // addOptionRef.current.focus(); + addOptionRef.current.focus(); }; const removeOption = id => { diff --git a/wax-questions-service/src/MultipleDropDownService/components/MultipleDropDownComponent.js b/wax-questions-service/src/MultipleDropDownService/components/MultipleDropDownComponent.js index a5515fe38..06f9aa9e0 100644 --- a/wax-questions-service/src/MultipleDropDownService/components/MultipleDropDownComponent.js +++ b/wax-questions-service/src/MultipleDropDownService/components/MultipleDropDownComponent.js @@ -14,7 +14,6 @@ const activeStylesSvg = css` `; const StyledIconActionContainer = styled.div` - font-variant-numeric: lining-nums proportional-nums; display: inline-block; height: 24px; width: 24px; @@ -24,7 +23,6 @@ const StyledIconActionContainer = styled.div` const StyledIconAction = styled(Icon)` ${props => props.isActive && activeStylesSvg} - display: inline-block; `; const AnswerContainer = styled.div` @@ -69,8 +67,7 @@ export default ({ node, getPos }) => { if (!readOnly) { return ( <StyledIconActionContainer isActive={isActive}> - 1 - {/* <StyledIconAction isActive={isActive} name="mulitpleDropDown" /> */} + <StyledIconAction isActive={isActive} name="mulitpleDropDown" /> </StyledIconActionContainer> ); } diff --git a/wax-questions-service/src/MultipleDropDownService/schema/multipleDropDownOptionNode.js b/wax-questions-service/src/MultipleDropDownService/schema/multipleDropDownOptionNode.js index 89f5af2a3..90452d15a 100644 --- a/wax-questions-service/src/MultipleDropDownService/schema/multipleDropDownOptionNode.js +++ b/wax-questions-service/src/MultipleDropDownService/schema/multipleDropDownOptionNode.js @@ -6,6 +6,7 @@ const multipleDropDownOptionNode = { correct: { default: '' }, answer: { default: '' }, }, + content: 'inline*', group: 'inline questions', inline: true, atom: true, -- GitLab