Commit 627aa508 authored by Ben Whitmore's avatar Ben Whitmore
Browse files

Merge branch 'wax-quick-fixes' into 'main'

Wax quick fixes

See merge request !299
parents 5ea3f65c 0ebaef6d
Pipeline #26849 failed with stage
in 0 seconds
......@@ -67,7 +67,7 @@ const Submit = ({
content: (
<EditorSection
manuscript={manuscript}
onChange={source => updateManuscript(versionId, { meta: { source } })}
onBlur={source => updateManuscript(versionId, { meta: { source } })}
readonly={!userCanEditManuscriptAndFormData}
/>
),
......
......@@ -393,4 +393,46 @@ export default css`
.math-node.ProseMirror-selectednode .math-render {
display: none;
}
/* added for figure weirdness */
figure {
border: 1px solid ${darken('colorPrimary', 1)};
margin-bottom: 1rem;
padding: 1rem;
position: relative;
}
figure::before {
color: ${darken('colorPrimary', 1)};
content: 'Figure:';
font-size: 75%;
left: 0;
letter-spacing: 0.5px;
position: absolute;
text-transform: uppercase;
top: -1.25rem;
}
figure:hover:before {
content: 'Click to add a caption';
}
figcaption {
border: 1px solid ${darken('colorPrimary', 1)};
margin-top: 1rem;
padding: 1rem;
position: relative;
}
figcaption::before {
color: ${darken('colorPrimary', 1)};
content: 'Caption:';
font-size: 75%;
left: 0;
letter-spacing: 0.5px;
position: absolute;
text-transform: uppercase;
top: -1.25rem;
}
`
import React, { useCallback, useContext } from 'react'
import React, { useContext } from 'react'
import PropTypes from 'prop-types'
import { debounce } from 'lodash'
// import { debounce } from 'lodash'
import { Wax, WaxContext, ComponentPlugin } from 'wax-prosemirror-core'
import { DefaultSchema, DocumentHelpers } from 'wax-prosemirror-utilities'
import styled, { css } from 'styled-components'
......@@ -326,7 +326,7 @@ const FullWaxEditor = ({
fileUpload,
...rest
}) => {
const debounceChange = useCallback(debounce(onChange ?? (() => {}), 1000), [])
// const debounceChange = useCallback(debounce(onChange ?? (() => {}), 1000), [])
return (
<div className={validationStatus}>
<Wax
......@@ -338,7 +338,7 @@ const FullWaxEditor = ({
onChange && onChange(val)
onBlur && onBlur(val)
}}
onChange={debounceChange}
/* onChange={debounceChange} */
placeholder={placeholder}
readonly={readonly}
value={value}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment