diff --git a/create.sh b/create.sh deleted file mode 100755 index 1f234beae5eaaf46e7c4642bb792c06914c46883..0000000000000000000000000000000000000000 --- a/create.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -if [ -z "$1" ] -then -echo -e "\e[01;31mError\e[0m Name is missing" >&2 -exit -else -cd editors -yarn create react-app $1 -cd $1 -npm install react-app-rewired --save-dev -cp ../editoria/config-overrides.js ./ -cp ../editoria/package.json ./ -cp ../editoria/src/* ./src/ -rm -rf src/App.css -rm -rf src/App.js -rm -rf src/index.css -rm -rf src/App.test.js -rm -rf src/logo.svg -sed -i "s/editoria/$1/" package.json -cd ../../ -sed -i '/"build": "lerna run build --concurrency=1 --stream",/a "'$1'": "cd editors/'$1' && yarn start",' package.json -yarn $1 -fi diff --git a/editors/demo/src/HHMI/HHMI.js b/editors/demo/src/HHMI/HHMI.js index 5853fc581bebc801c9ddc10b0df5a177f723ac27..09c338aa8b24e039827db5350327ba3330ae5cec 100644 --- a/editors/demo/src/HHMI/HHMI.js +++ b/editors/demo/src/HHMI/HHMI.js @@ -16,9 +16,15 @@ const renderImage = file => { }); }; +const ReadOnlyButton = styled.button` + position: absolute; + left: 550px; + top: 16px; +`; + const SubmitButton = styled.button` position: absolute; - left: 600px; + left: 650px; top: 16px; `; @@ -40,6 +46,11 @@ const t = `<p class="paragraph"></p> const Hhmi = () => { const [submited, isSubmited] = useState(false); const [readOnly, isReadOnly] = useState(false); + + const readOnlyQuestions = () => { + isReadOnly(true); + }; + const submitQuestions = () => { isSubmited(true); isReadOnly(true); @@ -47,6 +58,7 @@ const Hhmi = () => { return ( <> + <ReadOnlyButton onClick={readOnlyQuestions}>Read Only</ReadOnlyButton> <SubmitButton onClick={submitQuestions}>Submit</SubmitButton> <Wax config={config} diff --git a/editors/demo/src/NCBI/layout/EditorElements.js b/editors/demo/src/NCBI/layout/EditorElements.js index 4ad04d332db3b9c3640c8b407465c910b6e14c13..a81c5f4cd7932e944ad4176470f027a9b60e70bb 100644 --- a/editors/demo/src/NCBI/layout/EditorElements.js +++ b/editors/demo/src/NCBI/layout/EditorElements.js @@ -33,33 +33,5 @@ export default css` code span::selection title::selection { background-color: transparent; } - - &:focus { - outline: none; - } - } - - .ProseMirror .wax-selection-marker { - background-color: ${th('colorSelection')}; - } - - div[contenteditable='false'] { - pointer-events: none; - user-select: none; - } - - .ProseMirror title { - display: inline; - font-size: 14px; - } - - ul, - ol { - padding-left: 30px; - } - - sup, - sub { - line-height: 0; } `; diff --git a/wax-prosemirror-core/src/styles/styles.css b/wax-prosemirror-core/src/styles/styles.css index c409fcacb458978aed1e5faea924decdbe18724a..25272c3f9d1efdfff1ef64d6500571611a11263a 100644 --- a/wax-prosemirror-core/src/styles/styles.css +++ b/wax-prosemirror-core/src/styles/styles.css @@ -88,10 +88,10 @@ img.ProseMirror-separator { /* Read-Only */ - div[contenteditable='false'] { + /* div[contenteditable='false'] { pointer-events: none; user-select: none; - } + } */ /* placeholder */