diff --git a/editors/demo/src/Editors.js b/editors/demo/src/Editors.js index 1e839e3d33a7e73e494ec5a4903e8c7fa669e16d..166168897656c1d73e46585d9f7a08e372190219 100644 --- a/editors/demo/src/Editors.js +++ b/editors/demo/src/Editors.js @@ -70,7 +70,7 @@ const Editors = () => { case 'ncbi': return <NCBI />; default: - return <HHMI />; + return <Editoria />; } }; diff --git a/editors/demo/src/HHMI/HHMI.js b/editors/demo/src/HHMI/HHMI.js index af3923bc6e888faf7d46d454abe27c2d838db456..1b8623619ce3aa22d9f3bb4f7b39fdacf367f5ca 100644 --- a/editors/demo/src/HHMI/HHMI.js +++ b/editors/demo/src/HHMI/HHMI.js @@ -28,7 +28,7 @@ const SubmitButton = styled.button` top: 16px; `; -const t = `<div id="1624fa06-2075-488a-9912-9794a3763aca" class="multiple-drop-down-container" feedback=""> +const t = `<p class="paragraph"></p><div id="1624fa06-2075-488a-9912-9794a3763aca" class="multiple-drop-down-container" feedback=""> <p class="paragraph">Lorem ipsum dolor sit amet,<span id="fa9ff44d-19a6-4f47-99d9-d77d3dc02fbf" class="multiple-drop-down-option" options="[{"label":"option 1","value":"6c4aa0f3-43b1-40a7-a066-bc73449523df"},{"label":"option 2","value":"29365b0c-c00d-40c1-8a5e-118dbdf47e50"},{"label":"option 3","value":"743a425e-6340-4a72-a07c-d2e78154fcc8"}]" correct="29365b0c-c00d-40c1-8a5e-118dbdf47e50"></span>consectetur adipiscing elit. Nulla cursus ultricies enim, id condimentum dui facilisis a. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Sed euismod posuere orci. Praesent consectetur augue ut lorem suscipit, nec molestie libero pellentesque. </p> <p class="paragraph">Nullam porttitor ligula neque. In aliquam<span id="f8380222-11fa-46e7-91a9-0bf67ff3d1d7" class="multiple-drop-down-option" options="[{"label":"option 4","value":"4e2c45fe-0aad-4c59-9a92-ed44f01a82e2"},{"label":"option 5","value":"15e27b91-682a-4e10-a5d0-149192fd2e4c"},{"label":"option 6","value":"886c921d-2e75-41ea-a1a6-2d49e7921a57"},{"label":"option 7","value":"d14c2409-f66a-47d1-8f63-72686d24df37"}]" correct="4e2c45fe-0aad-4c59-9a92-ed44f01a82e2"></span> ex neque, sit amet sagittis nulla volutpat sed. Nulla blandit facilisis ante, vel tempus ante porta quis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Integer nulla tellus, dictum at laoreet eu, hendrerit at quam. Sed consectetur, neque vel ornare malesuada, eros sem commodo purus, <span id="c13f5243-03c0-433c-8e44-440d536d9150" class="multiple-drop-down-option" options="[{"label":"option 9","value":"3b9cd3b4-9e70-45de-975d-31407c48812c"},{"label":"option 10","value":"3baf86a8-a3fa-4e64-bfe8-f01ce4320489"},{"label":"option 11","value":"f1c6023c-5cde-445a-b9fb-cc23f06c8132"}]" correct="f1c6023c-5cde-445a-b9fb-cc23f06c8132"></span> sagittis volutpat elit leo in diam. Aliquam mattis, est non placerat euismod, nisl nisl vestibulum mauris, non interdum dui urna et tellus.</p> </div> diff --git a/wax-prosemirror-services/src/MultipleDropDownService/components/ContainerEditor.js b/wax-prosemirror-services/src/MultipleDropDownService/components/ContainerEditor.js index 99bbcb39328316c32ad4c17e2c4ab9cda8ed7a1f..52cd05c1037fce932a1e44333531c9035e4a7230 100644 --- a/wax-prosemirror-services/src/MultipleDropDownService/components/ContainerEditor.js +++ b/wax-prosemirror-services/src/MultipleDropDownService/components/ContainerEditor.js @@ -14,7 +14,7 @@ const EditorWrapper = styled.div` position: relative; > .ProseMirror { - padding: 5px; + padding: 5px !important; &:focus { outline: none; } @@ -85,14 +85,7 @@ const ContainerEditor = ({ node, view, getPos }) => { plugins: finalPlugins, }), dispatchTransaction, - disallowedTools: [ - 'Images', - 'Lists', - 'lift', - 'Tables', - 'FillTheGap', - 'MultipleChoice', - ], + disallowedTools: ['Images', 'FillTheGap', 'MultipleChoice'], handleDOMEvents: { mousedown: () => { main.dispatch( diff --git a/wax-prosemirror-services/src/MultipleDropDownService/components/DropDownComponent.js b/wax-prosemirror-services/src/MultipleDropDownService/components/DropDownComponent.js index 6c1dc27ffab6c839871509efdbea82f986079102..3d5139ee4de5c2a78681343aaf507d3c959b0d52 100644 --- a/wax-prosemirror-services/src/MultipleDropDownService/components/DropDownComponent.js +++ b/wax-prosemirror-services/src/MultipleDropDownService/components/DropDownComponent.js @@ -101,8 +101,6 @@ export default ({ setPosition, position }) => { pmViews: { main }, } = context; - const customProps = main.props.customValues; - const isEditable = main.props.editable(editable => { return editable; }); @@ -123,7 +121,7 @@ export default ({ setPosition, position }) => { const WaxSurface = activeView.dom.getBoundingClientRect(); const start = activeView.coordsAtPos(from); const left = start.left - WaxSurface.left - 75; - const top = start.top - WaxSurface.top + 30; + const top = start.top - WaxSurface.top + 25; setPosition({ ...position, left, top }); }, [position.left]); diff --git a/wax-prosemirror-services/src/MultipleDropDownService/components/ReadOnlyDropDown.js b/wax-prosemirror-services/src/MultipleDropDownService/components/ReadOnlyDropDown.js index 8638a53c73fe07f90c6fba82ace407626544c8ad..7621128179b70811ce2f616e742d5579b76eb5a7 100644 --- a/wax-prosemirror-services/src/MultipleDropDownService/components/ReadOnlyDropDown.js +++ b/wax-prosemirror-services/src/MultipleDropDownService/components/ReadOnlyDropDown.js @@ -50,7 +50,11 @@ const DropComponent = ({ options }) => { pmViews: { main }, } = context; - const onChange = option => {}; + const customProps = main.props.customValues; + + const onChange = option => { + console.log(option); + }; useEffect(() => {}, []); diff --git a/wax-prosemirror-services/src/MultipleDropDownService/schema/multipleDropDownContainerNode.js b/wax-prosemirror-services/src/MultipleDropDownService/schema/multipleDropDownContainerNode.js index 83884cd92d03f4ce4c124e4395e4ae8ada494e88..0631cd913d29c41fd5227432bc5acb49f9a79b34 100644 --- a/wax-prosemirror-services/src/MultipleDropDownService/schema/multipleDropDownContainerNode.js +++ b/wax-prosemirror-services/src/MultipleDropDownService/schema/multipleDropDownContainerNode.js @@ -5,10 +5,9 @@ const multipleDropDownContainerNode = { feedback: { default: '' }, }, group: 'block questions', - atom: true, selectable: false, draggable: false, - content: 'block*', + content: 'block+', parseDOM: [ { tag: 'div.multiple-drop-down-container',