Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax-prosemirror
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wax
wax-prosemirror
Commits
084a70ac
Commit
084a70ac
authored
3 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
add customValues Wax prop
parent
0a34c3be
No related branches found
No related tags found
1 merge request
!366
Questions read only
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
editors/demo/src/HHMI/HHMI.js
+4
-0
4 additions, 0 deletions
editors/demo/src/HHMI/HHMI.js
wax-prosemirror-core/src/Wax.js
+2
-0
2 additions, 0 deletions
wax-prosemirror-core/src/Wax.js
wax-prosemirror-core/src/WaxView.js
+4
-3
4 additions, 3 deletions
wax-prosemirror-core/src/WaxView.js
with
10 additions
and
3 deletions
editors/demo/src/HHMI/HHMI.js
+
4
−
0
View file @
084a70ac
...
...
@@ -17,12 +17,16 @@ const renderImage = file => {
const
t
=
`<p class="paragraph"></p><div id="84db3734-94ed-4dd0-82bb-15404854df0f" class="multiple-choice"><div class="multiple-choice-question" id="38de8538-647a-489d-8474-f92d0d256c32"><p class="paragraph">question</p></div><div class="multiple-choice-option" id="debb868e-bbfe-4ba2-bf93-c963153ff791" correct="false" feedback=""><p class="paragraph">answer 1</p></div><div class="multiple-choice-option" id="810bcf10-4fcb-4d1e-9dab-ce35cbd28527" correct="false" feedback=""><p class="paragraph">answer 2</p></div></div>`
;
const
submitQuestions
=
()
=>
{};
const
Hhmi
=
()
=>
{
return
(
<>
<
button
onClick
=
{
submitQuestions
}
>
Submit
<
/button
>
<
Wax
config
=
{
config
}
autoFocus
customValues
=
{{
showFeedBack
:
false
}}
fileUpload
=
{
file
=>
renderImage
(
file
)}
value
=
{
t
}
readonly
...
...
This diff is collapsed.
Click to expand it.
wax-prosemirror-core/src/Wax.js
+
2
−
0
View file @
084a70ac
...
...
@@ -36,6 +36,7 @@ const Wax = forwardRef((props, ref) => {
autoFocus
,
browserSpellCheck
,
className
,
customValues
,
debug
,
fileUpload
,
layout
,
...
...
@@ -96,6 +97,7 @@ const Wax = forwardRef((props, ref) => {
<
WaxView
autoFocus
=
{
autoFocus
}
browserSpellCheck
=
{
browserSpellCheck
}
customValues
=
{
customValues
}
debug
=
{
debug
}
fileUpload
=
{
fileUpload
}
onChange
=
{
finalOnChange
||
(
v
=>
true
)}
...
...
This diff is collapsed.
Click to expand it.
wax-prosemirror-core/src/WaxView.js
+
4
−
3
View file @
084a70ac
...
...
@@ -9,7 +9,7 @@ import React, {
forwardRef
,
useImperativeHandle
,
}
from
'
react
'
;
import
{
isEmpty
}
from
'
lodash
'
;
import
applyDevTools
from
'
prosemirror-dev-tools
'
;
import
{
EditorState
}
from
'
prosemirror-state
'
;
import
{
EditorView
}
from
'
prosemirror-view
'
;
...
...
@@ -29,6 +29,7 @@ const WaxView = forwardRef((props, ref) => {
let
view
;
const
{
browserSpellCheck
,
customValues
,
readonly
,
debug
,
autoFocus
,
...
...
@@ -99,7 +100,7 @@ const WaxView = forwardRef((props, ref) => {
}
WaxEditorRef
.
current
=
node
;
},
[
readonly
],
[
readonly
,
customValues
],
);
useEffect
(()
=>
{
...
...
@@ -157,7 +158,7 @@ const WaxView = forwardRef((props, ref) => {
props
.
children
({
editor
,
}),
[
readonly
],
[
readonly
,
customValues
],
);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment